-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Feat : An option for users to leave the Organization #2262
Feat : An option for users to leave the Organization #2262
Conversation
Warning Rate limit exceeded@AnshulKahar2729 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 22 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe pull request introduces a feature allowing users to leave an organization. This includes the addition of a new GraphQL mutation, localization updates for various languages, and user interface enhancements such as a confirmation modal and new styling for buttons. The changes are implemented across multiple files, improving both functionality and user experience without affecting existing features. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OrganizationCard
participant LeaveConfirmModal
participant GraphQL
User->>OrganizationCard: Click "Leave" button
OrganizationCard->>LeaveConfirmModal: Show confirmation modal
User->>LeaveConfirmModal: Confirm leaving
LeaveConfirmModal->>GraphQL: Call LEAVE_ORGANIZATION mutation
GraphQL-->>LeaveConfirmModal: Return success
LeaveConfirmModal->>User: Show success notification
Assessment against linked issues
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
Documentation and Community
|
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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
Outside diff range, codebase verification and nitpick comments (2)
src/components/UserPortal/UserSidebarOrg/LeaveConfirmModal.tsx (1)
33-50
: LGTM, but consider improving error handling and extracting redirection logic.The
leaveOrg
function is well-structured and handles the mutation and its outcomes appropriately. However, consider the following suggestions for improvement:
- Provide more specific error messages based on the error type to give users more context about what went wrong.
- Extract the redirection logic into a separate function for better separation of concerns and reusability.
src/components/UserPortal/OrganizationCard/OrganizationCard.module.css (1)
61-66
: LGTM, but consider removing the right margin.The
.leaveBtn
class is appropriately named and follows the CSS module naming convention. The styles are consistent with the existing button styles in the file. However, the right margin of 9rem seems excessive and may not be necessary. Consider removing it to maintain consistent spacing with other buttons..leaveBtn { display: flex; justify-content: space-around; width: 8rem; - margin-right: 9rem; }
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (16)
- public/locales/en/common.json (1 hunks)
- public/locales/en/translation.json (3 hunks)
- public/locales/fr/common.json (1 hunks)
- public/locales/fr/translation.json (3 hunks)
- public/locales/hi/common.json (1 hunks)
- public/locales/hi/translation.json (3 hunks)
- public/locales/sp/common.json (1 hunks)
- public/locales/sp/translation.json (3 hunks)
- src/GraphQl/Mutations/OrganizationMutations.ts (1 hunks)
- src/GraphQl/Mutations/mutations.ts (1 hunks)
- src/components/UserPortal/OrganizationCard/OrganizationCard.module.css (2 hunks)
- src/components/UserPortal/OrganizationCard/OrganizationCard.tsx (3 hunks)
- src/components/UserPortal/UserSidebarOrg/LeaveConfirmModal.module.css (1 hunks)
- src/components/UserPortal/UserSidebarOrg/LeaveConfirmModal.tsx (1 hunks)
- src/components/UserPortal/UserSidebarOrg/UserSidebarOrg.module.css (1 hunks)
- src/components/UserPortal/UserSidebarOrg/UserSidebarOrg.tsx (3 hunks)
Files skipped from review due to trivial changes (5)
- public/locales/en/common.json
- public/locales/fr/common.json
- public/locales/hi/common.json
- public/locales/sp/common.json
- src/components/UserPortal/UserSidebarOrg/LeaveConfirmModal.module.css
Additional comments not posted (27)
src/components/UserPortal/UserSidebarOrg/LeaveConfirmModal.tsx (2)
1-16
: LGTM!The import statements and component props interface are well-organized and follow best practices. The
InterfaceLeaveConfirmModalProps
interface clearly defines the expected properties for the component.
51-73
: LGTM!The modal rendering is straightforward and uses Bootstrap components effectively. The translations are properly used for the modal title, confirmation message, and button labels. The modal is centered and sized appropriately.
src/components/UserPortal/OrganizationCard/OrganizationCard.module.css (1)
150-154
: LGTM!The modifications to the
.btnContainer
class within the.orgCard
class improve the layout and spacing of buttons. Using flexbox with a column direction stacks the buttons vertically, which is appropriate for the card layout. The gap of 0.5rem provides consistent spacing between the buttons.src/components/UserPortal/UserSidebarOrg/UserSidebarOrg.module.css (1)
112-135
: LGTM!The
.leaveOrgContainer
class and its associated styles are appropriately named and follow the CSS module naming convention. The styles are consistent with the existing sidebar styles and provide a clear visual indication of the leave organization action. The focus state ensures a clean appearance when the container is focused. The primary text color and leave icon styles emphasize the importance of the action.src/GraphQl/Mutations/OrganizationMutations.ts (1)
286-292
: LGTM!The code changes are approved.
src/components/UserPortal/UserSidebarOrg/UserSidebarOrg.tsx (3)
50-50
: LGTM!The code changes are approved.
133-170
: LGTM!The code changes are approved.
16-17
: LGTM!The code changes are approved.
src/components/UserPortal/OrganizationCard/OrganizationCard.tsx (3)
81-81
: LGTM!The code changes are approved.
193-219
: LGTM!The code changes are approved.
20-20
: LGTM!The code changes are approved.
src/GraphQl/Mutations/mutations.ts (1)
725-725
: LGTM, but verify the mutation usage.The addition of the
LEAVE_ORGANIZATION
mutation is approved.However, ensure that this mutation is properly integrated and all necessary changes have been made across the codebase to handle the user leaving an organization. This may include updating the UI, revoking permissions, handling edge cases, etc.
Run the following script to verify the mutation usage:
public/locales/en/translation.json (5)
151-151
: LGTM!The addition of the "leave" translation string is approved.
770-770
: LGTM!The addition of the "leave" translation string under the "userSidebarOrg" section is approved.
1057-1062
: LGTM!The addition of the "orgLeave" section with its translation strings is approved. The translations provide clear and informative messages for the user throughout the process of leaving an organization.
1058-1058
: LGTM!The "confirmation" translation string is approved. Asking for user confirmation before leaving an organization is a necessary step to prevent accidental actions.
1060-1060
: Excellent description of the consequences of leaving an organization!The "description" translation string provides a clear and comprehensive explanation of the implications of leaving an organization. It effectively communicates the irreversibility of the action, potential loss of data and permissions, and the need for approval to rejoin if required.
This level of transparency is crucial for users to make informed decisions and understand the gravity of their actions. Well done!
public/locales/hi/translation.json (4)
153-154
: LGTM!The code changes are approved.
769-769
: LGTM!The code changes are approved.
770-770
: LGTM!The code changes are approved.
1058-1063
: LGTM!The code changes are approved.
public/locales/fr/translation.json (3)
151-151
: LGTM!The addition of the "leave" key with the French translation "partir" looks good.
770-770
: LGTM!The addition of the "leave" key with the French translation "Quitter l'organisation" in the
"userSidebarOrg"
section looks good.
1058-1063
: Looks great!The new
"orgLeave"
section with the relevant French translations for the process of leaving an organization is a valuable addition. The translations are clear, consistent, and enhance the user experience by providing necessary prompts and confirmations.public/locales/sp/translation.json (3)
231-231
: LGTM!The addition of the "leave" key with the Spanish translation "Dejar" in the
"users"
section looks good.
966-966
: LGTM!The addition of the "leave" key with the Spanish translation "Dejar la organización" in the
"userSidebarOrg"
section looks good.
1292-1297
: Looks great!The new
"orgLeave"
section with the relevant Spanish translations for the process of leaving an organization is a valuable addition. The translations are clear, consistent, and enhance the user experience by providing necessary prompts and confirmations.
fixing |
What kind of change does this PR introduce?
feature
Issue Number:
Fixes #1873
Did you add tests for your changes?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Bug Fixes
Documentation