Browse Source

Refactoring

pull/8836/head
rusikv 3 years ago
parent
commit
552be228a3
  1. 6
      ui-ngx/src/app/core/services/script/node-script-test.service.ts
  2. 5
      ui-ngx/src/app/modules/home/components/details-panel.component.ts
  3. 4
      ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts
  4. 45
      ui-ngx/src/app/modules/home/components/event/event-table-config.ts
  5. 36
      ui-ngx/src/app/modules/home/components/event/event-table.component.ts
  6. 1
      ui-ngx/src/app/modules/home/models/entity/entity-table-component.models.ts
  7. 25
      ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts
  8. 2
      ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.html
  9. 7
      ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts
  10. 9
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html
  11. 27
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts
  12. 48
      ui-ngx/src/app/shared/models/rule-node.models.ts
  13. 10
      ui-ngx/src/assets/locale/locale.constant-en_US.json

6
ui-ngx/src/app/core/services/script/node-script-test.service.ts

@ -61,7 +61,8 @@ export class NodeScriptTestService {
try {
msg = JSON.parse(eventBody.data);
} catch (e) {}
} else {
}
if (!msg) {
msg = {
temperature: 22.4,
humidity: 78
@ -71,7 +72,8 @@ export class NodeScriptTestService {
try {
metadata = JSON.parse(eventBody.metadata);
} catch (e) {}
} else {
}
if (!metadata) {
metadata = {
deviceName: 'Test Device',
deviceType: 'default',

5
ui-ngx/src/app/modules/home/components/details-panel.component.ts

@ -56,9 +56,6 @@ export class DetailsPanelComponent extends PageComponent implements OnDestroy {
this.theFormValue = value;
if (this.theFormValue !== null) {
this.formSubscription = this.theFormValue.valueChanges.subscribe(() => {
if (this.isReadOnly) {
this.switchToFirstTab.emit();
}
this.cd.detectChanges()
});
}
@ -77,8 +74,6 @@ export class DetailsPanelComponent extends PageComponent implements OnDestroy {
applyDetails = new EventEmitter<void>();
@Output()
closeSearch = new EventEmitter<void>();
@Output()
switchToFirstTab = new EventEmitter<void>()
isEditValue = false;
showSearchPane = false;

4
ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts

@ -637,6 +637,10 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
}
}
cellActionDescriptorsUpdated() {
this.cellActionDescriptors = [...this.entitiesTableConfig.cellActionDescriptors];
}
headerCellStyle(column: EntityColumn<BaseData<HasId>>) {
const index = this.entitiesTableConfig.columns.indexOf(column);
let res = this.headerCellStyleCache[index];

45
ui-ngx/src/app/modules/home/components/event/event-table-config.ts

@ -30,7 +30,7 @@ import { EntityId } from '@shared/models/id/entity-id';
import { EventService } from '@app/core/http/event.service';
import { EventTableHeaderComponent } from '@home/components/event/event-table-header.component';
import { EntityTypeResource } from '@shared/models/entity-type.models';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs';
import { PageData } from '@shared/models/page/page-data';
import { Direction } from '@shared/models/page/sort-order';
import { DialogService } from '@core/services/dialog.service';
@ -41,7 +41,7 @@ import {
} from '@home/components/event/event-content-dialog.component';
import { isEqual, sortObjectKeys } from '@core/utils';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { ChangeDetectorRef, Injector, StaticProvider, ViewContainerRef } from '@angular/core';
import { ChangeDetectorRef, EventEmitter, Injector, StaticProvider, ViewContainerRef } from '@angular/core';
import { ComponentPortal } from '@angular/cdk/portal';
import {
EVENT_FILTER_PANEL_DATA,
@ -50,7 +50,6 @@ import {
FilterEntityColumn
} from '@home/components/event/event-filter-panel.component';
import { NodeScriptTestService } from '@core/services/script/node-script-test.service';
import { ruleNodeClazzFunctionNameTranslations } from '@shared/models/rule-node.models';
export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
@ -63,6 +62,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
set eventType(eventType: EventType | DebugEventType) {
if (this.eventTypeValue !== eventType) {
this.eventTypeValue = eventType;
this.updateCellAction();
this.updateColumns(true);
this.updateFilterColumns();
}
@ -74,8 +74,6 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
eventTypes: Array<EventType | DebugEventType>;
debugEventSelectedSubject = new BehaviorSubject<DebugRuleNodeEventBody>(null);
constructor(private eventService: EventService,
private dialogService: DialogService,
private translate: TranslateService,
@ -90,9 +88,8 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
private viewContainerRef: ViewContainerRef,
private cd: ChangeDetectorRef,
private nodeScriptTestService: NodeScriptTestService,
private isRuleNodeDebugModeEnabled: boolean,
private editingRuleNodeHasScript: boolean,
private rulenodeClazz: string) {
public testButtonLabel?: string,
private debugEventSelected?: EventEmitter<DebugRuleNodeEventBody>) {
super();
this.loadDataOnInit = false;
this.tableTitle = '';
@ -128,6 +125,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
this.updateColumns();
this.updateCellAction();
this.updateFilterColumns();
this.headerActionDescriptors.push({
@ -325,18 +323,6 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
onAction: ($event, entity) => this.showContent($event, entity.body.error,
'event.error')
},
'48px'),
new EntityActionTableColumn<Event>('test', '',
{
name: this.translate.instant('rulenode.test-function',
{function: this.translate.instant(ruleNodeClazzFunctionNameTranslations[this.rulenodeClazz])}),
icon: 'bug_report',
isEnabled: (entity) => this.isRuleNodeDebugModeEnabled && entity.body.type === 'IN' &&
this.editingRuleNodeHasScript,
onAction: ($event, entity) => {
this.debugEventSelectedSubject.next(entity.body);
}
},
'48px')
);
break;
@ -369,6 +355,25 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
}
}
updateCellAction() {
this.cellActionDescriptors = [];
switch (this.eventType) {
case DebugEventType.DEBUG_RULE_NODE:
if (this.testButtonLabel) {
this.cellActionDescriptors.push({
name: this.translate.instant('rulenode.test-with-this-message', {test: this.testButtonLabel}),
icon: 'bug_report',
isEnabled: (entity) => entity.body.type === 'IN',
onAction: ($event, entity) => {
this.debugEventSelected.next(entity.body);
}
});
}
break;
}
this.getTable()?.cellActionDescriptorsUpdated();
}
showContent($event: MouseEvent, content: string, title: string, contentType: ContentType = null, sortKeys = false): void {
if ($event) {
$event.stopPropagation();

36
ui-ngx/src/app/modules/home/components/event/event-table.component.ts

@ -36,6 +36,7 @@ import { DebugEventType, DebugRuleNodeEventBody, EventType } from '@shared/model
import { Overlay } from '@angular/cdk/overlay';
import { Subscription } from 'rxjs';
import { NodeScriptTestService } from '@core/services/script/node-script-test.service';
import { isNotEmptyStr } from '@core/utils';
@Component({
selector: 'tb-event-table',
@ -60,6 +61,10 @@ export class EventTableComponent implements OnInit, AfterViewInit, OnDestroy {
dirtyValue = false;
entityIdValue: EntityId;
get active(): boolean {
return this.activeValue;
}
@Input()
set active(active: boolean) {
if (this.activeValue !== active) {
@ -84,14 +89,24 @@ export class EventTableComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
@Input()
isRuleNodeDebugModeEnabled: boolean;
private ruleNodeTestButtonLabelValue: string;
@Input()
editingRuleNodeHasScript: boolean;
get ruleNodeTestButtonLabel(): string {
return this.ruleNodeTestButtonLabelValue;
}
@Input()
rulenodeClazz: string;
set ruleNodeTestButtonLabel(value: string) {
if (isNotEmptyStr(value)) {
this.ruleNodeTestButtonLabelValue = value;
} else {
this.ruleNodeTestButtonLabelValue = '';
}
if (this.eventTableConfig) {
this.eventTableConfig.testButtonLabel = this.ruleNodeTestButtonLabel;
this.eventTableConfig.updateCellAction();
}
}
@Output()
debugEventSelected = new EventEmitter<DebugRuleNodeEventBody>(null);
@ -130,16 +145,9 @@ export class EventTableComponent implements OnInit, AfterViewInit, OnDestroy {
this.viewContainerRef,
this.cd,
this.nodeScriptTestService,
this.isRuleNodeDebugModeEnabled,
this.editingRuleNodeHasScript,
this.rulenodeClazz
this.ruleNodeTestButtonLabel,
this.debugEventSelected
);
this.eventTableConfig.debugEventSelectedSubject.subscribe((debugEventBody: DebugRuleNodeEventBody) => {
if (debugEventBody) {
this.debugEventSelected.emit(debugEventBody);
}
})
}
ngAfterViewInit() {

1
ui-ngx/src/app/modules/home/models/entity/entity-table-component.models.ts

@ -80,6 +80,7 @@ export interface IEntitiesTableComponent {
exitFilterMode(): void;
resetSortAndFilter(update?: boolean, preserveTimewindow?: boolean): void;
columnsUpdated(resetData?: boolean): void;
cellActionDescriptorsUpdated(): void;
headerCellStyle(column: EntityColumn<BaseData<HasId>>): any;
clearCellCache(col: number, row: number): void;
cellContent(entity: BaseData<HasId>, column: EntityColumn<BaseData<HasId>>, row: number): any;

25
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-config.component.ts

@ -18,14 +18,22 @@ import {
AfterViewInit,
Component,
ComponentRef,
EventEmitter,
forwardRef,
Input,
OnDestroy,
OnInit,
Output,
ViewChild,
ViewContainerRef
} from '@angular/core';
import { ControlValueAccessor, UntypedFormBuilder, UntypedFormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
import {
ControlValueAccessor,
NG_VALUE_ACCESSOR,
UntypedFormBuilder,
UntypedFormGroup,
Validators
} from '@angular/forms';
import {
IRuleNodeConfigurationComponent,
RuleNodeConfiguration,
@ -38,7 +46,6 @@ import { TranslateService } from '@ngx-translate/core';
import { JsonObjectEditComponent } from '@shared/components/json-object-edit.component';
import { deepClone } from '@core/utils';
import { RuleChainType } from '@shared/models/rule-chain.models';
import { DebugRuleNodeEventBody } from '@shared/models/event.models';
@Component({
selector: 'tb-rule-node-config',
@ -77,6 +84,9 @@ export class RuleNodeConfigComponent implements ControlValueAccessor, OnInit, On
@Input()
ruleChainType: RuleChainType;
@Output()
initRuleNode = new EventEmitter<void>();
nodeDefinitionValue: RuleNodeDefinition;
@Input()
@ -86,6 +96,7 @@ export class RuleNodeConfigComponent implements ControlValueAccessor, OnInit, On
if (this.nodeDefinitionValue) {
this.validateDefinedDirective();
}
setTimeout(() => this.initRuleNode.emit());
}
}
@ -93,21 +104,15 @@ export class RuleNodeConfigComponent implements ControlValueAccessor, OnInit, On
return this.nodeDefinitionValue;
}
@Input()
set debugEventBody(debugEventBody: DebugRuleNodeEventBody) {
if (debugEventBody) {
this.definedConfigComponent?.testScript(debugEventBody);
}
}
definedDirectiveError: string;
ruleNodeConfigFormGroup: UntypedFormGroup;
changeSubscription: Subscription;
definedConfigComponent: IRuleNodeConfigurationComponent;
private definedConfigComponentRef: ComponentRef<IRuleNodeConfigurationComponent>;
private definedConfigComponent: IRuleNodeConfigurationComponent;
private configuration: RuleNodeConfiguration;

2
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.html

@ -51,7 +51,7 @@
[ruleChainId]="ruleChainId"
[ruleChainType]="ruleChainType"
[nodeDefinition]="ruleNode.component.configurationDescriptor.nodeDefinition"
[debugEventBody]="debugEventBody">
(initRuleNode)="initRuleNode.emit($event)">
</tb-rule-node-config>
<div formGroupName="additionalInfo" fxLayout="column" class="description-block">
<mat-form-field class="mat-block">

7
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
@ -27,7 +27,6 @@ import { RuleNodeConfigComponent } from './rule-node-config.component';
import { Router } from '@angular/router';
import { RuleChainType } from '@app/shared/models/rule-chain.models';
import { ComponentClusteringMode } from '@shared/models/component-descriptor.models';
import { DebugRuleNodeEventBody } from '@shared/models/event.models';
@Component({
selector: 'tb-rule-node',
@ -56,8 +55,8 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O
@Input()
isAdd = false;
@Input()
debugEventBody: DebugRuleNodeEventBody;
@Output()
initRuleNode = new EventEmitter<void>();
ruleNodeType = RuleNodeType;
entityType = EntityType;

9
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html

@ -100,8 +100,7 @@
(closeDetails)="onEditRuleNodeClosed()"
(toggleDetailsEditMode)="onRevertRuleNodeEdit()"
(applyDetails)="saveRuleNode()"
[theForm]="tbRuleNode.ruleNodeFormGroup"
(switchToFirstTab)="onSwitchToFirstTab()">
[theForm]="tbRuleNode.ruleNodeFormGroup">
<div class="details-buttons">
<div [tb-help]="helpLinkIdForRuleNodeType()"></div>
</div>
@ -113,7 +112,7 @@
[ruleChainType]="ruleChainType"
[isEdit]="true"
[isReadOnly]="false"
[debugEventBody]="debugEventBody">
(initRuleNode)="onRuleNodeInit()">
</tb-rule-node>
</mat-tab>
<mat-tab *ngIf="editingRuleNode.ruleNodeId" label="{{ 'rulenode.events' | translate }}" #eventsTab="matTab">
@ -122,9 +121,7 @@
[active]="eventsTab.isActive"
[tenantId]="ruleChain.tenantId.id"
[entityId]="editingRuleNode.ruleNodeId"
[isRuleNodeDebugModeEnabled]="editingRuleNode?.debugMode"
[editingRuleNodeHasScript]="editingRuleNodeHasScript"
[rulenodeClazz]="editingRuleNode.component.clazz"
[ruleNodeTestButtonLabel]="ruleNodeTestButtonLabel"
(debugEventSelected)="onDebugEventSelected($event)">
</tb-event-table>
</mat-tab>

27
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts

@ -153,8 +153,7 @@ export class RuleChainPageComponent extends PageComponent
editingRuleNodeAllowCustomLabels = false;
editingRuleNodeLinkLabels: {[label: string]: LinkLabel};
editingRuleNodeSourceRuleChainId: string;
debugEventBody: DebugRuleNodeEventBody;
editingRuleNodeHasScript: boolean = false;
ruleNodeTestButtonLabel: string;
@ViewChild('tbRuleNode') ruleNodeComponent: RuleNodeDetailsComponent;
@ViewChild('tbRuleNodeLink') ruleNodeLinkComponent: RuleNodeLinkComponent;
@ -1112,7 +1111,6 @@ export class RuleChainPageComponent extends PageComponent
this.isEditingRuleNode = true;
this.editingRuleNodeIndex = this.ruleChainModel.nodes.indexOf(node);
this.editingRuleNode = deepClone(node, ['component']);
this.editingRuleNodeHasScript = this.editingRuleNode.configuration.hasOwnProperty('scriptLang');
setTimeout(() => {
this.ruleNodeComponent.ruleNodeFormGroup.markAsPristine();
}, 0);
@ -1261,7 +1259,6 @@ export class RuleChainPageComponent extends PageComponent
onEditRuleNodeClosed() {
this.editingRuleNode = null;
this.isEditingRuleNode = false;
this.debugEventBody = null;
}
onEditRuleNodeLinkClosed() {
@ -1282,13 +1279,25 @@ export class RuleChainPageComponent extends PageComponent
}
onDebugEventSelected(debugEventBody: DebugRuleNodeEventBody) {
if (debugEventBody) {
this.debugEventBody = debugEventBody;
}
if (this.ruleNodeComponent.ruleNodeConfigComponent.useDefinedDirective() &&
this.ruleNodeComponent.ruleNodeConfigComponent.definedConfigComponent.getSupportTestFunction() &&
this.ruleNodeComponent.ruleNodeConfigComponent.definedConfigComponent.testScript$) {
this.ruleNodeComponent.ruleNodeConfigComponent.definedConfigComponent.testScript$(debugEventBody)
.subscribe((value) => {
if (value) {
this.selectedRuleNodeTabIndex = 0;
}
})
}
}
onSwitchToFirstTab() {
this.selectedRuleNodeTabIndex = 0;
onRuleNodeInit() {
if (this.ruleNodeComponent.ruleNodeConfigComponent.useDefinedDirective() &&
this.ruleNodeComponent.ruleNodeConfigComponent.definedConfigComponent.getSupportTestFunction()) {
this.ruleNodeTestButtonLabel = this.ruleNodeComponent.ruleNodeConfigComponent.definedConfigComponent.getTestButtonLabel();
} else {
this.ruleNodeTestButtonLabel = '';
}
}
saveRuleNode() {

48
ui-ngx/src/app/shared/models/rule-node.models.ts

@ -27,6 +27,7 @@ import { AppState } from '@core/core.state';
import { AbstractControl, UntypedFormGroup } from '@angular/forms';
import { RuleChainType } from '@shared/models/rule-chain.models';
import { DebugRuleNodeEventBody } from '@shared/models/event.models';
import { TranslateService } from '@ngx-translate/core';
export interface RuleNodeConfiguration {
[key: string]: any;
@ -76,7 +77,9 @@ export interface IRuleNodeConfigurationComponent {
configuration: RuleNodeConfiguration;
configurationChanged: Observable<RuleNodeConfiguration>;
validate();
testScript? (debugEventBody: DebugRuleNodeEventBody);
getSupportTestFunction(): boolean;
getTestButtonLabel? (): string;
testScript$? (debugEventBody?: DebugRuleNodeEventBody): Observable<string>;
[key: string]: any;
}
@ -112,7 +115,8 @@ export abstract class RuleNodeConfigurationComponent extends PageComponent imple
configurationChangedEmiter = new EventEmitter<RuleNodeConfiguration>();
configurationChanged = this.configurationChangedEmiter.asObservable();
protected constructor(@Inject(Store) protected store: Store<AppState>) {
protected constructor(@Inject(Store) protected store: Store<AppState>,
@Inject(TranslateService) protected translate: TranslateService) {
super(store);
}
@ -130,6 +134,14 @@ export abstract class RuleNodeConfigurationComponent extends PageComponent imple
this.onValidate();
}
getSupportTestFunction(): boolean {
return false;
}
getTestButtonLabel(): string {
return this.translate.instant('rulenode.test-script-function');
}
protected setupConfiguration(configuration: RuleNodeConfiguration) {
this.onConfigurationSet(this.prepareInputConfig(configuration));
this.updateValidators(false);
@ -429,22 +441,13 @@ export const messageTypeNames = new Map<MessageType, string>(
export const ruleChainNodeClazz = 'org.thingsboard.rule.engine.flow.TbRuleChainInputNode';
export const outputNodeClazz = 'org.thingsboard.rule.engine.flow.TbRuleChainOutputNode';
export enum RuleNodeClazz {
TbJsFilterNode = 'org.thingsboard.rule.engine.filter.TbJsFilterNode',
TbLogNode = 'org.thingsboard.rule.engine.action.TbLogNode',
TbJsSwitchNode = 'org.thingsboard.rule.engine.filter.TbJsSwitchNode',
TbClearAlarmNode = 'org.thingsboard.rule.engine.action.TbClearAlarmNode',
TbCreateAlarmNode = 'org.thingsboard.rule.engine.action.TbCreateAlarmNode',
TbTransformMsgNode = 'org.thingsboard.rule.engine.transform.TbTransformMsgNode',
TbMsgGeneratorNode = 'org.thingsboard.rule.engine.debug.TbMsgGeneratorNode'
}
const ruleNodeClazzHelpLinkMap = {
'org.thingsboard.rule.engine.filter.TbCheckRelationNode': 'ruleNodeCheckRelation',
'org.thingsboard.rule.engine.filter.TbCheckMessageNode': 'ruleNodeCheckExistenceFields',
'org.thingsboard.rule.engine.geo.TbGpsGeofencingFilterNode': 'ruleNodeGpsGeofencingFilter',
[RuleNodeClazz.TbJsFilterNode]: 'ruleNodeJsFilter',
[RuleNodeClazz.TbJsSwitchNode]: 'ruleNodeJsSwitch',
'org.thingsboard.rule.engine.filter.TbJsFilterNode': 'ruleNodeJsFilter',
'org.thingsboard.rule.engine.filter.TbJsSwitchNode': 'ruleNodeJsSwitch',
'org.thingsboard.rule.engine.filter.TbAssetTypeSwitchNode': 'ruleNodeAssetProfileSwitch',
'org.thingsboard.rule.engine.filter.TbDeviceTypeSwitchNode': 'ruleNodeDeviceProfileSwitch',
'org.thingsboard.rule.engine.filter.TbCheckAlarmStatusNode': 'ruleNodeCheckAlarmStatus',
@ -463,18 +466,18 @@ const ruleNodeClazzHelpLinkMap = {
'org.thingsboard.rule.engine.metadata.TbGetTenantDetailsNode': 'ruleNodeTenantDetails',
'org.thingsboard.rule.engine.metadata.CalculateDeltaNode': 'ruleNodeCalculateDelta',
'org.thingsboard.rule.engine.transform.TbChangeOriginatorNode': 'ruleNodeChangeOriginator',
[RuleNodeClazz.TbTransformMsgNode]: 'ruleNodeTransformMsg',
'org.thingsboard.rule.engine.transform.TbTransformMsgNode': 'ruleNodeTransformMsg',
'org.thingsboard.rule.engine.mail.TbMsgToEmailNode': 'ruleNodeMsgToEmail',
'org.thingsboard.rule.engine.action.TbAssignToCustomerNode': 'ruleNodeAssignToCustomer',
'org.thingsboard.rule.engine.action.TbUnassignFromCustomerNode': 'ruleNodeUnassignFromCustomer',
[RuleNodeClazz.TbClearAlarmNode]: 'ruleNodeClearAlarm',
[RuleNodeClazz.TbCreateAlarmNode]: 'ruleNodeCreateAlarm',
'org.thingsboard.rule.engine.action.TbClearAlarmNode': 'ruleNodeClearAlarm',
'org.thingsboard.rule.engine.action.TbCreateAlarmNode': 'ruleNodeCreateAlarm',
'org.thingsboard.rule.engine.action.TbCreateRelationNode': 'ruleNodeCreateRelation',
'org.thingsboard.rule.engine.action.TbDeleteRelationNode': 'ruleNodeDeleteRelation',
'org.thingsboard.rule.engine.delay.TbMsgDelayNode': 'ruleNodeMsgDelay',
[RuleNodeClazz.TbMsgGeneratorNode]: 'ruleNodeMsgGenerator',
'org.thingsboard.rule.engine.debug.TbMsgGeneratorNode': 'ruleNodeMsgGenerator',
'org.thingsboard.rule.engine.geo.TbGpsGeofencingActionNode': 'ruleNodeGpsGeofencingEvents',
[RuleNodeClazz.TbLogNode]: 'ruleNodeLog',
'org.thingsboard.rule.engine.action.TbLogNode': 'ruleNodeLog',
'org.thingsboard.rule.engine.rpc.TbSendRPCReplyNode': 'ruleNodeRpcCallReply',
'org.thingsboard.rule.engine.rpc.TbSendRPCRequestNode': 'ruleNodeRpcCallRequest',
'org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode': 'ruleNodeSaveAttributes',
@ -511,12 +514,3 @@ export function getRuleNodeHelpLink(component: RuleNodeComponentDescriptor): str
return 'ruleEngine';
}
export const ruleNodeClazzFunctionNameTranslations = {
[RuleNodeClazz.TbJsFilterNode]: 'rulenode.function-name.filter',
[RuleNodeClazz.TbLogNode]: 'rulenode.function-name.to-string',
[RuleNodeClazz.TbJsSwitchNode]: 'rulenode.function-name.switch',
[RuleNodeClazz.TbClearAlarmNode]: 'rulenode.function-name.details',
[RuleNodeClazz.TbCreateAlarmNode]: 'rulenode.function-name.details',
[RuleNodeClazz.TbTransformMsgNode]: 'rulenode.function-name.transform',
[RuleNodeClazz.TbMsgGeneratorNode]: 'rulenode.function-name.generate'
}

10
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -3467,15 +3467,7 @@
"test": "Test",
"help": "Help",
"reset-debug-mode": "Reset debug mode in all nodes",
"test-function": "Test '{{function}}' function with this message",
"function-name": {
"filter": "Filter",
"to-string": "ToString",
"details": "Details",
"generate": "Generate",
"switch": "Switch",
"transform": "Transform"
}
"test-with-this-message": "{{test}} with this message"
},
"timezone": {
"timezone": "Timezone",

Loading…
Cancel
Save