From 85d9f694aad86872a06c17562690af77deda8f4b Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 19 Jul 2016 14:23:17 +0200 Subject: SONAR-7811 make warning badge rendering consistent --- .../apps/quality-profiles/details/ProfileHeader.js | 42 +++++++++++++++------- .../apps/quality-profiles/home/ProfilesListRow.js | 6 ++-- 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'server/sonar-web/src/main/js') diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.js b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.js index bef63b8da97..439be30205c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.js @@ -19,7 +19,6 @@ */ import React from 'react'; import { Link, IndexLink } from 'react-router'; -import classNames from 'classnames'; import ProfileLink from '../components/ProfileLink'; import ProfileActions from '../components/ProfileActions'; import ProfileDate from '../components/ProfileDate'; @@ -36,30 +35,47 @@ export default class ProfileHeader extends React.Component { renderUpdateDate () { const { profile } = this.props; - const warning = isStagnant(profile); - const className = classNames('small spacer-right', { - 'alert-warning': warning - }); - return ( -
  • + let inner = ( + {translate('quality_profiles.updated_')} {' '} + + ); + if (isStagnant(profile)) { + inner = ( + + {inner} + + ); + } + return ( +
  • + {inner}
  • ); } renderUsageDate () { const { profile } = this.props; - const warning = !profile.lastUsed; - const className = classNames('small big-spacer-right', { - 'alert-warning': warning - }); - return ( -
  • + let inner = ( + {translate('quality_profiles.used_')} {' '} + + ); + if (!profile.lastUsed) { + inner = ( + + {inner} + + ); + } + + return ( +
  • + {inner}
  • ); } diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.js b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.js index eeefc1b2514..255b2bb1e9e 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.js @@ -86,7 +86,7 @@ export default class ProfilesListRow extends React.Component {
    {profile.activeDeprecatedRuleCount > 0 && ( - @@ -105,7 +105,7 @@ export default class ProfilesListRow extends React.Component { renderUpdateDate () { const date = ; if (isStagnant(this.props.profile)) { - return {date}; + return {date}; } else { return date; } @@ -115,7 +115,7 @@ export default class ProfilesListRow extends React.Component { const { lastUsed } = this.props.profile; const date = ; if (!lastUsed) { - return {date}; + return {date}; } else { return date; } -- cgit v1.2.3