Browse Source
Merge pull request #11484 from rusikv/bug/filters-not-applying
Filters are not applying to state if it is opened in dialog window or popover
pull/11606/head
Igor Kulikov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
10 additions and
3 deletions
-
ui-ngx/src/app/core/api/alias-controller.ts
-
ui-ngx/src/app/core/api/widget-api.models.ts
-
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts
|
|
|
@ -68,10 +68,11 @@ export class AliasController implements IAliasController { |
|
|
|
private translate: TranslateService, |
|
|
|
private stateControllerHolder: StateControllerHolder, |
|
|
|
private origEntityAliases: EntityAliases, |
|
|
|
private origFilters: Filters) { |
|
|
|
private origFilters: Filters, |
|
|
|
private origUserFilters?: Filters) { |
|
|
|
this.entityAliases = deepClone(this.origEntityAliases) || {}; |
|
|
|
this.filters = deepClone(this.origFilters) || {}; |
|
|
|
this.userFilters = {}; |
|
|
|
this.userFilters = deepClone(this.origUserFilters) || {}; |
|
|
|
} |
|
|
|
|
|
|
|
updateEntityAliases(newEntityAliases: EntityAliases) { |
|
|
|
@ -166,6 +167,10 @@ export class AliasController implements IAliasController { |
|
|
|
return this.filters; |
|
|
|
} |
|
|
|
|
|
|
|
getUserFilters(): Filters { |
|
|
|
return this.userFilters; |
|
|
|
} |
|
|
|
|
|
|
|
getFilterInfo(filterId: string): FilterInfo { |
|
|
|
if (this.userFilters[filterId]) { |
|
|
|
return this.userFilters[filterId]; |
|
|
|
|
|
|
|
@ -137,6 +137,7 @@ export interface IAliasController { |
|
|
|
resolveAlarmSource(alarmSource: Datasource): Observable<Datasource>; |
|
|
|
getEntityAliases(): EntityAliases; |
|
|
|
getFilters(): Filters; |
|
|
|
getUserFilters(): Filters; |
|
|
|
getFilterInfo(filterId: string): FilterInfo; |
|
|
|
getKeyFilters(filterId: string): Array<KeyFilter>; |
|
|
|
updateCurrentAliasEntity(aliasId: string, currentEntity: EntityInfo): void; |
|
|
|
|
|
|
|
@ -522,7 +522,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
|
|
|
this.translate, |
|
|
|
() => this.dashboardCtx.stateController, |
|
|
|
this.dashboardConfiguration.entityAliases, |
|
|
|
this.dashboardConfiguration.filters); |
|
|
|
this.dashboardConfiguration.filters, |
|
|
|
this.parentDashboard?.aliasController.getUserFilters()); |
|
|
|
|
|
|
|
this.updateDashboardCss(); |
|
|
|
|
|
|
|
|