From 86d94568656d64b50d690b06abd41a2d9c443784 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:43:57 +0100 Subject: [PATCH] Add pluginId input --- .../tools/goToFlow/2.0.0/index.js | 52 ++++++++++++++++ .../tools/goToFlow/2.0.0/index.ts | 59 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 FlowPlugins/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.js create mode 100644 FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.ts diff --git a/FlowPlugins/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.js new file mode 100644 index 000000000..70b76e991 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Go To Flow', + description: 'Go to a different flow', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + pType: '', + requiresVersion: '2.14.01', + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [ + { + name: 'flowId', + type: 'string', + defaultValue: '', + inputUI: { + type: 'dropdown', + options: [], + }, + tooltip: 'Specify flow ID to go to', + }, + { + name: 'pluginId', + type: 'string', + defaultValue: 'start', + inputUI: { + type: 'text', + }, + tooltip: 'Specify plugin ID to go to', + }, + ], + outputs: [], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.ts new file mode 100644 index 000000000..c04baecdd --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/2.0.0/index.ts @@ -0,0 +1,59 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Go To Flow', + description: 'Go to a different flow', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + pType: '', + requiresVersion: '2.14.01', + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [ + { + name: 'flowId', + type: 'string', + defaultValue: '', + inputUI: { + type: 'dropdown', + options: [], + }, + tooltip: 'Specify flow ID to go to', + }, + { + name: 'pluginId', + type: 'string', + defaultValue: 'start', + inputUI: { + type: 'text', + }, + tooltip: 'Specify plugin ID to go to', + }, + ], + outputs: [], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +};