Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: [Application] When an application with form collection is embedded into the parent application, the conversation will report an error
fix: Knowledge Base Workflow - The icon of the data source tool node in the variable selection drop-down box does not correspond to it

…ed into the parent application, the conversation will report an error
…in the variable selection drop-down box does not correspond to it
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 9, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 9, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

result.push(value)
return result
}
get_up_node_field_dict(contain_self: boolean, use_cache: boolean) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code contains several issues:

  1. Duplicate result Variable: You have two variables named result. This is unnecessary and can lead to confusion.

  2. Variable Scope Issues: In the second line of the function body, you create an object value, but it's then overwritten immediately without being used elsewhere in the function.

  3. Missing Return Statement: The function doesn't explicitly return anything after constructing the final structure.

  4. Lack of Cache Handling: There seems to be an unused parameter use_cache.

  5. Inconsistent Object Initialization: When appending to result, there’s inconsistency in how properties are added. Sometimes they're appended directly, sometimes as nested objects.

Here’s a revised version of the code with these issues addressed:

class AppNode extends HtmlResize.view {
  pushToResult(result: {}, nodeData): void {
    result.push({
      value: nodeData.id,
      icon: nodeData.properties.node_data?.icon,
      label: nodeData.properties.stepName,
      type: nodeData.type,
      children: nodeData.properties.config?.fields || [],
    });
    if(nodeData.properties.kind) {
      result[value]['kind'] = nodeData.properties.kind;
    }
  }

  render(model): {}[] | JSX.Element | null {
    return [
      <AppRow data={globalFields}></AppRow>,
      ...[].map(() => ({
        value: model.data!.id,
        icon: model.properties?.['node-data'].icon,
        label: model.properties?.stepName,
        type: model.type,
        children: model.properties?.config?.fields || [],
      })),
    ];
  }

  getUpNodeFieldDict(containSelf: boolean, useCache: boolean): void {}
}

Key Changes:

  • Removed duplicate result variable.
  • Consolidated property setting for direct assignment instead of nesting.
  • Added a helper method pushToResult to reduce redundancy.
  • Fixed inconsistent handling of nested properties.
  • Cleaned up formatting for better readability.

If you'd like further optimizations or additional changes, feel free to ask!

@shaohuzhang1 shaohuzhang1 merged commit ff3ecb3 into v2 Dec 9, 2025
3 of 5 checks passed
kind?: string
}
}>()
</script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed code has a few minor adjustments to improve clarity and maintain consistency:

  1. Corrected the v-else-if condition for item.kind === 'data-source'.
  2. Added type annotations to make it more explicit what types each property should be.

Here's the corrected version:

@@ -8,7 +8,9 @@
 > 
   <el-avatar :src="item?.icon"></el-avatar>

---
+<el-avatar v-else-if="item?.kind === 'data-source'" class="avatar-purple" shape="square">
+  <img src="@/assets/tool/icon_datasource.svg" style="width: 58%;" alt="" />
+</el-avatar>

@@ -23,6 +25,7 @@ const props = defineProps<{
     name: string
     icon: string
     tool_type: string
+    kind?: string
 }>()
-</script>
++</script>

These changes address the inconsistencies in logic and clarify the expected structure of the input properties.

@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_workflow branch December 9, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants