mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
UI – sort case-insensitively and update default sort (#15808)
## Addresses #15253 - sort case-insensitively in the query results (live), query report, and host query report tables - default to sorting by the host display name in the query results and by `last_fetched` for the query report tables - (unchanged) host query reports sort by the first column of the results, since all `last_fetched` are the same <img width="383" alt="Screenshot 2023-12-21 at 9 49 31 AM" src="https://github.com/fleetdm/fleet/assets/61553566/2bb5ede1-c40e-4974-9079-4851650163cb"> ## Checklist for submitter - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
2f937ce9a2
commit
87196f43c3
6 changed files with 7 additions and 0 deletions
2
changes/15253-sort-results-case-insensitively
Normal file
2
changes/15253-sort-results-case-insensitively
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
* Sort query results and reports case insensitively, and default to sorting by the host display name
|
||||
column
|
||||
|
|
@ -59,6 +59,7 @@ const generateColumnConfigs = (rows: Record<string, string>[]) =>
|
|||
Filter: DefaultColumnFilter, // Component hides filter for last_fetched
|
||||
filterType: "text",
|
||||
disableSortBy: false,
|
||||
sortType: "caseInsensitive",
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ const QueryReport = ({
|
|||
/>
|
||||
);
|
||||
}}
|
||||
defaultSortHeader="last_fetched"
|
||||
isLoading={false}
|
||||
isClientSidePagination
|
||||
isClientSideFilter
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ const generateReportColumnConfigsFromResults = (results: any[]): Column[] => {
|
|||
Filter: DefaultColumnFilter, // Component hides filter for last_fetched
|
||||
filterType: "text",
|
||||
disableSortBy: false,
|
||||
sortType: "caseInsensitive",
|
||||
};
|
||||
});
|
||||
return _unshiftHostname(columnConfigs);
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ const QueryResults = ({
|
|||
return (
|
||||
<div className={`${baseClass}__results-table-container`}>
|
||||
<TableContainer
|
||||
defaultSortHeader="host_display_name"
|
||||
columnConfigs={
|
||||
tableType === "results" ? resultsColumnConfigs : errorColumnConfigs
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ const generateColumnConfigsFromRows = (
|
|||
},
|
||||
Filter: DefaultColumnFilter,
|
||||
disableSortBy: false,
|
||||
sortType: "caseInsensitive",
|
||||
};
|
||||
});
|
||||
return _unshiftHostname(columnsConfigs);
|
||||
|
|
|
|||
Loading…
Reference in a new issue