Browse Source
Merge pull request #3378 from vvlladd28/bugs/state/clear
Fixed clear state params for change dashboardId
pull/3394/head
Igor Kulikov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
2 deletions
-
ui-ngx/src/app/modules/home/pages/dashboard/states/state-controller.component.ts
|
|
|
@ -100,7 +100,7 @@ export abstract class StateControllerComponent implements IStateControllerCompon |
|
|
|
this.rxSubscriptions.push(this.route.queryParamMap.subscribe((paramMap) => { |
|
|
|
const dashboardId = this.route.snapshot.params.dashboardId; |
|
|
|
if (this.dashboardId === dashboardId) { |
|
|
|
const newState = decodeURIComponent(paramMap.get('state')); |
|
|
|
const newState = this.decodeStateParam(paramMap.get('state')); |
|
|
|
if (this.currentState !== newState) { |
|
|
|
this.currentState = newState; |
|
|
|
if (this.inited) { |
|
|
|
@ -147,10 +147,15 @@ export abstract class StateControllerComponent implements IStateControllerCompon |
|
|
|
} |
|
|
|
|
|
|
|
public reInit() { |
|
|
|
this.currentState = decodeURIComponent(this.route.snapshot.queryParamMap.get('state')); |
|
|
|
this.preservedState = null; |
|
|
|
this.currentState = this.decodeStateParam(this.route.snapshot.queryParamMap.get('state')); |
|
|
|
this.init(); |
|
|
|
} |
|
|
|
|
|
|
|
private decodeStateParam(stateURI: string): string{ |
|
|
|
return stateURI !== null ? decodeURIComponent(stateURI) : null; |
|
|
|
} |
|
|
|
|
|
|
|
protected abstract init(); |
|
|
|
|
|
|
|
protected abstract onMobileChanged(); |
|
|
|
|