]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13459 Sort Quality Profiles by display name
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Mon, 15 Jun 2020 08:09:03 +0000 (10:09 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 19 Jun 2020 20:04:42 +0000 (20:04 +0000)
server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx

index e03ae4f3b72ba12b1c37244573b70aff42b07a1a..ba36aed88abcd60cef6a9af96958087f26725750 100644 (file)
@@ -102,7 +102,12 @@ export default class ProfilesList extends React.PureComponent<Props> {
 
     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 (
       <div>