From 228354d3b854e80a1ff297afd78e6f87eacab7b6 Mon Sep 17 00:00:00 2001 From: rusikv Date: Fri, 1 Sep 2023 14:40:44 +0300 Subject: [PATCH] UI: Fix for slice click action taking wrong entity to state params --- .../app/modules/home/components/widget/lib/flot-widget.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts index e38bb3b098..9211bc9246 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts @@ -1621,10 +1621,10 @@ export class TbFlot { const descriptors = this.ctx.actionsApi.getActionDescriptors('sliceClick'); if ($event && descriptors.length) { $event.stopPropagation(); - const entityInfo = this.ctx.actionsApi.getActiveEntityInfo(); - const entityId = entityInfo ? entityInfo.entityId : null; - const entityName = entityInfo ? entityInfo.entityName : null; - const entityLabel = entityInfo ? entityInfo.entityLabel : null; + const datasource = item.series.datasource; + const entityId = datasource ? datasource.entity?.id : null; + const entityName = datasource ? datasource.entityName : null; + const entityLabel = datasource ? datasource.entityLabel : null; this.ctx.actionsApi.handleWidgetAction($event, descriptors[0], entityId, entityName, item, entityLabel); } }