-
Notifications
You must be signed in to change notification settings - Fork 18
fix(web): if not batch-remove permission should not display i18n or user batch-remove button #90
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
fix(web): if not batch-remove permission should not display i18n or user batch-remove button #90
Conversation
WalkthroughAdds v-permission directives to gate “Batch Remove” buttons in locale and user info tabs. Minor attribute reordering and whitespace adjustments occur in the locale component without behavioral changes. No logic, API, or exported entity modifications. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant C as Vue Component
participant P as v-permission Directive
participant B as Batch Remove Button
participant H as onBatchRemove Handler
U->>C: Open view
C->>P: Evaluate permission ('i18n::batch-remove' or 'user::batch-remove')
alt Has permission
P-->>B: Enable/Show
U->>B: Click
B->>H: Invoke handler
H-->>C: emit('batchRemove')
else Lacks permission
P-->>B: Disable/Hide
U -x B: Click blocked
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
template/tinyvue/src/views/locale/components/add-locale.vue (1)
3-5: Potentially invalid TinyButton prop: confirmshow-footerusage
show-footeris typically a dialog property, not a TinyButton prop. If unsupported on TinyButton, it will become a stray DOM attribute. Please confirm and remove if unnecessary.Apply if confirmed:
- <tiny-button show-footer type="primary" round @click="onOpen"> + <tiny-button type="primary" round @click="onOpen">
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
template/tinyvue/src/views/locale/components/add-locale.vue(4 hunks)template/tinyvue/src/views/userManager/info/components/info-tab.vue(1 hunks)
🔇 Additional comments (4)
template/tinyvue/src/views/userManager/info/components/info-tab.vue (1)
13-17: LGTM: Batch Remove button correctly guarded by v-permission
- Repo-wide grep confirms only two Vue UI triggers for “batch remove”:
• template/tinyvue/src/views/userManager/info/components/info-tab.vue (lines 13–17) usesv-permission="'user::batch-remove'"
• template/tinyvue/src/views/locale/components/add-locale.vue usesv-permission="'i18n::batch-remove'"- No other unguarded
batchRemoveorbatch-removebuttons found in the codebase.- Please verify that the translation key
'locale.batchRemove'matches the naming conventions for user-page labels (e.g.userInfo.*) and update it if needed.template/tinyvue/src/views/locale/components/add-locale.vue (3)
6-8: LGTM: Permission-gate i18n batch-remove
v-permission="'i18n::batch-remove'"correctly restricts access to the batch removal action in the locale module and aligns with the PR objective.
66-73: Attribute reordering onlyNon-functional attribute shuffle around
@click="addLocale". No action needed.
219-228: No-op style changeEnd-of-file/style formatting adjustment only. No action needed.
| const onBatchRemove = () => { | ||
| emits('batchRemove') | ||
| emits('batchRemove') | ||
| } |
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.
Type safety bug: missing 'batchRemove' in defineEmits causes TS error
emits('batchRemove') is called, but defineEmits only declares langChange and localChange. In <script lang="ts" setup>, this will produce a type error and can break builds with strict TS settings. Add batchRemove to the emit typings.
Apply:
- const emits = defineEmits<{
- langChange: [];
- localChange: [];
- }>();
+ const emits = defineEmits<{
+ langChange: [];
+ localChange: [];
+ batchRemove: [];
+ }>();Optional: if the parent needs context (e.g., current selection), consider emitting a payload now or later:
emits('batchRemove' /*, payload? */)🤖 Prompt for AI Agents
In template/tinyvue/src/views/locale/components/add-locale.vue around lines
125-128, the component calls emits('batchRemove') but defineEmits only declares
'langChange' and 'localChange', causing a TypeScript type error; update the
defineEmits call in the <script lang="ts" setup> block to include 'batchRemove'
(and, if you intend to pass data, add the appropriate payload type) so the
emitted event is properly typed and the TS build succeeds.
* style: remove console.log (#57) * feat: change the style of the home page and menu page (#51) * feat: change the style of the home page and menu page * feat: revise inspection comments * feat: Optimize the query table page, add corresponding functions, and modify the overall margin layout of Pro (#50) * feat: 优化查询表格页面,增加相应功能,修改pro整体边距布局 * feat: 优化数据算法 * fix: 根据意见修改页面查询表格、用户管理、国际化管理页面 (#59) * fix: 根据意见修改页面查询表格、用户管理、国际化管理页面 * fix: 统一分页pageSizes配置 * fix:修复刷新后表单数据丢失导致校验报错 (#58) * fix:表单校验以及分页条目修改 (#61) * feat: 监控页样式修改和解决初始化问题 (#60) * feat: change the style of the home page and menu page * feat: revise inspection comments * feat: 监控页样式修改和解决初始化问题 * feat: 修改表格pageSizes格式 * fix: 表格和弹出框优化 (#62) * fix: 表格和弹出框优化 * fix: 增加国际化 * feat: 解决查看菜单下级不能展开的问题 (#63) * fix:i18n (#70) * fix(web): data struct (#76) * fix(web): select change (#81) * fix(web): select change * feat: uncomment search-box style * fix(tiny-vue): user-manageer info-tab role id select * fix(tiny-pro): if role id is undefined will send empty array not [null] (#83) * fix(nestJS): added lost permissions (#89) * fix(web): if not batch-remove should not display i18n or user batch-remove button (#90) * chore: add `--no-frozen-lockfile` (#91) * chore: release v1.3.0 (#95) * fix:历史记录功能恢复 (#98) * fix: fix tabs style (#100) * fix(web): role table pager (#97) * fix(web): role table pager * chore: change default page-size to `10` * fix(web): role filter (#99) * feat: 支持初始化低代码设计器 --------- Co-authored-by: GaoNeng <31283122+GaoNeng-wWw@users.noreply.github.com> Co-authored-by: wuyiping <42107997+wuyiping0628@users.noreply.github.com> Co-authored-by: chenxi-20 <2465950588@qq.com> Co-authored-by: liukun <953831480@qq.com> Co-authored-by: Kagol <kagol@sina.com>
PR
请位于 #89 之后合并. 该PR解决了如果没有批量删除权限则不显示批量删除按钮的问题
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
如果用户没有
batch-remove权限也会显示i18n或user批量删除Issue Number: N/A
What is the new behavior?
如果用户没有
batch-remove权限将不会显示i18n或user批量删除Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit