-
Notifications
You must be signed in to change notification settings - Fork 4
Use API request to determine if user can leave or disband a team #1637
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
Currently these are used to check if the authenticated user can leave the team (team needs to retain at least one owner) and if the team can be disanded (team with packages can't be disbanded).
apps/cyberstorm-remix/app/settings/teams/team/tabs/Settings/Settings.tsx
Fixed
Show fixed
Hide fixed
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1637 +/- ##
=========================================
+ Coverage 9.86% 9.95% +0.09%
=========================================
Files 313 314 +1
Lines 22537 22606 +69
Branches 409 411 +2
=========================================
+ Hits 2223 2251 +28
- Misses 20314 20355 +41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There's no longer need to check if currentUser is set in the session context as the API call will return 401 that gets handled automatically (currently by showing 500 error but better once the global error handling PR is merged) if the user isn't authenticated. There's no need to wait for the teamName to resolve as it's resolved synchronously (based on the team name in the route URL), i.e. no Promise is returned.
While a simple thing to check, this gets repeated constantly so having a dedicated helper with basic unit tests in place makes sense.
Use actual permission checks to show content instead of hardcoding it. Try to remove repetitive text on the page. If user can perform the action, only show the button to do so, and show clarification texts in the modal. Show why user can't perform an operation only if they actually can't do so. Change alert boxes from "danger" to "info", since it looked like there was some sort of error preventing user from performing the operations, while the system is working just as intended. Update the "how to disband team if team has packages" text to match (roughly) what's on the legacy website. Contacting Mythic does nothing.
c06253e to
53b482d
Compare
No description provided.