From 2d4832279af45baeec7bd823c63a94d49336ff90 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Wed, 16 Jul 2014 11:37:43 +0200 Subject: [PATCH] Hide "Key" filter on Rules page --- .../coffee/coding-rules/views/filter-bar-view.coffee | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/coffee/coding-rules/views/filter-bar-view.coffee b/sonar-server/src/main/coffee/coding-rules/views/filter-bar-view.coffee index 84641dd998e..a5cf838ab49 100644 --- a/sonar-server/src/main/coffee/coding-rules/views/filter-bar-view.coffee +++ b/sonar-server/src/main/coffee/coding-rules/views/filter-bar-view.coffee @@ -3,12 +3,14 @@ define [ 'navigator/filters/base-filters', 'navigator/filters/favorite-filters', 'navigator/filters/more-criteria-filters', + 'navigator/filters/read-only-filters', 'templates/coding-rules' ], ( FilterBarView, BaseFilters, FavoriteFiltersModule, MoreCriteriaFilters, + ReadOnlyFilterView, Templates ) -> @@ -40,7 +42,10 @@ define [ addMoreCriteriaFilter: -> - disabledFilters = this.collection.where enabled: false + readOnlyFilters = @collection.where(type: ReadOnlyFilterView) + console.log readOnlyFilters + disabledFilters = _.difference(@collection.where(enabled: false), readOnlyFilters) + console.log disabledFilters if disabledFilters.length > 0 @moreCriteriaFilter = new BaseFilters.Filter type: MoreCriteriaFilters.MoreCriteriaFilterView, @@ -53,7 +58,7 @@ define [ changeEnabled: -> if @moreCriteriaFilter? disabledFilters = _.reject @collection.where(enabled: false), (filter) -> - filter.get('type') == MoreCriteriaFilters.MoreCriteriaFilterView + filter.get('type') in [MoreCriteriaFilters.MoreCriteriaFilterView, ReadOnlyFilterView] if disabledFilters.length == 0 @moreCriteriaFilter.set { enabled: false }, { silent: true } -- 2.39.5