-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Plans Grid: fix default state of storage dropdown when an addon is purchased #99310
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~11 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~11 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
TestingRequirements
Browsers
|
const selectControlOptions = [ defaultStorageItem ].concat( | ||
availableStorageAddOns?.map( ( addOn ) => { | ||
const addOnStorage = addOn.quantity ?? 0; | ||
return [ defaultStorageAddOnMeta, ...availableStorageAddOns ]?.map( ( addOn ) => { |
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.
NB:
A little confusing for me to read the destructuring of AddOnMeta
with AddOns
. Not a strong opinion, but thoughts about renaming to defaultStorageAddOnMeta
to defaultStorageAddOn
?
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.
Hmm, I named it because getSelectedStorageAddOn
returns AddOnMeta
. 🤔 It is a bit confusing because the value of defaultStorageAddOnMeta
can also be { addOnSlug: defaultStorageOptionSlug, prices: null, quantity: 0 }
, which is clearly not AddOnMeta
. I'll try to refactor this to make it clearer.
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.
Done via 4cfe287! Hope it's clearer now.
Related to #
Proposed Changes
Before
Kapture.2025-02-04.at.17.28.57.mp4
After
Kapture.2025-02-04.at.17.29.33.mp4
Why are these changes being made?
Testing Instructions
Go to
/add-ons/<site slug>
for a site a site on the Business plan and purchase a storage add-on.Go to
/plans/<site slug>
for the same site.Confirm that the default value in the storage dropdown in the spotlight card is the (plan storage (50GB) + the purchased storage add-on quantity).
Confirm that selecting a different option changes the CTA text to "Upgrade".
Confirm that selecting the default option changes the CTA text to "Manage Plan".
Go to
/setup/onboarding/plans
and confirm that the dropdown works as intended.Pre-merge Checklist