From 3f4c30e53e63aeab74d0ae571e82c62450fe357c Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Tue, 14 Jan 2025 15:44:50 +0000 Subject: [PATCH] fix(machines): Allow sorting by disks and storage (3.6 backport) (#5578) - Added `total_storage` and `physical_disk_count` as valid fetch group keys - Added `onClick` handlers to disks and storage column headers to update the sort key Resolves [LP#2092299](https://bugs.launchpad.net/maas-ui/+bug/2092299) --- .../MachineList/MachineListTable/MachineListTable.tsx | 8 ++++---- src/app/store/machine/types/actions.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/machines/views/MachineList/MachineListTable/MachineListTable.tsx b/src/app/machines/views/MachineList/MachineListTable/MachineListTable.tsx index 8d5204c925..d581db3051 100644 --- a/src/app/machines/views/MachineList/MachineListTable/MachineListTable.tsx +++ b/src/app/machines/views/MachineList/MachineListTable/MachineListTable.tsx @@ -340,8 +340,8 @@ export const MachineListTable = ({ updateSort(FetchGroupKey.PhysicalDiskCount)} + sortKey={FetchGroupKey.PhysicalDiskCount} > {columnLabels[MachineColumns.DISKS]} @@ -355,8 +355,8 @@ export const MachineListTable = ({ updateSort(FetchGroupKey.TotalStorage)} + sortKey={FetchGroupKey.TotalStorage} > {columnLabels[MachineColumns.STORAGE]} diff --git a/src/app/store/machine/types/actions.ts b/src/app/store/machine/types/actions.ts index 8c3368a418..46a2fe5771 100644 --- a/src/app/store/machine/types/actions.ts +++ b/src/app/store/machine/types/actions.ts @@ -403,6 +403,7 @@ export enum FetchGroupKey { Ownerdata = "ownerdata", Parent = "parent", ParentId = "parent_id", + PhysicalDiskCount = "physical_disk_count", Podhints = "podhints", Pod = "pod", PodType = "pod_type", @@ -430,6 +431,7 @@ export enum FetchGroupKey { SyncInterval = "sync_interval", SystemId = "system_id", Tags = "tags", + TotalStorage = "total_storage", Updated = "updated", Url = "url", Virtualmachine = "virtualmachine",