From 5ed505d271214bbb79bf87754a7d30903fd8dd9c Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 16 Sep 2021 13:08:12 +0300 Subject: [PATCH 1/2] Do not handle dashboard state name from dialog by mobile app --- .../states/default-state-controller.component.ts | 2 +- .../states/entity-state-controller.component.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.ts index 2491db6452..674386f108 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.ts @@ -235,7 +235,7 @@ export class DefaultStateControllerComponent extends StateControllerComponent im private gotoState(stateId: string, update: boolean, openRightLayout?: boolean) { if (this.dashboardCtrl.dashboardCtx.state !== stateId) { this.dashboardCtrl.openDashboardState(stateId, openRightLayout); - if (stateId && this.statesValue[stateId]) { + if (this.syncStateWithQueryParam && stateId && this.statesValue[stateId]) { this.mobileService.handleDashboardStateName(this.getStateName(stateId, this.statesValue[stateId])); } if (update) { diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/states/entity-state-controller.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/states/entity-state-controller.component.ts index e0a35dc66b..f12dd033aa 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/states/entity-state-controller.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/states/entity-state-controller.component.ts @@ -277,7 +277,9 @@ export class EntityStateControllerComponent extends StateControllerComponent imp private gotoState(stateId: string, update: boolean, openRightLayout?: boolean) { const isStateIdChanged = this.dashboardCtrl.dashboardCtx.state !== stateId; this.dashboardCtrl.openDashboardState(stateId, openRightLayout); - this.mobileService.handleDashboardStateName(this.getStateName(this.stateObject.length - 1)); + if (this.syncStateWithQueryParam) { + this.mobileService.handleDashboardStateName(this.getStateName(this.stateObject.length - 1)); + } if (update) { this.updateLocation(isStateIdChanged); } From 7740e3b857425e868b77ba70152e1146006d9f6f Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 16 Sep 2021 13:52:37 +0300 Subject: [PATCH 2/2] Open new dashboard state instead of separate dialog in mobile app mode --- .../src/app/modules/home/components/widget/widget.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts index adb0ff3824..456a1e3dee 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts @@ -1026,7 +1026,7 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI const params = deepClone(this.widgetContext.stateController.getStateParams()); this.updateEntityParams(params, targetEntityParamName, targetEntityId, entityName, entityLabel); if (type === WidgetActionType.openDashboardState) { - if (descriptor.openInSeparateDialog) { + if (descriptor.openInSeparateDialog && !this.mobileService.isMobileApp()) { this.openDashboardStateInSeparateDialog(descriptor.targetDashboardStateId, params, descriptor.dialogTitle, descriptor.dialogHideDashboardToolbar, descriptor.dialogWidth, descriptor.dialogHeight); } else {