Skip to content

Comments

fix: add my-quota page for non-admin users#419

Merged
ding113 merged 3 commits intodevfrom
fix/issue-412-quota-page
Dec 23, 2025
Merged

fix: add my-quota page for non-admin users#419
ding113 merged 3 commits intodevfrom
fix/issue-412-quota-page

Conversation

@ding113
Copy link
Owner

@ding113 ding113 commented Dec 23, 2025

Summary

  • Add /dashboard/my-quota page for non-admin users to view their quota (read-only)
  • Update navigation to show role-specific labels: Admin sees "Quotas", non-admin sees "My Quota"
  • Unify redirect targets for non-admin users accessing admin quota pages

Closes #412

Test plan

  • Login as admin user, verify "Quotas" nav links to /dashboard/quotas
  • Login as non-admin user with canLoginWebUi, verify "My Quota" nav links to /dashboard/my-quota
  • Verify /dashboard/my-quota displays QuotaCards correctly
  • Verify non-admin accessing /dashboard/quotas redirects to /dashboard/my-quota
  • Verify all 5 language translations display correctly

Generated with Claude Code

Non-admin users could see "Quotas" nav but were redirected away.
Now they see "My Quota" nav linking to a read-only quota view.

- Add /dashboard/my-quota page reusing QuotaCards component
- Update nav to show role-specific labels and routes
- Unify redirect targets for non-admin users
- Add i18n keys for all 5 languages

Closes #412

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ding113, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience by providing non-admin users with a personalized view of their quotas through a new 'My Quota' page. It intelligently adjusts the navigation menu based on user roles and standardizes the redirection behavior for non-admin users who might inadvertently try to access admin-specific quota management sections, ensuring they are guided to their relevant quota information.

Highlights

  • New 'My Quota' Page: A dedicated read-only page has been introduced at /dashboard/my-quota for non-admin users to view their personal quota information.
  • Role-Based Navigation: The dashboard navigation has been updated to dynamically display 'Quotas' for admin users (linking to /dashboard/quotas) and 'My Quota' for non-admin users (linking to the new /dashboard/my-quota page).
  • Unified Non-Admin Redirection: Non-admin users attempting to access administrative quota pages (e.g., /dashboard/quotas, /dashboard/quotas/providers, /dashboard/quotas/users) are now consistently redirected to the new /dashboard/my-quota page.
  • Internationalization Updates: New translation keys for 'My Quota' have been added across multiple language files (English, Japanese, Russian, Simplified Chinese, Traditional Chinese) to support the new feature.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions bot added enhancement New feature or request area:UI area:i18n labels Dec 23, 2025
@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@github-actions github-actions bot added the size/M Medium PR (< 500 lines) label Dec 23, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a dedicated 'My Quota' page for non-admin users, which is a great improvement for user experience. The changes correctly update the navigation to be role-aware and unify redirects for admin-only quota pages. The implementation is solid, including the necessary internationalization updates. I have a couple of suggestions to further improve the code.

...(isAdmin
? [{ href: "/dashboard/quotas", label: t("quotasManagement") }]
: [{ href: "/dashboard/my-quota", label: t("myQuota") }]),
{ href: "/dashboard/users", label: t("userManagement") },
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The userManagement link should only be visible to admin users. You should add adminOnly: true to this navigation item to prevent non-admin users from seeing a link to a page they cannot access. This would make it consistent with the other admin-only links and the changes you've made for the quotas link.

Suggested change
{ href: "/dashboard/users", label: t("userManagement") },
{ href: "/dashboard/users", label: t("userManagement"), adminOnly: true },

Comment on lines 23 to 25
<div>
<h3 className="text-lg font-medium">{tNav("myQuota")}</h3>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The inner div element is redundant. You can simplify the structure by placing the h3 element directly inside the flex container.

        <h3 className="text-lg font-medium">{tNav("myQuota")}</h3>

- Add error state handling in my-quota page (show Alert instead of empty state)
- Fix quotas/keys redirect to /dashboard/my-quota for consistency

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code Review Summary

No significant issues identified in this PR.

PR Size: M

  • Lines changed: 46
  • Files changed: 10

Review Coverage

  • Logic and correctness - Clean
  • Security (OWASP Top 10) - Clean
  • Error handling - Clean
  • Type safety - Clean
  • Documentation accuracy - Clean
  • Test coverage - Adequate
  • Code clarity - Good

Automated review by Codex AI

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

  • Identified open PR #419 and reviewed all diff hunks (46 LOC across 10 files).
  • Applied label size/M to PR #419.
  • Submitted a PR review summary comment via gh pr review; no inline comments left because no issues met the ≥80 confidence threshold on changed lines.

@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

Simplifies the JSX structure by removing unnecessary inner div
elements in both the error state and success state render paths.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ding113 ding113 merged commit 5d64df3 into dev Dec 23, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Claude Code Hub Roadmap Dec 23, 2025
@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@ding113 ding113 deleted the fix/issue-412-quota-page branch December 23, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n area:UI enhancement New feature or request size/M Medium PR (< 500 lines)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant