From ecaa7f2801ae310598dcc7ead7833a1010ae56aa Mon Sep 17 00:00:00 2001 From: OxSaitama Date: Fri, 13 Oct 2023 13:50:40 +0200 Subject: [PATCH] sort documentTypes by label --- .../Layouts/Folder/AskDocuments/ParameterDocuments/index.tsx | 1 + src/front/Components/Layouts/Folder/AskDocuments/index.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/front/Components/Layouts/Folder/AskDocuments/ParameterDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/ParameterDocuments/index.tsx index 1425919d..3bda2b0b 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/ParameterDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/ParameterDocuments/index.tsx @@ -40,6 +40,7 @@ export default function ParameterDocuments(props: IProps) { value: document.uid, }; }); + formattedOptions.sort((a, b) => a.label > b.label? 1 : -1); setFormattedOptions(formattedOptions); }, [props.folder.deed?.document_types]); diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index 1bfc9132..9e62b3e3 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -161,6 +161,8 @@ class AskDocumentsClass extends BasePage { }; }); + documentTypesOptions.sort((a, b) => a.label > b.label ? 1 : -1); + return documentTypesOptions; }