Skip to content

Commit

Permalink
Replace angular-based infra provider forms with the DDF component
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jul 3, 2020
1 parent 599bdf0 commit c7566d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/helpers/ems_infra_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ def scaling_field_label(param_name)
_("Number of %{host_type} Hosts") % {:host_type => field_name.underscore.humanize.titleize}
end
end

def edit_redirect_path(lastaction, ems)
lastaction == 'show_list' ? ems_infras_path : ems_infra_path(ems)
end
end
2 changes: 2 additions & 0 deletions app/views/ems_infra/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= react('ProviderForm', :providerId => @ems.id.to_s, :redirect => edit_redirect_path(@lastaction, @ems), :kind => 'infra', :title => ui_lookup(:model => 'ManageIQ::Providers::InfraManager'))

= form_for(@ems,
:url => ems_infra_path(@ems),
:method => :patch,
Expand Down
2 changes: 2 additions & 0 deletions app/views/ems_infra/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= react('ProviderForm', :redirect => ems_infras_path, :kind => 'infra', :title => ui_lookup(:model => 'ManageIQ::Providers::InfraManager'))

- url = @ems.persisted? ? ems_infras_path(@ems) : ems_infras_path
= form_for(@ems,
:url => url,
Expand Down

0 comments on commit c7566d5

Please sign in to comment.