-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[WEB-3411] fix: archive permission #6661
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
Conversation
WalkthroughThis change corrects a typo in the English translations JSON file and updates the permission logic for restoring archived issues. In the translations file, the key Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant Q as QuickActionDropdown
participant P as PermissionChecker
U->>Q: Click "Restore" action
Q->>P: Invoke allowPermissions()
P-->>Q: Return permission status
alt Permission Granted
Q->>Q: Execute restore action
else Permission Denied
Q-->>U: Notify inability to restore
end
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (5)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
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: 0
🧹 Nitpick comments (1)
web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx (1)
71-77: Consider enhancing error handling with specific messages.The current error message for restore failures is generic. Consider enhancing the error handling to provide more specific messages based on different error scenarios (e.g., permission issues, network errors, etc.).
- .catch(() => { + .catch((error) => { + const errorMessage = error.response?.status === 403 + ? "You don't have permission to restore this work item." + : error.response?.status === 404 + ? "This work item no longer exists." + : "Work item could not be restored. Please try again."; setToast({ type: TOAST_TYPE.ERROR, title: "Error!", - message: "Work item could not be restored. Please try again.", + message: errorMessage, }); });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/i18n/src/locales/en/translations.json(2 hunks)web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/i18n/src/locales/en/translations.json
🔇 Additional comments (2)
web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx (2)
47-48: LGTM! Permission logic correctly updated.The permission check for restoring archived issues now properly relies on specific user permissions (ADMIN/MEMBER) at the PROJECT level, without being tied to editing permissions. This change aligns with the PR objective of fixing the archive option visibility.
80-110: LGTM! Menu items correctly configured.The menu items are well-structured with appropriate permission checks:
- Restore action visibility is correctly controlled by
isRestoringAllowed- Other actions maintain their original permission checks
- The configuration follows a consistent pattern
* fix restore typo * fix archive permissions * fix restore typo Co-authored-by: Vipin Chaudhary <[email protected]>
* fix restore typo * fix archive permissions * fix restore typo
Description
Fix archive option not showing issue and typo in tool tip
Type of Change
Screenshots and Media (if applicable)
before
after
Screen.Recording.2025-02-24.at.1.40.09.PM.mov
Summary by CodeRabbit
Summary by CodeRabbit