From 90af292e36655add9a038dc696fc8292b6ee148c Mon Sep 17 00:00:00 2001 From: Maksym Tsymbarov Date: Mon, 9 Nov 2026 11:13:02 +0100 Subject: [PATCH] Reworked SCADA tag actions editor and made click/dblclick mutually exclusive --- .../widget/lib/scada/scada-symbol.models.ts | 82 +++++----- ...scada-symbol-metadata-components.module.ts | 6 +- ...-metadata-tag-actions-panel.component.html | 67 +++++++++ ...-metadata-tag-actions-panel.component.scss | 23 +++ ...ol-metadata-tag-actions-panel.component.ts | 126 ++++++++++++++++ ...l-metadata-tag-function-panel.component.ts | 31 +--- .../scada-symbol-metadata-tag.component.html | 37 ++--- .../scada-symbol-metadata-tag.component.scss | 9 +- .../scada-symbol-metadata-tag.component.ts | 141 +++++++----------- .../scada-symbol-metadata-tags.component.html | 4 +- .../scada-symbol-metadata-tags.component.scss | 9 +- .../scada-symbol-metadata-tags.component.ts | 10 +- .../scada-symbol-metadata.component.ts | 10 +- ...cada-symbol-tag-action-button.directive.ts | 32 ---- .../scada-symbol-editor.models.ts | 30 ++-- .../scada-symbol-tooltip.components.ts | 57 +++---- .../scada-symbol/scada-symbol.component.ts | 14 +- .../help/en_US/scada/tag_click_action_fn.md | 3 + .../en_US/scada/tag_dblclick_action_fn.md | 6 +- .../assets/locale/locale.constant-en_US.json | 5 + 20 files changed, 400 insertions(+), 302 deletions(-) create mode 100644 ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.html create mode 100644 ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.scss create mode 100644 ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.ts delete mode 100644 ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-tag-action-button.directive.ts diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts index da5cb1a4cd..6f655523f7 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts @@ -106,20 +106,26 @@ export type ScadaSymbolActionTrigger = 'click' | 'dblclick' | 'contextmenu'; export interface ScadaSymbolActionTriggerInfo { name: string; + enabledLabel: string; helpId: string; + excludedBy?: ScadaSymbolActionTrigger; } export const scadaSymbolActionTriggerInfo: Record = { click: { name: 'scada.tag.on-click-action', + enabledLabel: 'scada.tag.on-click-action-enabled', helpId: 'scada/tag_click_action_fn' }, dblclick: { name: 'scada.tag.on-double-click-action', - helpId: 'scada/tag_dblclick_action_fn' + enabledLabel: 'scada.tag.on-double-click-action-enabled', + helpId: 'scada/tag_dblclick_action_fn', + excludedBy: 'click' }, contextmenu: { name: 'scada.tag.on-right-click-action', + enabledLabel: 'scada.tag.on-right-click-action-enabled', helpId: 'scada/tag_contextmenu_action_fn' } }; @@ -127,12 +133,6 @@ export const scadaSymbolActionTriggerInfo: Record void; export interface ScadaSymbolAction { actionFunction?: string; @@ -143,9 +143,27 @@ export interface ScadaSymbolTag { tag: string; stateRenderFunction?: string; stateRender?: ScadaSymbolTagStateRenderFunction; - actions?: {[trigger in ScadaSymbolActionTrigger]?: ScadaSymbolAction}; + actions?: ScadaSymbolTagActions; } +export type ScadaSymbolTagActions = {[trigger in ScadaSymbolActionTrigger]?: ScadaSymbolAction}; + +export const exclusiveActionTrigger = (trigger: ScadaSymbolActionTrigger): ScadaSymbolActionTrigger | undefined => + scadaSymbolActionTriggerInfo[trigger].excludedBy ?? + scadaSymbolActionTriggers.find(other => scadaSymbolActionTriggerInfo[other].excludedBy === trigger); + +const isActionExcluded = (actions: ScadaSymbolTagActions, trigger: string): boolean => + scadaSymbolActionTriggers.some(known => { + const excludedBy = scadaSymbolActionTriggerInfo[known].excludedBy; + return known === trigger && !!excludedBy && !!actions[excludedBy]; + }); + +const activeTagActions = (actions: ScadaSymbolTagActions): [string, ScadaSymbolAction][] => + Object.entries(actions).filter(([trigger, action]) => !!action && !isActionExcluded(actions, trigger)); + +export const activeActionTriggers = (actions: ScadaSymbolTagActions): ScadaSymbolActionTrigger[] => + actions ? scadaSymbolActionTriggers.filter(trigger => !!actions[trigger] && !isActionExcluded(actions, trigger)) : []; + export enum ScadaSymbolBehaviorType { value = 'value', action = 'action', @@ -532,8 +550,6 @@ export class ScadaSymbolObject { private readonly shapeResize$: ResizeObserver; private readonly destroy$ = new Subject(); - private readonly deferredClickTimeouts = new Set>(); - private scale = 1; private performInit = true; @@ -563,8 +579,6 @@ export class ScadaSymbolObject { public destroy() { this.destroy$.next(); this.destroy$.complete(); - this.deferredClickTimeouts.forEach(timeout => clearTimeout(timeout)); - this.deferredClickTimeouts.clear(); if (this.shapeResize$) { this.shapeResize$.disconnect(); } @@ -594,11 +608,8 @@ export class ScadaSymbolObject { for (const tag of this.metadata.tags) { tag.stateRender = parseFunction(tag.stateRenderFunction, ['ctx', 'element']) || (() => {}); if (tag.actions) { - for (const trigger of scadaSymbolActionTriggers) { - const action = tag.actions[trigger]; - if (action) { - action.action = parseFunction(action.actionFunction, ['ctx', 'element', 'event']) || (() => {}); - } + for (const [, action] of activeTagActions(tag.actions)) { + action.action = parseFunction(action.actionFunction, ['ctx', 'element', 'event']) || (() => {}); } } } @@ -690,38 +701,15 @@ export class ScadaSymbolObject { for (const tag of this.metadata.tags) { if (tag.actions) { const elements = this.svgShape.find(`[tb\\:tag="${tag.tag}"]`); - const deferClick = !!tag.actions.click && !!tag.actions.dblclick; - for (const trigger of scadaSymbolActionTriggers) { - const action = tag.actions[trigger]; - if (!action) { - continue; - } + for (const [trigger, action] of activeTagActions(tag.actions)) { elements.forEach(element => { element.attr('cursor', 'pointer'); - if (trigger === 'click' && deferClick) { - let clickTimeout: ReturnType = null; - element.on('click', (event: MouseEvent) => { - if (clickTimeout !== null) { - clearTimeout(clickTimeout); - this.deferredClickTimeouts.delete(clickTimeout); - clickTimeout = null; - } - if (event.detail === 1) { - clickTimeout = setTimeout(() => { - this.deferredClickTimeouts.delete(clickTimeout); - action.action(this.context, element, event); - }, dblClickDelay); - this.deferredClickTimeouts.add(clickTimeout); - } - }); - } else { - element.on(trigger, (event) => { - if (trigger === 'contextmenu') { - event.preventDefault(); - } - action.action(this.context, element, event); - }); - } + element.on(trigger, (event) => { + if (trigger === 'contextmenu') { + event.preventDefault(); + } + action.action(this.context, element, event); + }); }); } } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-components.module.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-components.module.ts index 6ecb5589bf..47842c5541 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-components.module.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-components.module.ts @@ -26,8 +26,8 @@ import { ScadaSymbolMetadataTagFunctionPanelComponent } from '@home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-function-panel.component'; import { - ScadaSymbolTagActionButtonDirective -} from '@home/pages/scada-symbol/metadata-components/scada-symbol-tag-action-button.directive'; + ScadaSymbolMetadataTagActionsPanelComponent +} from '@home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component'; @NgModule({ declarations: @@ -35,8 +35,8 @@ import { ScadaSymbolMetadataComponent, ScadaSymbolMetadataTagComponent, ScadaSymbolMetadataTagsComponent, - ScadaSymbolTagActionButtonDirective, ScadaSymbolMetadataTagFunctionPanelComponent, + ScadaSymbolMetadataTagActionsPanelComponent, ScadaSymbolBehaviorsComponent, ScadaSymbolBehaviorRowComponent, ScadaSymbolBehaviorPanelComponent diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.html b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.html new file mode 100644 index 0000000000..5a3b2c7daf --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.html @@ -0,0 +1,67 @@ + + diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.scss b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.scss new file mode 100644 index 0000000000..eaa25dd445 --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.scss @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-License-Identifier: Apache-2.0 +@import '../../../../../../scss/constants'; + +.tb-scada-symbol-metadata-tag-actions-panel { + width: 800px; + display: flex; + flex-direction: column; + gap: 16px; + @media #{$mat-lt-md} { + width: 90vw; + } + .tb-action-trigger-enabled::before { + content: ''; + display: inline-block; + width: 6px; + height: 6px; + margin-right: 6px; + border-radius: 50%; + background-color: currentColor; + vertical-align: middle; + } +} diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.ts new file mode 100644 index 0000000000..288d66d7e8 --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component.ts @@ -0,0 +1,126 @@ +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-License-Identifier: Apache-2.0 +import { Component, DestroyRef, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core'; +import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { TbPopoverComponent } from '@shared/components/popover.component'; +import { TbEditorCompleter } from '@shared/models/ace/completion.models'; +import { scadaSymbolActionFunctionHighlightRules } from '@home/pages/scada-symbol/scada-symbol-editor.models'; +import { + activeActionTriggers, + exclusiveActionTrigger, + ScadaSymbolActionTrigger, + scadaSymbolActionTriggerInfo, + scadaSymbolActionTriggers, + ScadaSymbolTagActions +} from '@home/components/widget/lib/scada/scada-symbol.models'; + +@Component({ + selector: 'tb-scada-symbol-metadata-tag-actions-panel', + templateUrl: './scada-symbol-metadata-tag-actions-panel.component.html', + styleUrls: ['./scada-symbol-metadata-tag-actions-panel.component.scss'], + encapsulation: ViewEncapsulation.None, + standalone: false +}) +export class ScadaSymbolMetadataTagActionsPanelComponent implements OnInit { + + @Input() + tag: string; + + @Input() + actions: ScadaSymbolTagActions; + + @Input() + completer: TbEditorCompleter; + + @Input() + disabled: boolean; + + @Input() + popover: TbPopoverComponent; + + @Output() + actionsApplied = new EventEmitter(); + + actionTriggers = scadaSymbolActionTriggers; + + actionTriggerInfo = scadaSymbolActionTriggerInfo; + + actionFunctionArgs = ['ctx', 'element', 'event']; + + highlightRules = scadaSymbolActionFunctionHighlightRules; + + actionsFormGroup: UntypedFormGroup; + + selectedTrigger: ScadaSymbolActionTrigger; + + exclusiveActionTrigger = exclusiveActionTrigger; + + constructor(private fb: UntypedFormBuilder, + private destroyRef: DestroyRef) { + } + + ngOnInit(): void { + const activeTriggers = activeActionTriggers(this.actions); + const triggerGroups: {[trigger: string]: UntypedFormGroup} = {}; + for (const trigger of this.actionTriggers) { + triggerGroups[trigger] = this.fb.group({ + enabled: [activeTriggers.includes(trigger)], + actionFunction: [this.actions?.[trigger]?.actionFunction, [Validators.required]] + }); + } + this.actionsFormGroup = this.fb.group(triggerGroups); + if (this.actionTriggers.some(trigger => !!this.actions?.[trigger] && !activeTriggers.includes(trigger))) { + this.actionsFormGroup.markAsDirty(); + } + if (this.disabled) { + this.actionsFormGroup.disable({emitEvent: false}); + } else { + this.actionTriggers.forEach(trigger => this.updateActionFunctionState(trigger)); + } + this.selectedTrigger = this.actionTriggers.find(trigger => this.isEnabled(trigger)) ?? this.actionTriggers[0]; + for (const trigger of this.actionTriggers) { + this.actionsFormGroup.get([trigger, 'enabled']).valueChanges.pipe( + takeUntilDestroyed(this.destroyRef) + ).subscribe((enabled: boolean) => { + const exclusiveTrigger = exclusiveActionTrigger(trigger); + if (enabled && exclusiveTrigger) { + this.actionsFormGroup.get([exclusiveTrigger, 'enabled']).setValue(false, {emitEvent: false}); + this.updateActionFunctionState(exclusiveTrigger); + } + this.updateActionFunctionState(trigger); + }); + } + } + + isEnabled(trigger: ScadaSymbolActionTrigger): boolean { + return !!this.actionsFormGroup.get([trigger, 'enabled']).value; + } + + cancel() { + this.popover?.hide(); + } + + applyActions() { + const value = this.actionsFormGroup.getRawValue(); + let actions: ScadaSymbolTagActions = null; + for (const trigger of this.actionTriggers) { + if (value[trigger].enabled) { + actions = actions || {}; + actions[trigger] = { + actionFunction: value[trigger].actionFunction + }; + } + } + this.actionsApplied.emit(actions); + } + + private updateActionFunctionState(trigger: ScadaSymbolActionTrigger) { + const actionFunctionControl = this.actionsFormGroup.get([trigger, 'actionFunction']); + if (this.isEnabled(trigger)) { + actionFunctionControl.enable({emitEvent: false}); + } else { + actionFunctionControl.disable({emitEvent: false}); + } + } +} diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-function-panel.component.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-function-panel.component.ts index 4e825ad2b3..76cde81a47 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-function-panel.component.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-function-panel.component.ts @@ -15,15 +15,8 @@ import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { WidgetService } from '@core/http/widget.service'; import { TbEditorCompleter } from '@shared/models/ace/completion.models'; import { AceHighlightRules } from '@shared/models/ace/ace.models'; -import { - scadaSymbolActionFunctionHighlightRules, - scadaSymbolRenderFunctionHighlightRules -} from '@home/pages/scada-symbol/scada-symbol-editor.models'; +import { scadaSymbolRenderFunctionHighlightRules } from '@home/pages/scada-symbol/scada-symbol-editor.models'; import { JsFuncComponent } from '@shared/components/js-func.component'; -import { - ScadaSymbolActionTrigger, - scadaSymbolActionTriggerInfo -} from '@home/components/widget/lib/scada/scada-symbol.models'; @Component({ selector: 'tb-scada-symbol-metadata-tag-function-panel', @@ -40,9 +33,6 @@ export class ScadaSymbolMetadataTagFunctionPanelComponent implements OnInit, Aft @Input() tagFunction: string; - @Input() - tagFunctionType: 'renderFunction' | ScadaSymbolActionTrigger; - @Input() tag: string; @@ -62,13 +52,13 @@ export class ScadaSymbolMetadataTagFunctionPanelComponent implements OnInit, Aft tagFunctionFormGroup: UntypedFormGroup; - panelTitle: string; + panelTitle = 'scada.state-render-function'; - tagFunctionArgs: string[]; + tagFunctionArgs = ['ctx', 'element']; - tagFunctionHelpId: string; + tagFunctionHelpId = 'scada/tag_state_render_fn'; - highlightRules: AceHighlightRules; + highlightRules: AceHighlightRules = scadaSymbolRenderFunctionHighlightRules; constructor(private fb: UntypedFormBuilder, private widgetService: WidgetService) { @@ -83,17 +73,6 @@ export class ScadaSymbolMetadataTagFunctionPanelComponent implements OnInit, Aft if (this.disabled) { this.tagFunctionFormGroup.disable({emitEvent: false}); } - if (this.tagFunctionType === 'renderFunction') { - this.panelTitle = 'scada.state-render-function'; - this.tagFunctionArgs = ['ctx', 'element']; - this.highlightRules = scadaSymbolRenderFunctionHighlightRules; - this.tagFunctionHelpId = 'scada/tag_state_render_fn'; - } else { - this.panelTitle = scadaSymbolActionTriggerInfo[this.tagFunctionType].name; - this.tagFunctionArgs = ['ctx', 'element', 'event']; - this.highlightRules = scadaSymbolActionFunctionHighlightRules; - this.tagFunctionHelpId = scadaSymbolActionTriggerInfo[this.tagFunctionType].helpId; - } } ngAfterViewInit() { diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.html b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.html index 8cc6d9a375..bd5a298eb9 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.html +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.html @@ -14,32 +14,33 @@ + @let tag = tagFormGroup.get('tag').value;
- @if (isStateRenderFunctionVisible()) { + @if (!disabled || tagFormGroup.get('stateRenderFunction').value) { + @let stateRenderActionKey = disabled ? 'action.view' : (tagFormGroup.get('stateRenderFunction').value ? 'action.edit' : 'action.add'); + } +
+
+ @if (!disabled || actionsCount) { + @let actionsKey = disabled ? 'action.view' : (actionsCount ? 'action.edit' : 'action.add'); + }
- @for (trigger of actionTriggers; track trigger) { -
- @if (isActionVisible(trigger)) { - - } -
- } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.scss b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.scss index f8bd881b9a..bb7e97de6a 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.scss +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.scss @@ -2,10 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 .tb-scada-symbol-metadata-tag-row { .tb-tag-field { - flex: 1 1 40%; + flex: 1 1 70%; } - .tb-state-render-function-field, .tb-action-function-field { + .tb-state-render-function-field { flex: 1 1 15%; + } + .tb-actions-field { + flex: 1 1 15%; + } + .tb-state-render-function-field, .tb-actions-field { display: flex; justify-content: flex-end; .mdc-button { diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.ts index d2e8ae7c71..02ccaa3b6d 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag.component.ts @@ -5,15 +5,12 @@ import { forwardRef, Input, OnInit, - QueryList, Renderer2, ViewChild, - ViewChildren, ViewContainerRef, ViewEncapsulation } from '@angular/core'; import { - AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, @@ -22,22 +19,16 @@ import { UntypedFormGroup, Validator } from '@angular/forms'; -import { - ScadaSymbolActionTrigger, - scadaSymbolActionTriggerInfo, - scadaSymbolActionTriggers, - ScadaSymbolTag -} from '@home/components/widget/lib/scada/scada-symbol.models'; +import { activeActionTriggers, ScadaSymbolTag } from '@home/components/widget/lib/scada/scada-symbol.models'; import { TbEditorCompleter } from '@shared/models/ace/completion.models'; import { MatButton } from '@angular/material/button'; import { - ScadaSymbolTagActionButtonDirective -} from '@home/pages/scada-symbol/metadata-components/scada-symbol-tag-action-button.directive'; + ScadaSymbolMetadataTagActionsPanelComponent +} from '@home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-actions-panel.component'; import { TbPopoverService } from '@shared/components/popover.service'; import { ScadaSymbolMetadataTagFunctionPanelComponent } from '@home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tag-function-panel.component'; -import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'tb-scada-symbol-metadata-tag', @@ -63,8 +54,8 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On @ViewChild('editStateRenderFunctionButton') editStateRenderFunctionButton: MatButton; - @ViewChildren(ScadaSymbolTagActionButtonDirective) - editActionButtons: QueryList; + @ViewChild('editActionsButton') + editActionsButton: MatButton; @Input() disabled: boolean; @@ -75,7 +66,7 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On @Input() actionFunctionCompleter: TbEditorCompleter; - actionTriggers = scadaSymbolActionTriggers; + actionsCount = 0; tagFormGroup: UntypedFormGroup; @@ -86,19 +77,14 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On constructor(private fb: UntypedFormBuilder, private popoverService: TbPopoverService, private renderer: Renderer2, - private translate: TranslateService, private viewContainerRef: ViewContainerRef) { } ngOnInit() { - const controls: {[key: string]: any} = { + this.tagFormGroup = this.fb.group({ tag: [null, []], stateRenderFunction: [null, []] - }; - for (const trigger of this.actionTriggers) { - controls[this.actionControlName(trigger)] = [null, []]; - } - this.tagFormGroup = this.fb.group(controls); + }); } registerOnChange(fn: any): void { @@ -119,14 +105,13 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On writeValue(value: ScadaSymbolTag): void { this.modelValue = value; - const patch: {[key: string]: any} = { - tag: value?.tag, - stateRenderFunction: value?.stateRenderFunction - }; - for (const trigger of this.actionTriggers) { - patch[this.actionControlName(trigger)] = value?.actions?.[trigger]?.actionFunction; - } - this.tagFormGroup.patchValue(patch, {emitEvent: false}); + this.tagFormGroup.patchValue( + { + tag: value?.tag, + stateRenderFunction: value?.stateRenderFunction + }, {emitEvent: false} + ); + this.updateActionsCount(); } public validate(_c: UntypedFormControl) { @@ -138,61 +123,45 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On }; } - actionControlName(trigger: ScadaSymbolActionTrigger): string { - return trigger + 'Action'; - } - - isStateRenderFunctionVisible(): boolean { - return !this.disabled || !!this.tagFormGroup.get('stateRenderFunction').value; - } - - isActionVisible(trigger: ScadaSymbolActionTrigger): boolean { - return !this.disabled || !!this.tagFormGroup.get(this.actionControlName(trigger)).value; - } - - stateRenderFunctionButtonAriaLabel(): string { - return this.buttonAriaLabel('scada.state-render-function', this.tagFormGroup.get('stateRenderFunction').value); - } - - actionButtonAriaLabel(trigger: ScadaSymbolActionTrigger): string { - return this.buttonAriaLabel(scadaSymbolActionTriggerInfo[trigger].name, - this.tagFormGroup.get(this.actionControlName(trigger)).value); - } - editTagStateRenderFunction(): void { - this.openTagFunction('renderFunction', this.editStateRenderFunctionButton); + this.openTagFunction(this.editStateRenderFunctionButton); } - editAction(trigger: ScadaSymbolActionTrigger): void { - const actionButton = this.editActionButtons.find(b => b.trigger === trigger); - if (actionButton) { - this.openTagFunction(trigger, actionButton.button); + editActions(): void { + const trigger = this.editActionsButton._elementRef.nativeElement; + trigger.scrollIntoView(); + if (this.popoverService.hasPopover(trigger)) { + this.popoverService.hidePopover(trigger); + } else { + const actionsPanelPopover = this.popoverService.displayPopover({ + trigger, + renderer: this.renderer, + componentType: ScadaSymbolMetadataTagActionsPanelComponent, + hostView: this.viewContainerRef, + preferredPlacement: ['leftOnly', 'leftTopOnly', 'leftBottomOnly'], + context: { + tag: this.tagFormGroup.get('tag').value, + actions: this.modelValue?.actions, + completer: this.actionFunctionCompleter, + disabled: this.disabled + }, + isModal: true + }); + actionsPanelPopover.tbComponentRef.instance.popover = actionsPanelPopover; + actionsPanelPopover.tbComponentRef.instance.actionsApplied.subscribe((actions) => { + actionsPanelPopover.hide(); + this.updateModel(actions); + }); } } - private buttonAriaLabel(tagFunctionNameKey: string, tagFunction: string): string { - const action = this.disabled ? 'action.view' : (tagFunction ? 'action.edit' : 'action.add'); - const label = `${this.translate.instant(action)} ${this.translate.instant(tagFunctionNameKey)}`; - const tag = this.tagFormGroup.get('tag').value; - return tag ? `${label}: ${tag}` : label; - } - - private openTagFunction(tagFunctionType: 'renderFunction' | ScadaSymbolActionTrigger, - button: MatButton) { + private openTagFunction(button: MatButton) { const trigger = button._elementRef.nativeElement; trigger.scrollIntoView(); if (this.popoverService.hasPopover(trigger)) { this.popoverService.hidePopover(trigger); } else { - let tagFunctionControl: AbstractControl; - let completer: TbEditorCompleter; - if (tagFunctionType === 'renderFunction') { - tagFunctionControl = this.tagFormGroup.get('stateRenderFunction'); - completer = this.elementStateRenderFunctionCompleter; - } else { - tagFunctionControl = this.tagFormGroup.get(this.actionControlName(tagFunctionType)); - completer = this.actionFunctionCompleter; - } + const tagFunctionControl = this.tagFormGroup.get('stateRenderFunction'); const scadaSymbolTagFunctionPanelPopover = this.popoverService.displayPopover({ trigger, renderer: this.renderer, @@ -201,9 +170,8 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On preferredPlacement: ['leftOnly', 'leftTopOnly', 'leftBottomOnly'], context: { tagFunction: tagFunctionControl.value, - tagFunctionType, tag: this.tagFormGroup.get('tag').value, - completer, + completer: this.elementStateRenderFunctionCompleter, disabled: this.disabled }, isModal: true @@ -217,23 +185,18 @@ export class ScadaSymbolMetadataTagComponent implements ControlValueAccessor, On } } - private updateModel() { + private updateModel(actions = this.modelValue?.actions) { const value = this.tagFormGroup.value; this.modelValue = { tag: value.tag, - stateRenderFunction: value.stateRenderFunction + stateRenderFunction: value.stateRenderFunction, + actions }; - let actions: ScadaSymbolTag['actions'] = null; - for (const trigger of this.actionTriggers) { - const actionFunction = value[this.actionControlName(trigger)]; - if (actionFunction) { - actions = actions || {}; - actions[trigger] = { - actionFunction - }; - } - } - this.modelValue.actions = actions; + this.updateActionsCount(); this.propagateChange(this.modelValue); } + + private updateActionsCount() { + this.actionsCount = activeActionTriggers(this.modelValue?.actions).length; + } } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.html b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.html index 5e43ce3ff7..2a03db0523 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.html +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.html @@ -9,9 +9,7 @@
scada.tag.tag
scada.state-render-function
- @for (trigger of actionTriggers; track trigger) { -
{{ actionTriggerInfo[trigger].name | translate }}
- } +
scada.tag.actions
@if (tagsFormArray().controls.length) {
diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.scss b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.scss index 6b56e20e57..ec1e34f69b 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.scss +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.scss @@ -5,10 +5,15 @@ margin: 12px; .tb-form-table-header-cell { &.tb-tag-header { - flex: 1 1 40%; + flex: 1 1 70%; } - &.tb-state-render-function-header, &.tb-action-function-header { + &.tb-state-render-function-header { flex: 1 1 15%; + } + &.tb-actions-header { + flex: 1 1 15%; + } + &.tb-state-render-function-header, &.tb-actions-header { display: flex; justify-content: flex-end; } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.ts index 42e9eba269..eef4d25f33 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata-tags.component.ts @@ -25,9 +25,7 @@ import { Validator } from '@angular/forms'; import { - ScadaSymbolActionTrigger, scadaSymbolActionTriggers, - scadaSymbolActionTriggerInfo, ScadaSymbolTag } from '@home/components/widget/lib/scada/scada-symbol.models'; import { @@ -78,10 +76,6 @@ export class ScadaSymbolMetadataTagsComponent implements ControlValueAccessor, O @Input() actionFunctionCompleter: TbEditorCompleter; - actionTriggers = scadaSymbolActionTriggers; - - actionTriggerInfo = scadaSymbolActionTriggerInfo; - tagsFormGroup: UntypedFormGroup; private modelValue: ScadaSymbolTag[]; @@ -179,12 +173,12 @@ export class ScadaSymbolMetadataTagsComponent implements ControlValueAccessor, O }); } - editTagAction(tag: string, trigger: ScadaSymbolActionTrigger): void { + editTagActions(tag: string): void { setTimeout(() => { const tags: ScadaSymbolTag[] = this.tagsFormGroup.get('tags').value; const index = tags.findIndex(t => t.tag === tag); const tagComponent = this.metadataTags.get(index); - tagComponent?.editAction(trigger); + tagComponent?.editActions(); }); } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.ts index 58e2fa31db..c49b4b246b 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.ts @@ -23,11 +23,7 @@ import { Validators } from '@angular/forms'; import { PageComponent } from '@shared/components/page.component'; -import { - emptyMetadata, - ScadaSymbolActionTrigger, - ScadaSymbolMetadata -} from '@home/components/widget/lib/scada/scada-symbol.models'; +import { emptyMetadata, ScadaSymbolMetadata } from '@home/components/widget/lib/scada/scada-symbol.models'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { ToggleHeaderOption } from '@shared/components/toggle-header.component'; @@ -198,9 +194,9 @@ export class ScadaSymbolMetadataComponent extends PageComponent implements OnIni this.symbolMetadataTags.editTagStateRenderFunction(tag); } - editTagAction(tag: string, trigger: ScadaSymbolActionTrigger): void { + editTagActions(tag: string): void { this.selectedOption = 'tags'; - this.symbolMetadataTags.editTagAction(tag, trigger); + this.symbolMetadataTags.editTagActions(tag); } public validate(c: UntypedFormControl) { diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-tag-action-button.directive.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-tag-action-button.directive.ts deleted file mode 100644 index 7b08b4dece..0000000000 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-tag-action-button.directive.ts +++ /dev/null @@ -1,32 +0,0 @@ -/// -/// Copyright © 2016-2026 The Thingsboard Authors -/// -/// Licensed under the Apache License, Version 2.0 (the "License"); -/// you may not use this file except in compliance with the License. -/// You may obtain a copy of the License at -/// -/// http://www.apache.org/licenses/LICENSE-2.0 -/// -/// Unless required by applicable law or agreed to in writing, software -/// distributed under the License is distributed on an "AS IS" BASIS, -/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -/// See the License for the specific language governing permissions and -/// limitations under the License. -/// - -import { Directive, Input } from '@angular/core'; -import { MatButton } from '@angular/material/button'; -import { ScadaSymbolActionTrigger } from '@home/components/widget/lib/scada/scada-symbol.models'; - -@Directive({ - selector: '[tbScadaSymbolTagActionButton]', - standalone: false -}) -export class ScadaSymbolTagActionButtonDirective { - - @Input('tbScadaSymbolTagActionButton') - trigger: ScadaSymbolActionTrigger; - - constructor(public button: MatButton) { - } -} diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts index 2e66f60356..5a22cdf312 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts @@ -11,8 +11,8 @@ import { setupTagPanelTooltip } from '@home/pages/scada-symbol/scada-symbol-tooltip.components'; import { - ScadaSymbolActionTrigger, - scadaSymbolActionTriggers, + activeActionTriggers, + ScadaSymbolTagActions, ScadaSymbolBehavior, ScadaSymbolBehaviorType, scadaSymbolContentData, @@ -41,9 +41,9 @@ export interface ScadaSymbolData { export interface ScadaSymbolEditObjectCallbacks { tagHasStateRenderFunction: (tag: string) => boolean; - tagHasAction: (tag: string, trigger: ScadaSymbolActionTrigger) => boolean; + tagActions: (tag: string) => ScadaSymbolTagActions; editTagStateRenderFunction: (tag: string) => void; - editTagAction: (tag: string, trigger: ScadaSymbolActionTrigger) => void; + editTagActions: (tag: string) => void; tagsUpdated: (tags: string[]) => void; hasHiddenElements?: (hasHidden: boolean) => void; onSymbolEditObjectDirty: (dirty: boolean) => void; @@ -413,16 +413,16 @@ export class ScadaSymbolEditObject { return this.callbacks.tagHasStateRenderFunction(tag); } - public tagHasAction(tag: string, trigger: ScadaSymbolActionTrigger): boolean { - return this.callbacks.tagHasAction(tag, trigger); + public tagActions(tag: string): ScadaSymbolTagActions { + return this.callbacks.tagActions(tag); } public editTagStateRenderFunction(tag: string) { this.callbacks.editTagStateRenderFunction(tag); } - public editTagAction(tag: string, trigger: ScadaSymbolActionTrigger) { - this.callbacks.editTagAction(tag, trigger); + public editTagActions(tag: string) { + this.callbacks.editTagActions(tag); } public setDirty(dirty: boolean) { @@ -635,16 +635,16 @@ export class ScadaSymbolElement { } } - public hasAction(trigger: ScadaSymbolActionTrigger): boolean { + public actions(): ScadaSymbolTagActions { if (this.hasTag()) { - return this.editObject.tagHasAction(this.tag, trigger); + return this.editObject.tagActions(this.tag); } else { - return false; + return null; } } - public hasAnyAction(): boolean { - return scadaSymbolActionTriggers.some(trigger => this.hasAction(trigger)); + public actionsCount(): number { + return activeActionTriggers(this.actions()).length; } public editStateRenderFunction() { @@ -653,9 +653,9 @@ export class ScadaSymbolElement { } } - public editAction(trigger: ScadaSymbolActionTrigger) { + public editActions() { if (this.hasTag()) { - this.editObject.editTagAction(this.tag, trigger); + this.editObject.editTagActions(this.tag); } } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-tooltip.components.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-tooltip.components.ts index a6d6e3e331..8498101c56 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-tooltip.components.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-tooltip.components.ts @@ -17,11 +17,6 @@ import { ViewEncapsulation } from '@angular/core'; import { ScadaSymbolElement } from '@home/pages/scada-symbol/scada-symbol-editor.models'; -import { - ScadaSymbolActionTrigger, - scadaSymbolActionTriggerInfo, - scadaSymbolActionTriggers -} from '@home/components/widget/lib/scada/scada-symbol.models'; import { CommonModule } from '@angular/common'; import { SharedModule } from '@shared/shared.module'; import { ENTER } from '@angular/cdk/keycodes'; @@ -232,7 +227,7 @@ class ScadaSymbolTagPanelComponent extends ScadaSymbolPanelComponent implements ngOnInit() { if (this.symbolElement?.readonly) { - this.displayTagSettings = (this.symbolElement?.hasStateRenderFunction() || this.symbolElement?.hasAnyAction()); + this.displayTagSettings = (this.symbolElement?.hasStateRenderFunction() || !!this.symbolElement?.actionsCount()); } } @@ -357,6 +352,7 @@ class ScadaSymbolRemoveTagConfirmComponent extends ScadaSymbolPanelComponent imp @Component({ template: `
+ @let tag = symbolElement?.tag; @if (!symbolElement?.readonly || hasStateRenderFunction) {
scada.state-render-function
} @@ -364,6 +360,7 @@ class ScadaSymbolRemoveTagConfirmComponent extends ScadaSymbolPanelComponent imp } - @for (trigger of actionTriggers; track trigger) { - @if (!symbolElement?.readonly || hasActions[trigger]) { -
{{ actionTriggerInfo[trigger].name | translate }}
- } - @if (hasActions[trigger]) { - - } - @if (!hasActions[trigger] && !symbolElement?.readonly) { - - } + @if (!symbolElement?.readonly || actionsCount) { + @let actionsKey = symbolElement?.readonly ? 'action.view' : (actionsCount ? 'action.edit' : 'action.add'); +
scada.tag.actions
+ }
`, styleUrls: ['./scada-symbol-tooltip.component.scss'], @@ -408,13 +395,9 @@ class ScadaSymbolRemoveTagConfirmComponent extends ScadaSymbolPanelComponent imp }) class ScadaSymbolTagSettingsComponent extends ScadaSymbolPanelComponent implements OnInit, AfterViewInit { - actionTriggers = scadaSymbolActionTriggers; - - actionTriggerInfo = scadaSymbolActionTriggerInfo; - hasStateRenderFunction = false; - hasActions: {[trigger in ScadaSymbolActionTrigger]?: boolean} = {}; + actionsCount = 0; constructor(public element: ElementRef) { super(element); @@ -426,17 +409,15 @@ class ScadaSymbolTagSettingsComponent extends ScadaSymbolPanelComponent implemen updateFunctionsState() { this.hasStateRenderFunction = this.symbolElement.hasStateRenderFunction(); - for (const trigger of this.actionTriggers) { - this.hasActions[trigger] = this.symbolElement.hasAction(trigger); - } + this.actionsCount = this.symbolElement.actionsCount(); } editStateRenderFunction() { this.symbolElement.editStateRenderFunction(); } - editAction(trigger: ScadaSymbolActionTrigger) { - this.symbolElement.editAction(trigger); + editActions() { + this.symbolElement.editActions(); } } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol.component.ts b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol.component.ts index 13e98e8a1e..766a299ff6 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol.component.ts +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol.component.ts @@ -20,9 +20,9 @@ import { Subject } from 'rxjs'; import { ScadaSymbolData, ScadaSymbolEditObjectCallbacks } from '@home/pages/scada-symbol/scada-symbol-editor.models'; import { parseScadaSymbolMetadataFromContent, - ScadaSymbolActionTrigger, ScadaSymbolMetadata, ScadaSymbolObjectSettings, + ScadaSymbolTagActions, updateScadaSymbolMetadataInContent } from '@home/components/widget/lib/scada/scada-symbol.models'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; @@ -330,21 +330,17 @@ export class ScadaSymbolComponent extends PageComponent return false; } - tagHasAction(tag: string, trigger: ScadaSymbolActionTrigger): boolean { + tagActions(tag: string): ScadaSymbolTagActions { const metadata: ScadaSymbolMetadata = this.scadaSymbolFormGroup.get('metadata').value; - if (metadata.tags) { - const found = metadata.tags.find(t => t.tag === tag); - return !!found?.actions?.[trigger]?.actionFunction; - } - return false; + return metadata.tags?.find(t => t.tag === tag)?.actions ?? null; } editTagStateRenderFunction(tag: string) { this.symbolMetadata.editTagStateRenderFunction(tag); } - editTagAction(tag: string, trigger: ScadaSymbolActionTrigger) { - this.symbolMetadata.editTagAction(tag, trigger); + editTagActions(tag: string) { + this.symbolMetadata.editTagActions(tag); } onSymbolEditObjectDirty(dirty: boolean) { diff --git a/ui-ngx/src/assets/help/en_US/scada/tag_click_action_fn.md b/ui-ngx/src/assets/help/en_US/scada/tag_click_action_fn.md index 2573e9a25a..2eac5c1e50 100644 --- a/ui-ngx/src/assets/help/en_US/scada/tag_click_action_fn.md +++ b/ui-ngx/src/assets/help/en_US/scada/tag_click_action_fn.md @@ -21,6 +21,9 @@ A JavaScript function invoked when user clicks on SVG element with specific tag.
+A tag can have either an *on click* or an *on double click* action, but not both: every double click also fires two clicks. +If the symbol metadata contains both, only the click action is executed. + ##### Examples without setting values for callAction function diff --git a/ui-ngx/src/assets/help/en_US/scada/tag_dblclick_action_fn.md b/ui-ngx/src/assets/help/en_US/scada/tag_dblclick_action_fn.md index a5a41ebe9c..9244ac2c8f 100644 --- a/ui-ngx/src/assets/help/en_US/scada/tag_dblclick_action_fn.md +++ b/ui-ngx/src/assets/help/en_US/scada/tag_dblclick_action_fn.md @@ -21,8 +21,8 @@ A JavaScript function invoked when user double-clicks on SVG element with specif
-If the same tag also has an *on click* action configured, the click action is automatically deferred for a short interval -and cancelled when a double click is detected — only the double click action is executed. +A tag can have either an *on click* or an *on double click* action, but not both: every double click also fires two clicks. +If the symbol metadata contains both, only the click action is executed. ##### Example @@ -44,7 +44,7 @@ ctx.api.callAction(event, 'doubleClick'); // Trigger widget action 'doubleClick *Example Use Case* -- **Navigate to Dashboard State:** If the 'doubleClick' action is configured to navigate to a detailed dashboard state, the user will be redirected to that state when double-clicking on the element, while a single click may be reserved for a quick toggle action. +- **Navigate to Dashboard State:** If the 'doubleClick' action is configured to navigate to a detailed dashboard state, the user will be redirected to that state when double-clicking on the element. - **Open URL:** If configured to open a URL, double-clicking on the element will take the user to a specified web resource.
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 8a1f5d4dc3..d8a7983aa7 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -5993,6 +5993,11 @@ "on-click-action": "On click action", "on-double-click-action": "On double click action", "on-right-click-action": "On right click action", + "on-click-action-enabled": "Run the function below when an element with this tag is clicked", + "on-double-click-action-enabled": "Run the function below when an element with this tag is double-clicked", + "on-right-click-action-enabled": "Run the function below instead of the browser context menu when an element with this tag is right-clicked", + "actions": "Actions", + "action-conflict": "Can't be combined with {{trigger}}: enabling this action disables it.", "no-tags": "No tags configured", "delete-tag-text": "Are you sure you want to delete tag
{{tag}} from {{elementType}} element?", "update-tag": "Update tag",