From b87699dc8d463b0e9a41fd84cddb88420f2080ac Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Tue, 23 Jan 2024 11:20:36 +0200 Subject: [PATCH] UI: Fixed progress bar --- .../vc/repository-settings.component.html | 2 +- .../vc/repository-settings.component.ts | 3 +++ .../vc/version-control.component.html | 6 ++++-- ui-ngx/src/app/modules/home/home.component.ts | 20 ++++++++++++++++--- .../home/pages/admin/admin-routing.module.ts | 3 +++ .../notification-routing.module.ts | 1 + .../widget/widget-library-routing.module.ts | 1 + 7 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.html b/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.html index 10fae28b6d..e0d33fdfd5 100644 --- a/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.html @@ -26,7 +26,7 @@
- +
diff --git a/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.ts b/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.ts index e65658ea53..b2af171353 100644 --- a/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/vc/repository-settings.component.ts @@ -48,6 +48,9 @@ export class RepositorySettingsComponent extends PageComponent implements OnInit @Input() popoverComponent: TbPopoverComponent; + @Input() + hideLoadingBar = false; + repositorySettingsForm: UntypedFormGroup; settings: RepositorySettings = null; diff --git a/ui-ngx/src/app/modules/home/components/vc/version-control.component.html b/ui-ngx/src/app/modules/home/components/vc/version-control.component.html index 4495ce5c5e..566c1b149f 100644 --- a/ui-ngx/src/app/modules/home/components/vc/version-control.component.html +++ b/ui-ngx/src/app/modules/home/components/vc/version-control.component.html @@ -15,9 +15,11 @@ limitations under the License. --> - + *ngIf="!(hasRepository$ | async); else versionsTable"> , @Inject(WINDOW) private window: Window, private activeComponentService: ActiveComponentService, - public breakpointObserver: BreakpointObserver, - private fb: FormBuilder) { + private fb: FormBuilder, + private route: ActivatedRoute, + public breakpointObserver: BreakpointObserver) { super(store); } @@ -144,9 +147,20 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni private updateActiveComponent(activeComponent: any) { this.showSearch = false; + this.hideLoadingBar = false; this.textSearch.reset('', {emitEvent: false}); this.activeComponent = activeComponent; - this.hideLoadingBar = activeComponent && activeComponent instanceof RouterTabsComponent; + let showLoadingBar: boolean; + if (isDefined(this.route.children[0]?.snapshot?.data?.showLoadingBar)) { + showLoadingBar = this.route.children[0]?.snapshot?.data?.showLoadingBar; + } else if (isDefined(this.route.children[0]?.children[0]?.snapshot?.data?.showLoadingBar)) { + showLoadingBar = this.route.children[0]?.children[0]?.snapshot?.data?.showLoadingBar; + } + if (activeComponent && activeComponent instanceof RouterTabsComponent) { + this.hideLoadingBar = isDefinedAndNotNull(showLoadingBar) ? !showLoadingBar : true; + } else if (isDefinedAndNotNull(showLoadingBar)) { + this.hideLoadingBar = !showLoadingBar; + } if (this.activeComponent && instanceOfSearchableComponent(this.activeComponent)) { this.searchEnabled = true; this.searchableComponent = this.activeComponent; diff --git a/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts b/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts index 74c5012791..c91448c7d7 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts @@ -323,6 +323,7 @@ const routes: Routes = [ canDeactivate: [ConfirmOnExitGuard], data: { auth: [Authority.SYS_ADMIN], + showLoadingBar: false, title: 'admin.general', breadcrumb: { label: 'admin.general', @@ -336,6 +337,7 @@ const routes: Routes = [ canDeactivate: [ConfirmOnExitGuard], data: { auth: [Authority.SYS_ADMIN], + showLoadingBar: false, title: 'admin.2fa.2fa', breadcrumb: { label: 'admin.2fa.2fa', @@ -349,6 +351,7 @@ const routes: Routes = [ canDeactivate: [ConfirmOnExitGuard], data: { auth: [Authority.SYS_ADMIN], + showLoadingBar: false, title: 'admin.oauth2.oauth2', breadcrumb: { label: 'admin.oauth2.oauth2', diff --git a/ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts b/ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts index 41f49ee708..995bda9234 100644 --- a/ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts @@ -32,6 +32,7 @@ const routes: Routes = [ component: RouterTabsComponent, data: { auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER, Authority.SYS_ADMIN], + showLoadingBar: true, breadcrumb: { label: 'notification.notification-center', icon: 'mdi:message-badge' diff --git a/ui-ngx/src/app/modules/home/pages/widget/widget-library-routing.module.ts b/ui-ngx/src/app/modules/home/pages/widget/widget-library-routing.module.ts index c808bae163..160a0e18da 100644 --- a/ui-ngx/src/app/modules/home/pages/widget/widget-library-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/widget/widget-library-routing.module.ts @@ -234,6 +234,7 @@ export const widgetsLibraryRoutes: Routes = [ component: RouterTabsComponent, data: { auth: [Authority.SYS_ADMIN, Authority.TENANT_ADMIN], + showLoadingBar: true, breadcrumb: { label: 'widget.widget-library', icon: 'now_widgets'