From e12d945aed470019df4873abece4b3df90aed4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Gonz=C3=A1lez=20Mu=C3=B1oz?= Date: Fri, 3 Nov 2023 09:20:25 +0100 Subject: [PATCH] features list: sort by name as well when tag sorting is selected --- .../sidebar/project/inventory-panel/features/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/layout/project/sidebar/project/inventory-panel/features/index.tsx b/app/layout/project/sidebar/project/inventory-panel/features/index.tsx index c1973c35cc..a351581f83 100644 --- a/app/layout/project/sidebar/project/inventory-panel/features/index.tsx +++ b/app/layout/project/sidebar/project/inventory-panel/features/index.tsx @@ -50,7 +50,13 @@ const InventoryPanelFeatures = ({ noData: noDataMessage }: { noData: string }): const allFeaturesQuery = useAllFeatures( pid, { - ...filters, + ...{ + ...filters, + // ? if tag sorting is chosen, sort by tag and then by name + ...(['tag', '-tag'].includes(filters.sort) && { + sort: `${filters.sort},featureClassName`, + }), + }, search, }, {