name: string;
path?: string;
refKey?: string;
- qualityProfiles?: { key: string; language: string; name: string }[];
+ qualityProfiles?: ComponentQualityProfile[];
qualityGate?: { isDefault?: boolean; key: string; name: string };
tags?: string[];
version?: string;
showUpdateKey?: boolean;
}
+export interface ComponentQualityProfile {
+ deleted?: boolean;
+ key: string;
+ language: string;
+ name: string;
+}
+
export interface Condition {
error: string;
id: number;
import { getQualityProfileUrl } from '../../../helpers/urls';
import { searchRules } from '../../../api/rules';
import { getLanguages } from '../../../store/rootReducer';
+import { ComponentQualityProfile } from '../../../app/types';
interface StateProps {
languages: { [key: string]: { name: string } };
interface OwnProps {
headerClassName?: string;
organization?: string;
- profiles: { key: string; language: string; name: string }[];
+ profiles: ComponentQualityProfile[];
}
interface State {
}
loadDeprecatedRules() {
- const requests = this.props.profiles.map(profile =>
- this.loadDeprecatedRulesForProfile(profile.key)
- );
+ const requests = this.props.profiles
+ .filter(p => !p.deleted)
+ .map(profile => this.loadDeprecatedRulesForProfile(profile.key));
Promise.all(requests).then(
responses => {
if (this.mounted) {
return count || 0;
}
- renderProfile(profile: { key: string; language: string; name: string }) {
+ renderProfile(profile: ComponentQualityProfile) {
const languageFromStore = this.props.languages[profile.language];
const languageName = languageFromStore ? languageFromStore.name : profile.language;
- const path = getQualityProfileUrl(profile.name, profile.language, this.props.organization);
-
const inner = (
<div className="text-ellipsis">
<span className="note spacer-right">{'(' + languageName + ')'}</span>
- <Link to={path}>{profile.name}</Link>
+ {profile.deleted ? (
+ profile.name
+ ) : (
+ <Link to={getQualityProfileUrl(profile.name, profile.language, this.props.organization)}>
+ {profile.name}
+ </Link>
+ )}
</div>
);
+ if (profile.deleted) {
+ const tooltip = translateWithParameters('overview.deleted_profile', profile.name);
+ return (
+ <Tooltip key={profile.key} overlay={tooltip}>
+ <li className="overview-deleted-profile">{inner}</li>
+ </Tooltip>
+ );
+ }
+
const count = this.getDeprecatedRulesCount(profile);
if (count > 0) {