From 06c932c248e657055ea1c96747ee87fa13ae5d33 Mon Sep 17 00:00:00 2001 From: Philippe Rolet Date: Thu, 20 Jun 2024 16:44:57 +0200 Subject: [PATCH] [Dust Apps] Fix dataset descriptions shuffled (#5765) Description --- Fixes https://github.com/dust-tt/tasks/issues/893 Dataset keys and descr in 2 different arrays rely on matching by indices, but are not initially computed with indices matching. This initial computation is corrected in this PR Risk & deploy --- na --- front/components/app/DatasetView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/front/components/app/DatasetView.tsx b/front/components/app/DatasetView.tsx index cc63572ffb34..6417d69d81b3 100644 --- a/front/components/app/DatasetView.tsx +++ b/front/components/app/DatasetView.tsx @@ -206,7 +206,10 @@ export default function DatasetView({ ); const [datasetKeyDescriptions, setDatasetKeyDescriptions] = useState< string[] - >((schema || []).map((s) => s.description || "")); + >( + datasetKeys.map((k) => schema?.find((s) => s.key === k)?.description || "") + ); + const [datasetTypes, setDatasetTypes] = useState([]); const [datasetInitializing, setDatasetInitializing] = useState(true);