Skip to content

Commit 4ea8099

Browse files
committed
fix: Edit advanced orchestration applications, add application nodes, and display that some applications are unavailable after being added
1 parent 072b817 commit 4ea8099

File tree

1 file changed

+37
-28
lines changed
  • ui/src/workflow/nodes/application-node

1 file changed

+37
-28
lines changed

ui/src/workflow/nodes/application-node/index.vue

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -238,41 +238,49 @@ const update_field = () => {
238238
const new_user_input_field_list = cloneDeep(
239239
ok.data.work_flow.nodes[0].properties.user_input_field_list
240240
)
241-
const merge_api_input_field_list = new_api_input_field_list.map((item: any) => {
242-
const find_field = old_api_input_field_list.find(
243-
(old_item: any) => old_item.variable == item.variable
244-
)
245-
if (find_field) {
246-
return {
247-
...item,
248-
value: find_field.value,
249-
label:
250-
typeof item.label === 'object' && item.label != null ? item.label.label : item.label
241+
const merge_api_input_field_list =
242+
new_api_input_field_list ||
243+
[].map((item: any) => {
244+
const find_field = old_api_input_field_list.find(
245+
(old_item: any) => old_item.variable == item.variable
246+
)
247+
if (find_field) {
248+
return {
249+
...item,
250+
value: find_field.value,
251+
label:
252+
typeof item.label === 'object' && item.label != null
253+
? item.label.label
254+
: item.label
255+
}
256+
} else {
257+
return item
251258
}
252-
} else {
253-
return item
254-
}
255-
})
259+
})
256260
set(
257261
props.nodeModel.properties.node_data,
258262
'api_input_field_list',
259263
merge_api_input_field_list
260264
)
261-
const merge_user_input_field_list = new_user_input_field_list.map((item: any) => {
262-
const find_field = old_user_input_field_list.find(
263-
(old_item: any) => old_item.field == item.field
264-
)
265-
if (find_field) {
266-
return {
267-
...item,
268-
value: find_field.value,
269-
label:
270-
typeof item.label === 'object' && item.label != null ? item.label.label : item.label
265+
const merge_user_input_field_list =
266+
new_user_input_field_list ||
267+
[].map((item: any) => {
268+
const find_field = old_user_input_field_list.find(
269+
(old_item: any) => old_item.field == item.field
270+
)
271+
if (find_field) {
272+
return {
273+
...item,
274+
value: find_field.value,
275+
label:
276+
typeof item.label === 'object' && item.label != null
277+
? item.label.label
278+
: item.label
279+
}
280+
} else {
281+
return item
271282
}
272-
} else {
273-
return item
274-
}
275-
})
283+
})
276284
set(
277285
props.nodeModel.properties.node_data,
278286
'user_input_field_list',
@@ -294,6 +302,7 @@ const update_field = () => {
294302
}
295303
})
296304
.catch((err) => {
305+
console.log(err)
297306
set(props.nodeModel.properties, 'status', 500)
298307
})
299308
}

0 commit comments

Comments
 (0)