From b7c9b1ec1878aab2bd2707c56de38c52284961c6 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 12 Sep 2023 10:00:03 +0200 Subject: [PATCH 1/3] enh(wizard): sort projects in project-selection step --- src/utils/clack-utils.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/utils/clack-utils.ts b/src/utils/clack-utils.ts index dcbada0e..5d30ae36 100644 --- a/src/utils/clack-utils.ts +++ b/src/utils/clack-utils.ts @@ -778,14 +778,21 @@ async function askForWizardLogin(options: { async function askForProjectSelection( projects: SentryProjectData[], ): Promise { + const label = (project: SentryProjectData): string => { + return `${project.organization.slug}/${project.slug}`; + }; + const sortedProjects = [...projects]; + sortedProjects.sort((a: SentryProjectData, b: SentryProjectData) => { + return label(a).localeCompare(label(b)); + }); const selection: SentryProjectData | symbol = await abortIfCancelled( clack.select({ maxItems: 12, message: 'Select your Sentry project.', - options: projects.map((project) => { + options: sortedProjects.map((project) => { return { value: project, - label: `${project.organization.slug}/${project.slug}`, + label: label(project), }; }), }), From b2b36380242d4e67fb23e28270622b684226d952 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 12 Sep 2023 10:06:38 +0200 Subject: [PATCH 2/3] Add changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2abdacd..c456be33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- enh(wizard): sort projects in project-selection step #441 + ## 3.11.0 - feat(android): Add wizard support for Android (#389) From ab3ebfac378813356771f1d808418b16afaa6a47 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 12 Sep 2023 11:45:54 +0200 Subject: [PATCH 3/3] Add PR suggestions Co-authored-by: Lukas Stracke --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c456be33..85fddb79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- enh(wizard): sort projects in project-selection step #441 +- fix(wizard): Sort projects in project-selection step #441 ## 3.11.0