-
Notifications
You must be signed in to change notification settings - Fork 11
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: remove username from header #551
Conversation
3a42e81
to
2399197
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #551 +/- ##
==========================================
+ Coverage 71.94% 72.32% +0.37%
==========================================
Files 51 51
Lines 802 813 +11
Branches 156 163 +7
==========================================
+ Hits 577 588 +11
Misses 215 215
Partials 10 10 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work on the MFEs that are on the openedx organization? like frontend-app-learner-dashboard?
We set the npm alias to indicate from where the header component would be installed. For now, aliase is not added for |
|
Yes we can install in openedX repos but we need to add alias in edx-internal, for most of MFEs alias is added, you can check the detail here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankyou
12a9436
to
fba5dfe
Compare
src/Header.jsx
Outdated
@@ -32,6 +32,9 @@ subscribe(APP_CONFIG_INITIALIZED, () => { | |||
MINIMAL_HEADER: !!process.env.MINIMAL_HEADER, | |||
ENTERPRISE_LEARNER_PORTAL_HOSTNAME: process.env.ENTERPRISE_LEARNER_PORTAL_HOSTNAME, | |||
AUTHN_MINIMAL_HEADER: !!process.env.AUTHN_MINIMAL_HEADER, | |||
// this flag is introduced to unblock for new release. | |||
// the code behind flag would be removed in follow up PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code would be removed or the flag would be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag. comment updated
const userName = queryByTestId('username'); | ||
expect(userName).not.toBeInTheDocument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const userName = queryByTestId('username'); | |
expect(userName).not.toBeInTheDocument(); | |
const username = queryByTestId('username'); | |
expect(username).not.toBeInTheDocument(); |
const userMenue = container.querySelector('#user-dropdown-menu'); | ||
expect(userMenue.textContent).toContain(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const userMenue = container.querySelector('#user-dropdown-menu'); | |
expect(userMenue.textContent).toContain(''); | |
const userMenu = container.querySelector('#user-dropdown-menu'); | |
expect(userMenu.textContent).toContain(''); |
fba5dfe
to
38885c2
Compare
data-hj-suppress | ||
> | ||
{username} | ||
{!hideUsername && username} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be
{!hideUsername && username} | |
{usernameOrName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't want to show username or name when HIDE_USERNAME_FROM_HEADER is enabled.
}; | ||
|
||
AuthenticatedUserDropdown.defaultProps = { | ||
enterpriseLearnerPortalLink: '', | ||
name: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be string
name: null, | |
name: '', |
beef0db
to
4c22911
Compare
4c22911
to
11981e5
Compare
Remove username from header and add name for screen reader VAN-1804
11981e5
to
b9959a3
Compare
In the spirit of making registration experience quick and easy (more details on MVP scope doc), we want to be able to remove username from the registration form. This creates the need to remove it everywhere on the UX too. As part of this initiative, we will be removing username from the headers and making the dropdown consistent with edx.org site.
Changes
Set the flag
HIDE_USERNAME_FROM_HEADER
to hide the username from the header and replace the username with the name for the screen reader text when the flag is enabled.The flag will be removed when this PR would be merged
Screenshots
Ticket
VAN-1804