-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: Knowledge Base Workflow - The icon of the data source tool node in the variable selection drop-down box does not correspond to it #4475
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,9 @@ | |
| > | ||
| <img :src="item?.icon" alt="" /> | ||
| </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> | ||
| <el-avatar v-else-if="item?.tool_type === '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> | ||
|
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 proposed code has a few minor adjustments to improve clarity and maintain consistency:
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. |
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 contains several issues:
Duplicate
resultVariable: You have two variables namedresult. This is unnecessary and can lead to confusion.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.Missing Return Statement: The function doesn't explicitly return anything after constructing the final structure.
Lack of Cache Handling: There seems to be an unused parameter
use_cache.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:
Key Changes:
resultvariable.pushToResultto reduce redundancy.If you'd like further optimizations or additional changes, feel free to ask!