Skip to content
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

Error page for admin panel #322

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

GhiaraD
Copy link
Member

@GhiaraD GhiaraD commented Oct 19, 2021

Show an error page if you don't have permission to see admin panel content.

* add a new illustration
* show an error page if you dont have permissions to see admin panel content
@acs-upb-mobile-bot
Copy link
Member

4 Warnings
⚠️ No test changes detected. You should usually add at least one test for any new functionality.
⚠️ Missing en-GB changelog entry at android/fastlane/metadata/android/en-GB/changelogs/10041.txt
⚠️ Missing en-US changelog entry at android/fastlane/metadata/android/en-US/changelogs/10041.txt
⚠️ Missing ro changelog entry at android/fastlane/metadata/android/ro/changelogs/10041.txt

If this is a trivial change that doesn't warrant a test or changelog entry, you can mark it as #trivial in the PR title.

Generated by 🚫 Danger

Copy link
Member

@IoanaAlexandru IoanaAlexandru left a comment

Choose a reason for hiding this comment

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

Can you include screenshots of the page in the PR description please? In both dark mode & light mode.

@@ -145,6 +145,7 @@
"errorInsertGoogleEvents": "Unable to insert events in Google Calendar.",
"errorLoadRequests": "Could not load requests",
"errorUnknownUser": "Unknown User",
"errorDontHavePermissions": "You don't have permission to access this page.",
Copy link
Member

Choose a reason for hiding this comment

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

Nit: rename to "errorNoPermissions"

Comment on lines +84 to +88
if (user.isAdmin) {
return true;
} else {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (user.isAdmin) {
return true;
} else {
return false;
}
return user.isAdmin;

}

bool checkUserIsAdmin() {
final authProvider = Provider.of<AuthProvider>(context, listen: false);
Copy link
Member

Choose a reason for hiding this comment

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

I believe listen: false isn't necessary here. (also now that I look at it it's probably not necessary above either, for the admin provider)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants