aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-profiles
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-07-18 14:41:58 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-07-18 18:26:58 +0200
commit655d123958ad814fba45877e9cf31a5fbb52d11b (patch)
treeb29c345785de02a8d568fb656874b0e13a3d07da /server/sonar-web/src/main/js/apps/quality-profiles
parent8a2dbae335b8d7d9ab4a0c9e16a29bd5a23be086 (diff)
downloadsonarqube-655d123958ad814fba45877e9cf31a5fbb52d11b.tar.gz
sonarqube-655d123958ad814fba45877e9cf31a5fbb52d11b.zip
SONAR-7811 warn about profiles that were never used
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileDate.js2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileHeader.js21
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.js8
3 files changed, 24 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileDate.js b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileDate.js
index a538383bd82..8abac7aea15 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileDate.js
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileDate.js
@@ -36,7 +36,7 @@ export default class ProfileDate extends React.Component {
if (!date) {
return (
- <span className="text-muted">{translate('never')}</span>
+ <span>{translate('never')}</span>
);
}
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 51db2e4b8ac..bef63b8da97 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
@@ -49,6 +49,21 @@ export default class ProfileHeader extends React.Component {
);
}
+ renderUsageDate () {
+ const { profile } = this.props;
+ const warning = !profile.lastUsed;
+ const className = classNames('small big-spacer-right', {
+ 'alert-warning': warning
+ });
+ return (
+ <li className={className}>
+ {translate('quality_profiles.used_')}
+ {' '}
+ <ProfileDate date={profile.lastUsed}/>
+ </li>
+ );
+ }
+
render () {
const { profile } = this.props;
@@ -77,11 +92,7 @@ export default class ProfileHeader extends React.Component {
<div className="pull-right">
<ul className="list-inline" style={{ lineHeight: '24px' }}>
{this.renderUpdateDate()}
- <li className="small big-spacer-right">
- {translate('quality_profiles.used_')}
- {' '}
- <ProfileDate date={profile.lastUsed}/>
- </li>
+ {this.renderUsageDate()}
<li>
<Link
to={{ pathname: '/changelog', query: { key: profile.key } }}
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 fe65cbcce23..eeefc1b2514 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
@@ -112,7 +112,13 @@ export default class ProfilesListRow extends React.Component {
}
renderUsageDate () {
- return <ProfileDate date={this.props.profile.lastUsed}/>;
+ const { lastUsed } = this.props.profile;
+ const date = <ProfileDate date={lastUsed}/>;
+ if (!lastUsed) {
+ return <span className="badge badge-focus">{date}</span>;
+ } else {
+ return date;
+ }
}
render () {