Browse Source

Fixed right layout and state name propagation in mobile mode, skip popover/dialog dashboard changes.

pull/5627/head
Igor Kulikov 5 years ago
parent
commit
eda4e0f761
  1. 26
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts

26
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts

@ -345,24 +345,26 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
this.runChangeDetection(); this.runChangeDetection();
} }
)); ));
this.rxSubscriptions.push(this.route.queryParamMap.subscribe( if (this.syncStateWithQueryParam) {
(paramMap) => { this.rxSubscriptions.push(this.route.queryParamMap.subscribe(
if (paramMap.has('reload')) { (paramMap) => {
this.dashboardCtx.aliasController.updateAliases(); if (paramMap.has('reload')) {
setTimeout(() => { this.dashboardCtx.aliasController.updateAliases();
this.mobileService.handleDashboardStateName(this.dashboardCtx.stateController.getCurrentStateName()); setTimeout(() => {
this.mobileService.onDashboardLoaded(this.layouts.right.show, this.isRightLayoutOpened); this.mobileService.handleDashboardStateName(this.dashboardCtx.stateController.getCurrentStateName());
}); this.mobileService.onDashboardLoaded(this.layouts.right.show, this.isRightLayoutOpened);
});
}
} }
} ));
)); }
this.rxSubscriptions.push(this.breakpointObserver this.rxSubscriptions.push(this.breakpointObserver
.observe(MediaBreakpoints['gt-sm']) .observe(MediaBreakpoints['gt-sm'])
.subscribe((state: BreakpointState) => { .subscribe((state: BreakpointState) => {
this.isMobile = !state.matches; this.isMobile = !state.matches;
} }
)); ));
if (this.isMobileApp) { if (this.isMobileApp && this.syncStateWithQueryParam) {
this.mobileService.registerToggleLayoutFunction(() => { this.mobileService.registerToggleLayoutFunction(() => {
setTimeout(() => { setTimeout(() => {
this.toggleLayouts(); this.toggleLayouts();
@ -464,7 +466,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
} }
ngOnDestroy(): void { ngOnDestroy(): void {
if (this.isMobileApp) { if (this.isMobileApp && this.syncStateWithQueryParam) {
this.mobileService.unregisterToggleLayoutFunction(); this.mobileService.unregisterToggleLayoutFunction();
} }
this.rxSubscriptions.forEach((subscription) => { this.rxSubscriptions.forEach((subscription) => {

Loading…
Cancel
Save