classroom icon indicating copy to clipboard operation
classroom copied to clipboard

fix(navbar): show Dashboard instead of Classes label for admin users

Open AbiramiR-27 opened this issue 5 months ago • 2 comments

Checklist:

Closes #597

This PR dynamically renames the navbar link "Classes" to "Dashboard" for ADMIN users to match the actual destination page.

Changes:

  • Added the custom session callback to NextAuth config to expose user roles to the client.
  • Added a helper function in Navbar to recursively find and update the label for links to /classes based on user role.
  • Added unit tests to navbar.test.jsx to cover both admin and teacher role scenarios.

AbiramiR-27 avatar Jun 06 '26 14:06 AbiramiR-27

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.

AbiramiR-27 avatar Jun 08 '26 03:06 AbiramiR-27

Hi @utsab, Gentle ping for a final review on this. @NewtonLC has approved it. Thank you!

AbiramiR-27 avatar Jun 11 '26 14:06 AbiramiR-27

Hi @utsab @NewtonLC , just following up to see if you've had a chance to review this PR. In the meantime, I'll go ahead and resolve the merge conflicts in components/navbar.js. Thanks!

AbiramiR-27 avatar Aug 13 '26 05:08 AbiramiR-27

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.

NewtonLC avatar Aug 16 '26 19:08 NewtonLC

Hi @NewtonLC, Thanks for the update! No worries at all. Just reach out whenever the team is ready to review.

AbiramiR-27 avatar Aug 17 '26 07:08 AbiramiR-27

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!

NewtonLC avatar Sep 01 '26 04:09 NewtonLC

Thank you so much for the update! I’m glad to see the PR merged. Thank you for reviewing and merging it!

AbiramiR-27 avatar Sep 01 '26 11:09 AbiramiR-27