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

change: [M3-7996] - DC Get Well - PlanSelection availability updates and consolidation #10387

Merged
merged 16 commits into from
Apr 25, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Apr 18, 2024

Description 📝

This PR brings the latest changes to the PlanSelection panels on both the Linode and Kubernetes creation flows.
The diff is a bit larger than expected considering the need to refactor this portion of the code to allow for easier customization in the future. Both flows share very similar logic for rendering plan selection data, and identical logic for filtering unavailable and limited availability plans.

The logic implemented in this PR for the displaying of notices, disabled status and related tooltips is derived from the new requirements shown in the screenshots below:

1 2 3 4 5
DC Get Well User Story #5_2@2x DC Get Well User Story #5_3_Premium@2x DC_Get_well_User_Story5 _lessthanhalf@2x DC_Get_well_User_Story5 G_morethanhalf@2x DC_Get_well_User_Story5 G_morethanhalf@2x

Changes 🔄

List any change relevant to the reviewer.

  • Adjust RegionSelect tooltip copy
  • Limited Availability banners are now non-dismissible
  • Adjust table row disabled styles
    • make sure tooltip itself does not appear as disabled (lower opacity)
    • makes sure "greyed out" row treatment matches our disabled styles
  • Update & Consolidate limited availability/unavailable logic for all plans panels (see the "How to test" section for breakdown)
  • Add new e2e for PlanSelection covering both the Linode and Kubernetes creation flows

Target release date 🗓️

04/29/2024

Preview 📷

Screenshot 2024-04-23 at 10 53 20

How to test 🧪

Prerequisites

Verification steps

RegionSelect tooltip update
Best way i found to get a disabled RegionSelect item is on a newly created account (PROD)

  • Verify tooltip copy
  • Verify tooltip behavior

Plan Selection (both for Linode and Kubernetes flows)
rules:

  • always show an "unavailable" banner (red) if the whole plan panel is disabled. ex:
    • Newark, NJ => Premium CPU
    • Dallas, TX => GPU
  • always show a "limited availability" (yellow) notice if a plan panel has limited availability
    • Newark, NJ => Dedicated CPU (always have the 512Gb limited avail)
    • Newark, NJ => GPU
  • always show a tooltip if <= half of plans have limited availability
    • Newark, NJ => Dedicated CPU
  • never show a tooltip if more than half of plans have limited availability
    • Newark, NJ => GPU

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

@abailly-akamai abailly-akamai self-assigned this Apr 18, 2024
@abailly-akamai abailly-akamai added the DC Get Well Relating to the DC Get Well project label Apr 18, 2024
@abailly-akamai abailly-akamai changed the title change: [M3-7996] - DC Get Well phase 2 updates change: [M3-7996] - DC Get Well - PlanSelection updates and consolidatio Apr 23, 2024
@abailly-akamai abailly-akamai changed the title change: [M3-7996] - DC Get Well - PlanSelection updates and consolidatio change: [M3-7996] - DC Get Well - PlanSelection updates and consolidation Apr 23, 2024
@abailly-akamai abailly-akamai changed the title change: [M3-7996] - DC Get Well - PlanSelection updates and consolidation change: [M3-7996] - DC Get Well - PlanSelection availability updates and consolidation Apr 23, 2024
@abailly-akamai abailly-akamai marked this pull request as ready for review April 23, 2024 15:47
@abailly-akamai abailly-akamai requested review from a team as code owners April 23, 2024 15:47
@abailly-akamai abailly-akamai requested review from jdamore-linode, dwiley-akamai and carrillo-erik and removed request for a team April 23, 2024 15:48
*
* TODO: Cypress
* Move this to cypress component testing once the setup is complete - see https://github.com/linode/manager/pull/10134
*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jdamore-linode added a TODO for both since they are candidates, even if unrelated to this PR

});
});
});
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to be as detailed as possible including comments so the the logic is very clear for people coming in to modify anything

),
reason:
'This region is currently unavailable. For help, open a support ticket.',
tooltipWidth: 250,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To allow for copy not to wrap

theme.palette.mode === 'dark'
? theme.color.grey6
: theme.color.disabledText,
theme.palette.mode === 'dark' ? theme.color.grey6 : theme.color.grey1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those changes allow the tootip not to be "buried" in the disable state and show as active while the row isn't

Copy link

github-actions bot commented Apr 23, 2024

Coverage Report:
Base Coverage: 81.86%
Current Coverage: 81.82%

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

  • Verified changes against prod
  • Extracting shared logic is a big improvement
  • One code suggestion

Thanks for including E2Es. Approved pending review of one suggestion.

Comment on lines +77 to +88
const {
allDisabledPlans,
hasDisabledPlans,
hasMajorityOfPlansDisabled,
plansForThisLinodeTypeClass,
} = extractPlansInformation({
disableLargestGbPlans: flags.disableLargestGbPlans,
disabledPlanTypes: [],
plans: plansMap,
regionAvailabilities,
selectedRegionId,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this down into KubernetesPlanContainer to save one level of prop drilling?

Copy link
Contributor Author

@abailly-akamai abailly-akamai Apr 24, 2024

Choose a reason for hiding this comment

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

@hkhalil-akamai yes, this was considered but both <PlanInformation /> & <PlanContainer /> consume data from this util so it has to sit here to avoid redundancy

Comment on lines +137 to +148
const {
allDisabledPlans,
hasDisabledPlans,
hasMajorityOfPlansDisabled,
plansForThisLinodeTypeClass,
} = extractPlansInformation({
disableLargestGbPlans: flags.disableLargestGbPlans,
disabledPlanTypes,
plans: plansMap,
regionAvailabilities,
selectedRegionId: selectedRegionID,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above: can we move this down into PlanContainer to save one level of prop drilling?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same comment

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.

RegionSelect tooltip update ✅

For Linode, LKE, and Database plan panels:

  • always show an "unavailable" banner (red) if the whole plan panel is disabled ✅
  • always show a "limited availability" (yellow) notice if a plan panel has limited availability ✅
  • always show a tooltip if <= half of plans have limited availability ✅
  • never show a tooltip if more than half of plans have limited availability ✅

To confirm, we're totally moving away from Learn more about plans and availability. even when only one plan is disabled?

This branch Prod
Screenshot 2024-04-24 at 12 15 14 PM Screenshot 2024-04-24 at 12 15 11 PM

// Dedicated CPU tab
// Should be selected/open by default
// Should have the limited availability notice
// Should contains 4 plans (5 rows including the header row)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Should contains 4 plans (5 rows including the header row)
// Should contain 4 plans (5 rows including the header row)

(typo correction applies to the equivalent comment for each case)

</>
),
reason:
'This region is currently unavailable. For help, open a support ticket.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we moving away from the general convention of having open a support ticket linkified?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, no more links in tooltips from what I understand

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Functionality looks good as far as I was able to test!

<Link to={docsLink}>Learn more</Link> about our {planTypeLabel} plans.
</StyledNoticeTypography>
</Notice>
) : null;
Copy link
Member

Choose a reason for hiding this comment

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

Should this component return null? Could we move the null return to LimitedAvailabilityNotice?

It is actually belongs here, can we do

if (!hasDisabledPlans) {
  return null;
}

for readability

@bnussman-akamai bnussman-akamai added the Approved Multiple approvals and ready to merge! label Apr 24, 2024
@abailly-akamai abailly-akamai merged commit 16d2b7c into linode:develop Apr 25, 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! DC Get Well Relating to the DC Get Well project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants