Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4c5f6a0
upcoming: [DI-23542] - Resources to entity changes initial
venkymano-akamai Apr 3, 2025
faf77b9
upcoming: [DI-23542] - Table column changes
venkymano-akamai Apr 3, 2025
af58d0b
upcoming: [DI-23542] - Table column changes
venkymano-akamai Apr 3, 2025
2630f0a
upcoming: [DI-23542] - Cypress fixes
venkymano-akamai Apr 3, 2025
6a433df
upcoming: [DI-23542] - UT fixes
venkymano-akamai Apr 3, 2025
f8cac7b
upcoming: [DI-23542] - Resources to entity further changes
venkymano-akamai Apr 4, 2025
cfc1c67
upcoming: [DI-23542] - Resources to entity further changes
venkymano-akamai Apr 4, 2025
24c1acd
upcoming: [DI-23542] - Resources to entities cypress fixes
venkymano-akamai Apr 7, 2025
049cabc
upcoming: [DI-23542] - Remove QA id usage
venkymano-akamai Apr 7, 2025
7c81b11
Merge branch 'develop' of github.com:linode/manager into resource_to_…
venkymano-akamai Apr 7, 2025
b30a515
upcoming: [DI-24470] - Add changeset
venkymano-akamai Apr 7, 2025
cb256a8
upcoming: [DI-24470] - Revert comment in changes
venkymano-akamai Apr 7, 2025
ff7c378
upcoming: [DI-24470] - Refactoring
venkymano-akamai Apr 7, 2025
e886a19
upcoming: [DI-24470] - Fix cypress
venkymano-akamai Apr 7, 2025
d70919e
upcoming: [DI-24470] - More places fixes
venkymano-akamai Apr 7, 2025
dea7246
Merge branch 'develop' into resource_to_entities_linode
venkymano-akamai Apr 8, 2025
0b67800
Merge branch 'develop' into resource_to_entities_linode
venkymano-akamai Apr 8, 2025
290a8eb
Merge branch 'develop' into resource_to_entities_linode
venkymano-akamai Apr 9, 2025
833daf1
DI-23961 - Code review comments
venkymano-akamai Apr 9, 2025
7f4c522
Merge branch 'resource_to_entities_linode' of github.com:venkymano-ak…
venkymano-akamai Apr 9, 2025
a894522
Merge branch 'develop' of github.com:linode/manager into resource_to_…
venkymano-akamai Apr 9, 2025
be0c973
DI-23961 - Fix linting issue
venkymano-akamai Apr 9, 2025
586ae01
Merge branch 'develop' into resource_to_entities_linode
venkymano-akamai Apr 10, 2025
20198b5
DI-23961 - Use clean search placeholder
venkymano-akamai Apr 10, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Rename resources to entities in labels, placeholders, messages and warnings in `cloudpulse alerting` section ([#11977](https://github.com/linode/manager/pull/11977))
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ describe('Integration Tests for Alert Show Detail Page', () => {
});

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

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

ui.heading
.findByText('region')
.should('be.visible')
.should('have.text', 'Region');

cy.findByPlaceholderText('Search for a Region or Resource').should(
'be.visible'
);
cy.findByPlaceholderText(searchPlaceholder).should('be.visible');

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

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

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

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

ui.heading.findByText('resource').should('be.visible').click();
ui.heading.findByText('entity').should('be.visible').click();
verifyRowOrder(['1', '2', '3', '4']);

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

// Search by Resource
cy.findByPlaceholderText('Search for a Region or Resource')
// Search by Entity
cy.findByPlaceholderText(searchPlaceholder)
.should('be.visible')
.type(databases[0].label);

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

// Search by region
cy.findByPlaceholderText('Search for a Region or Resource').clear();
cy.findByPlaceholderText(searchPlaceholder).clear();

ui.regionSelect.find().click().type(`${regions[0].label}{enter}`);
ui.regionSelect.find().click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,20 @@ describe('Create Alert', () => {
ui.autocomplete.findByLabel('Severity').should('be.visible').type('Severe');
ui.autocompletePopper.findByTitle('Severe').should('be.visible').click();

// Search for Resource
cy.findByPlaceholderText('Search for a Region or Resource')
// Search for Entity
cy.findByPlaceholderText('Search for a Region or Entity')
.should('be.visible')
.type('database-2');

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

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

// Fill metric details for the first rule
const cpuUsageMetricDetails = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ describe('Integration Tests for Edit Alert', () => {

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

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

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

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

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

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

// Confirm toast notification appears
ui.toast.assertMessage('Alert resources successfully updated.');
ui.toast.assertMessage('Alert entities successfully updated.');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ describe('Integration Tests for Edit Alert', () => {
.should('have.value', 'Databases');
cy.findByLabelText('Severity').should('have.value', 'Severe');

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

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

// Assert rule values 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('AlertDetail component tests', () => {
// validate overview is present with its couple of properties (values will be validated in its own components test)
expect(getByText('Overview')).toBeInTheDocument();
expect(getByText('Criteria')).toBeInTheDocument(); // validate if criteria is present
expect(getByText('Resources')).toBeInTheDocument(); // validate if resources is present
expect(getByText('Entities')).toBeInTheDocument(); // validate if entities is present
expect(getByText('Notification Channels')).toBeInTheDocument(); // validate if notification channels is present
expect(getByText('Name:')).toBeInTheDocument();
expect(getByText('Description:')).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('AlertMaxSelectionText', () => {
);
expect(getByTestId('warning-tip')).toBeInTheDocument();
expect(getByTestId('warning-tip')).toHaveTextContent(
'You can select up to 2 resources.'
'You can select up to 2 entities.'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const AlertMaxSelectionText = (props: AlertMaxSelectionTextProps) => {
const { maxSelectionCount } = props;
return (
<Typography data-testid="warning-tip">
You can select up to {maxSelectionCount} resources.
You can select up to {maxSelectionCount} entities.
</Typography>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const linodes = linodeFactory.buildList(3).map((value, index) => {
};
});

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

const tableBody = getByTestId('alert_resources_content');
Expand Down Expand Up @@ -211,7 +211,7 @@ describe('AlertResources component tests', () => {
);

const noticeText = getByTestId('selection_notice');
expect(noticeText).toHaveTextContent('2 of 3 resources are selected.');
expect(noticeText).toHaveTextContent('2 of 3 entities are selected.');

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

// unselect 3 and test
await userEvent.click(getByTestId('select_item_3'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
<Stack gap={2}>
{!hideLabel && (
<Typography ref={titleRef} variant="h2">
{alertLabel || 'Resources'}
{alertLabel || 'Entities'}
{/* It can be either the passed alert label or just Resources */}
</Typography>
)}
Expand All @@ -329,8 +329,8 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
},
}}
icon={EntityIcon}
subtitle="Once you assign the resources, they will show up here."
title="No resources associated with this alert definition."
subtitle="Once you assign the entities, they will show up here."
title="No entities associated with this alert definition."
/>
</Stack>
);
Expand All @@ -355,14 +355,14 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
<Stack gap={2}>
{!hideLabel && (
<Typography ref={titleRef} variant="h2">
{alertLabel || 'Resources'}
{alertLabel || 'Entities'}
{/* It can be either the passed alert label or just Resources */}
</Typography>
)}
{showEditInformation && (
<Typography ref={titleRef} variant="body1">
You can enable or disable this system alert for each resource you have
access to. Select the resources listed below you want to enable the
You can enable or disable this system alert for each entities you have
access to. Select the entities listed below you want to enable the
alert for.
</Typography>
)}
Expand All @@ -384,9 +384,9 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
}}
clearable
hideLabel
label="Search for a Region or Resource"
label="Search for a Region or Entity"
onSearch={handleSearchTextChange}
placeholder="Search for a Region or Resource"
placeholder="Search for a Region or Entity"
value={searchText || ''}
/>
</Grid>
Expand Down Expand Up @@ -444,7 +444,7 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => {
{maxSelectionCount !== undefined && (
<Grid item xs={12}>
<AlertListNoticeMessages
errorMessage={`You can select up to ${maxSelectionCount} resources.`}
errorMessage={`You can select up to ${maxSelectionCount} entities.`}
separator={MULTILINE_ERROR_SEPARATOR}
style={noticeStyles}
variant="warning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const AlertsResourcesNotice = React.memo(
})}
data-testid="selection_notice"
>
{selectedResources} of {totalResources} resources are selected.
{selectedResources} of {totalResources} entities are selected.
</Typography>
<Tooltip
slotProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const serviceTypeBasedColumns: ServiceColumns<AlertInstance> = {
// Default fallback case when service type is empty, in the create flow, until we select a service type it will be empty
{
accessor: ({ label }) => label,
label: 'Resource',
label: 'Entity',
sortingKey: 'label',
},
{
Expand All @@ -33,7 +33,7 @@ export const serviceTypeBasedColumns: ServiceColumns<AlertInstance> = {
dbaas: [
{
accessor: ({ label }) => label,
label: 'Resource',
label: 'Entity',
sortingKey: 'label',
},
{
Expand All @@ -51,7 +51,7 @@ export const serviceTypeBasedColumns: ServiceColumns<AlertInstance> = {
linode: [
{
accessor: ({ label }) => label,
label: 'Resource',
label: 'Entity',
sortingKey: 'label',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ describe('AlertDefinition Create', () => {
expect(getByLabelText('Description (optional)')).toBeVisible();
expect(getByLabelText('Severity')).toBeVisible();
expect(getByLabelText('Service')).toBeVisible();
expect(getByText('2. Resources')).toBeVisible();
expect(getByText('2. Entities')).toBeVisible();
await expect(
getByPlaceholderText('Search for a Region or Resource')
getByPlaceholderText('Search for a Region or Entity')
).toBeInTheDocument();
await expect(getByPlaceholderText('Select Regions')).toBeInTheDocument();
expect(getByText('3. Criteria')).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('CreateAlertResources component tests', () => {
},
});
expect(
getByPlaceholderText('Search for a Region or Resource')
getByPlaceholderText('Search for a Region or Entity')
).toBeInTheDocument();
expect(getByPlaceholderText('Select Regions')).toBeInTheDocument();
expect(getByTestId('show_selected_only')).toBeInTheDocument();
Expand Down Expand Up @@ -158,15 +158,15 @@ describe('CreateAlertResources component tests', () => {
},
errors: {
entity_ids: {
message: 'More than 2 resources selected',
message: 'More than 2 entities selected',
},
},
},
});

expect(getAllByTestId('alert_message_notice').length).toBe(2); // one for error and one for selection warning
expect(getByText('You can select up to 2 resources.')).toBeInTheDocument();
expect(getByText('More than 2 resources selected')).toBeInTheDocument();
expect(getByText('You can select up to 2 entities.')).toBeInTheDocument();
expect(getByText('More than 2 entities selected')).toBeInTheDocument();
const resourceFour = getByTestId('select_item_4');
expect(resourceFour).toBeInTheDocument();
expect(resourceFour).toHaveAttribute('aria-disabled', 'true');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const CloudPulseModifyAlertResources = React.memo(
render={({ field, fieldState }) => (
<Box display="flex" flexDirection="column" gap={3} paddingTop={3}>
<Typography ref={titleRef} variant="h2">
2. Resources
2. Entities
</Typography>
<Box
sx={(theme) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ describe('EditAlertDefinition component', () => {
expect(getByLabelText('Description (optional)')).toBeVisible();
expect(getByLabelText('Severity')).toBeVisible();
expect(getByLabelText('Service')).toBeVisible();
expect(getByText('2. Resources')).toBeVisible();
expect(getByText('2. Entities')).toBeVisible();
expect(
await findByPlaceholderText('Search for a Region or Resource')
await findByPlaceholderText('Search for a Region or Entity')
).toBeInTheDocument();
expect(await findByPlaceholderText('Select Regions')).toBeInTheDocument();
expect(getByText('3. Criteria')).toBeVisible();
Expand Down
Loading