From 4c5f6a0b125b6cf988fcbb14f689816b2976ffa7 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 3 Apr 2025 11:41:26 +0530 Subject: [PATCH 01/17] upcoming: [DI-23542] - Resources to entity changes initial --- .../AlertsResources/AlertMaxSelectionText.tsx | 2 +- .../Alerts/AlertsResources/AlertsResources.tsx | 18 +++++++++--------- .../AlertsResources/AlertsResourcesNotice.tsx | 2 +- .../CloudPulseModifyAlertResources.tsx | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.tsx index 55e263d3f3d..3016971ab43 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.tsx @@ -12,7 +12,7 @@ export const AlertMaxSelectionText = (props: AlertMaxSelectionTextProps) => { const { maxSelectionCount } = props; return ( - You can select up to {maxSelectionCount} resources. + You can select up to {maxSelectionCount} entities. ); }; diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.tsx index 005b9c16bf6..fea284511dc 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.tsx @@ -319,7 +319,7 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => { {!hideLabel && ( - {alertLabel || 'Resources'} + {alertLabel || 'Entities'} {/* It can be either the passed alert label or just Resources */} )} @@ -330,8 +330,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." /> ); @@ -356,14 +356,14 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => { {!hideLabel && ( - {alertLabel || 'Resources'} + {alertLabel || 'Entities'} {/* It can be either the passed alert label or just Resources */} )} {showEditInformation && ( - 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. )} @@ -385,9 +385,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 || ''} /> @@ -445,7 +445,7 @@ export const AlertResources = React.memo((props: AlertResourcesProp) => { {maxSelectionCount !== undefined && ( - {selectedResources} of {totalResources} resources are selected. + {selectedResources} of {totalResources} entities are selected. ( - 2. Resources + 2. Entities ({ From faf77b9547b83ea08b8812c18fd17b9ba28333a1 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 3 Apr 2025 11:49:48 +0530 Subject: [PATCH 02/17] upcoming: [DI-23542] - Table column changes --- .../features/CloudPulse/Alerts/AlertsResources/constants.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/constants.ts b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/constants.ts index 0202f4ea006..b42136c6c46 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/constants.ts +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/constants.ts @@ -21,7 +21,7 @@ export const serviceTypeBasedColumns: ServiceColumns = { // 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', }, { @@ -33,7 +33,7 @@ export const serviceTypeBasedColumns: ServiceColumns = { dbaas: [ { accessor: ({ label }) => label, - label: 'Resource', + label: 'Entity', sortingKey: 'label', }, { @@ -51,7 +51,7 @@ export const serviceTypeBasedColumns: ServiceColumns = { linode: [ { accessor: ({ label }) => label, - label: 'Resource', + label: 'Entity', sortingKey: 'label', }, { From af58d0b29320372754d14db5de2cc5d2c46757f2 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 3 Apr 2025 13:09:26 +0530 Subject: [PATCH 03/17] upcoming: [DI-23542] - Table column changes --- .../core/cloudpulse/alert-show-details.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts index 5dfa6cbc1c5..c049a374b7f 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts @@ -265,17 +265,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( + cy.findByPlaceholderText('Search for a Region or Entity').should( 'be.visible' ); @@ -295,7 +295,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 ); @@ -308,10 +308,10 @@ describe('Integration Tests for Alert Show Detail Page', () => { }); // Sorting by Resource and Region columns - ui.heading.findByText('resource').should('be.visible').click(); + 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(); @@ -321,7 +321,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { verifyRowOrder(['1', '3', '2', '4']); // Search by Resource - cy.findByPlaceholderText('Search for a Region or Resource') + cy.findByPlaceholderText('Search for a Region or Entity') .should('be.visible') .type(databases[0].label); @@ -335,7 +335,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { ); // Search by region - cy.findByPlaceholderText('Search for a Region or Resource').clear(); + cy.findByPlaceholderText('Search for a Region or Entity').clear(); ui.regionSelect.find().click().type(`${regions[0].label}{enter}`); ui.regionSelect.find().click(); From 2630f0a3fcd185dbd5089ff0f8bc711a600e1b7d Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 3 Apr 2025 14:59:39 +0530 Subject: [PATCH 04/17] upcoming: [DI-23542] - Cypress fixes --- .../e2e/core/cloudpulse/create-user-alert.spec.ts | 8 ++++---- .../e2e/core/cloudpulse/edit-system-alert.spec.ts | 12 ++++++------ .../e2e/core/cloudpulse/edit-user-alert.spec.ts | 6 +++--- .../Alerts/EditAlert/EditAlertResources.test.tsx | 6 +++--- .../Alerts/EditAlert/EditAlertResources.tsx | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts index 97d48c5a7a5..9a919b394a6 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts @@ -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 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 resource cell .parents('tr') .find('[type="checkbox"]') .check(); // Assert resource selection notice - cy.findByText('1 of 10 resources are selected.'); + cy.findByText('1 of 10 entities are selected.'); // Fill metric details for the first rule const cpuUsageMetricDetails = { diff --git a/packages/manager/cypress/e2e/core/cloudpulse/edit-system-alert.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/edit-system-alert.spec.ts index de0def5b4b4..ab73676850a 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/edit-system-alert.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/edit-system-alert.spec.ts @@ -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(() => { @@ -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(); @@ -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.'); }); }); }); diff --git a/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts index ccb7427af30..f949394eeed 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts @@ -187,9 +187,9 @@ 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'); @@ -197,7 +197,7 @@ describe('Integration Tests for Edit Alert', () => { // Verify alert resource 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 diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx index 0c80632ecd0..5ddcc207495 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx @@ -125,7 +125,7 @@ describe('EditAlertResources component tests', () => { await waitFor(() => { expect( - getByText('Alert resources successfully updated.') // validate whether snackbar is displayed properly + getByText('Alert entities successfully updated.') // validate whether snackbar is displayed properly ).toBeInTheDocument(); }); @@ -138,7 +138,7 @@ describe('EditAlertResources component tests', () => { ); }); - it('Edit alert resources error case', async () => { + it('Edit alert entities error case', async () => { const mockMutateAsync = vi.fn().mockRejectedValue(new Error('API Error')); queryMocks.useEditAlertDefinition.mockReturnValue({ isError: true, @@ -175,7 +175,7 @@ describe('EditAlertResources component tests', () => { await waitFor(() => { expect( - getByText('Error while updating the resources. Try again later.') // validate whether snackbar is displayed properly + getByText('Error while updating the entities. Try again later.') // validate whether snackbar is displayed properly ).toBeInTheDocument(); }); }); diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.tsx index d4f1dff6640..4fa7c2910c7 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.tsx @@ -64,12 +64,12 @@ export const EditAlertResources = (props: EditAlertProps) => { setShowConfirmation(false); // on success land on the alert definition list page and show a success snackbar history.push(definitionLanding); - showSnackbar('Alert resources successfully updated.', 'success'); + showSnackbar('Alert entities successfully updated.', 'success'); }) .catch(() => { setShowConfirmation(false); showSnackbar( - 'Error while updating the resources. Try again later.', + 'Error while updating the entities. Try again later.', 'error' ); }); From 6a433dfc9a871559edd77941d75634107f79bf12 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 3 Apr 2025 15:09:46 +0530 Subject: [PATCH 05/17] upcoming: [DI-23542] - UT fixes --- .../CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx | 2 +- .../Alerts/AlertsResources/AlertsResources.test.tsx | 8 ++++---- .../Alerts/CreateAlert/CreateAlertDefinition.test.tsx | 4 ++-- .../Resources/CloudPulseModifyAlertResources.test.tsx | 8 ++++---- .../Alerts/EditAlert/EditAlertDefinition.test.tsx | 4 ++-- .../Alerts/EditAlert/EditAlertResources.test.tsx | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx index 10c91aa20ca..58f8f790eb3 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx @@ -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 resources is present expect(getByText('Notification Channels')).toBeInTheDocument(); // validate if notification channels is present expect(getByText('Name:')).toBeInTheDocument(); expect(getByText('Description:')).toBeInTheDocument(); diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx index 1616c915642..0bb0ace8e6a 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx @@ -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) => { @@ -147,7 +147,7 @@ describe('AlertResources component tests', () => { const { getByTestId } = renderWithTheme( ); - const resourceColumn = getByTestId('resource'); // get the resource header column + const resourceColumn = getByTestId('entity'); // get the resource header column await userEvent.click(resourceColumn); const tableBody = getByTestId('alert_resources_content'); @@ -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')); @@ -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')); diff --git a/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/CreateAlertDefinition.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/CreateAlertDefinition.test.tsx index 559c5f49406..0a152a7b012 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/CreateAlertDefinition.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/CreateAlertDefinition.test.tsx @@ -45,9 +45,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(); diff --git a/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/Resources/CloudPulseModifyAlertResources.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/Resources/CloudPulseModifyAlertResources.test.tsx index f481fde660c..f287543ec2f 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/Resources/CloudPulseModifyAlertResources.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/CreateAlert/Resources/CloudPulseModifyAlertResources.test.tsx @@ -89,7 +89,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(); @@ -164,15 +164,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'); diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertDefinition.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertDefinition.test.tsx index 79f3a696c7b..e0b46f28868 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertDefinition.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertDefinition.test.tsx @@ -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(); diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx index 5ddcc207495..7e83d6adc89 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResources.test.tsx @@ -85,7 +85,7 @@ describe('EditAlertResources 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(); From f8cac7bb1a09500f1ed54d6a9b07bbc4b7f80379 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Fri, 4 Apr 2025 10:28:27 +0530 Subject: [PATCH 06/17] upcoming: [DI-23542] - Resources to entity further changes --- .../e2e/core/cloudpulse/alert-show-details.spec.ts | 14 +++++++------- .../e2e/core/cloudpulse/create-user-alert.spec.ts | 8 ++++---- .../CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts index c049a374b7f..2b0096b6cd1 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts @@ -2,7 +2,7 @@ * @file Integration Tests for the CloudPulse Alerts Show Detail Page. * * This file contains Cypress tests that validate the display and content of the Alerts Show Detail Page in the CloudPulse application. - * It ensures that all alert details, criteria, and resource information are displayed correctly. + * It ensures that all alert details, criteria, and entity information are displayed correctly. */ import { capitalize, regionFactory } from '@linode/utilities'; import { @@ -90,7 +90,7 @@ const verifyRowOrder = (expectedIds: string[]) => { }); }; /** - * Integration tests for the CloudPulse Alerts Detail Page, ensuring that the alert details, criteria, and resource information are correctly displayed and validated, including various fields like name, description, status, severity, and trigger conditions. + * Integration tests for the CloudPulse Alerts Detail Page, ensuring that the alert details, criteria, and entity information are correctly displayed and validated, including various fields like name, description, status, severity, and trigger conditions. */ describe('Integration Tests for Alert Show Detail Page', () => { @@ -262,8 +262,8 @@ describe('Integration Tests for Alert Show Detail Page', () => { .should('be.visible') .should('have.text', 'consecutive occurrences.'); }); - // Validate the Resources section (Resource and Region columns) - cy.get('[data-qa-section="Resources"]').within(() => { + // Validate the entity section (Entity and Region columns) + cy.get('[data-qa-section="Entities"]').within(() => { ui.heading .findByText('entity') .scrollIntoView() @@ -283,7 +283,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { cy.get('[data-qa-alert-row]').should('have.length', 4); - // Validate resource-region mapping for each row in the table + // Validate entity-region mapping for each row in the table const regionMap = new Map(regions.map((r) => [r.id, r.label])); @@ -307,7 +307,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { }); }); - // Sorting by Resource and Region columns + // Sorting by Entity and Region columns ui.heading.findByText('entity').should('be.visible').click(); verifyRowOrder(['4', '3', '2', '1']); @@ -320,7 +320,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { ui.heading.findByText('region').should('be.visible').click(); verifyRowOrder(['1', '3', '2', '4']); - // Search by Resource + // Search by Entity cy.findByPlaceholderText('Search for a Region or Entity') .should('be.visible') .type(databases[0].label); diff --git a/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts index 9a919b394a6..5f104680b9d 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts @@ -150,7 +150,7 @@ const fillMetricDetailsForSpecificRule = ({ describe('Create Alert', () => { /* * - Confirms that users can navigate from the Alert Listings page to the Create Alert page. - * - Confirms that users can enter alert details, select resources, and configure conditions. + * - Confirms that users can enter alert details, select entities, and configure conditions. * - Confirms that the UI allows adding notification channels and setting thresholds. * - Confirms client-side validation when entering invalid metric values. * - Confirms that API interactions work correctly and return the expected responses. @@ -214,14 +214,14 @@ describe('Create Alert', () => { .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*="entity"]', '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 + // Assert entity selection notice cy.findByText('1 of 10 entities are selected.'); // Fill metric details for the first rule diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx index a351c28e009..df92a0cf7af 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx @@ -128,7 +128,7 @@ export const AlertDetail = () => { ...getAlertBoxStyles(theme), overflow: 'auto', }} - data-qa-section="Resources" + data-qa-section="Entities" > Date: Fri, 4 Apr 2025 10:34:52 +0530 Subject: [PATCH 07/17] upcoming: [DI-23542] - Resources to entity further changes --- .../CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx | 2 +- .../CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx index 58f8f790eb3..211570c25ca 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.test.tsx @@ -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('Entities')).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(); diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx index 0bb0ace8e6a..021bfdba2de 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.test.tsx @@ -147,7 +147,7 @@ describe('AlertResources component tests', () => { const { getByTestId } = renderWithTheme( ); - const resourceColumn = getByTestId('entity'); // get the resource header column + const resourceColumn = getByTestId('entity'); // get the entity header column await userEvent.click(resourceColumn); const tableBody = getByTestId('alert_resources_content'); From 24c1acd03f5ababd21bea66c2903e5d22fa08685 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Mon, 7 Apr 2025 10:48:15 +0530 Subject: [PATCH 08/17] upcoming: [DI-23542] - Resources to entities cypress fixes --- .../cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts | 1 + .../CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx | 2 +- .../features/CloudPulse/Alerts/EditAlert/EditAlertLanding.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts index 90d9498dd7b..99ac3312939 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts @@ -322,6 +322,7 @@ describe('Integration Tests for CloudPulse Alerts Listing Page', () => { }); ui.actionMenuItem.findByTitle(action).should('be.visible').click(); + ui.button.findByTitle(action).should('be.visible').click(); cy.wait(alias).then(({ response }) => { ui.toast.assertMessage(successMessage); diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx index 5a3bce99f8c..fe881fd7dce 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx @@ -25,7 +25,7 @@ describe('Edit Alert Landing tests', () => { expect( getByText( - 'An error occurred while loading the alerts definitions and resources. Please try again later.' + 'An error occurred while loading the alerts definitions and entities. Please try again later.' ) ).toBeInTheDocument(); diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.tsx index c2e8aa8b9cc..c01ab435b50 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.tsx @@ -46,7 +46,7 @@ export const EditAlertLanding = () => { if (isError) { return ( - + ); } From 049cabc37df7b15c830f13a0e8d2411fba3e331f Mon Sep 17 00:00:00 2001 From: vmangalr Date: Mon, 7 Apr 2025 11:11:04 +0530 Subject: [PATCH 09/17] upcoming: [DI-23542] - Remove QA id usage --- .../cypress/e2e/core/cloudpulse/alert-show-details.spec.ts | 2 +- .../src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts index 2b0096b6cd1..852d95eccd5 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts @@ -263,7 +263,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { .should('have.text', 'consecutive occurrences.'); }); // Validate the entity section (Entity and Region columns) - cy.get('[data-qa-section="Entities"]').within(() => { + cy.get('[data-qa-section="Resources"]').within(() => { ui.heading .findByText('entity') .scrollIntoView() diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx index df92a0cf7af..a351c28e009 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsDetail/AlertDetail.tsx @@ -128,7 +128,7 @@ export const AlertDetail = () => { ...getAlertBoxStyles(theme), overflow: 'auto', }} - data-qa-section="Entities" + data-qa-section="Resources" > Date: Mon, 7 Apr 2025 14:38:19 +0530 Subject: [PATCH 10/17] upcoming: [DI-24470] - Add changeset --- .../.changeset/pr-11977-upcoming-features-1744016876527.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-11977-upcoming-features-1744016876527.md diff --git a/packages/manager/.changeset/pr-11977-upcoming-features-1744016876527.md b/packages/manager/.changeset/pr-11977-upcoming-features-1744016876527.md new file mode 100644 index 00000000000..71a71205fe9 --- /dev/null +++ b/packages/manager/.changeset/pr-11977-upcoming-features-1744016876527.md @@ -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)) From cb256a88b0a445371e7304d7f0859300e263b763 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Mon, 7 Apr 2025 14:51:59 +0530 Subject: [PATCH 11/17] upcoming: [DI-24470] - Revert comment in changes --- .../e2e/core/cloudpulse/alert-show-details.spec.ts | 14 +++++++------- .../AlertsResources/AlertMaxSelectionText.test.tsx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts index 852d95eccd5..5e196d538d4 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts @@ -2,7 +2,7 @@ * @file Integration Tests for the CloudPulse Alerts Show Detail Page. * * This file contains Cypress tests that validate the display and content of the Alerts Show Detail Page in the CloudPulse application. - * It ensures that all alert details, criteria, and entity information are displayed correctly. + * It ensures that all alert details, criteria, and resource information are displayed correctly. */ import { capitalize, regionFactory } from '@linode/utilities'; import { @@ -90,7 +90,7 @@ const verifyRowOrder = (expectedIds: string[]) => { }); }; /** - * Integration tests for the CloudPulse Alerts Detail Page, ensuring that the alert details, criteria, and entity information are correctly displayed and validated, including various fields like name, description, status, severity, and trigger conditions. + * Integration tests for the CloudPulse Alerts Detail Page, ensuring that the alert details, criteria, and resource information are correctly displayed and validated, including various fields like name, description, status, severity, and trigger conditions. */ describe('Integration Tests for Alert Show Detail Page', () => { @@ -262,8 +262,8 @@ describe('Integration Tests for Alert Show Detail Page', () => { .should('be.visible') .should('have.text', 'consecutive occurrences.'); }); - // Validate the entity section (Entity and Region columns) - cy.get('[data-qa-section="Resources"]').within(() => { + // Validate the Resources section (Resource and Region columns) + cy.get('[data-qa-section="Entities"]').within(() => { ui.heading .findByText('entity') .scrollIntoView() @@ -283,7 +283,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { cy.get('[data-qa-alert-row]').should('have.length', 4); - // Validate entity-region mapping for each row in the table + // Validate resource-region mapping for each row in the table const regionMap = new Map(regions.map((r) => [r.id, r.label])); @@ -307,7 +307,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { }); }); - // Sorting by Entity and Region columns + // Sorting by Resource and Region columns ui.heading.findByText('entity').should('be.visible').click(); verifyRowOrder(['4', '3', '2', '1']); @@ -320,7 +320,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { ui.heading.findByText('region').should('be.visible').click(); verifyRowOrder(['1', '3', '2', '4']); - // Search by Entity + // Search by Resource cy.findByPlaceholderText('Search for a Region or Entity') .should('be.visible') .type(databases[0].label); diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.test.tsx index c994270e564..3d9b4f78dbd 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertMaxSelectionText.test.tsx @@ -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.' ); }); }); From ff7c378de01327584c531d73c81916823df58b83 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Mon, 7 Apr 2025 14:54:38 +0530 Subject: [PATCH 12/17] upcoming: [DI-24470] - Refactoring --- .../cypress/e2e/core/cloudpulse/alert-show-details.spec.ts | 6 +++--- .../cypress/e2e/core/cloudpulse/create-user-alert.spec.ts | 2 +- .../cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts index 5e196d538d4..54ac5de4086 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts @@ -263,7 +263,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { .should('have.text', 'consecutive occurrences.'); }); // Validate the Resources section (Resource and Region columns) - cy.get('[data-qa-section="Entities"]').within(() => { + cy.get('[data-qa-section="Resources"]').within(() => { ui.heading .findByText('entity') .scrollIntoView() @@ -307,7 +307,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { }); }); - // Sorting by Resource and Region columns + // Sorting by entity and Region columns ui.heading.findByText('entity').should('be.visible').click(); verifyRowOrder(['4', '3', '2', '1']); @@ -320,7 +320,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { ui.heading.findByText('region').should('be.visible').click(); verifyRowOrder(['1', '3', '2', '4']); - // Search by Resource + // Search by Entity cy.findByPlaceholderText('Search for a Region or Entity') .should('be.visible') .type(databases[0].label); diff --git a/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts index 5f104680b9d..591e0d38016 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/create-user-alert.spec.ts @@ -150,7 +150,7 @@ const fillMetricDetailsForSpecificRule = ({ describe('Create Alert', () => { /* * - Confirms that users can navigate from the Alert Listings page to the Create Alert page. - * - Confirms that users can enter alert details, select entities, and configure conditions. + * - Confirms that users can enter alert details, select resources, and configure conditions. * - Confirms that the UI allows adding notification channels and setting thresholds. * - Confirms client-side validation when entering invalid metric values. * - Confirms that API interactions work correctly and return the expected responses. diff --git a/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts index f949394eeed..190b3c1c094 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts @@ -194,7 +194,7 @@ describe('Integration Tests for Edit Alert', () => { .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 entities are selected.' From e886a1920e7712eca1234f6370d2a1fb26a42ac7 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Mon, 7 Apr 2025 16:03:01 +0530 Subject: [PATCH 13/17] upcoming: [DI-24470] - Fix cypress --- .../cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts index 99ac3312939..90d9498dd7b 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts @@ -322,7 +322,6 @@ describe('Integration Tests for CloudPulse Alerts Listing Page', () => { }); ui.actionMenuItem.findByTitle(action).should('be.visible').click(); - ui.button.findByTitle(action).should('be.visible').click(); cy.wait(alias).then(({ response }) => { ui.toast.assertMessage(successMessage); From d70919eaffbac44e493b2bef40a6d9ccf368cf4e Mon Sep 17 00:00:00 2001 From: vmangalr Date: Mon, 7 Apr 2025 17:55:29 +0530 Subject: [PATCH 14/17] upcoming: [DI-24470] - More places fixes --- .../src/features/CloudPulse/Alerts/Utils/utils.test.ts | 4 ++-- .../manager/src/features/CloudPulse/Alerts/Utils/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.test.ts b/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.test.ts index 5ae9436d157..8ea86e22d5a 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.test.ts +++ b/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.test.ts @@ -118,7 +118,7 @@ describe('getValidationSchema', () => { await expect( schema.validate({ entity_ids: ['id1', 'id2', 'id3', 'id4'] }) ).rejects.toThrow( - "The overall number of resources assigned to an alert can't exceed 3." + "The overall number of entities assigned to an alert can't exceed 3." ); }); @@ -133,7 +133,7 @@ describe('getValidationSchema', () => { entity_ids: ['id1', 'id2', 'id3', 'id4', 'id5', 'id6'], }) ).rejects.toThrow( - "The overall number of resources assigned to an alert can't exceed 5." + "The overall number of entities assigned to an alert can't exceed 5." ); }); it('should combine all the API errors to the parent field and return in errorMap properly', () => { diff --git a/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.ts b/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.ts index 12016d107b1..426daa09796 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.ts +++ b/packages/manager/src/features/CloudPulse/Alerts/Utils/utils.ts @@ -327,7 +327,7 @@ export const enhanceValidationSchemaWithEntityIdValidation = ( .of(string()) .max( maxSelectionCount, - `The overall number of resources assigned to an alert can't exceed ${maxSelectionCount}.` + `The overall number of entities assigned to an alert can't exceed ${maxSelectionCount}.` ), }) as ObjectSchema< CreateAlertDefinitionForm | EditAlertDefinitionPayload From 833daf139c7311374e6e57a2bf72d08b42d9b396 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Wed, 9 Apr 2025 17:14:30 +0530 Subject: [PATCH 15/17] DI-23961 - Code review comments --- .../CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx | 4 ++-- .../Alerts/EditAlert/EditAlertResourcesConfirmationDialog.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx index fe881fd7dce..f39ebd2597a 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertLanding.test.tsx @@ -14,7 +14,7 @@ vi.mock('src/queries/cloudpulse/alerts', () => ({ })); describe('Edit Alert Landing tests', () => { - it('Edit alert resources alert details error and loading path', () => { + it('Edit alert entities alert details error and loading path', () => { queryMocks.useAlertDefinitionQuery.mockReturnValue({ data: undefined, isError: true, // simulate error @@ -40,7 +40,7 @@ describe('Edit Alert Landing tests', () => { expect(getByTestId('circle-progress')).toBeInTheDocument(); }); - it('Edit alert resources alert details empty path', () => { + it('Edit alert entities alert details empty path', () => { queryMocks.useAlertDefinitionQuery.mockReturnValue({ data: undefined, // simulate empty isError: false, diff --git a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResourcesConfirmationDialog.tsx b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResourcesConfirmationDialog.tsx index e141676bca4..9f181734eda 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResourcesConfirmationDialog.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/EditAlert/EditAlertResourcesConfirmationDialog.tsx @@ -64,7 +64,7 @@ export const EditAlertResourcesConfirmDialog = React.memo( })} variant="body1" > - You have changed the resource settings for your alert. + You have changed the entity settings for your alert.
This also updates your alert definition. From be0c973a7eebbdd14f5aff9a7cb999e3c4086f69 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Wed, 9 Apr 2025 19:52:46 +0530 Subject: [PATCH 16/17] DI-23961 - Fix linting issue --- .../cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts index 8481c24768f..3b754ca5e5b 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts @@ -347,7 +347,7 @@ describe('Integration Tests for CloudPulse Alerts Listing Page', () => { .click(); }); - cy.wait(alias).then(({}) => { + cy.wait(alias).then(() => { ui.toast.assertMessage(successMessage); }); }; From 20198b577507743dc643fb5794037a1c7a4d7605 Mon Sep 17 00:00:00 2001 From: vmangalr Date: Thu, 10 Apr 2025 15:09:04 +0530 Subject: [PATCH 17/17] DI-23961 - Use clean search placeholder --- .../e2e/core/cloudpulse/alert-show-details.spec.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts index 54ac5de4086..66ce078ffe3 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/alert-show-details.spec.ts @@ -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']); @@ -275,9 +276,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { .should('be.visible') .should('have.text', 'Region'); - cy.findByPlaceholderText('Search for a Region or Entity').should( - 'be.visible' - ); + cy.findByPlaceholderText(searchPlaceholder).should('be.visible'); cy.findByPlaceholderText('Select Regions').should('be.visible'); @@ -321,7 +320,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { verifyRowOrder(['1', '3', '2', '4']); // Search by Entity - cy.findByPlaceholderText('Search for a Region or Entity') + cy.findByPlaceholderText(searchPlaceholder) .should('be.visible') .type(databases[0].label); @@ -335,7 +334,7 @@ describe('Integration Tests for Alert Show Detail Page', () => { ); // Search by region - cy.findByPlaceholderText('Search for a Region or Entity').clear(); + cy.findByPlaceholderText(searchPlaceholder).clear(); ui.regionSelect.find().click().type(`${regions[0].label}{enter}`); ui.regionSelect.find().click();