Skip to content

Commit 10bfefb

Browse files
upcoming: [DI-28504] - Add tooltip for clusters filter in lke and fix preferences bug in nodebalancers filter (#13141)
* upcoming: [DI-28504] - Add tooltip for clusters filter in lke * upcoming: [DI-28504] - Update test case * upcoming: [DI-28504] - Fix nodebalancers preferences bug * upcoming: [DI-28504] - Remove typo * upcoming: [DI-28504] - Add changeset --------- Co-authored-by: venkatmano-akamai <[email protected]>
1 parent 47f0958 commit 10bfefb

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
CloudPulse-Metrics: Add tooltip for clusters filter in lke and fix preferences bug for nodebalancers filter in firewall-nodebalancer dashboard ([#13141](https://github.com/linode/manager/pull/13141))

packages/manager/src/features/CloudPulse/Utils/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ export const INTERFACE_IDS_LIMIT_ERROR_MESSAGE =
9191

9292
export const INTERFACE_IDS_PLACEHOLDER_TEXT = 'e.g., 1234,5678';
9393

94+
export const CLUSTERS_TOOLTIP_TEXT = 'It includes enterprise Clusters only.';
95+
9496
export const NO_REGION_MESSAGE: Record<number, string> = {
9597
1: 'No database clusters configured in any regions.',
9698
2: 'No Linodes configured in any regions.',

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ export const CloudPulseFirewallNodebalancersSelect = React.memo(
138138
return;
139139
}
140140
// To save default values, go through side effects
141-
if (!getNodebalancersList || !savePreferences || selectedNodebalancers) {
141+
if (
142+
!getNodebalancersList.length ||
143+
!savePreferences ||
144+
selectedNodebalancers
145+
) {
142146
if (selectedNodebalancers) {
143147
setSelectedNodebalancers([]);
144148
handleNodebalancersSelection([]);

packages/manager/src/features/CloudPulse/shared/CloudPulseResourcesSelect.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as React from 'react';
55

66
import { renderWithTheme } from 'src/utilities/testHelpers';
77

8+
import { CLUSTERS_TOOLTIP_TEXT } from '../Utils/constants';
89
import { CloudPulseResourcesSelect } from './CloudPulseResourcesSelect';
910

1011
const queryMocks = vi.hoisted(() => ({
@@ -44,6 +45,21 @@ describe('CloudPulseResourcesSelect component tests', () => {
4445
expect(screen.getByPlaceholderText('Select Resources')).toBeInTheDocument();
4546
});
4647

48+
it('renders with the tooltip-text for lke service', async () => {
49+
renderWithTheme(
50+
<CloudPulseResourcesSelect
51+
handleResourcesSelection={mockResourceHandler}
52+
label="Clusters"
53+
region={'us-east'}
54+
resourceType={'lke'}
55+
/>
56+
);
57+
58+
expect(
59+
screen.getByRole('button', { name: CLUSTERS_TOOLTIP_TEXT })
60+
).toBeVisible();
61+
});
62+
4763
it('should render disabled component if the props are undefined or regions and service type does not have any resources', () => {
4864
renderWithTheme(
4965
<CloudPulseResourcesSelect

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React from 'react';
55
import { useFlags } from 'src/hooks/useFlags';
66
import { useResourcesQuery } from 'src/queries/cloudpulse/resources';
77

8-
import { RESOURCE_FILTER_MAP } from '../Utils/constants';
8+
import { CLUSTERS_TOOLTIP_TEXT, RESOURCE_FILTER_MAP } from '../Utils/constants';
99
import { filterUsingDependentFilters } from '../Utils/FilterBuilder';
1010
import { deepEqual } from '../Utils/utils';
1111
import { CLOUD_PULSE_TEXT_FIELD_PROPS } from './styles';
@@ -69,6 +69,8 @@ export const CloudPulseResourcesSelect = React.memo(
6969
} = props;
7070

7171
const flags = useFlags();
72+
const tooltipText =
73+
resourceType === 'lke' ? CLUSTERS_TOOLTIP_TEXT : undefined;
7274

7375
const {
7476
data: resources,
@@ -206,7 +208,10 @@ export const CloudPulseResourcesSelect = React.memo(
206208
</ListItem>
207209
);
208210
}}
209-
textFieldProps={{ ...CLOUD_PULSE_TEXT_FIELD_PROPS }}
211+
textFieldProps={{
212+
...CLOUD_PULSE_TEXT_FIELD_PROPS,
213+
labelTooltipText: tooltipText,
214+
}}
210215
value={selectedResources ?? []}
211216
/>
212217
);

0 commit comments

Comments
 (0)