aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx42
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap3
3 files changed, 36 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx
index b5f7a6fe21a..3e3adfad26d 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx
@@ -40,6 +40,7 @@ interface Props {
| 'subProject'
| 'subProjectName'
>;
+ link?: boolean;
organization: { key: string } | undefined;
selectedFlowIndex?: number;
selectedLocationIndex?: number;
@@ -48,6 +49,7 @@ interface Props {
export default function ComponentBreadcrumbs({
branchLike,
component,
+ link = true,
issue,
organization,
selectedFlowIndex,
@@ -65,14 +67,22 @@ export default function ComponentBreadcrumbs({
return (
<div className="component-name text-ellipsis">
{displayOrganization && (
- <Organization linkClassName="link-no-underline" organizationKey={issue.organization} />
+ <Organization
+ link={link}
+ linkClassName="link-no-underline"
+ organizationKey={issue.organization}
+ />
)}
{displayProject && (
<span title={issue.projectName}>
- <Link className="link-no-underline" to={getBranchLikeUrl(issue.project, branchLike)}>
- {limitComponentName(issue.projectName)}
- </Link>
+ {link ? (
+ <Link className="link-no-underline" to={getBranchLikeUrl(issue.project, branchLike)}>
+ {limitComponentName(issue.projectName)}
+ </Link>
+ ) : (
+ limitComponentName(issue.projectName)
+ )}
<span className="slash-separator" />
</span>
)}
@@ -81,16 +91,28 @@ export default function ComponentBreadcrumbs({
issue.subProject !== undefined &&
issue.subProjectName !== undefined && (
<span title={issue.subProjectName}>
- <Link className="link-no-underline" to={getBranchLikeUrl(issue.subProject, branchLike)}>
- {limitComponentName(issue.subProjectName)}
- </Link>
+ {link ? (
+ <Link
+ className="link-no-underline"
+ to={getBranchLikeUrl(issue.subProject, branchLike)}>
+ {limitComponentName(issue.subProjectName)}
+ </Link>
+ ) : (
+ limitComponentName(issue.subProjectName)
+ )}
<span className="slash-separator" />
</span>
)}
- <Link className="link-no-underline" to={getCodeUrl(issue.project, branchLike, componentKey)}>
- <span title={componentName}>{collapsePath(componentName || '')}</span>
- </Link>
+ {link ? (
+ <Link
+ className="link-no-underline"
+ to={getCodeUrl(issue.project, branchLike, componentKey)}>
+ <span title={componentName}>{collapsePath(componentName || '')}</span>
+ </Link>
+ ) : (
+ collapsePath(componentName || '')
+ )}
</div>
);
}
diff --git a/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx b/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx
index 9913dca0600..40e7657663d 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx
@@ -109,6 +109,7 @@ export default class ListItem extends React.PureComponent<Props, State> {
branchLike={branchLike}
component={component}
issue={this.props.issue}
+ link={false}
organization={this.props.organization}
/>
</div>
diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap
index ac510c72824..522da78f5a8 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap
@@ -5,6 +5,7 @@ exports[`renders 1`] = `
className="component-name text-ellipsis"
>
<Connect(Organization)
+ link={true}
linkClassName="link-no-underline"
organizationKey="org"
/>
@@ -58,6 +59,7 @@ exports[`renders with branch 1`] = `
className="component-name text-ellipsis"
>
<Connect(Organization)
+ link={true}
linkClassName="link-no-underline"
organizationKey="org"
/>
@@ -138,6 +140,7 @@ exports[`renders with sub-project 1`] = `
className="component-name text-ellipsis"
>
<Connect(Organization)
+ link={true}
linkClassName="link-no-underline"
organizationKey="org"
/>