-
Notifications
You must be signed in to change notification settings - Fork 367
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
upcoming: [M3-8840] - Add Cluster Type selection to LKE Create Cluster flow #11322
Merged
mjac0bs
merged 12 commits into
linode:develop
from
mjac0bs:M3-8840-add-cluster-type-section
Dec 2, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5435ca5
Display new Cluster Type panel in create flow when LKE-E is enabled
mjac0bs 1e1a2cc
Disable LKE-E card without the account capability
mjac0bs 3a3061e
Require feature enablement to create LKE-E cluster
mjac0bs 291802b
Fix divider margin
mjac0bs 6c6f4ec
Change placement of tooltip
mjac0bs 87bd21b
Improve responsive styling
mjac0bs 45942f0
Update useIsLkeEnterpriseEnabled hook test coverage
mjac0bs 0fd6a79
Add test coverage to lke-create.spec.ts
mjac0bs 151b1bf
Add changeset
mjac0bs c5e4ef3
Fix top margin of docs link
mjac0bs f207d66
Use the correct accountbeta query for the ClusterTypePanel
mjac0bs 20e8e20
clean up
hana-akamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,11 +51,10 @@ export const StyledFieldWithDocsStack = styled(Stack, { | |
})); | ||
|
||
export const StyledDocsLinkContainer = styled(Box, { | ||
label: 'StyledRegionSelectStack', | ||
label: 'StyledDocsLinkContainer', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes to use the same styling for both the cluster type and DC pricing docs links. |
||
})(({ theme }) => ({ | ||
alignSelf: 'flex-start', | ||
marginLeft: 'auto', | ||
marginTop: theme.spacing(2), | ||
[theme.breakpoints.down('md')]: { | ||
marginLeft: 'unset', | ||
marginTop: theme.spacing(2), | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Added this prop to be able to control the placement of the tooltip - it was covering the helper text and we could avoid that by placing elsewhere.