language: @options.app.languageFilter.view.renderValue()
allowActivateOnProfile: qualityProfile and (activationValues.length == 0 or activationValues[0] == 'false')
allowDeactivateOnProfile: qualityProfile and (activationValues.length == 0 or activationValues[0] == 'true')
- allowChangeSeverity: qualityProfile and activationValues.length > 0 and activationValues[0] == 'true'
width: '250px'
minimumResultsForSearch: 1
- format = (state) ->
- return state.text unless state.id
- "<i class='icon-severity-#{state.id.toLowerCase()}'></i> #{state.text}"
- @$('#coding-rules-bulk-change-severity').select2
- width: '250px'
- minimumResultsForSearch: 999
- formatResult: format
- formatSelection: format
- escapeMarkup: (m) -> m
-
-
show: (action, param = null) ->
@action = action
@profile = param
prepareQuery: ->
- query = @options.app.getQuery()
-
- if @action == 'activate' || @action == 'deactivate'
- _.extend query,
- wsAction: @action
- profile_key: @$('#coding-rules-bulk-change-profile').val() or @profile
-
- if @action == 'change-severity'
- _.extend query,
- wsAction: 'activate'
- profile_key: @profile
- activation_severity: @$('#coding-rules-bulk-change-severity').val()
-
- query
+ _.extend @options.app.getQuery(),
+ wsAction: @action
+ profile_key: @$('#coding-rules-bulk-change-profile').val() or @profile
bulkChange: (query) ->
qualityProfileName: @options.app.qualityProfileFilter.view.renderValue()
availableQualityProfiles: @getAvailableQualityProfiles()
-
- severities: ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO']
{{tp 'coding_rules.deactivate_in'}} <strong>{{qualityProfileName}}</strong>
</a>
{{/if}}
-
-
-
-{{! severity }}
-
-{{#if allowChangeSeverity}}
- <a class="coding-rules-bulk-change-dropdown-link" data-action="change-severity" data-param="{{qualityProfile}}">
- {{t 'coding_rules.change_severity_in'}} <strong>{{qualityProfileName}}</strong>
- </a>
-{{/if}}
{{#eq action 'deactivate'}}
<h2>{{t 'coding_rules.deactivate_in_quality_profile'}} ({{paging.total}} {{t 'coding_rules._rules'}})</h2>
{{/eq}}
- {{#eq action 'change-severity'}}
- <h2>{{t 'coding_rules.change_severity'}} ({{paging.total}} {{t 'coding_rules._rules'}})</h2>
- {{/eq}}
</div>
<div class="modal-body">
</select>
{{/if}}
</div>
-
-
- {{#eq action 'change-severity'}}
- {{#if qualityProfile}}
- <div class="modal-field">
- <h3><label for="coding-rules-bulk-change-severity">{{t 'severity'}}</label></h3>
- <select id="coding-rules-bulk-change-severity">
- {{#each severities}}
- <option value="{{this}}">{{t 'severity' this}}</option>
- {{/each}}
- </select>
- </div>
- {{/if}}
- {{/eq}}
</div>
<div class="modal-foot">