From 77496e8d0f7e52d712ea5d92ec824f11fe0ee365 Mon Sep 17 00:00:00 2001 From: "Amy J. Ko" Date: Sun, 21 Jul 2024 11:26:23 -0700 Subject: [PATCH] Sorted role titles on process page. --- CHANGELOG | 1 + src/routes/org/[orgid]/process/[processid]/+page.svelte | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c5efd32..e48c1f2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ Dates should be in`YYYY-MM-DD` format and versions are in [semantic versioning]( - Resolved issue where Supabase client would become unresponsive after tab change. - Improved styling of fields. +- Sorted role titles on process page. ## v0.6.0 2024-07-05 diff --git a/src/routes/org/[orgid]/process/[processid]/+page.svelte b/src/routes/org/[orgid]/process/[processid]/+page.svelte index 4d4d125..5b0ffea 100644 --- a/src/routes/org/[orgid]/process/[processid]/+page.svelte +++ b/src/routes/org/[orgid]/process/[processid]/+page.svelte @@ -128,9 +128,12 @@ tip="Choose a role to be accountable for the processes outcomes." options={[ { value: undefined, label: '—' }, - ...$org.getRoles().map((role) => { - return { value: role.id, label: role.title }; - }) + ...$org + .getRoles() + .toSorted((a, b) => a.title.localeCompare(b.title)) + .map((role) => { + return { value: role.id, label: role.title }; + }) ]} selection={process.accountable ?? undefined} change={(value) => $db.updateProcessAccountable(process, value ?? null)}