-
Notifications
You must be signed in to change notification settings - Fork 365
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] - Display parent email in user menu when no company name is available for restricted parent user #10248
fix: [M3-7826] - Display parent email in user menu when no company name is available for restricted parent user #10248
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.
Looks good when testing with mocks. Unable to verify account switching toasts.
Closing this PR as it has been determined that we do not need a fallback for companyName. Elsewhere on the backend, we were incorrectly retrieving that data from a value that could be optional. This will be changed on the backend to a value that is required, so the companyName will always exist. |
Coverage Report: ✅ |
For posterity: we reopened this PR after finding an edge case where if a restricted parent account does not have Billing Access but does have Following guidance from Product, we can fall back on parent email here. |
We received approval on this from Product so I'm going to go ahead and merge this ahead of the demo since it is a bug that otherwise will be visible. |
…eature/namespace-create * 'develop' of https://github.com/vrajesh73/manager: (89 commits) fix: [M3-7269] - Display parent email in user menu when no company name is available for restricted parent user (linode#10248) fix: [M3-7817] - Show correct status of Child Account Enabled column for parent users (linode#10233) upcoming: [M3-7616] - Add Placement Groups Events and Notifications (linode#10221) upcoming: [M3-7816-v2] - Adjust logic for when to show Switch Account button (linode#10266) fix: [M3-7831] - Persisting error messages in ACLB delete dialogs (linode#10254) upcoming: [M3-7842] - Update Assign Linode Drawer and improve query skipping (linode#10263) upcoming: [M3-7704] - Disable Cloning, Private IP, Backups for edge regions (linode#10222) test: Fix test flake for Images landing page test (linode#10267) fix: [M3-7824] - ACLB TCP Rule Creation and other fixes (linode#10264) refactor: [M3-7687] - Linodes Restricted User Experience 2/2 (linode#10227) test: Resolve OBJ create and delete E2E test flake (linode#10245) upcoming: [M3-7723] - Placement Group feature flag as object (linode#10256) chore(deps): Bump sanitize-html from 2.11.0 to 2.12.1 (linode#10247) change: [M3-7813] - Allow the disabling of the TypeToConfirm input (linode#10251) upcoming: [M3-7839] - Change Business Partner to Parent User (linode#10259) upcoming: [M3-7835] - Adjust user table column count (linode#10252) upcoming: [M3 7738] - Update Placement Group Create & Edit Drawers (linode#10205) refactor: [M3-7437] - Use `@lukemorales/query-key-factory` for Profile Queries (linode#10241) fix: React Query `updateInPaginatedStore` helper function not working as expected (linode#10249) test: [M3-7497] - Add tests for child user verification banner (linode#10204) ... # Conflicts: # packages/manager/src/MainContent.tsx # packages/manager/src/dev-tools/FeatureFlagTool.tsx
Description 📝
We learned on the backend that
company
may benull
for some users, even if they payByAkamai. (Though awaiting final confirmation that this won't change going forward and can be retroactively applied to parent/child accounts when the relationship made on the backend.) Assuming company can still benull
, we won't always be able to display the company under the helper text "You are currently logged in as:" in the user menu dropdown for parent and proxy users.This PR falls back on username in those cases, so we are no longer rendering an empty string in the UserMenu dropdown and success toast.
UPDATE (3/4): Marked as Do Not Merge and Requires Changes because:
UPDATE (3/8): Reopening this PR because we found a case where
company
is not available: when a restricted parent user has thechild_account_access
grant enabled (and therefore account-switching abilities) but does not have any Billing Access (account_access: null
) -- this means that are not authorized to accessaccount/
and retrieve thecompany
.Changes 🔄
UserMenu.test.tsx
to reflect this.Preview 📷
How to test 🧪
Prerequisites
child_account_access
(the grant isn't being returned correctly) to eliminate the final!isChildAccountAccessRestricted
check fromconst canSwitchBetweenParentOrProxyAccount
if you want the Switch Account button to show up.Reproduction steps
company
being an empty string if the conditional was false, and then displaying that empty string in the user menu and tooltip.Verification steps
yarn up
.With mocks:
null
company name. Confirm youruser_type
isparent
.user_type
ofproxy
.As an Author I have considered 🤔
Check all that apply