manualIssueView = new ManualIssueView
line: line
component: component
+ rules: @options.main.state.get 'manual_rules'
manualIssueView.render().$el.appendTo @options.row.find('.line')
manualIssueView.on 'add', (issue) =>
issues = @options.main.source.get('issues') || []
requestComponent: (key, clear = false, full = true) ->
- STATE_FIELDS = ['canBulkChange', 'canMarkAsFavourite', 'tabs']
+ STATE_FIELDS = ['canBulkChange', 'canMarkAsFavourite', 'canCreateManualIssue', 'tabs', 'manual_rules']
COMPONENT_FIELDS = ['key', 'name', 'path', 'q', 'projectName', 'subProjectName', 'measures', 'fav']
$.get API_COMPONENT, key: key, (data) =>
row = $(e.currentTarget).closest('.row')
row.addClass HIGHLIGHTED_ROW_CLASS
@highlightedLine = row.data 'line-number'
- @showLineActionsPopup(e)
+ @showLineActionsPopup(e) if @options.main.state.get 'canCreateManualIssue'
highlightCurrentLine: ->
_.extend super,
line: @options.line
component: @options.component
+ rules: _.sortBy @options.rules, 'name'
<input type="hidden" name="component" value="{{component}}">
<div class="code-issue-name">
- {{! TODO: replace mock data }}
<select name="rule">
- <option value="manual:api">API</option>
- <option value="manual:design">Design</option>
- <option value="manual:error_handling">Error handling</option>
- <option value="manual:performance">Performance</option>
- <option value="manual:sql_pitfalls">SQL Pitfall</option>
+ {{#each rules}}
+ <option value="{{key}}">{{name}}</option>
+ {{/each}}
</select>
</div>