From af31633ca4df34d91f7042b498b4201dc619e1ac Mon Sep 17 00:00:00 2001 From: santoshp210-akamai <159890961+santoshp210-akamai@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:16:04 +0530 Subject: [PATCH 1/2] fix: [DI-29215] - sort service type column on label --- .../cloudpulse/alerts-listing-page.spec.ts | 2 +- .../e2e/core/cloudpulse/groupby-tags.spec.ts | 2 +- .../Alerts/AlertsListing/AlertListTable.tsx | 20 +++++++++++++++++-- .../Alerts/AlertsListing/constants.ts | 2 +- packages/manager/src/mocks/serverHandlers.ts | 4 ++-- 5 files changed, 23 insertions(+), 7 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 adb9afa816c..f2b1701a8de 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 @@ -235,7 +235,7 @@ describe('Integration Tests for CloudPulse Alerts Listing Page', () => { { ascending: [2, 4, 1, 3], column: 'status', descending: [1, 3, 2, 4] }, { ascending: [1, 2, 3, 4], - column: 'service_type', + column: 'service_type_label', descending: [3, 4, 1, 2], }, { diff --git a/packages/manager/cypress/e2e/core/cloudpulse/groupby-tags.spec.ts b/packages/manager/cypress/e2e/core/cloudpulse/groupby-tags.spec.ts index e6eb5094c01..8f6165c5ce7 100644 --- a/packages/manager/cypress/e2e/core/cloudpulse/groupby-tags.spec.ts +++ b/packages/manager/cypress/e2e/core/cloudpulse/groupby-tags.spec.ts @@ -99,7 +99,7 @@ describe('Integration Tests for Grouping Alerts by Tags on the CloudPulse Alerts ui.button.findByAttribute('aria-label', 'Toggle group by tag').click(); // Validate table headers are visible - ['label', 'status', 'service_type', 'created_by', 'updated'].forEach( + ['label', 'status', 'service_type_label', 'created_by', 'updated'].forEach( (header) => { ui.heading.findByText(header).should('be.visible'); } diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/AlertListTable.tsx b/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/AlertListTable.tsx index ab210d68564..c85360080a3 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/AlertListTable.tsx +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/AlertListTable.tsx @@ -230,12 +230,28 @@ export const AlertsListTable = React.memo((props: AlertsListTableProps) => { } }; + // Create a map for service value-to-label mapping to optimize sorting + const serviceValueToLabelMap = React.useMemo(() => { + return services.reduce>((map, { label, value }) => { + map[value] = label; + return map; + }, {}); + }, [services]); + + const alertsWithServiceLabels = React.useMemo(() => { + return alerts.map((alert) => ({ + ...alert, + service_type_label: + serviceValueToLabelMap[alert.service_type] || alert.service_type, + })); + }, [alerts, serviceValueToLabelMap]); + const { order, orderBy, handleOrderChange, sortedData } = useOrderV2({ - data: alerts, + data: alertsWithServiceLabels, initialRoute: { defaultOrder: { order: 'asc', - orderBy: 'service_type', + orderBy: 'service_type_label', }, from: '/alerts/definitions', }, diff --git a/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/constants.ts b/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/constants.ts index f9e8fd7f37a..e6ee4f53937 100644 --- a/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/constants.ts +++ b/packages/manager/src/features/CloudPulse/Alerts/AlertsListing/constants.ts @@ -12,7 +12,7 @@ export const AlertListingTableLabelMap = [ }, { colName: 'Service', - label: 'service_type', + label: 'service_type_label', }, { colName: 'Created By', diff --git a/packages/manager/src/mocks/serverHandlers.ts b/packages/manager/src/mocks/serverHandlers.ts index 7f330fc1596..59ae52d766d 100644 --- a/packages/manager/src/mocks/serverHandlers.ts +++ b/packages/manager/src/mocks/serverHandlers.ts @@ -3772,7 +3772,7 @@ export const handlers = [ }), }), serviceTypesFactory.build({ - label: 'Block Storage', + label: 'Volume', service_type: 'blockstorage', regions: 'us-iad,us-east', alert: serviceAlertFactory.build({ scope: ['entity'] }), @@ -3798,7 +3798,7 @@ export const handlers = [ nodebalancer: 'NodeBalancers', firewall: 'Firewalls', objectstorage: 'Object Storage', - blockstorage: 'Block Storage', + blockstorage: 'Volume', lke: 'LKE Enterprise', }; const response = serviceTypesFactory.build({ From 754b9bda2e90bf74df6dc42534c17d7a206a72f7 Mon Sep 17 00:00:00 2001 From: santoshp210-akamai <159890961+santoshp210-akamai@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:50:27 +0530 Subject: [PATCH 2/2] add changeset --- packages/manager/.changeset/pr-13295-fixed-1768900807343.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-13295-fixed-1768900807343.md diff --git a/packages/manager/.changeset/pr-13295-fixed-1768900807343.md b/packages/manager/.changeset/pr-13295-fixed-1768900807343.md new file mode 100644 index 00000000000..b7f993dd9d3 --- /dev/null +++ b/packages/manager/.changeset/pr-13295-fixed-1768900807343.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +ACLP-Alerting List sorting from service_type to service_type label ([#13295](https://github.com/linode/manager/pull/13295))