From 2d34068014a3e7d34a23c64e6c028cfacd68e478 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 10 Nov 2023 16:33:40 -0300 Subject: [PATCH] show languages selected choices on top. --- generators/languages/prompts.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generators/languages/prompts.mjs b/generators/languages/prompts.mjs index 8d0614edb351..ea44dec9a984 100644 --- a/generators/languages/prompts.mjs +++ b/generators/languages/prompts.mjs @@ -59,7 +59,9 @@ export async function askForLanguages({ control }) { choices: () => { const languageOptions = this.supportedLanguages; const nativeLanguage = this.jhipsterConfigWithDefaults.nativeLanguage; - return languagesAsChoices(languageOptions.filter(l => l.languageTag !== nativeLanguage)); + const choices = languagesAsChoices(languageOptions.filter(l => l.languageTag !== nativeLanguage)); + const defaults = this.jhipsterConfigWithDefaults.languages; + return [...choices.filter(({ value }) => defaults.includes(value)), ...choices.filter(({ value }) => !defaults.includes(value))]; }, default: () => this.jhipsterConfigWithDefaults.languages, },