change: [M3-8000] - GPUv2 Plan Divider & PlanSelection cleanup #10407
change: [M3-8000] - GPUv2 Plan Divider & PlanSelection cleanup #10407abailly-akamai merged 16 commits intolinode:developfrom
Conversation
ffd352b to
0a71f39
Compare
| // Should have one disabled plan | ||
| // Should have tooltip for the disabled plan (more than half disabled plans in the panel, but only one plan) | ||
| fbtClick('High Memory'); | ||
| cy.findByText('High Memory').click(); |
There was a problem hiding this comment.
fbtClick is now marked as deprecated
| <CardBaseHeading | ||
| className="cardSubheadingTitle" | ||
| data-qa-select-card-heading={heading} | ||
| > |
There was a problem hiding this comment.
These changes help with the styling of the disabled selection card, allowing non string items to not suffer fro the opacity change
| <StyledPlansPanel | ||
| disableSmallerPlans={{ | ||
| selectedDiskSize: currentPlanDisk, | ||
| }} |
There was a problem hiding this comment.
The reasons for nesting this property are:
- being very explicit on what the prop achieves (before this change,
selectedDiskSizewas employed to disable smaller plans and it was not clear at all - Allowing more conditions to be passed as the logic needs some finesse (working with the dbaas team to sort them out - see M3-8057)
| }, | ||
| ], | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
Main logic for declaring plan panel splitting. It was made to be dynamic to more items can be added to the array as we're gearing up towards more granularity in our selection plans in the next few weeks/months.
At the moment, without added API support, the only logic we split plans is to do string matching on the label, per plan type (including a way to turn this off via feature flag). Considering the slow rollout of such family plans, it has been the accepted hard coded solution on both the product and engineering side for the time being.
| selectedId?: string; | ||
| selectedRegionId?: Region['id']; | ||
| showTransfer?: boolean; | ||
| type: PlanSelectionType; |
There was a problem hiding this comment.
type was really ambiguous here, since planType usually refers to a plan "family". renamed to plan for code clarity since that's what it refers to. It has actually helped me with the refactor
| text={tooltip} | ||
| tooltipPosition="right" | ||
| /> | ||
| )} |
There was a problem hiding this comment.
Both tooltips consolidated in one - was kind of a mess
| </TableBody> | ||
| </StyledTable> | ||
| ); | ||
| }; |
There was a problem hiding this comment.
new component to separate concern
| data-qa-plan-row={type.formattedLabel} | ||
| disabled={rowIsDisabled} | ||
| key={type.id} | ||
| onClick={() => (!rowIsDisabled ? onSelect(type.id) : undefined)} |
There was a problem hiding this comment.
The reason for this change is to prevent applying aria-labels on non-interactive elements (more info documented in M3-8045, which will be a follow up PR) and have the interactive elements within the table row carrying that assistive information instead.
Some screen-readers don't even register aria-labels on non-interactive elements and in general are agreed to add more confusion than context. Cloud Manager in general needs work towards reducing this unwanted friction.
…lanSelection components
|
Coverage Report: ✅ |
| } | ||
|
|
||
| interface gpuV2 { | ||
| planDivider: boolean; |
There was a problem hiding this comment.
Are other properties planned for the feature flag?
There was a problem hiding this comment.
There will a string change there will be hence the payload. If not, it's quite ok to have it a JSON flag anyway?
| export const SMALLER_PLAN_DISABLED_COPY = | ||
| 'Resizing to smaller plans is not supported'; | ||
| export const PLAN_NOT_AVAILABLE_IN_REGION_COPY = | ||
| "This plan isn't available for the selected region"; |
There was a problem hiding this comment.
Should these end with periods to be consistent with the others?
There was a problem hiding this comment.
agreed - done!
| planBelongsToDisabledClass, | ||
| planHasLimitedAvailability, | ||
| planIsDisabled512Gb, | ||
| planIsTooSmall: false, |
There was a problem hiding this comment.
Does disabling based on planIsTooSmall only apply to DBaaS? If so, might be worth commenting here to specify why we're setting this to false
| <TableBody role="radiogroup"> | ||
| {shouldDisplayNoRegionSelectedMessage ? ( | ||
| <TableRowEmpty | ||
| colSpan={9} |
There was a problem hiding this comment.
We can do tableCells.length instead of hardcoding the colSpan
|
@jaalah-akamai this |
dwiley-akamai
left a comment
There was a problem hiding this comment.
GPU tab changes with no regressions observed on other tabs or Kubernetes or DBaaS Create flows ✅
Tests pass ✅
Code review ✅

Description 📝
This PR has two separate goals:
There may be more follow up as new features build on our Plan Selection interfaces, but this refactor will help much in reducing the barrier to doing so.
Changes 🔄
gpuv2feature flag to control Divider for GPU plansExtendedTypesto include props tied to plan disabled stateTarget release date 🗓️
5/13/2024
Preview 📷
The major visual change resulting from this PR is the Table divider feature shown below
Another changes include the Card chip opacity (opacity for copy but not "Limited Development Availability" chip
How to test 🧪
Verification steps
ℹ️ Using ALPHA (the new "Ada" plans are only returned there at the moment)
ℹ️ The new
gpuv2flag isONin development only and I didn't add it to the dev tools as it did not seem the switching feature was important here.As an Author I have considered 🤔
Check all that apply