Browse Source

UI: Fixed progress bar

pull/10036/head
Artem Dzhereleiko 3 years ago
parent
commit
b87699dc8d
  1. 2
      ui-ngx/src/app/modules/home/components/vc/repository-settings.component.html
  2. 3
      ui-ngx/src/app/modules/home/components/vc/repository-settings.component.ts
  3. 6
      ui-ngx/src/app/modules/home/components/vc/version-control.component.html
  4. 20
      ui-ngx/src/app/modules/home/home.component.ts
  5. 3
      ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts
  6. 1
      ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts
  7. 1
      ui-ngx/src/app/modules/home/pages/widget/widget-library-routing.module.ts

2
ui-ngx/src/app/modules/home/components/vc/repository-settings.component.html

@ -26,7 +26,7 @@
<span fxFlex></span> <span fxFlex></span>
<div tb-help="repositorySettings"></div> <div tb-help="repositorySettings"></div>
</mat-card-header> </mat-card-header>
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> <mat-progress-bar color="warn" mode="indeterminate" *ngIf="!hideLoadingBar && isLoading$ | async">
</mat-progress-bar> </mat-progress-bar>
<div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div> <div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div>
<mat-card-content style="padding-top: 16px;"> <mat-card-content style="padding-top: 16px;">

3
ui-ngx/src/app/modules/home/components/vc/repository-settings.component.ts

@ -48,6 +48,9 @@ export class RepositorySettingsComponent extends PageComponent implements OnInit
@Input() @Input()
popoverComponent: TbPopoverComponent; popoverComponent: TbPopoverComponent;
@Input()
hideLoadingBar = false;
repositorySettingsForm: UntypedFormGroup; repositorySettingsForm: UntypedFormGroup;
settings: RepositorySettings = null; settings: RepositorySettings = null;

6
ui-ngx/src/app/modules/home/components/vc/version-control.component.html

@ -15,9 +15,11 @@
limitations under the License. limitations under the License.
--> -->
<tb-repository-settings #repositorySettingsComponent [detailsMode]="detailsMode" <tb-repository-settings #repositorySettingsComponent
[detailsMode]="detailsMode"
[hideLoadingBar]="true"
[popoverComponent]="popoverComponent" [popoverComponent]="popoverComponent"
*ngIf="!(hasRepository$ | async); else versionsTable"> *ngIf="!(hasRepository$ | async); else versionsTable">
</tb-repository-settings> </tb-repository-settings>
<ng-template #versionsTable> <ng-template #versionsTable>
<tb-entity-versions-table [singleEntityMode]="singleEntityMode" <tb-entity-versions-table [singleEntityMode]="singleEntityMode"

20
ui-ngx/src/app/modules/home/home.component.ts

@ -32,6 +32,8 @@ import { instanceOfSearchableComponent, ISearchableComponent } from '@home/model
import { ActiveComponentService } from '@core/services/active-component.service'; import { ActiveComponentService } from '@core/services/active-component.service';
import { RouterTabsComponent } from '@home/components/router-tabs.component'; import { RouterTabsComponent } from '@home/components/router-tabs.component';
import { FormBuilder } from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { isDefined, isDefinedAndNotNull } from '@core/utils';
@Component({ @Component({
selector: 'tb-home', selector: 'tb-home',
@ -70,8 +72,9 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,
@Inject(WINDOW) private window: Window, @Inject(WINDOW) private window: Window,
private activeComponentService: ActiveComponentService, private activeComponentService: ActiveComponentService,
public breakpointObserver: BreakpointObserver, private fb: FormBuilder,
private fb: FormBuilder) { private route: ActivatedRoute,
public breakpointObserver: BreakpointObserver) {
super(store); super(store);
} }
@ -144,9 +147,20 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni
private updateActiveComponent(activeComponent: any) { private updateActiveComponent(activeComponent: any) {
this.showSearch = false; this.showSearch = false;
this.hideLoadingBar = false;
this.textSearch.reset('', {emitEvent: false}); this.textSearch.reset('', {emitEvent: false});
this.activeComponent = activeComponent; 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)) { if (this.activeComponent && instanceOfSearchableComponent(this.activeComponent)) {
this.searchEnabled = true; this.searchEnabled = true;
this.searchableComponent = this.activeComponent; this.searchableComponent = this.activeComponent;

3
ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts

@ -323,6 +323,7 @@ const routes: Routes = [
canDeactivate: [ConfirmOnExitGuard], canDeactivate: [ConfirmOnExitGuard],
data: { data: {
auth: [Authority.SYS_ADMIN], auth: [Authority.SYS_ADMIN],
showLoadingBar: false,
title: 'admin.general', title: 'admin.general',
breadcrumb: { breadcrumb: {
label: 'admin.general', label: 'admin.general',
@ -336,6 +337,7 @@ const routes: Routes = [
canDeactivate: [ConfirmOnExitGuard], canDeactivate: [ConfirmOnExitGuard],
data: { data: {
auth: [Authority.SYS_ADMIN], auth: [Authority.SYS_ADMIN],
showLoadingBar: false,
title: 'admin.2fa.2fa', title: 'admin.2fa.2fa',
breadcrumb: { breadcrumb: {
label: 'admin.2fa.2fa', label: 'admin.2fa.2fa',
@ -349,6 +351,7 @@ const routes: Routes = [
canDeactivate: [ConfirmOnExitGuard], canDeactivate: [ConfirmOnExitGuard],
data: { data: {
auth: [Authority.SYS_ADMIN], auth: [Authority.SYS_ADMIN],
showLoadingBar: false,
title: 'admin.oauth2.oauth2', title: 'admin.oauth2.oauth2',
breadcrumb: { breadcrumb: {
label: 'admin.oauth2.oauth2', label: 'admin.oauth2.oauth2',

1
ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts

@ -32,6 +32,7 @@ const routes: Routes = [
component: RouterTabsComponent, component: RouterTabsComponent,
data: { data: {
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER, Authority.SYS_ADMIN], auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER, Authority.SYS_ADMIN],
showLoadingBar: true,
breadcrumb: { breadcrumb: {
label: 'notification.notification-center', label: 'notification.notification-center',
icon: 'mdi:message-badge' icon: 'mdi:message-badge'

1
ui-ngx/src/app/modules/home/pages/widget/widget-library-routing.module.ts

@ -234,6 +234,7 @@ export const widgetsLibraryRoutes: Routes = [
component: RouterTabsComponent, component: RouterTabsComponent,
data: { data: {
auth: [Authority.SYS_ADMIN, Authority.TENANT_ADMIN], auth: [Authority.SYS_ADMIN, Authority.TENANT_ADMIN],
showLoadingBar: true,
breadcrumb: { breadcrumb: {
label: 'widget.widget-library', label: 'widget.widget-library',
icon: 'now_widgets' icon: 'now_widgets'

Loading…
Cancel
Save