* 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';
.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">
)}
</div>
<ul>
- {profilesWithDeprecations.map(profile => (
+ {sortedProfiles.map(profile => (
<li key={profile.key} className="spacer-top">
<div className="text-ellipsis">
<ProfileLink
<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">
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;
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;