From 42cf60a64a18c941b0c844ad3cf4ecd8f86a9612 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 14 Jan 2016 11:05:00 +0100 Subject: [PATCH] SONAR-6929 Issues page loads unnecessary facets --- server/sonar-web/src/main/js/apps/issues/controller.js | 4 +++- .../sonar-web/src/main/js/components/navigator/controller.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 398f94344d2..31a13f246da 100644 --- a/server/sonar-web/src/main/js/apps/issues/controller.js +++ b/server/sonar-web/src/main/js/apps/issues/controller.js @@ -29,7 +29,9 @@ const FACET_DATA_FIELDS = ['components', 'users', 'rules', 'actionPlans', 'langu export default Controller.extend({ _facetsFromServer: function () { var facets = Controller.prototype._facetsFromServer.apply(this, arguments) || []; - facets.push('assigned_to_me'); + if (facets.indexOf('assignees') !== -1) { + facets.push('assigned_to_me'); + } return facets; }, diff --git a/server/sonar-web/src/main/js/components/navigator/controller.js b/server/sonar-web/src/main/js/components/navigator/controller.js index 9de0bc89a7e..28dbfad8d01 100644 --- a/server/sonar-web/src/main/js/components/navigator/controller.js +++ b/server/sonar-web/src/main/js/components/navigator/controller.js @@ -43,6 +43,7 @@ export default Marionette.Controller.extend({ return that.options.app.state.get('transform')[facet] != null ? that.options.app.state.get('transform')[facet] : facet; }); + facets = _.uniq(facets); return facets.filter(function (facet) { return that.options.app.state.get('allFacets').indexOf(facet) !== -1; }); -- 2.39.5