Skip to content

Commit

Permalink
Merge pull request #4166 from skateman/include-domain-prefix
Browse files Browse the repository at this point in the history
Fix include domain prefix behavior for catalog entrypoint selection
  • Loading branch information
Dan Clarizio authored Jun 19, 2018
2 parents 90bbf6f + 0f00b7d commit a57956f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/helpers/automate_tree_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def at_tree_select_toggle(edit_key)
when 'submit'
@edit[:new][@edit[:ae_field_typ]] = @edit[:active_id]
page << set_element_visible("#{edit_key}_div", true)

if @edit[:include_domain_prefix] != true && MiqAeDatastore.path_includes_domain?(@edit[:automate_tree_selected_path])
selected_path = @edit[:automate_tree_selected_path]
@edit[:automate_tree_selected_path] = selected_path.slice(selected_path.index('/', 1), selected_path.length)
end

@edit[:new][edit_key] = @edit[:automate_tree_selected_path]
if @edit[:new][edit_key]
page << "$('##{edit_key}').val('#{@edit[:new][edit_key]}');"
Expand Down

0 comments on commit a57956f

Please sign in to comment.