]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22390 Fixing SQ error for project overview refactoring
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Tue, 18 Jun 2024 08:16:03 +0000 (10:16 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 18 Jun 2024 20:02:41 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/overview/branches/FailedConditions.tsx
server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx

index 01f6d5a86a255677fbe297b92741d5aa7535a3ee..18d271de5ede4175c5f56194ecf8f32086f230df 100644 (file)
@@ -44,7 +44,7 @@ export default function FailedConditions({
   failedConditions,
   component,
   branchLike,
-}: FailedConditionsProps) {
+}: Readonly<FailedConditionsProps>) {
   const [newCodeFailedConditions, overallFailedConditions] = _.partition(
     failedConditions,
     (condition) => isDiffMetric(condition.metric),
index a2d0fcacff129410a09baf88cecb55b13d6e443d..a6b421c8e38e1438bd221111acd65f261ff4050b 100644 (file)
@@ -166,9 +166,9 @@ export default function NewCodeMeasuresPanel(props: Readonly<Props>) {
           </b>
         </span>
       )}
-      <GridContainer className=" sw-relative sw-overflow-hidden sw-mt-8 js-summary">
+      <GridContainer className="sw-relative sw-overflow-hidden sw-mt-8 js-summary">
         {!noConditionsAndWarningForNewCode && (
-          <StyledConditionsCard className="sw-row-span-3 sw-col-span-4">
+          <StyledConditionsCard className="sw-row-span-4 sw-col-span-4">
             <QualityGatePanel
               component={component}
               loading={loading}
index 7b955a46a0dc5fada3fd48cf1c3640c9a7370aed..4bbd8bcc1ce56372f03640ebcae0b4585ea3ecfb 100644 (file)
@@ -67,8 +67,6 @@ export function QualityGatePanel(props: QualityGatePanelProps) {
 
   const failedQgStatuses = qgStatuses.filter((qgStatus) => qgStatus.failedConditions.length > 0);
 
-  const totalFailedCondition = qgStatuses?.flatMap((qg) => qg.failedConditions) ?? [];
-
   const isApp = isApplication(component.qualifier);
 
   const nonCaycProjectsInApp = isApp
@@ -105,7 +103,7 @@ export function QualityGatePanel(props: QualityGatePanelProps) {
             </>
           )}
 
-          {totalFailedCondition.length > 0 && (
+          {totalFailedConditionLength > 0 && (
             <div data-test="overview__quality-gate-conditions">
               {failedQgStatuses.map((qgStatus, qgStatusIdx) => {
                 const failedConditionLength = qgStatus.failedConditions.filter((con) =>
@@ -123,6 +121,7 @@ export function QualityGatePanel(props: QualityGatePanelProps) {
                     />
                   );
                 }
+                return null;
               })}
             </div>
           )}
index 13aeb32b1b6a0b51054150595d98d8e832f8f7cc..8bfbca3dccc8a57b2a390ebe3405d5e8d2e29a5f 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+import { IconQuestionMark, Tooltip, TooltipSide } from '@sonarsource/echoes-react';
 import classNames from 'classnames';
 import {
   Card,
-  HelperHintIcon,
   LightLabel,
   SnoozeCircleIcon,
   TextError,
   TextSubdued,
   TrendDownCircleIcon,
   TrendUpCircleIcon,
-} from 'design-system/lib';
+} from 'design-system';
 import * as React from 'react';
 import { useIntl } from 'react-intl';
 import {
@@ -35,7 +35,6 @@ import {
   getComponentSecurityHotspotsUrl,
 } from '~sonar-aligned/helpers/urls';
 import { MetricKey, MetricType } from '~sonar-aligned/types/metrics';
-import Tooltip from '../../../components/controls/Tooltip';
 import { getLeakValue } from '../../../components/measure/utils';
 import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils';
 import { findMeasure } from '../../../helpers/measures';
@@ -152,7 +151,7 @@ export default function MeasuresCardPanel(props: React.PropsWithChildren<Props>)
             disabled={component.needIssueSync}
             url={acceptedUrl}
             icon={
-              acceptedCount && (
+              acceptedCount !== undefined && (
                 <SnoozeCircleIcon
                   color={
                     acceptedCount === '0' ? 'overviewCardDefaultIcon' : 'overviewCardWarningIcon'
@@ -187,9 +186,11 @@ export default function MeasuresCardPanel(props: React.PropsWithChildren<Props>)
                       </span>
                     </div>
                   }
-                  side="top"
+                  side={TooltipSide.Top}
                 >
-                  <HelperHintIcon raised />
+                  <span className="sw-body-sm sw-cursor-default">
+                    <IconQuestionMark color="echoes-color-icon-subdued" />
+                  </span>
                 </Tooltip>
               </>
             }
@@ -198,7 +199,7 @@ export default function MeasuresCardPanel(props: React.PropsWithChildren<Props>)
             value={formatMeasure(fixedCount, MetricType.ShortInteger)}
             disabled={component.needIssueSync}
             url={fixedUrl}
-            icon={fixedCount && fixedCount !== '0' && <TrendDownCircleIcon />}
+            icon={fixedCount !== undefined && fixedCount !== '0' && <TrendDownCircleIcon />}
             footer={
               <TextSubdued className="sw-body-xs">
                 {intl.formatMessage({ id: 'overview.pull_request.fixed_issues.help' })}