diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-11-07 12:54:10 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-11-07 12:54:10 +0100 |
commit | 5bae92cf0f91e54068a09a1827021160826eabb8 (patch) | |
tree | 354e8c67a7f8ee7f009466559879fd17a465b637 /server | |
parent | 5f6b3b27f94a19834739716fa9f5cb160e7a9e5f (diff) | |
download | sonarqube-5bae92cf0f91e54068a09a1827021160826eabb8.tar.gz sonarqube-5bae92cf0f91e54068a09a1827021160826eabb8.zip |
SONAR-5718 Add an unplanned option
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/coffee/issues/facets/action-plan-facet.coffee | 30 | ||||
-rw-r--r-- | server/sonar-web/src/main/hbs/issues/facets/issues-action-plan-facet.hbs | 18 |
2 files changed, 47 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/coffee/issues/facets/action-plan-facet.coffee b/server/sonar-web/src/main/coffee/issues/facets/action-plan-facet.coffee index 16a1dcd4b03..6ecc3a387be 100644 --- a/server/sonar-web/src/main/coffee/issues/facets/action-plan-facet.coffee +++ b/server/sonar-web/src/main/coffee/issues/facets/action-plan-facet.coffee @@ -1,11 +1,35 @@ define [ 'issues/facets/base-facet' + 'templates/issues' ], ( BaseFacet + Templates ) -> + $ = jQuery + class extends BaseFacet + template: Templates['issues-action-plan-facet'] + + + onRender: -> + super + value = @options.app.state.get('query')['planned'] + if value? && (!value || value == 'false') + @$('.js-issues-facet').filter("[data-unplanned]").addClass 'active' + + + toggleFacet: (e) -> + unplanned = $(e.currentTarget).is "[data-unplanned]" + $(e.currentTarget).toggleClass 'active' + if unplanned + checked = $(e.currentTarget).is '.active' + value = if checked then 'false' else null + @options.app.state.updateFilter planned: value, actionPlans: null + else + @options.app.state.updateFilter planned: null, actionPlans: @getValue() + getValuesWithLabels: -> values = @model.getValues() @@ -20,6 +44,10 @@ define [ values + disable: -> + @options.app.state.updateFilter planned: null, actionPlans: null + + serializeData: -> _.extend super, - values: @sortValues @getValuesWithLabels() + values: @getValuesWithLabels() diff --git a/server/sonar-web/src/main/hbs/issues/facets/issues-action-plan-facet.hbs b/server/sonar-web/src/main/hbs/issues/facets/issues-action-plan-facet.hbs new file mode 100644 index 00000000000..d0cdd871563 --- /dev/null +++ b/server/sonar-web/src/main/hbs/issues/facets/issues-action-plan-facet.hbs @@ -0,0 +1,18 @@ +{{> '_issues-facet-header'}} + +<div class="issues-facet-list"> + {{#each values}} + {{#eq val ''}} + {{! unplanned }} + <a class="facet issues-facet js-issues-facet" data-unplanned title="{{t 'issue.unplanned'}}"> + <span class="facet-name">{{t 'issue.unplanned'}}</span> + <span class="facet-stat">{{count}}</span> + </a> + {{else}} + <a class="facet issues-facet js-issues-facet" data-value="{{val}}" title="{{label}}"> + <span class="facet-name">{{label}}</span> + <span class="facet-stat">{{count}}</span> + </a> + {{/eq}} + {{/each}} +</div> |