-
Notifications
You must be signed in to change notification settings - Fork 367
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
fix: [M3-7826-v2] - Fix email displaying in top menu for all users without a company name #10276
fix: [M3-7826-v2] - Fix email displaying in top menu for all users without a company name #10276
Conversation
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.
Thanks for the tests! These changes are now working - not seeing email above my normal user accounts
const companyNameOrEmail = | ||
hasParentChildAccountAccess && | ||
profile?.user_type !== 'default' && | ||
account?.company | ||
? account.company | ||
: profile?.email; | ||
: isParentUser && profile?.email | ||
? profile.email | ||
: undefined; |
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 we break this out into a util function and unit test it?
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.
Yeah, that's fair, it's probably the better approach than to add every test case related to this to the UserMenu. I'll revisit.
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.
Sounds good! I think both testing approaches are fine, but I do think a helper function using if/else would be more readable than the ternaries here.
Feel free to revisit later if it will keep parent/child unblocked
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.
@bnussman-akamai Done in 2a259d0.
Coverage Report: ✅ |
Description 📝
In #10248, I didn't test the regular user experience thoroughly enough, because the conditional logic was defaulting to the profile email of the user if no company name was set, even if the user was not a parent/child/proxy account. We don't want this.
We should see the following:
account_access
set to at leastread_only
, the top menu should display username and email (in place of company).For restricted parent users who do not have
account_access
set to at leastread_only
, the dropdown menu should display email (in place of company).Changes 🔄
Target release date 🗓️
3/18
Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
Reproduction steps
(How to reproduce the issue, if applicable)
Verification steps
(How to verify changes)
user_type
toparent
,proxy
,child
, anddefault
in the MSW. For a restricted parent user, you'd want to mock a 403 on the account endpoint.As an Author I have considered 🤔
Check all that apply