From e5dc35064fbadec0431843ad938fd6bcb6cf7b72 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 7 May 2024 07:19:00 +0100 Subject: [PATCH 1/4] Check against multiple values for == --- .../tools/checkFlowVariable/1.0.0/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts index 266283a74..21f4a4b0d 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts @@ -64,7 +64,10 @@ const details = (): IpluginDetails => ({ inputUI: { type: 'text', }, - tooltip: 'Value of variable to check', + tooltip: `Value of variable to check. + For == condition, you can specify multiple values separated by comma. For example: value1,value2,value3 + If the variable matches any of the values, the condition is true. + `, }, ], outputs: [ @@ -123,8 +126,9 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { let outputNumber = 1; if (condition === '==') { - if (targetValue === value) { - args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${value}`); + const valuesArr = value.trim().split(','); + if (valuesArr.includes(targetValue)) { + args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${valuesArr}`); outputNumber = 1; } else { args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`); From 7e6498e3c9819e5c705bd48a4340929b8bc7e043 Mon Sep 17 00:00:00 2001 From: HaveAGitGat Date: Tue, 7 May 2024 06:21:32 +0000 Subject: [PATCH 2/4] Apply auto-build changes --- .../tools/checkFlowVariable/1.0.0/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js index bae9545bf..3f366b407 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js @@ -47,7 +47,7 @@ var details = function () { return ({ inputUI: { type: 'text', }, - tooltip: 'Value of variable to check', + tooltip: "Value of variable to check. \n For == condition, you can specify multiple values separated by comma. For example: value1,value2,value3\n If the variable matches any of the values, the condition is true.\n ", }, ], outputs: [ @@ -100,8 +100,9 @@ var plugin = function (args) { targetValue = String(targetValue); var outputNumber = 1; if (condition === '==') { - if (targetValue === value) { - args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " matches condition ").concat(condition, " ").concat(value)); + var valuesArr = value.trim().split(','); + if (valuesArr.includes(targetValue)) { + args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " matches condition ").concat(condition, " ").concat(valuesArr)); outputNumber = 1; } else { From 806af22b44ad3e6a2faeda330fe75d76e209e0fe Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 7 May 2024 07:29:48 +0100 Subject: [PATCH 3/4] Add multi value to != --- .../tools/checkFlowVariable/1.0.0/index.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts index 21f4a4b0d..844c6e16d 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.ts @@ -65,9 +65,7 @@ const details = (): IpluginDetails => ({ type: 'text', }, tooltip: `Value of variable to check. - For == condition, you can specify multiple values separated by comma. For example: value1,value2,value3 - If the variable matches any of the values, the condition is true. - `, +You can specify multiple values separated by comma. For example: value1,value2,value3`, }, ], outputs: [ @@ -125,21 +123,21 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { targetValue = String(targetValue); let outputNumber = 1; + const valuesArr = value.trim().split(','); if (condition === '==') { - const valuesArr = value.trim().split(','); if (valuesArr.includes(targetValue)) { args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${valuesArr}`); outputNumber = 1; } else { - args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`); + args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${valuesArr}`); outputNumber = 2; } } else if (condition === '!=') { - if (targetValue !== value) { - args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${value}`); + if (!valuesArr.includes(targetValue)) { + args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${valuesArr}`); outputNumber = 1; } else { - args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`); + args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${valuesArr}`); outputNumber = 2; } } From 2e4f96d40a50eda63ea01902612b6c231def5488 Mon Sep 17 00:00:00 2001 From: HaveAGitGat Date: Tue, 7 May 2024 06:33:30 +0000 Subject: [PATCH 4/4] Apply auto-build changes --- .../tools/checkFlowVariable/1.0.0/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js index 3f366b407..7ef26ce87 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/checkFlowVariable/1.0.0/index.js @@ -47,7 +47,7 @@ var details = function () { return ({ inputUI: { type: 'text', }, - tooltip: "Value of variable to check. \n For == condition, you can specify multiple values separated by comma. For example: value1,value2,value3\n If the variable matches any of the values, the condition is true.\n ", + tooltip: "Value of variable to check. \nYou can specify multiple values separated by comma. For example: value1,value2,value3", }, ], outputs: [ @@ -99,24 +99,24 @@ var plugin = function (args) { } targetValue = String(targetValue); var outputNumber = 1; + var valuesArr = value.trim().split(','); if (condition === '==') { - var valuesArr = value.trim().split(','); if (valuesArr.includes(targetValue)) { args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " matches condition ").concat(condition, " ").concat(valuesArr)); outputNumber = 1; } else { - args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " does not match condition ").concat(condition, " ").concat(value)); + args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " does not match condition ").concat(condition, " ").concat(valuesArr)); outputNumber = 2; } } else if (condition === '!=') { - if (targetValue !== value) { - args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " matches condition ").concat(condition, " ").concat(value)); + if (!valuesArr.includes(targetValue)) { + args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " matches condition ").concat(condition, " ").concat(valuesArr)); outputNumber = 1; } else { - args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " does not match condition ").concat(condition, " ").concat(value)); + args.jobLog("Variable ".concat(variable, " of value ").concat(targetValue, " does not match condition ").concat(condition, " ").concat(valuesArr)); outputNumber = 2; } }