diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-29 11:37:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 11:37:28 +0100 |
commit | c85948205409283fa7dec4ab1db9764acc0d3ce9 (patch) | |
tree | b4fbd692e4ce6cc93ccf417173242398adecf9c1 /server/sonar-web/src/main/js/apps/issues/controller.js | |
parent | 5595c2f862cca1d07312c9219013f836e45a5f90 (diff) | |
download | sonarqube-c85948205409283fa7dec4ab1db9764acc0d3ce9.tar.gz sonarqube-c85948205409283fa7dec4ab1db9764acc0d3ce9.zip |
remove explicit _ and $ dependecies (#1487)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/controller.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/controller.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/controller.js b/server/sonar-web/src/main/js/apps/issues/controller.js index ff55d711134..92fe0ebc113 100644 --- a/server/sonar-web/src/main/js/apps/issues/controller.js +++ b/server/sonar-web/src/main/js/apps/issues/controller.js @@ -18,7 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import $ from 'jquery'; -import _ from 'underscore'; import Backbone from 'backbone'; import Controller from '../../components/navigator/controller'; import ComponentViewer from './component-viewer/main'; @@ -46,12 +45,12 @@ export default Controller.extend({ this.closeComponentViewer(); } const data = this._issuesParameters(); - _.extend(data, this.options.app.state.get('query')); + Object.assign(data, this.options.app.state.get('query')); if (this.options.app.state.get('query').assigned_to_me) { - _.extend(data, { assignees: '__me__' }); + Object.assign(data, { assignees: '__me__' }); } if (this.options.app.state.get('isContext')) { - _.extend(data, this.options.app.state.get('contextQuery')); + Object.assign(data, this.options.app.state.get('contextQuery')); } return $.get(window.baseUrl + '/api/issues/search', data).done(r => { const issues = that.options.app.list.parseIssues(r); @@ -100,18 +99,18 @@ export default Controller.extend({ requestFacet (id) { const that = this; const facet = this.options.app.facets.get(id); - const data = _.extend({ facets: id, ps: 1, additionalFields: '_all' }, this.options.app.state.get('query')); + const data = { facets: id, ps: 1, additionalFields: '_all', ...this.options.app.state.get('query') }; if (this.options.app.state.get('query').assigned_to_me) { - _.extend(data, { assignees: '__me__' }); + Object.assign(data, { assignees: '__me__' }); } if (this.options.app.state.get('isContext')) { - _.extend(data, this.options.app.state.get('contextQuery')); + Object.assign(data, this.options.app.state.get('contextQuery')); } return $.get(window.baseUrl + '/api/issues/search', data, r => { FACET_DATA_FIELDS.forEach(field => { that.options.app.facets[field] = that._mergeCollections(that.options.app.facets[field], r[field]); }); - const facetData = _.findWhere(r.facets, { property: id }); + const facetData = r.facets.find(facet => facet.property === id); if (facetData != null) { return facet.set(facetData); } @@ -140,13 +139,15 @@ export default Controller.extend({ } const filter = this.options.app.state.get('query'); if (addContext && this.options.app.state.get('isContext')) { - _.extend(filter, this.options.app.state.get('contextQuery')); + Object.assign(filter, this.options.app.state.get('contextQuery')); } if (handleMyIssues && this.options.app.state.get('query').assigned_to_me) { - _.extend(filter, { assignees: '__me__' }); + Object.assign(filter, { assignees: '__me__' }); } const route = []; - _.map(filter, (value, property) => route.push(`${property}=${encodeURIComponent(value)}`)); + Object.keys(filter).forEach(property => { + route.push(`${property}=${encodeURIComponent(filter[property])}`); + }); return route.join(separator); }, |