From 72b7b8df41217dae0740249ea93256f173ae457b Mon Sep 17 00:00:00 2001 From: vlo-rte Date: Wed, 26 Feb 2025 14:12:50 +0100 Subject: [PATCH] Add loading spinner in custom card list screen (#7904) Signed-off-by: vlo-rte --- .../customCardList/CustomCardListComponent.html | 16 ++++++++++++++-- .../customCardList/CustomCardListComponent.scss | 3 ++- .../customCardList/CustomCardListComponent.ts | 15 +++++++++++++-- .../monitoring/monitoring.component.scss | 12 +----------- ui/main/src/scss/styles.scss | 10 ++++++++++ 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/ui/main/src/app/components/customCardList/CustomCardListComponent.html b/ui/main/src/app/components/customCardList/CustomCardListComponent.html index fe9d81327b..9cad5924a9 100644 --- a/ui/main/src/app/components/customCardList/CustomCardListComponent.html +++ b/ui/main/src/app/components/customCardList/CustomCardListComponent.html @@ -75,7 +75,7 @@

Custom Screen {{id}} does not exist

(); + loadingInProgress = false; + constructor(private readonly modalService: NgbModal) { ModuleRegistry.registerModules([AllCommunityModule]); provideGlobalGridOptions({theme: 'legacy'}); @@ -125,6 +130,12 @@ export class CustomCardListComponent implements OnInit, OnDestroy { } ngOnInit(): void { + OpfabEventStreamService.getLoadingInProgress() + .pipe(takeUntil(this.ngUnsubscribe$), debounceTime(500)) + .subscribe((loadingInProgress: boolean) => { + this.loadingInProgress = loadingInProgress; + }); + this.customCardListView = new CustomCardListView(this.customScreenId); const severityCellClassRules = { diff --git a/ui/main/src/app/components/monitoring/monitoring.component.scss b/ui/main/src/app/components/monitoring/monitoring.component.scss index 187c78f523..d4ad58a333 100644 --- a/ui/main/src/app/components/monitoring/monitoring.component.scss +++ b/ui/main/src/app/components/monitoring/monitoring.component.scss @@ -1,4 +1,4 @@ -/* Copyright (c) 2018-2024, RTE (http://www.rte-france.com) +/* Copyright (c) 2018-2025, RTE (http://www.rte-france.com) * See AUTHORS.txt * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -11,16 +11,6 @@ color: var(--opfab-text-color); } -.opfab-loading-spinner { - float: right; - margin-right: 5%; - font-size: 30px; - border: solid 1px var(--opfab-bgcolor); - text-align: center; - background-color: var(--opfab-bgcolor); - color: #aaa; -} - .opfab-response-checkbox { float: left; margin-left: 5%; diff --git a/ui/main/src/scss/styles.scss b/ui/main/src/scss/styles.scss index 5c68bf1e0b..9782bc5417 100644 --- a/ui/main/src/scss/styles.scss +++ b/ui/main/src/scss/styles.scss @@ -720,3 +720,13 @@ tag-input { } // END CUSTOM STYLE FOR DATE RANGE PICKER + +.opfab-loading-spinner { + float: right; + margin-right: 5%; + font-size: 30px; + border: solid 1px var(--opfab-bgcolor); + text-align: center; + background-color: var(--opfab-bgcolor); + color: #aaa; +}