diff options
author | Pascal Mugnier <pascal.mugnier@sonarsource.com> | 2018-05-01 12:12:57 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-05-03 20:20:49 +0200 |
commit | 820d0ab69be35d4b25538790bfccf8791a1f4a84 (patch) | |
tree | 6eb8282d02e585cc145b3e44985007b0dcf31e9f | |
parent | d13e2d9a08ea6fc3cb29bcf4add0c4f2f12cc3b8 (diff) | |
download | sonarqube-820d0ab69be35d4b25538790bfccf8791a1f4a84.tar.gz sonarqube-820d0ab69be35d4b25538790bfccf8791a1f4a84.zip |
Fix SONAR-10585
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" /> |