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-9008] Improve Close Account UI #11469

Merged
merged 23 commits into from
Jan 8, 2025

Conversation

jaalah-akamai
Copy link
Contributor

@jaalah-akamai jaalah-akamai commented Jan 2, 2025

Description 📝

We've updated our account closure confirmation dialog to clearly explain this permanent action. This includes clearer warnings, confirmation checkboxes for service/user deletion, and updated the Close Account button styling.

Changes 🔄

  • Added E2E tests to confirm new behavior 🧪 cc: @jdamore-linode
  • Added reversePrimaryButtonPosition prop to ActionsPanel component to support the new design's button layout (primary left, secondary right)
  • Changed type-to-confirm to use email instead of username
  • Added new storybook for color="warning"
  • Updated Button component to allow for new color and added some maps for scalability
  • Added a loading variant to MuiButton theme 🎨

Target release date 🗓️

01/14/2025 (Next Release)

Preview 📷

Before After
cloud linode com_account_settings 01
Light Mode Dark Mode
01 01-dark
Must meet criteria 02 Must meet criteria 02-dark
Active localhost_3000_oauth_callback Active localhost_3000_oauth_callback (1)
Active w/ Button Hover 03 Active w/ Button Hover localhost_3000_oauth_callback (2)

How to test 🧪

Prerequisites

  • Checkout branch or view preview link

Reproduction steps

  • Go to /account/settings
  • Click on Close Account

Verification steps

  • Ensure close account button is disabled unless both checkboxes and type-to-confirm has been filled out
  • Confirm styles look good in both light/dark mode
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 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


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@jaalah-akamai
Copy link
Contributor Author

Screenshot 2025-01-02 at 8 33 11 PM

@jaalah-akamai jaalah-akamai marked this pull request as ready for review January 3, 2025 01:36
@jaalah-akamai jaalah-akamai requested review from a team as code owners January 3, 2025 01:36
@jaalah-akamai jaalah-akamai requested review from jdamore-linode, hana-akamai and coliu-akamai and removed request for a team January 3, 2025 01:36
onChange: (value: string) => void;
textFieldStyle?: React.CSSProperties;
title?: string;
typographyStyle?: React.CSSProperties;
typographyStyleSx?: SxProps<Theme>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typographyStyle must've been old. typographyStyleSx is a lot better.

confirmText: '',
services: false,
users: false,
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tossed validation into a state object - RHF seemed overkill

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will follow up with a PR to convert this to RHF afterwards

const isTextConfirmationValid = deleteAccount.confirmText === entity.name;
const isCloseAccount = entity.subType === 'CloseAccount';
const isCloseAccountValid =
!isCloseAccount || (deleteAccount.services && deleteAccount.users);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hoping to provide some better readability with these

hideInstructions: false,
placeholder: '',
};
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noticed these props were all based on the CloseAccount subtype

