Skip to content

Commit

Permalink
Merge pull request #2908 from h-kataria/use_backend_method_to_show_di…
Browse files Browse the repository at this point in the history
…sabled_catalog_item_types_in_drop_down

UI changes to show options as disabled if those are not supported.
(cherry picked from commit 19ecd2e)

https://bugzilla.redhat.com/show_bug.cgi?id=1520613
  • Loading branch information
Dan Clarizio authored and simaishi committed Dec 11, 2017
1 parent 992f875 commit 6cf7b71
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 6cf7b71

Please sign in to comment.