diff --git a/app/javascript/components/pxe-customization-template-form/index.jsx b/app/javascript/components/pxe-customization-template-form/index.jsx index a43dfde070c..59b78a771e0 100644 --- a/app/javascript/components/pxe-customization-template-form/index.jsx +++ b/app/javascript/components/pxe-customization-template-form/index.jsx @@ -19,7 +19,7 @@ const PxeCustomizationTemplateForm = ({ recordId }) => { } }, [recordId]); - const onSubmit = ({ edit: _edit, ...values }) => { + const onSubmit = (values) => { miqSparkleOn(); const request = recordId ? API.patch(`/api/customization_templates/${recordId}`, values) : API.post('/api/customization_templates', values); @@ -63,4 +63,4 @@ PxeCustomizationTemplateForm.defaultProps = { recordId: undefined, }; -export default PxeCustomizationTemplateForm; \ No newline at end of file +export default PxeCustomizationTemplateForm; diff --git a/app/javascript/components/pxe-customization-template-form/pxe-customization-template-form.schema.js b/app/javascript/components/pxe-customization-template-form/pxe-customization-template-form.schema.js index 98aeb46325a..4508b0e4e16 100644 --- a/app/javascript/components/pxe-customization-template-form/pxe-customization-template-form.schema.js +++ b/app/javascript/components/pxe-customization-template-form/pxe-customization-template-form.schema.js @@ -4,7 +4,7 @@ const setFormat = (values) => { return typeof values.type !== 'undefined' && values.type == "CustomizationTemplateKickstart" ? "shell" : "xml"; }; -const createSchema = ( initialValues = {}, loadSchema ) => { +const createSchema = ( initialValues = {} ) => { return ({ fields: [ { @@ -27,7 +27,6 @@ const createSchema = ( initialValues = {}, loadSchema ) => { name: 'pxe_image_type_id', id: 'pxe_image_type_id', label: __('Image Type'), - placeholder: __(''), loadOptions: () => API.get(`/api/pxe_image_types?attributes=name,id&expand=resources`).then(({ resources }) => resources.map(({ id, name }) => ({ value: id, label: name }))), isRequired: true, @@ -37,7 +36,6 @@ const createSchema = ( initialValues = {}, loadSchema ) => { name: 'type', id: 'type', label: __('Type'), - placeholder: __(''), options: [ { 'label': 'Kickstart', @@ -60,13 +58,9 @@ const createSchema = ( initialValues = {}, loadSchema ) => { name: 'script', label: __('Script'), mode: setFormat(initialValues), - validateOnMount: true, - // validate: [{ - // type: validatorTypes.REQUIRED, - // }, value => validateCopyContent(value, initialValues, isCopying)], }, ], }); }; -export default createSchema; \ No newline at end of file +export default createSchema; diff --git a/app/views/pxe/_template_details.html.haml b/app/views/pxe/_template_details.html.haml index 86a8f05af49..8b66195e395 100644 --- a/app/views/pxe/_template_details.html.haml +++ b/app/views/pxe/_template_details.html.haml @@ -4,6 +4,7 @@ #template_info_div - if @edit = render :partial => "template_form" + = react 'PxeCustomizationTemplateForm', :recordId => @ct.try(:id).try(:to_s) - else = render :partial => "layouts/flash_msg" = react 'GenericGroupWrapper', expand_generic_group(TextualGroup.new(_('Basic Information'), textual_template_basicinfo), @record) diff --git a/app/views/pxe/_template_form.html.haml b/app/views/pxe/_template_form.html.haml index d63964b76cc..7afa54c0f47 100644 --- a/app/views/pxe/_template_form.html.haml +++ b/app/views/pxe/_template_form.html.haml @@ -47,5 +47,3 @@ %hr %h3= _('Script') = render :partial => "template_script_data" - -= react 'PxeCustomizationTemplateForm', :recordId => @ct.try(:id).try(:to_s) \ No newline at end of file