Skip to content

Commit

Permalink
Merge pull request #1248 from lfu/dialog_field_sort_none_1389010
Browse files Browse the repository at this point in the history
Check :sort_by: :none to keep the field values in the order that they are inserted in the file.
(cherry picked from commit 662b026)

https://bugzilla.redhat.com/show_bug.cgi?id=1458447
  • Loading branch information
Dan Clarizio authored and simaishi committed Jun 5, 2017
1 parent d45fce6 commit 7656be5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/views/miq_request/_prov_field.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@
- opts = [["<#{_('Choose')}>", nil]]
- else
- opts = multiple ? [] : [["<#{_('None')}>", nil]]
- if field_hash[:data_type] == :integer
- if field_hash[:sort_by] == :none
- opts += Array(field_hash[:values].invert)
- elsif field_hash[:data_type] == :integer
- opts += Array(field_hash[:values].invert).sort_by(&:last)
- else
- opts += Array(field_hash[:values].invert).sort_by { |a| a.first.downcase }
Expand Down

0 comments on commit 7656be5

Please sign in to comment.