download notification
This commit is contained in:
parent
230d7814c0
commit
55946c55b7
@ -27,7 +27,6 @@
|
||||
</div>
|
||||
<redaction-user-button
|
||||
[matMenuTriggerFor]="userMenu"
|
||||
[showDot]="fileDownloadService.hasPendingDownloads"
|
||||
[userId]="currentUser.id"
|
||||
iqserHelpMode="open-usermenu"
|
||||
></redaction-user-button>
|
||||
@ -36,7 +35,6 @@
|
||||
<ng-container *ngFor="let item of userMenuItems; trackBy: trackByName">
|
||||
<button (click)="(item.action)" *ngIf="item.show" [routerLink]="item.routerLink" mat-menu-item translate>
|
||||
{{ item.name }}
|
||||
<span *ngIf="item.showDot()" class="dot"></span>
|
||||
</button>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@ -36,26 +36,22 @@ export class BaseScreenComponent {
|
||||
routerLink: '/main/account',
|
||||
show: true,
|
||||
action: this.appStateService.reset,
|
||||
showDot: () => false,
|
||||
},
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.admin'),
|
||||
routerLink: '/main/admin',
|
||||
show: this.currentUser.isManager || this.currentUser.isUserAdmin,
|
||||
action: this.appStateService.reset,
|
||||
showDot: () => false,
|
||||
},
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.downloads'),
|
||||
routerLink: '/main/downloads',
|
||||
show: this.currentUser.isUser,
|
||||
showDot: () => this.fileDownloadService.hasPendingDownloads,
|
||||
},
|
||||
{
|
||||
name: _('top-bar.navigation-items.my-account.children.trash'),
|
||||
routerLink: '/main/admin/trash',
|
||||
show: this.currentUser.isManager,
|
||||
showDot: () => false,
|
||||
},
|
||||
];
|
||||
readonly searchActions: readonly SpotlightSearchAction[] = [
|
||||
@ -85,7 +81,6 @@ export class BaseScreenComponent {
|
||||
readonly userService: UserService,
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
readonly titleService: Title,
|
||||
readonly fileDownloadService: FileDownloadService,
|
||||
private readonly _router: Router,
|
||||
private readonly _translateService: TranslateService,
|
||||
readonly breadcrumbsService: BreadcrumbsService,
|
||||
|
||||
@ -16,8 +16,6 @@ import { EntitiesService, List, mapEach, RequiredParam, Validate } from '@iqser/
|
||||
|
||||
@Injectable()
|
||||
export class FileDownloadService extends EntitiesService<DownloadStatus, IDownloadStatus> {
|
||||
hasPendingDownloads = false;
|
||||
|
||||
constructor(
|
||||
private readonly _userService: UserService,
|
||||
private readonly _keycloakService: KeycloakService,
|
||||
@ -25,13 +23,6 @@ export class FileDownloadService extends EntitiesService<DownloadStatus, IDownlo
|
||||
protected readonly _injector: Injector,
|
||||
) {
|
||||
super(_injector, DownloadStatus, 'async/download');
|
||||
interval(5000)
|
||||
.pipe(
|
||||
withLatestFrom(_userService.currentUser$),
|
||||
filter(([, user]) => user.isUser),
|
||||
switchMap(() => this.loadAll()),
|
||||
)
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
downloadFiles(fileIds: List, dossierId: string): Observable<DownloadStatus[]> {
|
||||
@ -45,7 +36,6 @@ export class FileDownloadService extends EntitiesService<DownloadStatus, IDownlo
|
||||
return this.getStatuses().pipe(
|
||||
mapEach(entity => new DownloadStatus(entity)),
|
||||
tap(entities => this.setEntities(entities)),
|
||||
tap(() => (this.hasPendingDownloads = !!this.all.find(f => !f.lastDownload && f.isReady))),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user