Skip to content

Conversation

ChristopherChudzicki
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki commented Dec 19, 2023

What are the relevant tickets?

Closes #241

Description (What does it do?)

This PR adds a user menu in top-right corner with log in / log out links as appropriate. A few other links are added, too.

Authenticated user / Anonymous user *Note, "Learning Paths" only available to those with editing permissions".

Screenshot 2023-12-19 at 9 57 14 AM / Screenshot 2023-12-19 at 9 57 23 AM

Additionally, I made some updates to the reusable SimpleMenu component.

How can this be tested?

Prerequisites: Connect your local instance to keycloak; either local keycloak or on RC. Ask me for creds if you need them.

Assuming you are initially unauthenticated:

  1. Unauthenticated: Visit http://localhost:8063/ ; in top right, click user menu and log in. You should be redirected to keycloak, after which you're redirected back to MIT Open.
  2. Authenticated: Now click usermenu
    • if your user has is_learning_path_editor permission, they'll see a "Learning Paths" link.
    • all authenticated users see "Log out" link.
  3. Authenticated: Try logging out. It should work.
    • Note: Does not currently redirect to MIT Open

Some accessibility stuff: This is most easily tested as a superuser, since you'll have multiple links int he dropdown usermenu.

  • Check that you can tab to the usermenu trigger and open it with keyboard
  • Once it's open, check that navigation with keyboard arrows works.
  • The whole menu item should be clickable as a link
    Screenshot 2023-12-19 at 10 12 02 AM

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (eab21e3) 76.80% compared to head (a39dee6) 76.86%.
Report is 4 commits behind head on main.

❗ Current head a39dee6 differs from pull request most recent head 79fd138. Consider uploading reports for the commit 79fd138 to get more accurate results

Files Patch % Lines
...omponents/src/components/SimpleMenu/SimpleMenu.tsx 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
+ Coverage   76.80%   76.86%   +0.05%     
==========================================
  Files         281      282       +1     
  Lines       13047    13097      +50     
  Branches     2133     2141       +8     
==========================================
+ Hits        10021    10067      +46     
- Misses       2800     2803       +3     
- Partials      226      227       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChristopherChudzicki ChristopherChudzicki marked this pull request as ready for review December 19, 2023 15:27
@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Dec 19, 2023
@collinpreston collinpreston self-requested a review December 19, 2023 17:33
Copy link
Contributor

@collinpreston collinpreston left a comment

Choose a reason for hiding this comment

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

Nicely done. Works well with screen reader.

@collinpreston collinpreston added Waiting on author and removed Needs Review An open Pull Request that is ready for review labels Dec 19, 2023
@ChristopherChudzicki ChristopherChudzicki force-pushed the cc/usermenu branch 2 times, most recently from a39dee6 to 79fd138 Compare December 19, 2023 21:51
@ChristopherChudzicki ChristopherChudzicki merged commit 44ba41e into main Dec 19, 2023
@rhysyngsun rhysyngsun deleted the cc/usermenu branch February 7, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add simple login / logout to frontend

2 participants