aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2024-11-22 17:57:34 +0100
committersonartech <sonartech@sonarsource.com>2024-11-29 20:03:07 +0000
commit1553847b42c26843c1503fdd8716fe3d9dbee726 (patch)
tree4850a2fa90da66bcb611c2e2dd2c1d4f7fc46605 /server/sonar-web/src/main/js/apps
parentdfe8c0a21bd4b817b18a212ee4f59ed4ad0e05a7 (diff)
downloadsonarqube-1553847b42c26843c1503fdd8716fe3d9dbee726.tar.gz
sonarqube-1553847b42c26843c1503fdd8716fe3d9dbee726.zip
SONAR-23619 Change AI code assurance setting
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/AIAssuredIcon.tsx35
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx10
3 files changed, 9 insertions, 38 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/AIAssuredIcon.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/AIAssuredIcon.tsx
deleted file mode 100644
index b4cf1d2a233..00000000000
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/AIAssuredIcon.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2024 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import { ShieldIcon } from '~design-system';
-
-interface Props {
- className?: string;
- isDisabled?: boolean;
-}
-
-export default function AIAssuredIcon({ isDisabled = false, className }: Readonly<Props>) {
- return (
- <ShieldIcon
- className={className}
- fill={isDisabled ? `var(--echoes-color-icon-disabled)` : `var(--echoes-color-icon-accent)`}
- />
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
index 98801f60680..3cc78cc51ee 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx
@@ -39,6 +39,7 @@ import { useAvailableFeatures } from '../../../app/components/available-features
import { useMetrics } from '../../../app/components/metrics/withMetricsContext';
import DocumentationLink from '../../../components/common/DocumentationLink';
import { ModalProps } from '../../../components/controls/ModalButton';
+import AIAssuredIcon from '../../../components/icon-mappers/AIAssuredIcon';
import { DocLink } from '../../../helpers/doc-links';
import { useDocUrl } from '../../../helpers/docs';
import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
@@ -53,7 +54,6 @@ import {
STANDARD_CONDITIONS_MAP,
} from '../utils';
import AddConditionModal from './AddConditionModal';
-import AIAssuredIcon from './AIAssuredIcon';
import CaycCompliantBanner from './CaycCompliantBanner';
import CaycCondition from './CaycCondition';
import CaYCConditionsSimplificationGuide from './CaYCConditionsSimplificationGuide';
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
index bbf9a0f700d..023db95473c 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/List.tsx
@@ -22,12 +22,12 @@ import { IconRefresh, Spinner, Tooltip } from '@sonarsource/echoes-react';
import { useNavigate } from 'react-router-dom';
import { Badge, BareButton, SubnavigationGroup, SubnavigationItem } from '~design-system';
import { useAvailableFeatures } from '../../../app/components/available-features/withAvailableFeatures';
+import AIAssuredIcon, { AiIconColor } from '../../../components/icon-mappers/AIAssuredIcon';
import { translate } from '../../../helpers/l10n';
import { getQualityGateUrl } from '../../../helpers/urls';
import { useStandardExperienceModeQuery } from '../../../queries/mode';
import { Feature } from '../../../types/features';
import { CaycStatus, QualityGate } from '../../../types/types';
-import AIAssuredIcon from './AIAssuredIcon';
import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
import QGRecommendedIcon from './QGRecommendedIcon';
@@ -111,7 +111,13 @@ export default function List({ qualityGates, currentQualityGate }: Readonly<Prop
className="sw-mr-1 sw-flex sw-items-start"
data-testid="quality-gates-ai-assurance-indicator"
>
- <AIAssuredIcon isDisabled={shouldShowQualityGateUpdateIcon} />
+ <AIAssuredIcon
+ color={
+ shouldShowQualityGateUpdateIcon
+ ? AiIconColor.Disable
+ : AiIconColor.Accent
+ }
+ />
</span>
</Tooltip>
)}