Commit 226908b8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix issue weight selection

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b4efe44d
......@@ -121,13 +121,13 @@ module IssuesHelper
end
end
def projects_weight_options
def projects_weight_options(selected = nil)
options = (Issue::WEIGHT_RANGE).map do |i|
[i, i]
end
options.unshift(['Any', nil])
options_for_select(options, params[:weight])
options_for_select(options, selected || params[:weight])
end
# Required for Banzai::Filter::IssueReferenceFilter
......
......@@ -60,7 +60,7 @@
= icon('magnet')
Weight
.col-sm-10
= f.select :weight, projects_weight_options, { include_blank: true },
= f.select :weight, projects_weight_options(issuable.weight), { include_blank: true },
{ class: 'select2 js-select2', data: { placeholder: "Select weight" }}
.form-group
......
......@@ -68,7 +68,7 @@
- else
.light None
.selectbox
= f.select :weight, projects_weight_options, { include_blank: true },
= f.select :weight, projects_weight_options(issuable.weight), { include_blank: true },
{ class: 'select2 js-select2', data: { placeholder: "Select weight" }}
.block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment