</li>
</ul>
- <h6 class="sidebar-heading px-3 mt-4 mb-1 text-muted" *ngIf='savedViewService.sidebarViews.length > 0'>
+ <h6 class="sidebar-heading px-3 mt-4 mb-1 text-muted" *ngIf='savedViewService.loading || savedViewService.sidebarViews.length > 0'>
<ng-container i18n>Saved views</ng-container>
+ <div *ngIf="savedViewService.loading" class="spinner-border spinner-border-sm fw-normal ms-2" role="status"></div>
</h6>
<ul class="nav flex-column mb-2">
<li class="nav-item w-100" *ngFor="let view of savedViewService.sidebarViews">
z-index: 995; /* Behind the navbar */
padding: 50px 0 0; /* Height of navbar */
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
+
+ .sidebar-heading .spinner-border {
+ width: 0.8em;
+ height: 0.8em;
+ }
}
@media (max-width: 767.98px) {
.sidebar {
providedIn: 'root',
})
export class SavedViewService extends AbstractPaperlessService<PaperlessSavedView> {
+ loading: boolean
+
constructor(http: HttpClient) {
super(http, 'saved_views')
this.reload()
}
private reload() {
- this.listAll().subscribe((r) => (this.savedViews = r.results))
+ this.loading = true
+ this.listAll().subscribe((r) => {
+ this.savedViews = r.results
+ this.loading = false
+ })
}
private savedViews: PaperlessSavedView[] = []