-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: Workspace manager folder #4267
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 |
|---|---|---|
|
|
@@ -380,6 +380,7 @@ const toolStoreDescDrawerRef = ref<InstanceType<typeof ToolStoreDescDrawer>>() | |
| function openCreateDialog(data?: any) { | ||
| // mcp工具 | ||
| if (data?.tool_type === 'MCP') { | ||
| bus.emit('select_node', data.folder_id) | ||
| openCreateMcpDialog(data) | ||
| return | ||
| } | ||
|
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 looks mostly correct but can be simplified for better readability and maintainability. Here's an optimized version: function openCreateDialog(data?: any) {
if (!data || !this.isToolTypeSupported(data.tool_type)) {
return;
}
this.selectNodeFromData(data);
this.openCreateMcpDialog(data);
this.handlePostOpenCreateDialog();
}
handlePostOpenCreateDialog() {
// Add any additional cleanup or logging here
}Optimization Suggestions:
|
||
|
|
||
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.
There seems to be an error in the code snippet you provided. In the
@has_permissionsdecorators:Operation.UPDATEandOPERATE.CREATE. Typically, one should use eitherUPDATEorCREATE, not both.This will result in an inconsistency and might lead to unexpected behavior in your application.
Ensure that all parameters used (
'source', 'workspace_id', 'parent_id') are correctly set before accessing them with.get(). Using these values directly without setting it first could throw a KeyError if those keys do not exist in the request data.Consider whether the logic for checking permissions should be more specific or general based on additional fields or context within your application.
If you intend to perform different operations depending on certain conditions, ensure that each decorator uses the appropriate constants from your library (e.g.,
Permission.Operation.UPDATEvs.Permission.Operate.CREATE).