-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7155 from skateman/container-provider-forms
Replace old container provider forms with the new DDF version
- Loading branch information
Showing
5 changed files
with
26 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import fieldsMapper from '../../forms/mappers/formFieldsMapper'; | ||
import { componentTypes } from '@@ddf'; | ||
|
||
const Component = fieldsMapper[componentTypes.BUTTON]; | ||
|
||
const DetectButton = ({ formOptions, dependencies, target, FormSpyProvider, ...props }) => { | ||
return <span/>; | ||
|
||
// const onClick = () => { | ||
// // TODO: api('detect endpoint data').then('store in form using formOptions'); | ||
// }; | ||
// return <Component formOptions={formOptions} {...props} onClick={onClick} />; | ||
}; | ||
|
||
export default DetectButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1 @@ | ||
= form_for(@ems, | ||
:url => "/#{controller_name}/#{@ems.id}", | ||
:method => :patch, | ||
:html => {"ng-controller" => "emsCommonFormController", | ||
"name" => "angularForm", | ||
"ng-show" => "afterGet", | ||
"update-url" => "/#{controller_name}/#{@ems.id}", | ||
"form-fields-url" => "/#{controller_name}/ems_container_form_fields/", | ||
"novalidate" => true}) do |f| | ||
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} | ||
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"} | ||
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} | ||
|
||
= render :partial => "form" | ||
|
||
:javascript | ||
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); | ||
miq_bootstrap($('#form_id').val()); | ||
= react('ProviderForm', :providerId => @ems.id.to_s, :redirect => edit_redirect_path(@lastaction, @ems), :kind => 'container', :title => ui_lookup(:model => 'ManageIQ::Providers::ContainerManager')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
- url = @ems.persisted? ? ems_containers_path(@ems) : ems_containers_path | ||
= form_for(@ems, | ||
:url => url, | ||
:method => :post, | ||
:html => {"ng-controller" => "emsCommonFormController", | ||
"name" => "angularForm", | ||
"ng-show" => "afterGet", | ||
"create-url" => url, | ||
"form-fields-url" => "/#{controller_name}/ems_container_form_fields/", | ||
"novalidate" => true}) do |f| | ||
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"} | ||
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "add"} | ||
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"} | ||
|
||
= render :partial => "form" | ||
|
||
:javascript | ||
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}'); | ||
miq_bootstrap($('#form_id').val()); | ||
= react('ProviderForm', :redirect => ems_containers_path, :kind => 'container', :title => ui_lookup(:model => 'ManageIQ::Providers::ContainerManager')) |