);
}
+ 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;
<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 } }}
}
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 () {