Repository navigation
fix: workspace tool folder create error #7784
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 |
|---|---|---|
|
|
@@ -34,7 +34,6 @@ import ButtonCreateTool from './components/ButtonCreateTool.vue' | |
| import ButtonToolStore from './components/ButtonToolStore.vue' | ||
| import EditToolForm from '@/views/tool/tool-form/EditToolForm.vue' | ||
| import perm from '@/permission/index.ts' | ||
| import { getWorkspaceId } from '@/utils/resource-context.ts' | ||
|
|
||
| /* 当前文件夹 */ | ||
|
|
||
|
|
@@ -223,7 +222,7 @@ onMounted(() => { | |
| <template #aside="{ title, Header }"> | ||
| <component :is="Header"> | ||
| <h4>{{ title }}</h4> | ||
| <MkTooltip v-if="perm.tool.workspace.folderCreate(getWorkspaceId() || '')" content="创建文件夹" placement="top"> | ||
| <MkTooltip v-if="perm.tool.workspace.folderCreateWorkspace()" content="创建文件夹" placement="top"> | ||
| <el-button @click="handleCreateFolder" text type="primary" class="-mr-1"> | ||
| <MkIcon name="icon_add-folder_outlined" :size="18" /> | ||
| </el-button> | ||
|
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 diff shows a change that likely breaks functionality. The Issues:
Suggestion: <MkTooltip v-if="perm.tool.workspace.folderCreate(currentWorkspaceId)" ...>Verify that the |
||
|
|
||
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.
Here is the review of the code snippet:
Irregularities & Issues
/** ... */comment block and thefolderCreateWorkspacemethod are indented with spaces, while the existingimportmethod appears to be at the base level (or differently indented depending on context). This inconsistency reduces readability. Ensure consistent indentation (usually 2 or 4 spaces) across all object properties./** ... */) is consistent, but verify if other methods in theworkspaceobject use the same JSDoc style. If others use single-line comments//, consider standardizing.Optimization Suggestions
folderCreateWorkspaceis verbose. Since this is already within aworkspacecontext,createFolderorfolderCreatewould be more concise and standard.createFolder: () => can(P.TOOL_FOLDER_CREATE),workspace. Remove it for cleaner API usage (e.g.,workspace.createFolder()vsworkspace.folderCreateWorkspace()).Corrected Example