Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidResende0 committed Feb 16, 2021
1 parent 6dbd063 commit f380ae6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -63,4 +63,4 @@ PxeCustomizationTemplateForm.defaultProps = {
recordId: undefined,
};

export default PxeCustomizationTemplateForm;
export default PxeCustomizationTemplateForm;
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand All @@ -27,7 +27,6 @@ const createSchema = ( initialValues = {}, loadSchema ) => {
name: 'pxe_image_type_id',
id: 'pxe_image_type_id',
label: __('Image Type'),
placeholder: __('<Choose>'),
loadOptions: () => API.get(`/api/pxe_image_types?attributes=name,id&expand=resources`).then(({ resources }) =>
resources.map(({ id, name }) => ({ value: id, label: name }))),
isRequired: true,
Expand All @@ -37,7 +36,6 @@ const createSchema = ( initialValues = {}, loadSchema ) => {
name: 'type',
id: 'type',
label: __('Type'),
placeholder: __('<Choose>'),
options: [
{
'label': 'Kickstart',
Expand All @@ -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;
export default createSchema;
1 change: 1 addition & 0 deletions app/views/pxe/_template_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions app/views/pxe/_template_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,3 @@
%hr
%h3= _('Script')
= render :partial => "template_script_data"

= react 'PxeCustomizationTemplateForm', :recordId => @ct.try(:id).try(:to_s)

0 comments on commit f380ae6

Please sign in to comment.