From: Grégoire Aubert Date: Thu, 20 Jul 2017 14:53:00 +0000 (+0200) Subject: SONAR-9566 Remove organization name from component path when in issues page at org... X-Git-Tag: 6.6-RC1~829 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ef941b5c7b4faa45f7f19461a8b1d81ccac540d;p=sonarqube.git SONAR-9566 Remove organization name from component path when in issues page at org level --- 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 ?
- +
: 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 {
{displayComponent &&
- +
} | string { - const { referencedComponents } = this.props; + const { organization, referencedComponents } = this.props; return referencedComponents[project] ? - + {!organization && + } {referencedComponents[project].name} : 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 }; diff --git a/tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java b/tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java index 572b69b8454..0918af6b0ae 100644 --- a/tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java +++ b/tests/src/test/java/org/sonarqube/pageobjects/issues/IssuesPage.java @@ -66,6 +66,11 @@ public class IssuesPage { return this; } + public IssuesPage componentsShouldNotContain(String path) { + this.getIssuesPathComponents().forEach(element -> element.shouldNotHave(text(path))); + return this; + } + public IssuesPage bulkChangeOpen() { $("#issues-bulk-change").shouldBe(visible).click(); $("#bulk-change-form").shouldBe(visible); diff --git a/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssuesPageTest.java b/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssuesPageTest.java index f6f5a1dcaeb..979467ee693 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssuesPageTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssuesPageTest.java @@ -73,10 +73,11 @@ public class OrganizationIssuesPageTest { nav.openIssues(org1.getKey()) .issuesCount(2) - .componentsShouldContain(org1.getName()); + .componentsShouldNotContain(org1.getName()); nav.openIssues() - .issuesCount(4); + .issuesCount(4) + .componentsShouldContain("Org "); } private String provisionProject(Organizations.Organization organization) {