Skip to content

Commit

Permalink
fix(wizard): sort projects in project-selection step (#441)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Stracke <[email protected]>
  • Loading branch information
markushi and Lms24 authored Sep 12, 2023
1 parent 4be7aff commit 72c8f11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- feat(sourcemaps): Automatically insert Sentry Webpack plugin (#432)
- fix(android): Add support for unusual import statements (#440)
- fix(wizard): Sort projects in project-selection step #441

## 3.11.0

Expand Down
11 changes: 9 additions & 2 deletions src/utils/clack-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,21 @@ async function askForWizardLogin(options: {
async function askForProjectSelection(
projects: SentryProjectData[],
): Promise<SentryProjectData> {
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),
};
}),
}),
Expand Down

0 comments on commit 72c8f11

Please sign in to comment.