<ul>
{exportersForLanguage.map((exporter, index) => (
<li
- key={exporter.key}
+ className={index > 0 ? 'spacer-top' : undefined}
data-key={exporter.key}
- className={index > 0 ? 'spacer-top' : undefined}>
+ key={exporter.key}>
<a href={this.getExportUrl(exporter)} target="_blank">
{exporter.name}
</a>
const { profile } = this.props;
let inner = (
<span>
- {translate('quality_profiles.updated_')} <ProfileDate date={profile.userUpdatedAt} />
+ {translate('quality_profiles.updated_')} <ProfileDate date={profile.rulesUpdatedAt} />
</span>
);
if (isStagnant(profile)) {
return (
<header className="page-header quality-profile-header">
<div className="note spacer-bottom">
- <IndexLink to={getProfilesPath(organization)} className="text-muted">
+ <IndexLink className="text-muted" to={getProfilesPath(organization)}>
{translate('quality_profiles.page')}
</IndexLink>
{' / '}
<Link
- to={getProfilesForLanguagePath(profile.language, organization)}
- className="text-muted">
+ className="text-muted"
+ to={getProfilesForLanguagePath(profile.language, organization)}>
{profile.languageName}
</Link>
</div>
{this.renderUsageDate()}
<li>
<Link
- to={getProfileChangelogPath(profile.name, profile.language, organization)}
- className="button">
+ className="button"
+ to={getProfileChangelogPath(profile.name, profile.language, organization)}>
{translate('changelog')}
</Link>
</li>
autoFocus={true}
className="Select-big"
clearable={false}
- isLoading={this.state.loading}
// disable default react-select filtering
filterOptions={identity}
+ isLoading={this.state.loading}
noResultsText={noResultsText}
- optionRenderer={optionRenderer}
- options={options}
onChange={this.props.onChange}
onInputChange={this.handleInputChange}
+ optionRenderer={optionRenderer}
+ options={options}
placeholder=""
searchable={true}
value={this.props.selected && getStringValue(this.props.selected)}
/>
{TYPES.map(type => (
<ProfileRulesRowOfType
- key={type}
count={this.getRulesCountForType(type)}
+ key={type}
organization={organization}
qprofile={profile.key}
total={this.getRulesTotalForType(type)}
profile.actions.edit &&
!profile.isBuiltIn && (
<div className="text-right big-spacer-top">
- <Link to={activateMoreUrl} className="button js-activate-rules">
+ <Link className="button js-activate-rules" to={activateMoreUrl}>
{translate('quality_profiles.activate_more')}
</Link>
</div>
language={profile.language}
organization={organization}
profile={profile.key}
- sonarway={compareToSonarWay.profile}
sonarWayMissingRules={compareToSonarWay.missingRuleCount}
+ sonarway={compareToSonarWay.profile}
/>
)}
</div>
<tr>
<td>
<span>
- <IssueTypeIcon query={props.type} className="little-spacer-right" />
+ <IssueTypeIcon className="little-spacer-right" query={props.type} />
{translate('issue.type', props.type, 'plural')}
</span>
</td>
<td className="thin nowrap text-right">
{inactiveCount != null &&
(inactiveCount > 0 ? (
- <Link to={inactiveRulesUrl} className="small text-muted">
+ <Link className="small text-muted" to={inactiveRulesUrl}>
{formatMeasure(inactiveCount, 'SHORT_INT', null)}
</Link>
) : (
<td className="thin nowrap text-right">
{inactiveCount != null &&
(inactiveCount > 0 ? (
- <Link to={inactiveRulesUrl} className="small text-muted">
+ <Link className="small text-muted" to={inactiveRulesUrl}>
<strong>{formatMeasure(inactiveCount, 'SHORT_INT', null)}</strong>
</Link>
) : (
language="Java"
organization="foo"
profile="bar"
- sonarway="baz"
sonarWayMissingRules={158}
+ sonarway="baz"
/>
)
).toMatchSnapshot();
</div>
<ul>
{sortedProfiles.map(profile => (
- <li key={profile.key} className="spacer-top">
+ <li className="spacer-top" key={profile.key}>
<div className="text-ellipsis">
<ProfileLink
className="link-no-underline"
{profile.languageName}
{', '}
<Link
- to={getDeprecatedActiveRulesUrl({ qprofile: profile.key }, props.organization)}
- className="text-muted">
+ className="text-muted"
+ to={getDeprecatedActiveRulesUrl({ qprofile: profile.key }, props.organization)}>
{translateWithParameters(
'quality_profile.x_rules',
profile.activeDeprecatedRuleCount
}
export default function EvolutionStagnant(props: Props) {
- // TODO filter built-in out
-
- const outdated = props.profiles.filter(isStagnant);
+ const outdated = props.profiles.filter(profile => !profile.isBuiltIn && isStagnant(profile));
if (outdated.length === 0) {
return null;
</div>
<ul>
{outdated.map(profile => (
- <li key={profile.key} className="spacer-top">
+ <li className="spacer-top" key={profile.key}>
<div className="text-ellipsis">
<ProfileLink
className="link-no-underline"
renderLanguage = (languageKey: string, profiles: Profile[] | undefined) => {
return (
- <div key={languageKey} className="boxed-group boxed-group-inner quality-profiles-table">
- <table data-language={languageKey} className="data zebra zebra-hover">
+ <div className="boxed-group boxed-group-inner quality-profiles-table" key={languageKey}>
+ <table className="data zebra zebra-hover" data-language={languageKey}>
{profiles !== undefined && this.renderHeader(languageKey, profiles.length)}
<tbody>{profiles !== undefined && this.renderProfiles(profiles)}</tbody>
</table>
{profile.activeDeprecatedRuleCount > 0 && (
<span className="spacer-right">
<Tooltip overlay={translate('quality_profiles.deprecated_rules')}>
- <Link to={deprecatedRulesUrl} className="badge badge-normal-size badge-danger-light">
+ <Link className="badge badge-normal-size badge-danger-light" to={deprecatedRulesUrl}>
{profile.activeDeprecatedRuleCount}
</Link>
</Tooltip>
}
renderUpdateDate() {
- const date = <ProfileDate date={this.props.profile.userUpdatedAt} />;
+ const date = <ProfileDate date={this.props.profile.rulesUpdatedAt} />;
if (isStagnant(this.props.profile)) {
return <span className="badge badge-normal-size badge-focus">{date}</span>;
} else {
}
export function isStagnant(profile: Profile): boolean {
- if (profile.userUpdatedAt) {
- const updateDate = parseDate(profile.userUpdatedAt);
+ if (profile.rulesUpdatedAt) {
+ const updateDate = parseDate(profile.rulesUpdatedAt);
if (isValidDate(updateDate)) {
return differenceInYears(new Date(), updateDate) >= 1;
}