aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps
diff options
context:
space:
mode:
author7PH <benjamin.raymond@sonarsource.com>2023-06-01 10:09:39 +0200
committersonartech <sonartech@sonarsource.com>2023-06-05 20:02:48 +0000
commit81400607613b2a4a2bb4bcee875eb39c805b77c1 (patch)
tree5bf2ec2678573aade8f9118e623d2e9da3a1dfce /server/sonar-web/src/main/js/apps
parent76b6ef07b14ca6769d65cba7ee12c178427a60a9 (diff)
downloadsonarqube-81400607613b2a4a2bb4bcee875eb39c805b77c1.tar.gz
sonarqube-81400607613b2a4a2bb4bcee875eb39c805b77c1.zip
SONAR-19391 Measures page's header for the source viewer should be moved to the new UI
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx12
3 files changed, 11 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
index 5f241e9e2c4..aca949a8c60 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
@@ -405,6 +405,7 @@ export default class MeasureContent extends React.PureComponent<Props, State> {
{isFileComponent ? (
<div className="measure-details-viewer">
<SourceViewer
+ hideHeader={true}
branchLike={branchLike}
component={baseComponent.key}
metricKey={this.state.metric?.key}
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
index 855983957b9..ff9f686eafb 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
@@ -129,6 +129,7 @@ export default class MeasureOverview extends React.PureComponent<Props, State> {
return (
<div className="measure-details-viewer">
<SourceViewer
+ hideHeader={true}
branchLike={branchLike}
component={component.key}
onIssueChange={this.props.onIssueChange}
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx
index b5c578c07e8..7eca8c1f172 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx
@@ -17,7 +17,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Breadcrumbs, HoverLink } from 'design-system';
+import classNames from 'classnames';
+import { Breadcrumbs, ClipboardIconButton, HoverLink } from 'design-system';
import * as React from 'react';
import { getBreadcrumbs } from '../../../api/components';
import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
@@ -25,7 +26,7 @@ import { KeyboardKeys } from '../../../helpers/keycodes';
import { translate } from '../../../helpers/l10n';
import { collapsePath, limitComponentName } from '../../../helpers/path';
import { BranchLike } from '../../../types/branch-like';
-import { ComponentQualifier } from '../../../types/component';
+import { ComponentQualifier, isProject } from '../../../types/component';
import { ComponentMeasure, ComponentMeasureIntern } from '../../../types/types';
interface Props {
@@ -97,6 +98,7 @@ export default class MeasuresBreadcrumbs extends React.PureComponent<Props, Stat
render() {
const { breadcrumbs } = this.state;
+ const lastBreadcrumb = breadcrumbs[breadcrumbs.length - 1];
if (breadcrumbs.length <= 0) {
return null;
@@ -105,8 +107,12 @@ export default class MeasuresBreadcrumbs extends React.PureComponent<Props, Stat
return (
<Breadcrumbs
ariaLabel={translate('breadcrumbs')}
- className={this.props.className}
+ className={classNames(this.props.className)}
maxWidth={500}
+ actions={
+ !isProject(lastBreadcrumb.qualifier) &&
+ lastBreadcrumb.path && <ClipboardIconButton copyValue={lastBreadcrumb.path} />
+ }
>
{breadcrumbs.map((component) => (
<HoverLink