Commit ea039008b148453dfa166cf92bc40b26e487e660

Authored by Igor Kulikov
1 parent 952b9038

Add help support for rule node script test dialog

@@ -26,6 +26,10 @@ const PROXY_CONFIG = { @@ -26,6 +26,10 @@ const PROXY_CONFIG = {
26 "target": ruleNodeUiforwardUrl, 26 "target": ruleNodeUiforwardUrl,
27 "secure": false, 27 "secure": false,
28 }, 28 },
  29 + "/assets/help/*/rulenode/**": {
  30 + "target": ruleNodeUiforwardUrl,
  31 + "secure": false,
  32 + },
29 "/static/widgets": { 33 "/static/widgets": {
30 "target": forwardUrl, 34 "target": forwardUrl,
31 "secure": false, 35 "secure": false,
@@ -35,7 +35,7 @@ export class NodeScriptTestService { @@ -35,7 +35,7 @@ export class NodeScriptTestService {
35 } 35 }
36 36
37 testNodeScript(script: string, scriptType: string, functionTitle: string, 37 testNodeScript(script: string, scriptType: string, functionTitle: string,
38 - functionName: string, argNames: string[], ruleNodeId: string): Observable<string> { 38 + functionName: string, argNames: string[], ruleNodeId: string, helpId?: string): Observable<string> {
39 if (ruleNodeId) { 39 if (ruleNodeId) {
40 return this.ruleChainService.getLatestRuleNodeDebugInput(ruleNodeId).pipe( 40 return this.ruleChainService.getLatestRuleNodeDebugInput(ruleNodeId).pipe(
41 switchMap((debugIn) => { 41 switchMap((debugIn) => {
@@ -52,18 +52,18 @@ export class NodeScriptTestService { @@ -52,18 +52,18 @@ export class NodeScriptTestService {
52 msgType = debugIn.msgType; 52 msgType = debugIn.msgType;
53 } 53 }
54 return this.openTestScriptDialog(script, scriptType, functionTitle, 54 return this.openTestScriptDialog(script, scriptType, functionTitle,
55 - functionName, argNames, msg, metadata, msgType); 55 + functionName, argNames, msg, metadata, msgType, helpId);
56 }) 56 })
57 ); 57 );
58 } else { 58 } else {
59 return this.openTestScriptDialog(script, scriptType, functionTitle, 59 return this.openTestScriptDialog(script, scriptType, functionTitle,
60 - functionName, argNames); 60 + functionName, argNames, null, null, null, helpId);
61 } 61 }
62 } 62 }
63 63
64 private openTestScriptDialog(script: string, scriptType: string, 64 private openTestScriptDialog(script: string, scriptType: string,
65 functionTitle: string, functionName: string, argNames: string[], 65 functionTitle: string, functionName: string, argNames: string[],
66 - msg?: any, metadata?: {[key: string]: string}, msgType?: string): Observable<string> { 66 + msg?: any, metadata?: {[key: string]: string}, msgType?: string, helpId?: string): Observable<string> {
67 if (!msg) { 67 if (!msg) {
68 msg = { 68 msg = {
69 temperature: 22.4, 69 temperature: 22.4,
@@ -94,7 +94,8 @@ export class NodeScriptTestService { @@ -94,7 +94,8 @@ export class NodeScriptTestService {
94 functionName, 94 functionName,
95 script, 95 script,
96 scriptType, 96 scriptType,
97 - argNames 97 + argNames,
  98 + helpId
98 } 99 }
99 }).afterClosed(); 100 }).afterClosed();
100 } 101 }
@@ -78,6 +78,7 @@ @@ -78,6 +78,7 @@
78 [functionArgs]="data.argNames" 78 [functionArgs]="data.argNames"
79 [validationArgs]="[data.msg, data.metadata, data.msgType]" 79 [validationArgs]="[data.msg, data.metadata, data.msgType]"
80 resultType="object" 80 resultType="object"
  81 + [helpId]="data.helpId"
81 [fillHeight]="true"> 82 [fillHeight]="true">
82 </tb-js-func> 83 </tb-js-func>
83 </div> 84 </div>
@@ -52,6 +52,7 @@ export interface NodeScriptTestDialogData { @@ -52,6 +52,7 @@ export interface NodeScriptTestDialogData {
52 msg?: any; 52 msg?: any;
53 metadata?: {[key: string]: string}; 53 metadata?: {[key: string]: string};
54 msgType?: string; 54 msgType?: string;
  55 + helpId?: string;
55 } 56 }
56 57
57 // @dynamic 58 // @dynamic