From c085f7c44fe534dbef0612055a44d6656c6b33f3 Mon Sep 17 00:00:00 2001 From: Peter Makowski Date: Tue, 7 Nov 2023 11:58:23 +0200 Subject: [PATCH] fix(machines): default to ascending sort (#5203) --- src/app/kvm/components/LXDVMsTable/LXDVMsTable.test.tsx | 2 +- .../machines/views/MachineList/MachineListTable/constants.ts | 2 +- src/app/tags/views/TagMachines/TagMachines.test.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/kvm/components/LXDVMsTable/LXDVMsTable.test.tsx b/src/app/kvm/components/LXDVMsTable/LXDVMsTable.test.tsx index 868e5032cf..679f5af278 100644 --- a/src/app/kvm/components/LXDVMsTable/LXDVMsTable.test.tsx +++ b/src/app/kvm/components/LXDVMsTable/LXDVMsTable.test.tsx @@ -46,7 +46,7 @@ describe("LXDVMsTable", () => { group_key: null, page_number: 1, page_size: 10, - sort_direction: FetchSortDirection.Descending, + sort_direction: FetchSortDirection.Ascending, sort_key: FetchGroupKey.Hostname, }); expect( diff --git a/src/app/machines/views/MachineList/MachineListTable/constants.ts b/src/app/machines/views/MachineList/MachineListTable/constants.ts index 36cdacc830..752d9eb660 100644 --- a/src/app/machines/views/MachineList/MachineListTable/constants.ts +++ b/src/app/machines/views/MachineList/MachineListTable/constants.ts @@ -2,7 +2,7 @@ import { SortDirection } from "app/base/types"; import { FetchGroupKey } from "app/store/machine/types"; export const DEFAULTS = { pageSize: 50, - sortDirection: SortDirection.DESCENDING, + sortDirection: SortDirection.ASCENDING, // TODO: change this to fqdn when the API supports it: // https://github.com/canonical/app-tribe/issues/1268 sortKey: FetchGroupKey.Hostname, diff --git a/src/app/tags/views/TagMachines/TagMachines.test.tsx b/src/app/tags/views/TagMachines/TagMachines.test.tsx index 4dbc70fdfc..144b954751 100644 --- a/src/app/tags/views/TagMachines/TagMachines.test.tsx +++ b/src/app/tags/views/TagMachines/TagMachines.test.tsx @@ -94,7 +94,7 @@ it("dispatches actions to fetch necessary data", () => { group_key: null, page_number: 1, page_size: 50, - sort_direction: FetchSortDirection.Descending, + sort_direction: FetchSortDirection.Ascending, sort_key: FetchGroupKey.Hostname, }), tagActions.fetch(),