-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: After adding parameters to the variable splitting parameter extraction node, the subsequent node parameters were not updated #4231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,11 +17,7 @@ | |
| row-key="field" | ||
| class="border-l border-r" | ||
| > | ||
| <el-table-column | ||
| prop="field" | ||
| :label="$t('common.variable')" | ||
| width="95" | ||
| > | ||
| <el-table-column prop="field" :label="$t('common.variable')" width="95"> | ||
| <template #default="{ row }"> | ||
| <span :title="row.field" class="ellipsis-1">{{ row.field }}</span> | ||
| </template> | ||
|
|
@@ -84,6 +80,7 @@ function deleteField(index: any) { | |
| ...inputFieldList.value.map((item) => ({ label: item.label, value: item.field })), | ||
| ] | ||
| set(props.nodeModel.properties.config, 'fields', fields) | ||
| props.nodeModel.clear_next_node_field(false) | ||
| } | ||
|
|
||
| function refreshFieldList(data: any, index: any) { | ||
|
|
@@ -107,6 +104,7 @@ function refreshFieldList(data: any, index: any) { | |
| ...inputFieldList.value.map((item) => ({ label: item.label, value: item.field })), | ||
| ] | ||
| set(props.nodeModel.properties.config, 'fields', fields) | ||
| props.nodeModel.clear_next_node_field(false) | ||
| } | ||
|
|
||
| onMounted(() => { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code you provided is relatively clean and well-organized, but there are a few minor adjustments and improvements that could be made:
Here's an slightly optimized version of the code based on these considerations: function deleteField(index: any): void {
const inputFieldList = reactive([
{ label: 'Value', value: 'id' },
// Add more items here...
]);
const fields: any[] = [
...inputFieldList.value.map((item) => ({ label: item.label, value: item.field })),
];
props.nodeModel.properties.config.fields = fields;
props.nodeModel.clearNextNodeField(false);
}
function refreshFields(data: any, index: any): void {
const currentData = data; // Assuming data refers to some specific context
const currentIndex = index;
const updatedConfig = structuredClone(props.nodeModel.properties.config);
updatedConfig.fields = [...currentInputFieldList.value.map(item => ({
label: item.label,
value: item.field,
}))];
props.nodeModel.updateProperties(updatedConfig); // Update only the fields property
}
onMounted(() => {
// Initialize any necessary state or perform initial setup here...
});Key Changes:
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet appears to be part of a React application where there are functions
deleteFieldandrefreshFieldList. These methods seem to update the properties of an element using certain configuration settings. However, it also contains an additional method callprops.nodeModel.clear_next_node_field(false)which is not immediately clear what this does.Here's my analysis:
Irregularites / Potential Issues:
set(props.nodeModel.properties.config, 'fields', fields), but no imports for vue are imported).clear_next_node_field(false)call seems to have been added without understanding its purpose or functionality in context with other parts of the code.props.nodeModel.clear_next_node_field()call, especially iffalseis meant as some conditional parameter that needs to be validated.Optimization Suggestions:
props.nodeModel.clear_next_node_field false)to understand exactly how values are being passed and expected in the function.Overall, the code looks functional based on the logic present. Just ensure consistency with component/library usage and implement necessary error checking when dealing with custom behavior outside your typical framework features.