diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-26 14:57:51 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-26 15:12:30 +0200 |
commit | 0629a1049e4c0b022cb8bcc5def2c4ffc4a6916c (patch) | |
tree | 4348386a5dbfd710ed5f7ac14cb843d6288d10f7 /server/sonar-web/src/main/js | |
parent | d42ad40824b6b8739cf68a97f59ff331c46588a2 (diff) | |
download | sonarqube-0629a1049e4c0b022cb8bcc5def2c4ffc4a6916c.tar.gz sonarqube-0629a1049e4c0b022cb8bcc5def2c4ffc4a6916c.zip |
fix SONAR-6249 Non favorite issue filters cannot be loaded by Issues page
Diffstat (limited to 'server/sonar-web/src/main/js')
4 files changed, 22 insertions, 14 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 c0467e9b6a1..29ae5db89f3 100644 --- a/server/sonar-web/src/main/js/apps/issues/controller.js +++ b/server/sonar-web/src/main/js/apps/issues/controller.js @@ -7,8 +7,8 @@ define([ var $ = jQuery, FIELDS = 'component,componentId,project,subProject,rule,status,resolution,author,reporter,assignee,debt,line,' + - 'message,severity,actionPlan,creationDate,updateDate,closeDate,tags,comments,attr,actions,transitions,' + - 'actionPlanName', + 'message,severity,actionPlan,creationDate,updateDate,closeDate,tags,comments,attr,actions,transitions,' + + 'actionPlanName', FACET_DATA_FIELDS = ['components', 'users', 'rules', 'actionPlans', 'languages']; return Controller.extend({ @@ -90,13 +90,14 @@ define([ fetchFilters: function () { var that = this; - return $.get(baseUrl + '/api/issue_filters/app', function (r) { - that.options.app.state.set({ - canBulkChange: r.canBulkChange, - canManageFilters: r.canManageFilters - }); - return that.options.app.filters.reset(r.favorites); - }); + return $.when( + that.options.app.filters.fetch(), + $.get(baseUrl + '/api/issue_filters/app', function (r) { + that.options.app.state.set({ + canBulkChange: r.canBulkChange, + canManageFilters: r.canManageFilters + }); + })); }, _mergeCollections: function (a, b) { diff --git a/server/sonar-web/src/main/js/apps/issues/filters-view.js b/server/sonar-web/src/main/js/apps/issues/filters-view.js index 568402c3582..896a3d3abb7 100644 --- a/server/sonar-web/src/main/js/apps/issues/filters-view.js +++ b/server/sonar-web/src/main/js/apps/issues/filters-view.js @@ -51,9 +51,8 @@ define([ var that = this; var id = $(e.currentTarget).data('id'), filter = this.collection.get(id); - return filter.fetch().done(function () { - return that.options.app.controller.applyFilter(filter); - }); + return that.options.app.controller.applyFilter(filter); + }, saveAs: function () { diff --git a/server/sonar-web/src/main/js/apps/issues/models/filters.js b/server/sonar-web/src/main/js/apps/issues/models/filters.js index cde0286b159..98c5507c645 100644 --- a/server/sonar-web/src/main/js/apps/issues/models/filters.js +++ b/server/sonar-web/src/main/js/apps/issues/models/filters.js @@ -4,7 +4,15 @@ define([ ], function (Backbone, Filter) { return Backbone.Collection.extend({ - model: Filter + model: Filter, + + url: function () { + return window.baseUrl + '/api/issue_filters/search'; + }, + + parse: function (r) { + return r.issueFilters; + } }); }); diff --git a/server/sonar-web/src/main/js/apps/main/app.jsx b/server/sonar-web/src/main/js/apps/main/app.jsx index 25c2d1dff30..97c3d781c2f 100644 --- a/server/sonar-web/src/main/js/apps/main/app.jsx +++ b/server/sonar-web/src/main/js/apps/main/app.jsx @@ -15,7 +15,7 @@ const APP_URL_MAPPING = { 'dashboard': 'dashboard/app', 'drilldown': 'drilldown/app', 'groups': 'groups/app', - 'issues': 'issues/app', + 'issues/search': 'issues/app', 'maintenance': { name: 'maintenance/app', options: { setup: false } }, 'markdown': 'markdown/app', 'measures': 'measures/app', |