Eligibility warnings: show only the blocking notice when a transfer is in progress - #113952
Eligibility warnings: show only the blocking notice when a transfer is in progress#113952bcotrim wants to merge 2 commits into
Conversation
|
WordPress.com
Automattic for Agencies
|
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~277 bytes removed 📉 [gzipped]) Details
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. 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. |
|
I'm reviewing this now, fyi |
fredrikekelund
left a comment
There was a problem hiding this comment.
First and foremost: I tested this, and it fixes the issue 👍
However, looking at the code made me confused. The hold list is being used for several different purposes at different levels. It's filtered, it's searched for blocking holds, it's used for conditional rendering both in the EligibilityWarnings parent and the HardBlockingNotice child.
The way I read it, there are a few things making the logic unnecessarily complex right now:
- There's a legacy assumption about plans below Business not supporting plugins, which is no longer true. I assume this means the API just no longer returns
NO_BUSINESS_PLANfor those sites. We probably leave the core front-end logic as is, but the naming does add confusion, IMO. - The relationship between
HardBlockingNoticeandHoldListis unclear. I asked if we should only ever render one at a time, but that's quite hard to decipher right now. - We changed
EligibilityWarningsto only renderHardBlockingNoticeifhasValidBlockingHoldis true. However, insideHardBlockingNotice, the first thing we do is invert that logic and returnnullis it's true. We should conditionally render this component either outside or inside (the right answer is probably outside). - We only render
HoldListif! hasValidBlockingHold. Do we still need to also construct and checkfilteredHold..? It looks kind of redundant to me, even if it's difficult to say for sure from the code alone.
| { ! isPlaceholder && context === 'plugin-details' && hasBlockingHold( listHolds ) && ( | ||
| { ! isPlaceholder && hasValidBlockingHold && ( | ||
| <CompactCard> | ||
| <HardBlockingNotice |
There was a problem hiding this comment.
Are HardBlockingNotice and HoldList supposed to ever render side by side?
Fixes DOTDEV-444
Proposed Changes
TRANSFER_ALREADY_EXISTSwhile an Atomic transfer is running), render only the blocking notice and the support link — the dimmed "To continue you'll need to:" hold list and the disabled Continue button are no longer shown.plugin-details.hold-list.tsxand theeligibility-warnings__hold-list-dimstyles; add spacing between the notice and the support link.Why are these changes being made?
Testing Instructions
Regression checks:
blocked_atomic_transferhold → error notice with "Contact us", no Continue button.transfer_already_exists+no_business_plan) → unchanged: upgrade hold list with enabled "Upgrade and continue".Pre-merge Checklist