mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	dashboard loading indicator, remove duplicate call to saved views
This commit is contained in:
		| @@ -21,9 +21,14 @@ | ||||
|  | ||||
| <div class='row'> | ||||
|   <div class="col-lg-8"> | ||||
|     <app-welcome-widget *ngIf="savedViews.length == 0"></app-welcome-widget> | ||||
|     <ng-container *ngIf="savedViewService.loading"> | ||||
|       <div class="spinner-border spinner-border-sm me-2" role="status"></div> | ||||
|       <ng-container i18n>Loading...</ng-container> | ||||
|     </ng-container> | ||||
|  | ||||
|     <ng-container *ngFor="let v of savedViews"> | ||||
|     <app-welcome-widget *ngIf="!savedViewService.loading && savedViewService.dashboardViews.length == 0"></app-welcome-widget> | ||||
|  | ||||
|     <ng-container *ngFor="let v of savedViewService.dashboardViews"> | ||||
|       <app-saved-view-widget [savedView]="v"></app-saved-view-widget> | ||||
|     </ng-container> | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| import { Component, OnInit } from '@angular/core' | ||||
| import { Meta } from '@angular/platform-browser' | ||||
| import { PaperlessSavedView } from 'src/app/data/paperless-saved-view' | ||||
| import { SavedViewService } from 'src/app/services/rest/saved-view.service' | ||||
|  | ||||
| @Component({ | ||||
| @@ -8,8 +7,8 @@ import { SavedViewService } from 'src/app/services/rest/saved-view.service' | ||||
|   templateUrl: './dashboard.component.html', | ||||
|   styleUrls: ['./dashboard.component.scss'], | ||||
| }) | ||||
| export class DashboardComponent implements OnInit { | ||||
|   constructor(private savedViewService: SavedViewService, private meta: Meta) {} | ||||
| export class DashboardComponent { | ||||
|   constructor(public savedViewService: SavedViewService, private meta: Meta) {} | ||||
|  | ||||
|   get displayName() { | ||||
|     let tagFullName = this.meta.getTag('name=full_name') | ||||
| @@ -30,14 +29,4 @@ export class DashboardComponent implements OnInit { | ||||
|       return $localize`Welcome to Paperless-ngx!` | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   savedViews: PaperlessSavedView[] = [] | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     this.savedViewService.listAll().subscribe((results) => { | ||||
|       this.savedViews = results.results.filter( | ||||
|         (savedView) => savedView.show_on_dashboard | ||||
|       ) | ||||
|     }) | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon