Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/api-v4/src/regions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type Capabilities =
| 'Distributed Plans'
| 'GPU Linodes'
| 'Kubernetes'
| 'Kubernetes Enterprise'
| 'Linodes'
| 'Managed Databases'
| 'Metadata'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Update Region Select for LKE-Enterprise ([#11348](https://github.com/linode/manager/pull/11348))
30 changes: 30 additions & 0 deletions packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,18 @@ describe('LKE Cluster Creation with LKE-E', () => {
capabilities: ['Kubernetes Enterprise'],
})
).as('getAccount');
mockGetRegions([
regionFactory.build({
capabilities: ['Linodes', 'Kubernetes'],
id: 'us-east',
label: 'Newark, US',
}),
regionFactory.build({
capabilities: ['Linodes', 'Kubernetes', 'Kubernetes Enterprise'],
id: 'us-iad',
label: 'Washington, DC',
}),
]).as('getRegions');

cy.visitWithLogin('/kubernetes/clusters');

Expand Down Expand Up @@ -904,6 +916,24 @@ describe('LKE Cluster Creation with LKE-E', () => {
// Confirm HA section is hidden since LKE-E includes HA by default
cy.findByText('HA Control Plane').should('not.exist');

cy.wait(['@getRegions']);

// Confirm unsupported regions are not displayed
ui.regionSelect.find().click().type('Newark, NJ');
ui.autocompletePopper.find().within(() => {
cy.findByText('Newark, NJ (us-east)').should('not.exist');
});

// Select a supported region
ui.regionSelect.find().clear().type('Washington, DC{enter}');

// Confirm that there is a tooltip explanation for the region dropdown options
ui.tooltip
.findByText(
'Only regions that support Kubernetes Enterprise are listed.'
)
.should('be.visible');

// TODO: finish the rest of this test in subsequent PRs
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const RegionSelect = <
}}
sx={(theme) => ({
[theme.breakpoints.up('md')]: {
width: '416px',
maxWidth: tooltipText ? '458px' : '416px',
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the culprit here... putting out a PR

},
})}
textFieldProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,22 @@ export const CreateCluster = () => {
<StyledFieldWithDocsStack>
<Stack>
<RegionSelect
currentCapability={
isLkeEnterpriseLAFeatureEnabled &&
selectedTier === 'enterprise'
? 'Kubernetes Enterprise'
: 'Kubernetes'
}
textFieldProps={{
helperText: <RegionHelperText mb={2} />,
helperTextPosition: 'top',
}}
currentCapability="Kubernetes"
tooltipText={
isLkeEnterpriseLAFeatureEnabled &&
selectedTier === 'enterprise'
? 'Only regions that support Kubernetes Enterprise are listed.'
: undefined
}
disableClearable
errorText={errorMap.region}
onChange={(e, region) => setSelectedRegionId(region.id)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const getLinodeCreateResolver = (
}

const regions = await queryClient.ensureQueryData(regionQueries.regions);

const selectedRegion = regions.find((r) => r.id === values.region);

const hasSelectedAnEURegion = isEURegion(
Expand Down
5 changes: 2 additions & 3 deletions packages/ui/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ export const TextField = (props: TextFieldProps) => {
{helperText && helperTextPosition === 'top' && (
<FormHelperText
sx={{
marginBottom: theme.spacing(),
marginTop: theme.spacing(),
marginTop: 0,
}}
data-qa-textfield-helper-text
>
Expand Down Expand Up @@ -371,7 +370,7 @@ export const TextField = (props: TextFieldProps) => {
sx={{
marginTop: 0,
...(Boolean(tooltipText) && {
width: '415px',
width: '416px',
}),
...props.sx,
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/foundations/themes/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ export const lightTheme: ThemeOptions = {
},
fontSize: '0.875rem',
lineHeight: 1.25,
maxWidth: 415,
maxWidth: 416,
},
},
},
Expand Down