show failed tasks badge in sidebar

This commit is contained in:
Michael Shamoon 2022-05-26 23:09:24 -07:00
parent 66b2013d23
commit 6b4d8b18e0
3 changed files with 6 additions and 3 deletions

View File

@ -145,7 +145,7 @@
<a class="nav-link" routerLink="tasks" routerLinkActive="active" (click)="closeMenu()">
<svg class="sidebaricon" fill="currentColor">
<use xlink:href="assets/bootstrap-icons.svg#list-task"/>
</svg>&nbsp;<ng-container i18n>File Tasks</ng-container>
</svg>&nbsp;<ng-container i18n>File Tasks<ng-container *ngIf="tasksService.failedFileTasks.length > 0"><span class="badge bg-danger ms-2">{{tasksService.failedFileTasks.length}}</span></ng-container></ng-container>
</a>
</li>
<li class="nav-item">

View File

@ -22,6 +22,7 @@ import {
AppRemoteVersion,
} from 'src/app/services/rest/remote-version.service'
import { SettingsService } from 'src/app/services/settings.service'
import { TasksService } from 'src/app/services/tasks.service'
@Component({
selector: 'app-app-frame',
@ -37,13 +38,15 @@ export class AppFrameComponent {
public savedViewService: SavedViewService,
private remoteVersionService: RemoteVersionService,
private list: DocumentListViewService,
public settingsService: SettingsService
public settingsService: SettingsService,
public tasksService: TasksService
) {
this.remoteVersionService
.checkForUpdates()
.subscribe((appRemoteVersion: AppRemoteVersion) => {
this.appRemoteVersion = appRemoteVersion
})
tasksService.reload()
}
versionString = `${environment.appTitle} ${environment.version}`

View File

@ -98,7 +98,7 @@
</ng-template>
</li>
<li ngbNavItem="failed">
<a ngbNavLink i18n>Failed&nbsp;<span class="badge bg-secondary ms-1">{{tasksService.failedFileTasks.length}}</span></a>
<a ngbNavLink i18n>Failed&nbsp;<span class="badge bg-danger ms-1">{{tasksService.failedFileTasks.length}}</span></a>
<ng-template ngbNavContent>
<ng-container [ngTemplateOutlet]="tasksTemplate" [ngTemplateOutletContext]="{tasks:tasksService.failedFileTasks}"></ng-container>
</ng-template>