From: Pascal Mugnier Date: Mon, 12 Mar 2018 15:22:14 +0000 (+0100) Subject: SONAR-10379 Improve issue permalink UX (#3139) X-Git-Tag: 7.5~1555 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9955fbbea60109c203cde83c110ffd4524a33422;p=sonarqube.git SONAR-10379 Improve issue permalink UX (#3139) --- diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx index 7771dce09bb..a52d9a31a51 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx @@ -148,6 +148,8 @@ export default class ComponentNavMenu extends React.PureComponent { } renderIssuesLink() { + const { location = { pathname: '' } } = this.props; + const isIssuesActive = location.pathname.startsWith('project/issues'); return (
  • { resolved: 'false' } }} + className={classNames({ active: isIssuesActive })} activeClassName="active"> {translate('issues.page')} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMenu-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMenu-test.tsx.snap index 592b1d44eee..22c56c67930 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMenu-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMenu-test.tsx.snap @@ -23,6 +23,7 @@ exports[`should work for all qualifiers 1`] = `
  • { - this.closeIssue(); + if (this.state.query.issues.length !== 1) { + this.closeIssue(); + } return false; }); window.addEventListener('keydown', this.handleKeyDown); @@ -842,11 +844,12 @@ export default class App extends React.PureComponent { } renderConciseIssuesList() { - const { issues, paging } = this.state; + const { issues, paging, query } = this.state; return (
    void, onReload: () => void, + displayBackButton?: boolean, paging?: Paging, selectedIndex: ?number |}; */ export default function ConciseIssuesListHeader(props /*: Props */) { - const { paging, selectedIndex } = props; + const { displayBackButton = true, paging, selectedIndex } = props; return (
    - + {displayBackButton && } {props.loading ? ( ) : (