Commit c3c5bb59 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Set dropdown labels for protected branches

[ci skip]
parent 8c3b7ee6
- defaultLabel = 'Select'
- dropdownLabel = defaultLabel
- access_by_type = protected_branch.merge_access_level_frequencies
- if access_levels.present?
- access_levels.map.with_index do |level, i|
- if (level.type == :user)
......@@ -9,5 +13,7 @@
%input{ type: 'hidden', name: "protected_branch[#{input_basic_name}][#{i}][#{fieldKey}]",
value: value, data: { type: level.type } }
= dropdown_tag('Select', options: { toggle_class: "#{toggle_class} js-multiselect", dropdown_class: 'dropdown-menu-user dropdown-menu-selectable', filter: true,
data: { default_label: 'Select' } })
- dropdownLabel = [pluralize(access_by_type[:role], 'role'), pluralize(access_by_type[:user], 'user')].to_sentence
= dropdown_tag(dropdownLabel, options: { toggle_class: "#{toggle_class} js-multiselect", dropdown_class: 'dropdown-menu-user dropdown-menu-selectable', filter: true,
data: { default_label: defaultLabel } })
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