From f445b7ce3f4a2fd1a988ea1ccca16b0ef6df4ae9 Mon Sep 17 00:00:00 2001 From: Psami-wondah Date: Wed, 14 Aug 2024 18:06:06 +0100 Subject: [PATCH] feat: DX-1693 - Dataset Listing Name start with Z-A, must be A-Z --- .../components/AssetCollection/Charts/chartsGrid.tsx | 6 +++--- .../components/AssetCollection/Datasets/datasetsGrid.tsx | 4 +++- .../components/AssetCollection/Reports/reportsGrid.tsx | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/modules/home-module/components/AssetCollection/Charts/chartsGrid.tsx b/src/app/modules/home-module/components/AssetCollection/Charts/chartsGrid.tsx index b08539b4f..fbe685fa3 100644 --- a/src/app/modules/home-module/components/AssetCollection/Charts/chartsGrid.tsx +++ b/src/app/modules/home-module/components/AssetCollection/Charts/chartsGrid.tsx @@ -63,9 +63,9 @@ export default function ChartsGrid(props: Props) { props.searchStr?.length > 0 ? `"where":{"name":{"like":"${props.searchStr}.*","options":"i"}},` : ""; - return `filter={${value}"order":"${ - props.sortBy - } desc","limit":${limit},"offset":${fromZeroOffset ? 0 : offset}}`; + return `filter={${value}"order":"${props.sortBy} ${ + props.sortBy === "name" ? "asc" : "desc" + }","limit":${limit},"offset":${fromZeroOffset ? 0 : offset}}`; }; const getWhereString = () => { diff --git a/src/app/modules/home-module/components/AssetCollection/Datasets/datasetsGrid.tsx b/src/app/modules/home-module/components/AssetCollection/Datasets/datasetsGrid.tsx index 60220d87c..8667383e3 100644 --- a/src/app/modules/home-module/components/AssetCollection/Datasets/datasetsGrid.tsx +++ b/src/app/modules/home-module/components/AssetCollection/Datasets/datasetsGrid.tsx @@ -72,7 +72,9 @@ export default function DatasetsGrid(props: Readonly) { return `${props.userOnly ? "userOnly=true&" : ""}filter={${value}"order":"${ props.sortBy - } desc","limit":${limit},"offset":${fromZeroOffset ? 0 : offset}}`; + } ${props.sortBy === "name" ? "asc" : "desc"}","limit":${limit},"offset":${ + fromZeroOffset ? 0 : offset + }}`; }; const getWhereString = () => { diff --git a/src/app/modules/home-module/components/AssetCollection/Reports/reportsGrid.tsx b/src/app/modules/home-module/components/AssetCollection/Reports/reportsGrid.tsx index b8a1f273e..70360fccd 100644 --- a/src/app/modules/home-module/components/AssetCollection/Reports/reportsGrid.tsx +++ b/src/app/modules/home-module/components/AssetCollection/Reports/reportsGrid.tsx @@ -57,9 +57,9 @@ export default function ReportsGrid(props: Props) { props.searchStr?.length > 0 ? `"where":{"name":{"like":"${props.searchStr}.*","options":"i"}},` : ""; - return `filter={${value}"order":"${ - props.sortBy - } desc","limit":${limit},"offset":${fromZeroOffset ? 0 : offset}}`; + return `filter={${value}"order":"${props.sortBy} ${ + props.sortBy === "name" ? "asc" : "desc" + }","limit":${limit},"offset":${fromZeroOffset ? 0 : offset}}`; }; const getWhereString = () => {