From f13c16569ffc35fa2a48df1cd23a8972114f152b Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sun, 9 Jul 2023 18:18:04 +0800 Subject: [PATCH 1/2] modify options api config --- packages/server/src/utils/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/server/src/utils/index.ts b/packages/server/src/utils/index.ts index d32faa8b422..9e8c5c32da7 100644 --- a/packages/server/src/utils/index.ts +++ b/packages/server/src/utils/index.ts @@ -632,7 +632,7 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[]) => { for (const flowNode of reactFlowNodes) { for (const inputParam of flowNode.data.inputParams) { let obj: IOverrideConfig - if (inputParam.type === 'password' || inputParam.type === 'options') { + if (inputParam.type === 'password') { continue } else if (inputParam.type === 'file') { obj = { @@ -641,6 +641,19 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[]) => { name: 'files', type: inputParam.fileType ?? inputParam.type } + } else if (inputParam.type === 'options') { + obj = { + node: flowNode.data.label, + label: inputParam.label, + name: inputParam.name, + type: inputParam.options + ? inputParam.options + ?.map((option) => { + return option.name + }) + .join(', ') + : 'string' + } } else { obj = { node: flowNode.data.label, From 9dd19178ff30ababe681cf4e200f8a981f370d27 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Mon, 10 Jul 2023 21:19:22 +0800 Subject: [PATCH 2/2] modify password api config --- packages/server/src/utils/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/server/src/utils/index.ts b/packages/server/src/utils/index.ts index 9e8c5c32da7..9bcf0f71a5f 100644 --- a/packages/server/src/utils/index.ts +++ b/packages/server/src/utils/index.ts @@ -632,9 +632,7 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[]) => { for (const flowNode of reactFlowNodes) { for (const inputParam of flowNode.data.inputParams) { let obj: IOverrideConfig - if (inputParam.type === 'password') { - continue - } else if (inputParam.type === 'file') { + if (inputParam.type === 'file') { obj = { node: flowNode.data.label, label: inputParam.label, @@ -659,7 +657,7 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[]) => { node: flowNode.data.label, label: inputParam.label, name: inputParam.name, - type: inputParam.type + type: inputParam.type === 'password' ? 'string' : inputParam.type } } if (!configs.some((config) => JSON.stringify(config) === JSON.stringify(obj))) {