Skip to content

Commit f87bc9d

Browse files
upcoming: [DI-24470] - Rename resources to entities in labels, placeholders and messages in cloudpulse alerting (#11977)
* upcoming: [DI-23542] - Resources to entity changes initial * upcoming: [DI-23542] - Table column changes * upcoming: [DI-23542] - Table column changes * upcoming: [DI-23542] - Cypress fixes * upcoming: [DI-23542] - UT fixes * upcoming: [DI-23542] - Resources to entity further changes * upcoming: [DI-23542] - Resources to entity further changes * upcoming: [DI-23542] - Resources to entities cypress fixes * upcoming: [DI-23542] - Remove QA id usage * upcoming: [DI-24470] - Add changeset * upcoming: [DI-24470] - Revert comment in changes * upcoming: [DI-24470] - Refactoring * upcoming: [DI-24470] - Fix cypress * upcoming: [DI-24470] - More places fixes * DI-23961 - Code review comments * DI-23961 - Fix linting issue * DI-23961 - Use clean search placeholder
1 parent 1b0688e commit f87bc9d

23 files changed

Lines changed: 75 additions & 71 deletions
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+
Rename resources to entities in labels, placeholders, messages and warnings in `cloudpulse alerting` section ([#11977](https://github.com/linode/manager/pull/11977))

packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ describe('Integration Tests for Alert Show Detail Page', () => {
132132
});
133133

134134
it('should correctly display the details of the DBaaS alert in the alert details view', () => {
135+
const searchPlaceholder = 'Search for a Region or Entity';
135136
cy.visitWithLogin(`/alerts/definitions/detail/${service_type}/${id}`);
136137
cy.wait(['@getDBaaSAlertDefinitions', '@getMockedDbaasDatabases']);
137138

@@ -265,19 +266,17 @@ describe('Integration Tests for Alert Show Detail Page', () => {
265266
// Validate the Resources section (Resource and Region columns)
266267
cy.get('[data-qa-section="Resources"]').within(() => {
267268
ui.heading
268-
.findByText('resource')
269+
.findByText('entity')
269270
.scrollIntoView()
270271
.should('be.visible')
271-
.should('have.text', 'Resource');
272+
.should('have.text', 'Entity');
272273

273274
ui.heading
274275
.findByText('region')
275276
.should('be.visible')
276277
.should('have.text', 'Region');
277278

278-
cy.findByPlaceholderText('Search for a Region or Resource').should(
279-
'be.visible'
280-
);
279+
cy.findByPlaceholderText(searchPlaceholder).should('be.visible');
281280

282281
cy.findByPlaceholderText('Select Regions').should('be.visible');
283282

@@ -295,7 +294,7 @@ describe('Integration Tests for Alert Show Detail Page', () => {
295294
const regionLabel = regionMap.get(db.region) || 'Unknown Region';
296295

297296
cy.wrap(row).within(() => {
298-
cy.get(`[data-qa-alert-cell="${rowNumber}_resource"]`).should(
297+
cy.get(`[data-qa-alert-cell="${rowNumber}_entity"]`).should(
299298
'have.text',
300299
db.label
301300
);
@@ -307,11 +306,11 @@ describe('Integration Tests for Alert Show Detail Page', () => {
307306
});
308307
});
309308

310-
// Sorting by Resource and Region columns
311-
ui.heading.findByText('resource').should('be.visible').click();
309+
// Sorting by entity and Region columns
310+
ui.heading.findByText('entity').should('be.visible').click();
312311
verifyRowOrder(['4', '3', '2', '1']);
313312

314-
ui.heading.findByText('resource').should('be.visible').click();
313+
ui.heading.findByText('entity').should('be.visible').click();
315314
verifyRowOrder(['1', '2', '3', '4']);
316315

317316
ui.heading.findByText('region').should('be.visible').click();
@@ -320,8 +319,8 @@ describe('Integration Tests for Alert Show Detail Page', () => {
320319
ui.heading.findByText('region').should('be.visible').click();
321320
verifyRowOrder(['1', '3', '2', '4']);
322321

323-
// Search by Resource
324-
cy.findByPlaceholderText('Search for a Region or Resource')
322+
// Search by Entity
323+
cy.findByPlaceholderText(searchPlaceholder)
325324
.should('be.visible')
326325
.type(databases[0].label);
327326

@@ -335,7 +334,7 @@ describe('Integration Tests for Alert Show Detail Page', () => {
335334
);
336335

337336
// Search by region
338-
cy.findByPlaceholderText('Search for a Region or Resource').clear();
337+
cy.findByPlaceholderText(searchPlaceholder).clear();
339338

340339
ui.regionSelect.find().click().type(`${regions[0].label}{enter}`);
341340
ui.regionSelect.find().click();

packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,20 @@ describe('Create Alert', () => {
209209
ui.autocomplete.findByLabel('Severity').should('be.visible').type('Severe');
210210
ui.autocompletePopper.findByTitle('Severe').should('be.visible').click();
211211

212-
// Search for Resource
213-
cy.findByPlaceholderText('Search for a Region or Resource')
212+
// Search for Entity
213+
cy.findByPlaceholderText('Search for a Region or Entity')
214214
.should('be.visible')
215215
.type('database-2');
216216

217-
// Find the table and locate the resource cell containing 'database-2', then check the corresponding checkbox
217+
// Find the table and locate the entity cell containing 'database-2', then check the corresponding checkbox
218218
cy.get('[data-qa-alert-table="true"]') // Find the table
219-
.contains('[data-qa-alert-cell*="resource"]', 'database-2') // Find resource cell
219+
.contains('[data-qa-alert-cell*="entity"]', 'database-2') // Find entity cell
220220
.parents('tr')
221221
.find('[type="checkbox"]')
222222
.check();
223223

224-
// Assert resource selection notice
225-
cy.findByText('1 of 10 resources are selected.');
224+
// Assert entity selection notice
225+
cy.findByText('1 of 10 entities are selected.');
226226

227227
// Fill metric details for the first rule
228228
const cpuUsageMetricDetails = {

packages/manager/cypress/e2e/core/cloudpulse/edit-system-alert.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ describe('Integration Tests for Edit Alert', () => {
113113

114114
cy.wait(['@getAlertDefinitions', '@getDatabases']);
115115

116-
// Verify that the heading with text 'resource' is visible
117-
ui.heading.findByText('resource').should('be.visible');
116+
// Verify that the heading with text 'entity' is visible
117+
ui.heading.findByText('entity').should('be.visible');
118118

119119
// Verify that the heading with text 'region' is visible
120120
ui.heading.findByText('region').should('be.visible');
121121

122-
// Verify the initial selection of resources, then select all resources.
123-
cy.findByText('3 of 50 resources are selected.')
122+
// Verify the initial selection of entities, then select all entities.
123+
cy.findByText('3 of 50 entities are selected.')
124124
.should('be.visible')
125125
.closest('[data-qa-notice]')
126126
.within(() => {
@@ -133,7 +133,7 @@ describe('Integration Tests for Edit Alert', () => {
133133
});
134134

135135
// Confirm notice text updates to reflect selection.
136-
cy.findByText('50 of 50 resources are selected.').should('be.visible');
136+
cy.findByText('50 of 50 entities are selected.').should('be.visible');
137137

138138
// Verify the initial state of the page size
139139
ui.pagination.findPageSizeSelect().click();
@@ -271,7 +271,7 @@ describe('Integration Tests for Edit Alert', () => {
271271
cy.url().should('endWith', '/alerts/definitions');
272272

273273
// Confirm toast notification appears
274-
ui.toast.assertMessage('Alert resources successfully updated.');
274+
ui.toast.assertMessage('Alert entities successfully updated.');
275275
});
276276
});
277277
});

packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,17 @@ describe('Integration Tests for Edit Alert', () => {
187187
.should('have.value', 'Databases');
188188
cy.findByLabelText('Severity').should('have.value', 'Severe');
189189

190-
// Verify alert resource selection
190+
// Verify alert entity selection
191191
cy.get('[data-qa-alert-table="true"]')
192-
.contains('[data-qa-alert-cell*="resource"]', 'database-3')
192+
.contains('[data-qa-alert-cell*="entity"]', 'database-3')
193193
.parents('tr')
194194
.find('[type="checkbox"]')
195195
.should('be.checked');
196196

197-
// Verify alert resource selection count message
197+
// Verify alert entity selection count message
198198
cy.get('[data-testid="selection_notice"]').should(
199199
'contain',
200-
'1 of 5 resources are selected.'
200+
'1 of 5 entities are selected.'
201201
);
202202

203203
// Assert rule values 1

packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('AlertDetail component tests', () => {
121121
// validate overview is present with its couple of properties (values will be validated in its own components test)
122122
expect(getByText('Overview')).toBeInTheDocument();
123123
expect(getByText('Criteria')).toBeInTheDocument(); // validate if criteria is present
124-
expect(getByText('Resources')).toBeInTheDocument(); // validate if resources is present
124+
expect(getByText('Entities')).toBeInTheDocument(); // validate if entities is present
125125
expect(getByText('Notification Channels')).toBeInTheDocument(); // validate if notification channels is present
126126
expect(getByText('Name:')).toBeInTheDocument();
127127
expect(getByText('Description:')).toBeInTheDocument();

packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('AlertMaxSelectionText', () => {
1111
);
1212
expect(getByTestId('warning-tip')).toBeInTheDocument();
1313
expect(getByTestId('warning-tip')).toHaveTextContent(
14-
'You can select up to 2 resources.'
14+
'You can select up to 2 entities.'
1515
);
1616
});
1717
});

packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const AlertMaxSelectionText = (props: AlertMaxSelectionTextProps) => {
1212
const { maxSelectionCount } = props;
1313
return (
1414
<Typography data-testid="warning-tip">
15-
You can select up to {maxSelectionCount} resources.
15+
You can select up to {maxSelectionCount} entities.
1616
</Typography>
1717
);
1818
};

packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const linodes = linodeFactory.buildList(3).map((value, index) => {
3434
};
3535
});
3636

37-
const searchPlaceholder = 'Search for a Region or Resource';
37+
const searchPlaceholder = 'Search for a Region or Entity';
3838
const regionPlaceholder = 'Select Regions';
3939
const checkedAttribute = 'data-qa-checked';
4040
const cloudPulseResources: CloudPulseResources[] = linodes.map((linode) => {
@@ -147,7 +147,7 @@ describe('AlertResources component tests', () => {
147147
const { getByTestId } = renderWithTheme(
148148
<AlertResources {...alertResourcesProp} />
149149
);
150-
const resourceColumn = getByTestId('resource'); // get the resource header column
150+
const resourceColumn = getByTestId('entity'); // get the entity header column
151151
await userEvent.click(resourceColumn);
152152

153153
const tableBody = getByTestId('alert_resources_content');
@@ -211,7 +211,7 @@ describe('AlertResources component tests', () => {
211211
);
212212

213213
const noticeText = getByTestId('selection_notice');
214-
expect(noticeText).toHaveTextContent('2 of 3 resources are selected.');
214+
expect(noticeText).toHaveTextContent('2 of 3 entities are selected.');
215215

216216
// validate it selects 3
217217
await userEvent.click(getByTestId('select_item_3'));
@@ -220,7 +220,7 @@ describe('AlertResources component tests', () => {
220220
'true'
221221
);
222222
expect(handleResourcesSelection).toHaveBeenCalledWith(['1', '2', '3']);
223-
expect(noticeText).toHaveTextContent('3 of 3 resources are selected.');
223+
expect(noticeText).toHaveTextContent('3 of 3 entities are selected.');
224224

225225
// unselect 3 and test
226226
await userEvent.click(getByTestId('select_item_3'));

packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
318318
<Stack gap={2}>
319319
{!hideLabel && (
320320
<Typography ref={titleRef} variant="h2">
321-
{alertLabel || 'Resources'}
321+
{alertLabel || 'Entities'}
322322
{/* It can be either the passed alert label or just Resources */}
323323
</Typography>
324324
)}
@@ -329,8 +329,8 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
329329
},
330330
}}
331331
icon={EntityIcon}
332-
subtitle="Once you assign the resources, they will show up here."
333-
title="No resources associated with this alert definition."
332+
subtitle="Once you assign the entities, they will show up here."
333+
title="No entities associated with this alert definition."
334334
/>
335335
</Stack>
336336
);
@@ -355,14 +355,14 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
355355
<Stack gap={2}>
356356
{!hideLabel && (
357357
<Typography ref={titleRef} variant="h2">
358-
{alertLabel || 'Resources'}
358+
{alertLabel || 'Entities'}
359359
{/* It can be either the passed alert label or just Resources */}
360360
</Typography>
361361
)}
362362
{showEditInformation && (
363363
<Typography ref={titleRef} variant="body1">
364-
You can enable or disable this system alert for each resource you have
365-
access to. Select the resources listed below you want to enable the
364+
You can enable or disable this system alert for each entities you have
365+
access to. Select the entities listed below you want to enable the
366366
alert for.
367367
</Typography>
368368
)}
@@ -384,9 +384,9 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
384384
}}
385385
clearable
386386
hideLabel
387-
label="Search for a Region or Resource"
387+
label="Search for a Region or Entity"
388388
onSearch={handleSearchTextChange}
389-
placeholder="Search for a Region or Resource"
389+
placeholder="Search for a Region or Entity"
390390
value={searchText || ''}
391391
/>
392392
</Grid>
@@ -444,7 +444,7 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
444444
{maxSelectionCount !== undefined && (
445445
<Grid item xs={12}>
446446
<AlertListNoticeMessages
447-
errorMessage={`You can select up to ${maxSelectionCount} resources.`}
447+
errorMessage={`You can select up to ${maxSelectionCount} entities.`}
448448
separator={MULTILINE_ERROR_SEPARATOR}
449449
style={noticeStyles}
450450
variant="warning"

0 commit comments

Comments
 (0)