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

feat: display profile name in navbar if available #3

Conversation

ArturGaspar
Copy link
Member

Description

Display profile name in navbar if available.

Port of 157056e to Redwood.

Testing instructions

  1. Set a user's first and last name in Django Admin UI (not in user profile settings).
  2. See full name instead of username in header.

image

Deadline

2024-07-22

Other information

Private-ref: https://tasks.opencraft.com/browse/BB-8994

Display profile name if set, else fallback to username

(cherry picked from commit eb1f2ca)

Upstream PR: https://github.com/openedx/frontend-app-learner-dashboard/pull/313/commits
@tecoholic
Copy link
Member

@ArturGaspar The change works. However, it is loading the "Name" field from the "Profile" object and not the First+Last name from the "User Object". Here is what I see:

User object in the Django Admin

image

image

Learner Dashboard

image

@tecoholic
Copy link
Member

@ArturGaspar From the looks of it, the authenticatedUser is loaded from the JWT Token which contains the following information:
image

So, using the given_name and family_name fields will give the User object's name value instead of the Profile.

Caveat: There is a tiny chance that the JWT payload of what I am testing might be different from the payload you are testing (maybe different versions of edx-platform code). So, kindly inspect the edx-jwt-cookie-header-payload cookie.

@tecoholic
Copy link
Member

@ArturGaspar Also, the commit you referenced in the description mentions "Display profile name if set, else fallback to username". If that's the case then 👍 from me.

Copy link
Member

@tecoholic tecoholic left a comment

Choose a reason for hiding this comment

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

@ArturGaspar 👍 if expected value is "Profile name".

  • I tested this: Verified that the profile name is shown when available.
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@ArturGaspar ArturGaspar merged commit 4accfc9 into opencraft-release/redwood.1-krach-institute Jul 24, 2024
3 checks passed
@xitij2000 xitij2000 deleted the artur/profile-name-in-navbar branch August 13, 2024 07:16
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