From 6484fef8ea343479dca42b13052d359abf26d59f Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 22 Apr 2025 11:25:47 +0800 Subject: [PATCH] fix: Edit advanced orchestration applications, add application nodes, and display that some applications are unavailable after being added (#2945) --- .../workflow/nodes/application-node/index.vue | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/ui/src/workflow/nodes/application-node/index.vue b/ui/src/workflow/nodes/application-node/index.vue index 77bff4ac0..e700826f4 100644 --- a/ui/src/workflow/nodes/application-node/index.vue +++ b/ui/src/workflow/nodes/application-node/index.vue @@ -238,41 +238,49 @@ const update_field = () => { const new_user_input_field_list = cloneDeep( ok.data.work_flow.nodes[0].properties.user_input_field_list ) - const merge_api_input_field_list = new_api_input_field_list.map((item: any) => { - const find_field = old_api_input_field_list.find( - (old_item: any) => old_item.variable == item.variable - ) - if (find_field) { - return { - ...item, - value: find_field.value, - label: - typeof item.label === 'object' && item.label != null ? item.label.label : item.label + const merge_api_input_field_list = + new_api_input_field_list || + [].map((item: any) => { + const find_field = old_api_input_field_list.find( + (old_item: any) => old_item.variable == item.variable + ) + if (find_field) { + return { + ...item, + value: find_field.value, + label: + typeof item.label === 'object' && item.label != null + ? item.label.label + : item.label + } + } else { + return item } - } else { - return item - } - }) + }) set( props.nodeModel.properties.node_data, 'api_input_field_list', merge_api_input_field_list ) - const merge_user_input_field_list = new_user_input_field_list.map((item: any) => { - const find_field = old_user_input_field_list.find( - (old_item: any) => old_item.field == item.field - ) - if (find_field) { - return { - ...item, - value: find_field.value, - label: - typeof item.label === 'object' && item.label != null ? item.label.label : item.label + const merge_user_input_field_list = + new_user_input_field_list || + [].map((item: any) => { + const find_field = old_user_input_field_list.find( + (old_item: any) => old_item.field == item.field + ) + if (find_field) { + return { + ...item, + value: find_field.value, + label: + typeof item.label === 'object' && item.label != null + ? item.label.label + : item.label + } + } else { + return item } - } else { - return item - } - }) + }) set( props.nodeModel.properties.node_data, 'user_input_field_list', @@ -294,6 +302,7 @@ const update_field = () => { } }) .catch((err) => { + console.log(err) set(props.nodeModel.properties, 'status', 500) }) }