aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/coding-rules/components
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules/components')
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx16
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderSide.tsx28
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx6
3 files changed, 27 insertions, 23 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
index e29d4e44913..ec284499b1d 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/FacetsList.tsx
@@ -24,7 +24,7 @@ import { useAvailableFeatures } from '../../../app/components/available-features
import SeverityFacet from '../../../components/facets/SeverityFacet';
import StandardSeverityFacet from '../../../components/facets/StandardSeverityFacet';
import { translate } from '../../../helpers/l10n';
-import { useIsLegacyCCTMode } from '../../../queries/settings';
+import { useStandardExperienceMode } from '../../../queries/settings';
import { Feature } from '../../../types/features';
import { Dict } from '../../../types/types';
import { LanguageFacet } from '../../issues/sidebar/LanguageFacet';
@@ -59,7 +59,7 @@ const MAX_INITIAL_LANGUAGES = 5;
export default function FacetsList(props: FacetsListProps) {
const { hasFeature } = useAvailableFeatures();
- const { data: isLegacy } = useIsLegacyCCTMode();
+ const { data: isStandardMode } = useStandardExperienceMode();
const languageDisabled = !props.hideProfileFacet && props.query.profile !== undefined;
const inheritanceDisabled =
@@ -82,7 +82,7 @@ export default function FacetsList(props: FacetsListProps) {
disabledHelper={translate('coding_rules.filters.language.inactive')}
/>
- {isLegacy && (
+ {isStandardMode && (
<>
<BasicSeparator className="sw-my-4" />
@@ -96,7 +96,7 @@ export default function FacetsList(props: FacetsListProps) {
</>
)}
- {!isLegacy && (
+ {!isStandardMode && (
<>
<BasicSeparator className="sw-my-4" />
@@ -110,7 +110,7 @@ export default function FacetsList(props: FacetsListProps) {
</>
)}
- {!isLegacy && (
+ {!isStandardMode && (
<>
<BasicSeparator className="sw-my-4" />
@@ -124,7 +124,7 @@ export default function FacetsList(props: FacetsListProps) {
</>
)}
- {!isLegacy && (
+ {!isStandardMode && (
<>
<BasicSeparator className="sw-my-4" />
@@ -138,7 +138,7 @@ export default function FacetsList(props: FacetsListProps) {
</>
)}
- {isLegacy && (
+ {isStandardMode && (
<>
<BasicSeparator className="sw-my-4" />
@@ -152,7 +152,7 @@ export default function FacetsList(props: FacetsListProps) {
</>
)}
- {!isLegacy && (
+ {!isStandardMode && (
<>
<BasicSeparator className="sw-my-4" />
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderSide.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderSide.tsx
index 8731166166f..25b8bc60b9b 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderSide.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderSide.tsx
@@ -23,7 +23,7 @@ import React from 'react';
import { CleanCodeAttributePill } from '../../../components/shared/CleanCodeAttributePill';
import SoftwareImpactPillList from '../../../components/shared/SoftwareImpactPillList';
import { translate } from '../../../helpers/l10n';
-import { useIsLegacyCCTMode } from '../../../queries/settings';
+import { useStandardExperienceMode } from '../../../queries/settings';
import { IssueSeverity } from '../../../types/issues';
import { RuleDetails } from '../../../types/types';
@@ -35,7 +35,7 @@ export default function RuleDetailsHeaderSide({ ruleDetails }: Readonly<Props>)
const hasCleanCodeAttribute =
ruleDetails.cleanCodeAttributeCategory && ruleDetails.cleanCodeAttribute;
const hasSoftwareImpact = ruleDetails.impacts.length > 0;
- const { data: isLegacy } = useIsLegacyCCTMode();
+ const { data: isStandardMode } = useStandardExperienceMode();
if (!hasCleanCodeAttribute && !hasSoftwareImpact) {
return null;
@@ -45,7 +45,9 @@ export default function RuleDetailsHeaderSide({ ruleDetails }: Readonly<Props>)
<StyledSection className="sw-flex sw-flex-col sw-pl-4 sw-gap-6 sw-max-w-[250px]">
{hasSoftwareImpact && (
<RuleHeaderInfo
- title={isLegacy ? translate('type') : translate('coding_rules.software_qualities.label')}
+ title={
+ isStandardMode ? translate('type') : translate('coding_rules.software_qualities.label')
+ }
>
<SoftwareImpactPillList
className="sw-flex-wrap"
@@ -57,15 +59,17 @@ export default function RuleDetailsHeaderSide({ ruleDetails }: Readonly<Props>)
</RuleHeaderInfo>
)}
- {ruleDetails.cleanCodeAttributeCategory && ruleDetails.cleanCodeAttribute && !isLegacy && (
- <RuleHeaderInfo title={translate('coding_rules.cct_attribute.label')}>
- <CleanCodeAttributePill
- cleanCodeAttributeCategory={ruleDetails.cleanCodeAttributeCategory}
- cleanCodeAttribute={ruleDetails.cleanCodeAttribute}
- type="rule"
- />
- </RuleHeaderInfo>
- )}
+ {ruleDetails.cleanCodeAttributeCategory &&
+ ruleDetails.cleanCodeAttribute &&
+ !isStandardMode && (
+ <RuleHeaderInfo title={translate('coding_rules.cct_attribute.label')}>
+ <CleanCodeAttributePill
+ cleanCodeAttributeCategory={ruleDetails.cleanCodeAttributeCategory}
+ cleanCodeAttribute={ruleDetails.cleanCodeAttribute}
+ type="rule"
+ />
+ </RuleHeaderInfo>
+ )}
</StyledSection>
);
}
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx
index 8d26d829b47..607c206990d 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx
@@ -42,7 +42,7 @@ import {
useDeactivateRuleMutation,
} from '../../../queries/quality-profiles';
import { useRuleDetailsQuery } from '../../../queries/rules';
-import { useIsLegacyCCTMode } from '../../../queries/settings';
+import { useStandardExperienceMode } from '../../../queries/settings';
import { IssueSeverity } from '../../../types/issues';
import { Rule, RuleActivation } from '../../../types/types';
import ActivatedRuleActions from './ActivatedRuleActions';
@@ -85,7 +85,7 @@ export default function RuleListItem(props: Readonly<Props>) {
const { mutate: deactivateRule } = useDeactivateRuleMutation((data) =>
onDeactivate(data.key, data.rule),
);
- const { data: isLegacy } = useIsLegacyCCTMode();
+ const { data: isStandardMode } = useStandardExperienceMode();
const activation =
data && ruleIsChanged
@@ -249,7 +249,7 @@ export default function RuleListItem(props: Readonly<Props>) {
</div>
<div>
- {rule.cleanCodeAttributeCategory !== undefined && !isLegacy && (
+ {rule.cleanCodeAttributeCategory !== undefined && !isStandardMode && (
<CleanCodeAttributePill
cleanCodeAttributeCategory={rule.cleanCodeAttributeCategory}
type="rule"