]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7920 sort links
authorStas Vilchik <vilchiks@gmail.com>
Wed, 10 Aug 2016 12:19:17 +0000 (14:19 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 10 Aug 2016 12:19:17 +0000 (14:19 +0200)
server/sonar-web/src/main/js/apps/overview/meta/MetaLinks.js
server/sonar-web/src/main/js/apps/project-admin/links/utils.js

index 1bc4b5ce2563d5eba011d1593a654e810ab9b1cd..067b04483c533ece96f70a2177036ce937a881d0 100644 (file)
@@ -19,7 +19,7 @@
  */
 import React from 'react';
 import { getProjectLinks } from '../../../api/projectLinks';
-import { isProvided } from '../../project-admin/links/utils';
+import { isProvided, orderLinks } from '../../project-admin/links/utils';
 
 export default class MetaLinks extends React.Component {
   static propTypes = {
@@ -64,9 +64,11 @@ export default class MetaLinks extends React.Component {
       return null;
     }
 
+    const orderedLinks = orderLinks(links);
+
     return (
         <ul className="overview-meta-list big-spacer-bottom">
-          {links.map(link => (
+          {orderedLinks.map(link => (
               <li key={link.id}>
                 <a className="link-with-icon" href={link.url} target="_blank">
                   {this.renderLinkIcon(link)}
index 9a34509d38bd0bc31f110bf7399ec09d988f8ae1..d04c67a4c89d6a10cb2575684c8cbfa14ec8e6be 100644 (file)
@@ -36,7 +36,7 @@ export function orderLinks (links) {
   const [provided, unknown] = partition(links, isProvided);
   return [
     ...sortBy(provided, link => PROVIDED_TYPES.indexOf(link.type)),
-    ...sortBy(unknown, link => link.name)
+    ...sortBy(unknown, link => link.name.toLowerCase())
   ];
 }