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 ecc7a507a6..d46ba364d7 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 @@ -101,13 +101,13 @@ export class ScadaSymbolMetadataTagFunctionPanelComponent implements OnInit, Aft this.tagFunctionArgs = ['ctx', 'element']; this.objectHighlightRules = scadaSymbolElementStateRenderHighlightRules; this.propertyHighlightRules = scadaSymbolElementStateRenderPropertiesHighlightRules; - this.tagFunctionHelpId = 'widget/lib/timeseries/cell_style_fn'; // TODO: + this.tagFunctionHelpId = 'scada/tag_state_render_fn'; } else if (this.tagFunctionType === 'clickAction') { this.panelTitle = 'scada.tag.on-click-action'; this.tagFunctionArgs = ['ctx', 'element', 'event']; this.objectHighlightRules = scadaSymbolClickActionHighlightRules; this.propertyHighlightRules = scadaSymbolClickActionPropertiesHighlightRules; - this.tagFunctionHelpId = 'widget/lib/timeseries/cell_style_fn'; // TODO: + this.tagFunctionHelpId = 'scada/tag_click_action_fn'; } } diff --git a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.html b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.html index 37098a982d..9e5d22fa94 100644 --- a/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.html +++ b/ui-ngx/src/app/modules/home/pages/scada-symbol/metadata-components/scada-symbol-metadata.component.html @@ -83,7 +83,7 @@ [objectHighlightRules]="scadaSymbolGeneralStateRenderHighlightRules" [propertyHighlightRules]="scadaSymbolGeneralStateRenderPropertiesHighlightRules" [functionArgs]="['ctx', 'svg']" - helpId="widget/lib/timeseries/cell_style_fn"> + helpId="scada/symbol_state_render_fn"> 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 5ddec8b1a9..f3caf1dbfc 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 @@ -1167,37 +1167,110 @@ export const scadaSymbolContextCompletion = (metadata: ScadaSymbolMetadata, tags description: 'Set text to element(s). Only applicable for elements of type ' + 'SVG.Text or ' + 'SVG.Tspan.', - args: [] + args: [ + { + name: 'element', + description: 'SVG element or an array of SVG elements', + type: 'Element | Array<Element>' + }, + { + name: 'text', + description: 'Text to be set', + type: 'string' + } + ] }, font: { meta: 'function', description: 'Set element(s) text font and color. Only applicable for elements of type ' + 'SVG.Text or ' + 'SVG.Tspan.', - args: [] + args: [ + { + name: 'element', + description: 'SVG element or an array of SVG elements', + type: 'Element | Array<Element>' + }, + { + name: 'font', + description: 'Font settings object used to apply text element font', + type: 'Font' + }, + { + name: 'color', + description: 'Color string used to apply text color of the element', + type: 'string' + } + ] }, disable: { meta: 'function', description: 'Disables element(s). Disabled element doesn\'t accept any user interaction. ' + 'For ex. if disabled element has click action, no click action will be performed on user click.', - args: [] + args: [ + { + name: 'element', + description: 'SVG element or an array of SVG elements', + type: 'Element | Array<Element>' + } + ] }, enable: { meta: 'function', description: 'Enables disabled element(s). Enabled element accepts user interaction. ' + 'For ex. if element has click action, click action will be performed on user click.', - args: [] + args: [ + { + name: 'element', + description: 'SVG element or an array of SVG elements', + type: 'Element | Array<Element>' + } + ] }, callAction: { meta: 'function', description: 'Invokes action specified by behavior of type "Action" found by behaviorId.', - args: [] + args: [ + { + name: 'event', + description: 'DOM event', + type: 'Event' + }, + { + name: 'behaviorId', + description: 'Id of the "Action" behavior', + type: 'string' + }, + { + name: 'value', + description: 'Optional value passed to behavior', + type: 'any', + optional: true + }, + { + name: 'observer', + description: 'Optional observer callback', + type: 'Partial<Observer<void>>', + optional: true + } + ] }, setValue: { meta: 'function', description: 'Updates value by valueId. See ctx.values for reference. ' + 'Value update triggers all render functions.', - args: [] + args: [ + { + name: 'valueId', + description: 'Id of the value to be updated', + type: 'string' + }, + { + name: 'value', + description: 'New value to be set', + type: 'any' + } + ] } } }, diff --git a/ui-ngx/src/assets/help/en_US/scada/symbol_state_render_fn.md b/ui-ngx/src/assets/help/en_US/scada/symbol_state_render_fn.md new file mode 100644 index 0000000000..bdb0d45234 --- /dev/null +++ b/ui-ngx/src/assets/help/en_US/scada/symbol_state_render_fn.md @@ -0,0 +1,27 @@ +#### Symbol state render function + +
+
+ +*function (ctx, svg): void* + +A JavaScript function used to render SCADA symbol state. + +**Parameters:** + + + +
+ +##### Examples + +
+ +TODO + + 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 new file mode 100644 index 0000000000..26ec4f9bb3 --- /dev/null +++ b/ui-ngx/src/assets/help/en_US/scada/tag_click_action_fn.md @@ -0,0 +1,29 @@ +#### Symbol tag click action function + +
+
+ +*function (ctx, element, event): void* + +A JavaScript function invoked when user clicks on SVG element with specific tag. + +**Parameters:** + + + +
+ +##### Examples + +
+ +TODO diff --git a/ui-ngx/src/assets/help/en_US/scada/tag_state_render_fn.md b/ui-ngx/src/assets/help/en_US/scada/tag_state_render_fn.md new file mode 100644 index 0000000000..caed8060d4 --- /dev/null +++ b/ui-ngx/src/assets/help/en_US/scada/tag_state_render_fn.md @@ -0,0 +1,27 @@ +#### Symbol tag state render function + +
+
+ +*function (ctx, element): void* + +A JavaScript function used to render SCADA symbol element with specific tag. + +**Parameters:** + + + +
+ +##### Examples + +
+ +TODO