fix(navbar): show Dashboard instead of Classes label for admin users - #601
Conversation
NewtonLC
left a comment
There was a problem hiding this comment.
Hi @AbiramiR-27, thank you for working on this issue! I tested your code, and it works as expected. Before merging this though, I'd like to modify it to also hide this button if the user is not signed in, or if the user has a role other than ADMIN or TEACHER.
Would you be alright with adding those changes? If not, no worries! I can patch it later this week.
|
Thank you for testing the changes and for the feedback! I'd be happy to make the additional updates. I'll modify the implementation to hide the button when the user is not signed in and when the user's role is neither ADMIN nor TEACHER, then update the PR shortly. |
13b92af to
3e5d6f1
Compare
|
Hi Abirami, I apologize for the wait. At the moment, we still aren't able to give a clear date for when we can review and merge your PRs. I still appreciate your work on both of them and will definitely reach out once we are able to review them. |
|
Hi @NewtonLC, |
utsab
left a comment
There was a problem hiding this comment.
This looks good to me. There is one minor change we can patch later, which is the description of your first test. Instead of saying "non-admin", it would be clearer to say "teacher".
|
Hi @AbiramiR-27, sorry for the wait! We were able to merge in your navbar fix PR just now. Thank you for working on this! |
|
Thank you so much for the update! I’m glad to see the PR merged. Thank you for reviewing and merging it! |
Checklist:
Closes #597
This PR dynamically renames the navbar link
"Classes"to"Dashboard"forADMINusers to match the actual destination page.Changes:
sessioncallback to NextAuth config to expose user roles to the client.Navbarto recursively find and update the label for links to/classesbased on user role.navbar.test.jsxto cover both admin and teacher role scenarios.