Skip to content

Commit 9a9dac3

Browse files
committed
Replace the physical infra provider forms with the DDF-based new one
1 parent 590486b commit 9a9dac3

File tree

3 files changed

+6
-36
lines changed

3 files changed

+6
-36
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
module EmsPhysicalInfraHelper
22
include_concern 'TextualSummary'
33
include_concern 'ComplianceSummaryHelper'
4+
5+
def edit_redirect_path(lastaction, ems)
6+
lastaction == 'show_list' ? ems_physical_infras_path : ems_physical_infra_path(ems)
7+
end
48
end
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
= form_for(@ems,
2-
:url => ems_physical_infra_path(@ems),
3-
:method => :patch,
4-
:html => {"ng-controller" => "emsCommonFormController",
5-
"name" => "angularForm",
6-
"ng-show" => "afterGet",
7-
"update-url" => "#{ems_physical_infra_path(@ems)}",
8-
"form-fields-url" => "/#{controller_name}/ems_physical_infra_form_fields/",
9-
"novalidate" => true}) do |f|
10-
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"}
11-
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"}
12-
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"}
13-
= render :partial => "form"
14-
15-
:javascript
16-
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}');
17-
miq_bootstrap($('#form_id').val());
1+
= react('ProviderForm', :providerId => @ems.id.to_s, :redirect => edit_redirect_path(@lastaction, @ems), :kind => 'physical_infra', :title => ui_lookup(:model => 'ManageIQ::Providers::PhysicalInfraManager'))
Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
1-
- url = @ems.persisted? ? ems_physical_infras_path(@ems) : ems_physical_infras_path
2-
= form_for(@ems,
3-
:url => url,
4-
:method => :post,
5-
:html => {"ng-controller" => "emsCommonFormController",
6-
"name" => "angularForm",
7-
"ng-show" => "afterGet",
8-
"create-url" => "#{url}",
9-
"form-fields-url" => "/#{controller_name}/ems_physical_infra_form_fields/",
10-
"novalidate" => true}) do |f|
11-
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"}
12-
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "add"}
13-
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"}
14-
15-
= render :partial => "form"
16-
17-
:javascript
18-
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}');
19-
miq_bootstrap($('#form_id').val());
1+
= react('ProviderForm', :redirect => ems_physical_infras_path, :kind => 'physical_infra', :title => ui_lookup(:model => 'ManageIQ::Providers::PhysicalInfraManager'))

0 commit comments

Comments
 (0)