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