From 8cbfbbe99dab20d6ecf3477d64888e474dbe6428 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Mon, 15 Jun 2020 10:09:03 +0200 Subject: [PATCH] SONAR-13459 Sort Quality Profiles by display name --- .../main/js/apps/quality-profiles/home/ProfilesList.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx index e03ae4f3b72..ba36aed88ab 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx @@ -102,7 +102,12 @@ export default class ProfilesList extends React.PureComponent { const profilesToShow = language ? pick(profilesIndex, language) : profilesIndex; - const languagesToShow = sortBy(Object.keys(profilesToShow)); + let languagesToShow: string[]; + if (language) { + languagesToShow = languages.find(({ key }) => key === language) ? [language] : []; + } else { + languagesToShow = sortBy(languages, ({ name }) => name).map(({ key }) => key); + } return (
-- 2.39.5