Skip to content

Commit 7c026eb

Browse files
Fix:[DI-29006] - Alignment for region filter in lke (#13218)
* upcoming: [DI-29006] - fix alignment for region filter in lke * upcoming: [DI-29006] - use better prop * upcoming: [DI-29006] - use theme * upcoming: [DI-29006] - use input_label_props * upcoming: [DI-29006] - Add changeset
1 parent 677db9c commit 7c026eb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
CloudPulse-Metrics: Fix alignment for region filter in lke service. ([#13218](https://github.com/linode/manager/pull/13218))

packages/manager/src/features/CloudPulse/shared/CloudPulseRegionSelect.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { filterRegionByServiceType } from '../Alerts/Utils/utils';
1010
import {
1111
NO_REGION_MESSAGE,
1212
PARENT_ENTITY_REGION,
13+
REGION,
1314
RESOURCE_FILTER_MAP,
1415
} from '../Utils/constants';
1516
import { filterUsingDependentFilters } from '../Utils/FilterBuilder';
@@ -19,6 +20,7 @@ import { CLOUD_PULSE_TEXT_FIELD_PROPS } from './styles';
1920

2021
import type { CloudPulseMetricsFilter } from '../Dashboard/CloudPulseDashboardLanding';
2122
import type { Dashboard, FilterValue, Region } from '@linode/api-v4';
23+
import type { Theme } from '@linode/ui';
2224

2325
export interface CloudPulseRegionSelectProps {
2426
defaultValue?: FilterValue;
@@ -153,6 +155,9 @@ export const CloudPulseRegionSelect = React.memo(
153155
dependencyKey, // Reacts to region changes
154156
]);
155157

158+
// Add spacing for region filter in LKE service to align with Clusters filter that has tooltip
159+
const shouldAddSpacing = serviceType === 'lke' && filterKey === REGION;
160+
156161
return (
157162
<RegionSelect
158163
currentCapability={capability}
@@ -193,7 +198,16 @@ export const CloudPulseRegionSelect = React.memo(
193198
}}
194199
placeholder={placeholder ?? 'Select a Region'}
195200
regions={supportedRegionsFromResources}
196-
textFieldProps={{ ...CLOUD_PULSE_TEXT_FIELD_PROPS }}
201+
textFieldProps={{
202+
...CLOUD_PULSE_TEXT_FIELD_PROPS,
203+
...(shouldAddSpacing && {
204+
InputLabelProps: {
205+
sx: (theme: Theme) => ({
206+
marginBottom: theme.spacingFunction(4),
207+
}),
208+
},
209+
}),
210+
}}
197211
value={
198212
supportedRegionsFromResources?.length
199213
? (selectedRegion ?? null)

0 commit comments

Comments
 (0)