diff --git a/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx b/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx index e82991610c..21d7b8ad2b 100644 --- a/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx +++ b/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx @@ -62,20 +62,21 @@ const InventoryPanelCostSurface = ({ noData: noDataMessage }: { noData: string } ); const filteredData = useMemo(() => { + if (!allProjectCostSurfacesQuery.data.length) return allProjectCostSurfacesQuery.data; let sortedData = allProjectCostSurfacesQuery.data; - if (filters.sort === '-name') { - sortedData = orderBy(allProjectCostSurfacesQuery.data, 'name', 'desc'); + switch (filters.sort) { + case 'name': + sortedData = orderBy(allProjectCostSurfacesQuery.data, 'name', 'asc'); + break; + case '-name': + sortedData = orderBy(allProjectCostSurfacesQuery.data, 'name', 'desc'); + break; } - if (search) { - sortedData = sortedData.filter((cs) => - cs.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) - ); - } - - // the API assumes the default sort is ascending - return sortedData; + return sortedData.filter((cs) => + cs.name.toLocaleLowerCase().includes(search?.toLocaleLowerCase()) + ); }, [filters, allProjectCostSurfacesQuery.data, search]); const costSurfaceIds = filteredData?.map((cs) => cs.id); diff --git a/app/layout/project/sidebar/project/inventory-panel/features/modals/upload/index.tsx b/app/layout/project/sidebar/project/inventory-panel/features/modals/upload/index.tsx index a233151024..4417304f2a 100644 --- a/app/layout/project/sidebar/project/inventory-panel/features/modals/upload/index.tsx +++ b/app/layout/project/sidebar/project/inventory-panel/features/modals/upload/index.tsx @@ -283,7 +283,7 @@ export const FeatureUploadModal = ({ saveUploadMode(mode)} /> {uploadMode === 'csv' && ( -

+

Please download and fill in the{' '}