diff options
author | Mathieu Suen <mathieu.suen@sonarsource.com> | 2021-08-24 12:19:21 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-08-25 20:03:16 +0000 |
commit | c0b537fa9aabfe07c6e85e5f8379419df806e30a (patch) | |
tree | d2a5b072a5b2a38a2a1483965eb1ac80b9a2b3f0 /server/sonar-web/src/main/js/components/ui/PageActions.tsx | |
parent | 35fcc48832ce85263446e9a4d019b091cd0221c3 (diff) | |
download | sonarqube-c0b537fa9aabfe07c6e85e5f8379419df806e30a.tar.gz sonarqube-c0b537fa9aabfe07c6e85e5f8379419df806e30a.zip |
SONAR-12019 Fix counter in measure page for Application and Portfolio
Diffstat (limited to 'server/sonar-web/src/main/js/components/ui/PageActions.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/components/ui/PageActions.tsx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/components/ui/PageActions.tsx b/server/sonar-web/src/main/js/components/ui/PageActions.tsx index 8c2e4106b16..f367fafc18d 100644 --- a/server/sonar-web/src/main/js/components/ui/PageActions.tsx +++ b/server/sonar-web/src/main/js/components/ui/PageActions.tsx @@ -19,16 +19,18 @@ */ import * as React from 'react'; import { translate } from '../../helpers/l10n'; -import FilesCounter from './FilesCounter'; +import { formatMeasure } from '../../helpers/measures'; +import { ComponentQualifier } from '../../types/component'; export interface Props { + componentQualifier?: string; current?: number; showShortcuts?: boolean; total?: number; } export default function PageActions(props: Props) { - const { current, showShortcuts, total = 0 } = props; + const { componentQualifier, current, showShortcuts, total = 0 } = props; return ( <div className="page-actions display-flex-center"> @@ -47,9 +49,20 @@ export default function PageActions(props: Props) { </span> </span> )} - {total > 0 && ( + {total > 0 && componentQualifier === ComponentQualifier.Project && ( <div className="nowrap"> - <FilesCounter className="big-spacer-left" current={current} total={total} /> + <span className="big-spacer-left"> + <strong> + {current !== undefined && ( + <span> + {formatMeasure(current, 'INT')} + {' / '} + </span> + )} + {formatMeasure(total, 'INT')} + </strong>{' '} + {translate('component_measures.files')} + </span> </div> )} </div> |