diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-20 16:53:00 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-25 09:20:30 +0200 |
commit | 1ef941b5c7b4faa45f7f19461a8b1d81ccac540d (patch) | |
tree | af6fada5dc0333790b859858b76fd08867d07158 /server/sonar-web | |
parent | 5d7a55d1a1f259ab7b9395743c36af7aa83827a9 (diff) | |
download | sonarqube-1ef941b5c7b4faa45f7f19461a8b1d81ccac540d.tar.gz sonarqube-1ef941b5c7b4faa45f7f19461a8b1d81ccac540d.zip |
SONAR-9566 Remove organization name from component path when in issues page at org level
Diffstat (limited to 'server/sonar-web')
6 files changed, 27 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.js b/server/sonar-web/src/main/js/apps/issues/components/App.js index 43dfe6ecba7..3f5dc5a0290 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/App.js +++ b/server/sonar-web/src/main/js/apps/issues/components/App.js @@ -748,7 +748,7 @@ export default class App extends React.PureComponent { } renderList() { - const { component, currentUser } = this.props; + const { component, currentUser, organization } = this.props; const { issues, openIssue, paging } = this.state; const selectedIndex = this.getSelectedIndex(); const selectedIssue = selectedIndex != null ? issues[selectedIndex] : null; @@ -768,6 +768,7 @@ export default class App extends React.PureComponent { onIssueChange={this.handleIssueChange} onIssueCheck={currentUser.isLoggedIn ? this.handleIssueCheck : undefined} onIssueClick={this.openIssue} + organization={organization} selectedIssue={selectedIssue} />} @@ -819,7 +820,11 @@ export default class App extends React.PureComponent { {this.renderBulkChange(openIssue)} {openIssue != null ? <div className="pull-left width-60"> - <ComponentBreadcrumbs component={component} issue={openIssue} /> + <ComponentBreadcrumbs + component={component} + issue={openIssue} + organization={this.props.organization} + /> </div> : <PageActions loading={this.state.loading} diff --git a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.js b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.js index fafa016098a..e4103100db0 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.js +++ b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.js @@ -27,16 +27,18 @@ import type { Component } from '../utils'; type Props = { component?: Component, - issue: Object + issue: Object, + organization?: { key: string } }; export default class ComponentBreadcrumbs extends React.PureComponent { props: Props; render() { - const { component, issue } = this.props; + const { component, issue, organization } = this.props; - const displayOrganization = component == null || ['VW', 'SVW'].includes(component.qualifier); + const displayOrganization = + !organization && (component == null || ['VW', 'SVW'].includes(component.qualifier)); const displayProject = component == null || !['TRK', 'BRC', 'DIR'].includes(component.qualifier); const displaySubProject = component == null || !['BRC', 'DIR'].includes(component.qualifier); diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesList.js b/server/sonar-web/src/main/js/apps/issues/components/IssuesList.js index a3a6097152b..b0e56815484 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesList.js +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesList.js @@ -31,6 +31,7 @@ type Props = {| onIssueChange: Issue => void, onIssueCheck?: string => void, onIssueClick: string => void, + organization?: { key: string }, selectedIssue: ?Issue |}; @@ -52,6 +53,7 @@ export default class IssuesList extends React.PureComponent { onCheck={this.props.onIssueCheck} onClick={this.props.onIssueClick} onFilterChange={this.props.onFilterChange} + organization={this.props.organization} previousIssue={index > 0 ? issues[index - 1] : null} selected={selectedIssue != null && selectedIssue.key === issue.key} /> diff --git a/server/sonar-web/src/main/js/apps/issues/components/ListItem.js b/server/sonar-web/src/main/js/apps/issues/components/ListItem.js index 7d46d74eab7..050a34093b2 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ListItem.js +++ b/server/sonar-web/src/main/js/apps/issues/components/ListItem.js @@ -32,6 +32,7 @@ type Props = {| onCheck?: string => void, onClick: string => void, onFilterChange: (changes: {}) => void, + organization?: { key: string }, previousIssue: ?Object, selected: boolean |}; @@ -89,7 +90,11 @@ export default class ListItem extends React.PureComponent { <div className="issues-workspace-list-item"> {displayComponent && <div className="issues-workspace-list-component"> - <ComponentBreadcrumbs component={component} issue={this.props.issue} /> + <ComponentBreadcrumbs + component={component} + issue={this.props.issue} + organization={this.props.organization} + /> </div>} <Issue checked={this.props.checked} diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js index 843f659a275..8d4c9269e1e 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.js @@ -104,11 +104,15 @@ export default class ProjectFacet extends React.PureComponent { } renderName(project: string): React.Element<*> | string { - const { referencedComponents } = this.props; + const { organization, referencedComponents } = this.props; return referencedComponents[project] ? <span> <QualifierIcon className="little-spacer-right" qualifier="TRK" /> - <Organization link={false} organizationKey={referencedComponents[project].organization} /> + {!organization && + <Organization + link={false} + organizationKey={referencedComponents[project].organization} + />} {referencedComponents[project].name} </span> : <span> diff --git a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js index ab54c533014..0d8939752c6 100644 --- a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js +++ b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js @@ -39,7 +39,7 @@ const ADMIN_PATHS = [ export default class OrganizationNavigation extends React.PureComponent { props: { - currentUser: { isLoggedIn: boolean, showOnboardingTutorial: true }, + currentUser: { isLoggedIn: boolean }, location: { pathname: string }, organization: Organization }; |