Skip to content

fix: show an error when a user doesn't have permission to view the health page #16580

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

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

brettkolodny
Copy link
Contributor

No description provided.

@brettkolodny brettkolodny changed the title fix: show an error notification when a user doesn't have permission to view the health page fix: show an error when a user doesn't have permission to view the health page Feb 14, 2025
@brettkolodny brettkolodny requested a review from aslilac February 18, 2025 16:18
Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

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

Typically for this sort of thing, we prefer early returns over checks using ternaries. It helps keep the main return focused on rendering the page and makes it clearer when other states are special cases.

A good example of a page that does this right is GroupPage.tsx

While you're at it, could you turn the <Loader /> case into an early return as well?

@brettkolodny
Copy link
Contributor Author

Moved the checks for loading/error outside of the ternary, and then based on this line from GroupPage.tsx removed the ternary entirely

@brettkolodny brettkolodny merged commit 4732f08 into main Feb 19, 2025
30 checks passed
@brettkolodny brettkolodny deleted the brett/redirect-unpermissioned-users-on-health branch February 19, 2025 15:54
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants