Skip to content

Commit

Permalink
UI changes to show options as disabled if those are not supported.
Browse files Browse the repository at this point in the history
This PR uses changes from backend in ManageIQ/manageiq#16559 to determine whether options in the drop down should be available or disabled based upon results returned in hash by backend method.

https://bugzilla.redhat.com/show_bug.cgi?id=1515371
  • Loading branch information
h-kataria committed Dec 1, 2017
1 parent 797eb75 commit 449896b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/views/catalog/_st_form.html.haml
Expand Up @@ -8,9 +8,14 @@
.form-group
%label.col-md-2.control-label= _('Catalog Item Type')
.col-md-8
- array = Array(ServiceTemplate::CATALOG_ITEM_TYPES.invert).sort_by { |a| a.first.downcase }
- catalog_item_types = ServiceTemplate.catalog_item_types
- array = catalog_item_types.collect { |x| [x[1][:description], x[0]]}
- array.sort_by! { |a| a.first.downcase }
- disabled_options = catalog_item_types.collect { |x| x[0] if !x[1][:display]}
= select_tag('st_prov_type',
options_for_select(([["<#{_('Choose')}>",nil]]) + array, nil),
options_for_select(([["<#{_('Choose')}>",nil]]) + array,
:selected => '',
:disabled => disabled_options),
"data-miq_sparkle_on" => true,
:class => "selectpicker")
:javascript
Expand Down

0 comments on commit 449896b

Please sign in to comment.