-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upcoming: [M3-8840] - Add Cluster Type selection to LKE Create Cluste…
…r flow (#11322) * Display new Cluster Type panel in create flow when LKE-E is enabled * Disable LKE-E card without the account capability * Require feature enablement to create LKE-E cluster * Fix divider margin * Change placement of tooltip * Improve responsive styling * Update useIsLkeEnterpriseEnabled hook test coverage * Add test coverage to lke-create.spec.ts * Add changeset * Fix top margin of docs link * Use the correct accountbeta query for the ClusterTypePanel * clean up --------- Co-authored-by: Hana Xu <hxu@akamai.com>
- Loading branch information
1 parent
b39d3e7
commit 35fffca
Showing
9 changed files
with
279 additions
and
34 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-11322-upcoming-features-1732570083227.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Add Cluster Type section to Create Cluster flow for LKE-E ([#11322](https://github.com/linode/manager/pull/11322)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
packages/manager/src/features/Kubernetes/CreateCluster/ClusterTypePanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { Stack } from '@linode/ui'; | ||
import { Typography, useMediaQuery } from '@mui/material'; | ||
import React from 'react'; | ||
|
||
import { DocsLink } from 'src/components/DocsLink/DocsLink'; | ||
import { SelectionCard } from 'src/components/SelectionCard/SelectionCard'; | ||
import { useAccountBeta } from 'src/queries/account/account'; | ||
|
||
import { StyledDocsLinkContainer } from './CreateCluster.styles'; | ||
|
||
import type { KubernetesTier } from '@linode/api-v4'; | ||
import type { Theme } from '@mui/material/styles'; | ||
|
||
interface Props { | ||
handleClusterTypeSelection: (tier: KubernetesTier) => void; | ||
selectedTier: KubernetesTier; | ||
} | ||
|
||
export const ClusterTypePanel = (props: Props) => { | ||
const { handleClusterTypeSelection, selectedTier } = props; | ||
|
||
const { data: account } = useAccountBeta(); | ||
|
||
const mdDownBreakpoint = useMediaQuery((theme: Theme) => | ||
theme.breakpoints.down('md') | ||
); | ||
const smDownBreakpoint = useMediaQuery((theme: Theme) => | ||
theme.breakpoints.down('sm') | ||
); | ||
|
||
const isLkeEnterpriseSelectionDisabled = !account?.capabilities?.includes( | ||
'Kubernetes Enterprise' | ||
); | ||
|
||
return ( | ||
<Stack> | ||
<Stack flexDirection={mdDownBreakpoint ? 'column' : 'row'}> | ||
<Stack> | ||
<Typography variant="h3">Cluster Type</Typography> | ||
<Typography sx={{ marginTop: 1, maxWidth: 700 }}> | ||
Choose from a managed solution for smaller deployments or enterprise | ||
grade clusters with enhanced ingress, networking, and security. | ||
</Typography> | ||
</Stack> | ||
<StyledDocsLinkContainer> | ||
<DocsLink href="/" label="Full Cluster Features" /> | ||
</StyledDocsLinkContainer> | ||
</Stack> | ||
|
||
<Stack | ||
flexDirection={smDownBreakpoint ? 'column' : 'row'} | ||
gap={2} | ||
marginTop={2} | ||
> | ||
<SelectionCard | ||
subheadings={[ | ||
'Up to 250 nodes, 1000 pods', | ||
'Shared control plane', | ||
'HA control plane (optional)', | ||
]} | ||
checked={selectedTier === 'standard'} | ||
heading="LKE" | ||
onClick={() => handleClusterTypeSelection('standard')} | ||
/> | ||
<SelectionCard | ||
subheadings={[ | ||
'Up to 500 nodes, 5000 pods', | ||
'Dedicated control plane', | ||
'HA control plane (included)', | ||
]} | ||
tooltip={ | ||
isLkeEnterpriseSelectionDisabled | ||
? 'LKE Enterprise is not currently enabled on this contract. To inquire, fill out the Cloud Computing Sales form or email sales@linode.com.' | ||
: undefined | ||
} | ||
checked={selectedTier === 'enterprise'} | ||
disabled={isLkeEnterpriseSelectionDisabled} | ||
heading="LKE Enterprise" | ||
onClick={() => handleClusterTypeSelection('enterprise')} | ||
tooltipPlacement={smDownBreakpoint ? 'bottom' : 'right'} | ||
/> | ||
</Stack> | ||
</Stack> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.