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

upcoming: [M3-7475] - Add Switch Account button to Account Landing page #10052

Merged

Conversation

mjac0bs
Copy link
Contributor

@mjac0bs mjac0bs commented Jan 10, 2024

Description 📝

This PR adds a convenient "Switch Account" button to the Account Landing page to allow an alternative and efficient way (aside from the user menu) to access the account switching drawer.

Changes 🔄

  • A 'Switch Account' button is now visible on the Billing Info tab of the Account Landing page for parent and proxy users

Preview 📷

Video
Screen.Recording.2024-01-10.at.10.48.49.AM.mov

Screenshot 2024-01-10 at 10 48 33 AM

How to test 🧪

Prerequisites

(How to setup test environment)

  • Check out this PR and yarn dev.
  • Turn the parent/child feature flag and mocks on.

Verification steps

(How to verify changes)

  • Go to http://localhost:3000/account/billing and observe the Switch Account button.
  • Click the button and observe that it opens and displays a list of child accounts. (By default, user_type is parent.)
  • Go to serverHandlers.ts and edit the account/users/:user request to the following in order to mock a proxy user:
  rest.get('*/account/users/:user', (req, res, ctx) => {
  // Parent/Child: switch the `user_type` depending on what account view you need to mock.
  return res(ctx.json(accountUserFactory.build({ user_type: 'proxy' })));
  }),
  • Confirm that clicking the button opens the drawer for a proxy user, and text includes a link back to parent account.
  • Toggle off feature flag and confirm parity with prod.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@mjac0bs mjac0bs self-assigned this Jan 10, 2024
@mjac0bs mjac0bs force-pushed the M3-7475-account-landing-switch-account-button branch from 9288741 to 0d33960 Compare January 11, 2024 18:21
@@ -55,6 +55,9 @@ describe('SwitchAccountDrawer', () => {

it('should display a list of child accounts', async () => {
server.use(
rest.get('*/account/users/*', (req, res, ctx) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small fix here - noticed that I hadn't mocked this request and so if the mock endpoint were to change in user_type in serverHandlers.ts, this test would fail.

@mjac0bs mjac0bs marked this pull request as ready for review January 11, 2024 18:34
@mjac0bs mjac0bs requested a review from a team as a code owner January 11, 2024 18:34
@mjac0bs mjac0bs requested review from dwiley-akamai and jaalah-akamai and removed request for a team January 11, 2024 18:34
@mjac0bs mjac0bs force-pushed the M3-7475-account-landing-switch-account-button branch from 0d33960 to be46234 Compare January 16, 2024 15:36
Copy link

github-actions bot commented Jan 16, 2024

Coverage Report:
Base Coverage: 79.84%
Current Coverage: 79.85%

@jaalah-akamai jaalah-akamai added the Add'tl Approval Needed Waiting on another approval! label Jan 17, 2024
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

"Switch Account" button visible for parent & proxy users ✅
Drawer for parent user lists child accounts ✅
Drawer for proxy user lists child accounts & has a link to switch back ✅
Improved tablet/mobile view ✅

@mjac0bs mjac0bs removed Add'tl Approval Needed Waiting on another approval! Ready for Review labels Jan 17, 2024
@mjac0bs mjac0bs added the Approved Multiple approvals and ready to merge! label Jan 17, 2024
@mjac0bs mjac0bs merged commit 6561b4a into linode:develop Jan 17, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Parent / Child Account
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants