]> source.dussan.org Git - sonarqube.git/commitdiff
increase visibility of deprecated rules on profiles page
authorStas Vilchik <vilchiks@gmail.com>
Wed, 13 Jul 2016 13:03:09 +0000 (15:03 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 13 Jul 2016 13:32:13 +0000 (15:32 +0200)
server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionDeprecated.js
server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.js
server/sonar-web/src/main/js/apps/quality-profiles/styles.css
server/sonar-web/src/main/less/components/badges.less

index 132aa9eef92ea6c782818e220b601de99b5c499c..6d26699393a88dce5314db454828c5ceda5216a8 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import React from 'react';
+import sortBy from 'lodash/sortBy';
 import ProfileLink from '../components/ProfileLink';
 import { getDeprecatedActiveRulesUrl } from '../../../helpers/urls';
 import { ProfilesListType } from '../propTypes';
@@ -40,6 +41,9 @@ export default class EvolutionDeprecated extends React.Component {
         .map(p => p.activeDeprecatedRuleCount)
         .reduce((p, c) => p + c, 0);
 
+    const sortedProfiles =
+        sortBy(profilesWithDeprecations, p => -p.activeDeprecatedRuleCount);
+
     return (
         <div
             className="quality-profile-box quality-profiles-evolution-deprecated">
@@ -54,7 +58,7 @@ export default class EvolutionDeprecated extends React.Component {
             )}
           </div>
           <ul>
-            {profilesWithDeprecations.map(profile => (
+            {sortedProfiles.map(profile => (
                 <li key={profile.key} className="spacer-top">
                   <div className="text-ellipsis">
                     <ProfileLink
index 2ff6c99936c0084db0f40d8bbdb50ca023f04a12..fe65cbcce23afe61588dacdc5f4332b698c8a5ef 100644 (file)
@@ -86,7 +86,7 @@ export default class ProfilesListRow extends React.Component {
         <div>
           {profile.activeDeprecatedRuleCount > 0 && (
               <span className="spacer-right">
-                <a className="badge badge-focus"
+                <a className="badge badge-danger-light"
                    href={deprecatedRulesUrl}
                    title={translate('quality_profiles.deprecated_rules')}
                    data-toggle="tooltip">
index 0c1a947cfac942a6fee738724a3275107725a57a..5d97a57c5247c09d9cc6f675075457f219ca3e89 100644 (file)
   padding-top: 55px;
 }
 
-.quality-profiles-evolution-deprecated,
+.quality-profiles-evolution-deprecated {
+  margin-bottom: 20px;
+  border-color: #ebccd1;
+  background-color: #f2dede;
+}
+
 .quality-profiles-evolution-stagnant {
   margin-bottom: 20px;
   border-color: #faebcc;
index e130b6a6c047f83a8280a6186e3223b04fc77cea..1d0b557f708f50a5c470d7c1a98541ec5828f408 100644 (file)
   background-color: @red
 }
 
+.badge-danger-light {
+  border: 1px solid #ebccd1 !important;
+  border-radius: 3px;
+  background-color: #f2dede;
+  color: #a94442;
+
+  a&:hover, a&:focus, a&:active { color: #a94442; }
+}
+
 .badge-focus {
   border: 1px solid #faebcc;
   border-radius: 3px;