From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 8 May 2022 16:03:29 +0000 (-0700) Subject: loading indicator for dashboard widgets X-Git-Tag: v1.8.0-beta.rc1~121^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=010f1f2bd1e186f78249c8a16e84900231187810;p=thirdparty%2Fpaperless-ngx.git loading indicator for dashboard widgets --- diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html index 01809d1c60..8d5b9c43f3 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html @@ -1,4 +1,4 @@ - + Show all diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts index 9506e6842a..6e8b679006 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.ts @@ -15,6 +15,8 @@ import { QueryParamsService } from 'src/app/services/query-params.service' styleUrls: ['./saved-view-widget.component.scss'], }) export class SavedViewWidgetComponent implements OnInit, OnDestroy { + loading: boolean = true + constructor( private documentService: DocumentService, private router: Router, @@ -43,6 +45,7 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy { } reload() { + this.loading = true this.documentService .listFiltered( 1, @@ -52,6 +55,7 @@ export class SavedViewWidgetComponent implements OnInit, OnDestroy { this.savedView.filter_rules ) .subscribe((result) => { + this.loading = false this.documents = result.results }) } diff --git a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html index a29b50f784..106d306105 100644 --- a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html @@ -1,4 +1,4 @@ - +

Documents in inbox: {{statistics?.documents_inbox}}

Total documents: {{statistics?.documents_total}}

diff --git a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts index a13839f197..3d9f7b5e7a 100644 --- a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts +++ b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts @@ -15,6 +15,8 @@ export interface Statistics { styleUrls: ['./statistics-widget.component.scss'], }) export class StatisticsWidgetComponent implements OnInit, OnDestroy { + loading: boolean = true + constructor( private http: HttpClient, private consumerStatusService: ConsumerStatusService @@ -29,7 +31,9 @@ export class StatisticsWidgetComponent implements OnInit, OnDestroy { } reload() { + this.loading = true this.getStatistics().subscribe((statistics) => { + this.loading = false this.statistics = statistics }) } diff --git a/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.html b/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.html index a9d3d306ad..4eaee47618 100644 --- a/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.html +++ b/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.html @@ -2,6 +2,10 @@
{{title}}
+ +
+
Loading...
+
diff --git a/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.ts b/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.ts index f21f6ca351..b1e926eefa 100644 --- a/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.ts +++ b/src-ui/src/app/components/dashboard/widgets/widget-frame/widget-frame.component.ts @@ -11,5 +11,8 @@ export class WidgetFrameComponent implements OnInit { @Input() title: string + @Input() + loading: boolean = false + ngOnInit(): void {} }