From aed90ea8cb336a131da90d32a89701f60e0ee86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Diamond?= <32074058+Andre-Diamond@users.noreply.github.com> Date: Thu, 27 Jun 2024 06:17:16 +0200 Subject: [PATCH] Alphabetical order for WGs - [Date: 2024-06-15] Fixes #118 --- pages/submit-meeting-summary/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/submit-meeting-summary/index.tsx b/pages/submit-meeting-summary/index.tsx index f9150cb..c5cf789 100644 --- a/pages/submit-meeting-summary/index.tsx +++ b/pages/submit-meeting-summary/index.tsx @@ -44,6 +44,11 @@ const SubmitMeetingSummary: NextPage = () => { const names1 = await getNames(); const tags1 = await getTags(); + // Sort workgroups alphabetically by workgroup name + const sortedWorkgroups = workgroupList.sort((a: Workgroup, b: Workgroup) => + a.workgroup.localeCompare(b.workgroup) + ); + let newNames = names1.map((value) => ({ value: value.name, label: value.name })); let otherTags = tags1 @@ -66,7 +71,7 @@ const SubmitMeetingSummary: NextPage = () => { .filter(tag => tag.type === 'gamesPlayed') .map(tag => ({ value: tag.tag, label: tag.tag })); - setWorkgroups(workgroupList); + setWorkgroups(sortedWorkgroups); setNames(newNames); setTags({ other: otherTags, emotions: emotionTags, topicsCovered: topicTags, references: referenceTags, gamesPlayed: gamesPlayedTags }); setIsLoading(false);