Browse Source

Add help support for rule node script test dialog

pull/5333/head
Igor Kulikov 5 years ago
parent
commit
ea039008b1
  1. 4
      ui-ngx/proxy.conf.js
  2. 11
      ui-ngx/src/app/core/services/script/node-script-test.service.ts
  3. 1
      ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.html
  4. 1
      ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.ts

4
ui-ngx/proxy.conf.js

@ -26,6 +26,10 @@ const PROXY_CONFIG = {
"target": ruleNodeUiforwardUrl,
"secure": false,
},
"/assets/help/*/rulenode/**": {
"target": ruleNodeUiforwardUrl,
"secure": false,
},
"/static/widgets": {
"target": forwardUrl,
"secure": false,

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

@ -35,7 +35,7 @@ export class NodeScriptTestService {
}
testNodeScript(script: string, scriptType: string, functionTitle: string,
functionName: string, argNames: string[], ruleNodeId: string): Observable<string> {
functionName: string, argNames: string[], ruleNodeId: string, helpId?: string): Observable<string> {
if (ruleNodeId) {
return this.ruleChainService.getLatestRuleNodeDebugInput(ruleNodeId).pipe(
switchMap((debugIn) => {
@ -52,18 +52,18 @@ export class NodeScriptTestService {
msgType = debugIn.msgType;
}
return this.openTestScriptDialog(script, scriptType, functionTitle,
functionName, argNames, msg, metadata, msgType);
functionName, argNames, msg, metadata, msgType, helpId);
})
);
} else {
return this.openTestScriptDialog(script, scriptType, functionTitle,
functionName, argNames);
functionName, argNames, null, null, null, helpId);
}
}
private openTestScriptDialog(script: string, scriptType: string,
functionTitle: string, functionName: string, argNames: string[],
msg?: any, metadata?: {[key: string]: string}, msgType?: string): Observable<string> {
msg?: any, metadata?: {[key: string]: string}, msgType?: string, helpId?: string): Observable<string> {
if (!msg) {
msg = {
temperature: 22.4,
@ -94,7 +94,8 @@ export class NodeScriptTestService {
functionName,
script,
scriptType,
argNames
argNames,
helpId
}
}).afterClosed();
}

1
ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.html

@ -78,6 +78,7 @@
[functionArgs]="data.argNames"
[validationArgs]="[data.msg, data.metadata, data.msgType]"
resultType="object"
[helpId]="data.helpId"
[fillHeight]="true">
</tb-js-func>
</div>

1
ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.ts

@ -52,6 +52,7 @@ export interface NodeScriptTestDialogData {
msg?: any;
metadata?: {[key: string]: string};
msgType?: string;
helpId?: string;
}
// @dynamic

Loading…
Cancel
Save