Skip to content

Commit

Permalink
Replace cloud provider forms with the ProviderForm react component
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed May 25, 2020
1 parent 4b9a6b0 commit 3598c6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/helpers/ems_cloud_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module EmsCloudHelper
include_concern 'TextualSummary'
include_concern 'ComplianceSummaryHelper'

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

= form_for(@ems,
:url => ems_cloud_path(@ems),
:method => :patch,
Expand Down
3 changes: 3 additions & 0 deletions app/views/ems_cloud/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
- url = @ems.persisted? ? ems_clouds_path(@ems) : ems_clouds_path

= react('ProviderForm', :redirect => ems_clouds_path, :kind => 'cloud', :title => ui_lookup(:model => 'ManageIQ::Providers::CloudManager'))

= form_for(@ems,
:url => url,
:method => :post,
Expand Down

0 comments on commit 3598c6c

Please sign in to comment.