aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app/components/nav/global
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-04-03 17:56:23 +0200
committerStas Vilchik <stas-vilchik@users.noreply.github.com>2017-04-13 12:21:37 +0200
commit139261bbc13192621ef795d6d45298e1d8e1b7f3 (patch)
tree7aa153b4b3fec7e8fbf3b3b4f5ed0a1a5cc69113 /server/sonar-web/src/main/js/app/components/nav/global
parentd665528c8751ead9ca93e3d18dd8600fac92834b (diff)
downloadsonarqube-139261bbc13192621ef795d6d45298e1d8e1b7f3.tar.gz
sonarqube-139261bbc13192621ef795d6d45298e1d8e1b7f3.zip
SONAR-9064 Rework facets sidebar on the issues page
Diffstat (limited to 'server/sonar-web/src/main/js/app/components/nav/global')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js13
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js1
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/SearchView.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNavMenu-test.js4
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap10
5 files changed, 21 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js
index 1c7f395f741..3a5f67cdada 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.js
@@ -25,7 +25,10 @@ import { isUserAdmin } from '../../../../helpers/users';
export default class GlobalNavMenu extends React.Component {
static propTypes = {
appState: React.PropTypes.object.isRequired,
- currentUser: React.PropTypes.object.isRequired
+ currentUser: React.PropTypes.object.isRequired,
+ location: React.PropTypes.shape({
+ pathname: React.PropTypes.string.isRequired
+ }).isRequired
};
static defaultProps = {
@@ -59,12 +62,12 @@ export default class GlobalNavMenu extends React.Component {
renderIssuesLink() {
const query = this.props.currentUser.isLoggedIn
- ? '#resolved=false|assigned_to_me=true'
- : '#resolved=false';
- const url = '/issues' + query;
+ ? { myIssues: 'true', resolved: 'false' }
+ : { resolved: 'false' };
+ const active = this.props.location.pathname === 'issues';
return (
<li>
- <Link to={url} className={this.activeLink('/issues')}>
+ <Link to={{ pathname: '/issues', query }} className={active ? 'active' : undefined}>
{translate('issues.page')}
</Link>
</li>
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js
index cb8349ecca5..d7089b5a536 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavSearch.js
@@ -20,6 +20,7 @@
import Backbone from 'backbone';
import React from 'react';
import { connect } from 'react-redux';
+import key from 'keymaster';
import SearchView from './SearchView';
import { getCurrentUser } from '../../../../store/rootReducer';
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js b/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
index 163ec964e26..9277cb5acb5 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
@@ -253,7 +253,7 @@ export default Marionette.LayoutView.extend({
getNavigationFindings(q) {
const DEFAULT_ITEMS = [
- { name: translate('issues.page'), url: window.baseUrl + '/issues/search' },
+ { name: translate('issues.page'), url: window.baseUrl + '/issues' },
{
name: translate('layout.measures'),
url: window.baseUrl + '/measures/search?qualifiers[]=TRK'
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNavMenu-test.js b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNavMenu-test.js
index d21f3f609ee..99b97c82c4f 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNavMenu-test.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNavMenu-test.js
@@ -30,6 +30,8 @@ it('should work with extensions', () => {
isLoggedIn: false,
permissions: { global: [] }
};
- const wrapper = shallow(<GlobalNavMenu appState={appState} currentUser={currentUser} />);
+ const wrapper = shallow(
+ <GlobalNavMenu appState={appState} currentUser={currentUser} location={{ pathname: '' }} />
+ );
expect(wrapper).toMatchSnapshot();
});
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap
index 2f2dc6dd0f3..30ec923b76a 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap
+++ b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap
@@ -12,10 +12,16 @@ exports[`test should work with extensions 1`] = `
</li>
<li>
<Link
- className={null}
onlyActiveOnIndex={false}
style={Object {}}
- to="/issues#resolved=false">
+ to={
+ Object {
+ "pathname": "/issues",
+ "query": Object {
+ "resolved": "false",
+ },
+ }
+ }>
issues.page
</Link>
</li>