<ActionsPanel
{...getButtonProps()}
reversePrimaryButtonPosition
style={{ padding: 0 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept this, but could probably be moved to maybe?

outlined: 'outlined',
primary: 'contained',
secondary: 'contained',
} as const;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The maps will help if we need more variants or colors

spacingBottom !== undefined ? `${spacingBottom}px` : theme.spacing(3),
marginLeft: spacingLeft !== undefined ? `${spacingLeft}px` : 0,
marginTop: spacingTop !== undefined ? `${spacingTop}px` : 0,
sx,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This sx prop did not accept styles passed down that used theme. So I fixed this 🐛

packages/ui/src/foundations/themes/dark.ts Outdated Show resolved Hide resolved
interface ButtonPropsVariantOverrides {
loading: true;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't forsee us doing this much, but we may once we start going deep with CDS

Copy link

github-actions bot commented Jan 3, 2025

Coverage Report:
Base Coverage: 86.94%
Current Coverage: 86.98%

packages/ui/src/components/Button/Button.stories.tsx Outdated Show resolved Hide resolved
packages/ui/src/components/Button/Button.tsx Outdated Show resolved Hide resolved
packages/ui/src/components/Button/Button.stories.tsx Outdated Show resolved Hide resolved
packages/ui/src/foundations/themes/dark.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

With type-to-confirm disabled, there's no way to close the account and no explanation for why the button is disabled.

I thought in the past, this field was independent of the TTC profile setting but looks like that's not the case anymore 🤔. I think we should always show the TTC input for the close account dialog regardless of user setting

@jaalah-akamai
Copy link
Contributor Author

Thanks @hana-akamai should be enforced now

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 0 passing tests on test run #9 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing0 Passing0 Skipped0s

Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

Looks like there's some failing unit tests

Can we also add a test to check that the TTC input is still displayed for account cancellation when the user has the setting enabled?

packages/manager/cypress/support/constants/account.ts Outdated Show resolved Hide resolved
packages/ui/src/components/Button/Button.tsx Outdated Show resolved Hide resolved
@jaalah-akamai
Copy link
Contributor Author

@hana-akamai It saw that it had to do with the new usePreferences hook we just added. Either way I fixed them, thanks!

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

seeing a small visual regression in other TTC dialogs' textfields:

local prod
image image

jaalah-akamai and others added 3 commits January 7, 2025 14:15
….spec.ts

Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>
….spec.ts

Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>
….spec.ts

Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>
@jaalah-akamai
Copy link
Contributor Author

seeing a small visual regression in other TTC dialogs' textfields:

@coliu-akamai Sorry for not pointing that out, the fields will span full width now by default

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Looks great, nice to have these extra safeguards! Test improvements look great too, thanks @jaalah-akamai!

Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

Looks good! Can we merge develop in and make sure tests are passing before merging?

@hana-akamai hana-akamai added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Jan 8, 2025
Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

dialog text field widths looking good for the dialogs that were pushed up ✅ (+ potential follow up pr for the rest)

thank you!

@jaalah-akamai jaalah-akamai merged commit 3511734 into linode:develop Jan 8, 2025
21 of 23 checks passed
Copy link

cypress bot commented Jan 8, 2025

Cloud Manager E2E    Run #7057

Run Properties:  status check failed Failed #7057  •  git commit 3511734c87: upcoming: [M3-9008] Improve Close Account UI (#11469)
Project Cloud Manager E2E
Branch Review develop
Run status status check failed Failed #7057
Run duration 13m 30s
Commit git commit 3511734c87: upcoming: [M3-9008] Improve Close Account UI (#11469)
Committer Jaalah Ramos
View all properties for this run ↗︎

Test results
Tests that failed  Failures 36
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 438
View all changes introduced in this branch ↗︎

Tests for review

Failed  databases/resize-database.spec.ts • 6 failed tests

View Output Video

Test Artifacts
Resizing existing clusters > Resizes a g6-standard-6 MySQL v8.x 3-node cluster (legacy DBaaS) > Can resize active database clusters Screenshots Video
Resizing existing clusters > Resizes a g6-standard-6 MySQL v8.x 3-node cluster (legacy DBaaS) > Can resize active database clusters from g6-standard-6 type and switch plan type Screenshots Video
Resizing existing clusters > Resizes a g6-standard-6 MySQL v8.x 3-node cluster (legacy DBaaS) > Cannot resize database clusters while they are not in active state Screenshots Video
Resizing existing clusters > Resizes a g6-dedicated-16 MySQL v5.x 3-node cluster (legacy DBaaS) > Can resize active database clusters Screenshots Video
Resizing existing clusters > Resizes a g6-dedicated-16 MySQL v5.x 3-node cluster (legacy DBaaS) > Can resize active database clusters from g6-dedicated-16 type and switch plan type Screenshots Video
Resizing existing clusters > Resizes a g6-dedicated-16 MySQL v5.x 3-node cluster (legacy DBaaS) > Cannot resize database clusters while they are not in active state Screenshots Video
Failed  objectStorage/object-storage.e2e.spec.ts • 2 failed tests

View Output Video

Test Artifacts
object storage end-to-end tests > can create and delete object storage buckets Screenshots Video
object storage end-to-end tests > can upload, access, and delete objects Screenshots Video
Failed  objectStorageGen2/bucket-create-gen2.spec.ts • 4 failed tests

View Output Video

Test Artifacts
Object Storage Gen2 create bucket tests > can create a bucket with E0 endpoint type Screenshots Video
Object Storage Gen2 create bucket tests > can create a bucket with E1 endpoint type Screenshots Video
Object Storage Gen2 create bucket tests > can create a bucket with E2 endpoint type Screenshots Video
Object Storage Gen2 create bucket tests > can create a bucket with E3 endpoint type Screenshots Video
Failed  linodes/smoke-delete-linode.spec.ts • 4 failed tests

View Output Video

Test Artifacts
delete linode > deletes linode from linode details page Screenshots Video
delete linode > deletes linode from setting tab in linode details page Screenshots Video
delete linode > deletes linode from linode landing page Screenshots Video
delete linode > deleting multiple linodes with action menu Screenshots Video
Failed  vpc/vpc-landing-page.spec.ts • 2 failed tests

View Output Video

Test Artifacts
VPC landing page > can update and delete VPCs from VPC landing page Screenshots Video
VPC landing page > cannot delete a VPC with linodes assigned to it Screenshots Video

The first 5 failed specs are shown, see all 13 specs in Cypress Cloud.

dmcintyr-akamai pushed a commit to dmcintyr-akamai/manager that referenced this pull request Jan 9, 2025
* upcoming: [M3-9008] Improve Close Account UI

* Add changesets

* Update e2e test to cover parent/child

* More cleanup

* Change warning to error and update variants/colors

* Enforce type-to-confirm for close account

* Small revert

* Revision

* Text updates to title, warning, comment blurb

* Expand comments section full width - allow this prop to be set

* Fix unit tests due to usePreference updates - remove loading variant

* Update packages/manager/cypress/e2e/core/account/account-cancellation.spec.ts

Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>

* Update packages/manager/cypress/e2e/core/account/account-cancellation.spec.ts

Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>

* Update packages/manager/cypress/e2e/core/account/account-cancellation.spec.ts

Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>

* Update state variable name @coliu-akamai

* Allow expand to be passed for deletionDialogs

* Expand all delete type-to-confirms @coliu-akamai

* more deletion dialogs

* Few more dialogs

---------

Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
Co-authored-by: Connie Liu <139280159+coliu-akamai@users.noreply.github.com>
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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants