diff --git a/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules-table-config.ts b/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules-table-config.ts index 15c7cdaeb1..0cb6069ee9 100644 --- a/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules-table-config.ts @@ -264,25 +264,17 @@ export class AlarmRulesTableConfig extends EntityTableConfig { } private openDebugEventsDialog(calculatedField: CalculatedField): void { - const customCellActionEnabledFn = (event: DebugEvent) => { - return (calculatedField.type === CalculatedFieldType.SCRIPT || - (calculatedField.type === CalculatedFieldType.PROPAGATION && - calculatedField.configuration.applyExpressionToResolvedArguments) - ) && !!(event as DebugEvent).body.arguments; - }; - this.dialog.open(EventsDialogComponent, { disableClose: true, panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], data: { title: 'alarm-rule.debugging', tenantId: this.tenantId, - value: calculatedField.id, + entityId: calculatedField.id, debugEventTypes:[DebugEventType.DEBUG_CALCULATED_FIELD], disabledEventTypes:[EventType.LC_EVENT, EventType.ERROR, EventType.STATS], defaultEventType: DebugEventType.DEBUG_CALCULATED_FIELD, - onDebugEventSelected: null, - customCellActionEnabledFn: customCellActionEnabledFn + debugActionEnabledFn: () => false } }) .afterClosed() diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts index 18dcb28a2e..60c2878802 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts @@ -233,7 +233,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig { + const debugActionEnabledFn = (event: DebugEvent) => { return (calculatedField.type === CalculatedFieldType.SCRIPT || (calculatedField.type === CalculatedFieldType.PROPAGATION && calculatedField.configuration.applyExpressionToResolvedArguments) @@ -251,12 +251,12 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig diff --git a/ui-ngx/src/app/modules/home/dialogs/events-dialog.component.ts b/ui-ngx/src/app/modules/home/dialogs/events-dialog.component.ts index 613f4e9c15..d5339de3b2 100644 --- a/ui-ngx/src/app/modules/home/dialogs/events-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/dialogs/events-dialog.component.ts @@ -28,13 +28,13 @@ import { BaseData, HasId } from '@shared/models/base-data'; export interface EventsDialogData { title: string; tenantId: string; - value: EntityId; + entityId: EntityId; debugEventTypes: Array; defaultEventType: DebugEventType; disabledEventTypes?: Array; functionTestButtonLabel?: string; onDebugEventSelected?: (event: any, dialogRef: MatDialogRef) => void; - customCellActionEnabledFn?: (event: BaseData) => boolean; + debugActionEnabledFn?: (event: BaseData) => boolean; } @Component({ @@ -54,8 +54,8 @@ export class EventsDialogComponent extends DialogComponent 0) { - this.eventsTable.entitiesTable.cellActionDescriptors[0].isEnabled = this.data.customCellActionEnabledFn; + if (this.data.debugActionEnabledFn && this.eventsTable.entitiesTable.cellActionDescriptors?.length > 0) { + this.eventsTable.entitiesTable.cellActionDescriptors[0].isEnabled = this.data.debugActionEnabledFn; } this.eventsTable.entitiesTable.updateData(); } diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts index b1cf2eddf2..7f751a0bfe 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts @@ -1682,7 +1682,7 @@ export class RuleChainPageComponent extends PageComponent debugEventTypes: [DebugEventType.DEBUG_RULE_NODE], defaultEventType: DebugEventType.DEBUG_RULE_NODE, tenantId: this.ruleChain.tenantId.id, - value: this.editingRuleNode.ruleNodeId, + entityId: this.editingRuleNode.ruleNodeId, functionTestButtonLabel: this.ruleNodeTestButtonLabel, onDebugEventSelected: this.onDebugEventSelected.bind(this) }