Fleet UI: Queries default to alpha order (#12924)

This commit is contained in:
RachelElysia
2023-07-27 13:53:25 -07:00
committed by Jacob Shandling
parent 0b503a6182
commit 8b5f7fbae9
@@ -66,8 +66,14 @@ const ManageAutomationsModal = ({
// TODO: Error handling, if any
const [errors, setErrors] = useState<{ [key: string]: string }>({});
// Client side sort queries alphabetically
const sortedAvailableQueries =
availableQueries?.sort((a, b) =>
a.name.toLowerCase().localeCompare(b.name.toLowerCase())
) || [];
const { queryItems, updateQueryItems } = useCheckboxListStateManagement(
availableQueries || [],
sortedAvailableQueries,
automatedQueryIds || []
);