diff --git a/ui-ngx/src/app/core/api/alias-controller.ts b/ui-ngx/src/app/core/api/alias-controller.ts index bf7399cf6d..83dd4e102f 100644 --- a/ui-ngx/src/app/core/api/alias-controller.ts +++ b/ui-ngx/src/app/core/api/alias-controller.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]; diff --git a/ui-ngx/src/app/core/api/widget-api.models.ts b/ui-ngx/src/app/core/api/widget-api.models.ts index 71bfa32ee6..bca6a05644 100644 --- a/ui-ngx/src/app/core/api/widget-api.models.ts +++ b/ui-ngx/src/app/core/api/widget-api.models.ts @@ -137,6 +137,7 @@ export interface IAliasController { resolveAlarmSource(alarmSource: Datasource): Observable; getEntityAliases(): EntityAliases; getFilters(): Filters; + getUserFilters(): Filters; getFilterInfo(filterId: string): FilterInfo; getKeyFilters(filterId: string): Array; updateCurrentAliasEntity(aliasId: string, currentEntity: EntityInfo): void; diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 099eedb5bd..1919bee9b9 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -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();