From c1d3a83b0a6cc0d9b775cbebcfc4049895f3efe5 Mon Sep 17 00:00:00 2001 From: David Resende Date: Wed, 1 Nov 2023 15:00:34 -0400 Subject: [PATCH] Update Service Reconfigure Form to React --- .../components/order-service-form/index.jsx | 12 +- .../dialog-fields-builder.js} | 49 ++++--- .../helper.js | 31 +++-- .../service-dialog-builder.schema.js} | 0 .../service-dialog-refresh-button.jsx} | 6 +- .../service-reconfigure-form/index.jsx | 129 +++++++++++++++--- .../service-reconfigure-form.schema.js | 24 ---- .../dialog_user/dialog_user_controller.js | 62 ++++----- .../dialog_user_reconfigure_controller.js | 1 - .../services/dialog_field_refresh_service.js | 3 +- .../packs/component-definitions-common.js | 2 +- .../service/reconfigure_dialog.html.haml | 2 +- .../shared/dialogs/_dialog_user.html.haml | 2 +- 13 files changed, 197 insertions(+), 126 deletions(-) rename app/javascript/components/{order-service-form/fields.schema.js => service-dialog-builder/dialog-fields-builder.js} (84%) rename app/javascript/components/{order-service-form => service-dialog-builder}/helper.js (89%) rename app/javascript/components/{order-service-form/order-service-form.schema.js => service-dialog-builder/service-dialog-builder.schema.js} (100%) rename app/javascript/components/{order-service-form/order-service-refresh-button.jsx => service-dialog-builder/service-dialog-refresh-button.jsx} (81%) delete mode 100644 app/javascript/components/service-reconfigure-form/service-reconfigure-form.schema.js diff --git a/app/javascript/components/order-service-form/index.jsx b/app/javascript/components/order-service-form/index.jsx index 343049a2f526..25063ec20588 100644 --- a/app/javascript/components/order-service-form/index.jsx +++ b/app/javascript/components/order-service-form/index.jsx @@ -3,11 +3,11 @@ import PropTypes from 'prop-types'; import MiqFormRenderer, { useFormApi } from '@@ddf'; import { Button, Loading } from 'carbon-components-react'; import { FormSpy } from '@data-driven-forms/react-form-renderer'; -import createSchema from './order-service-form.schema'; +import createSchema from '../service-dialog-builder/service-dialog-builder.schema'; import { API } from '../../http_api'; import miqRedirectBack from '../../helpers/miq-redirect-back'; -import { buildFields, prepareSubmitData } from './helper'; -import OrderServiceRefreshButton from './order-service-refresh-button'; +import { buildFields, prepareSubmitData } from '../service-dialog-builder/helper'; +import ServiceDialogRefreshButton from '../service-dialog-builder/service-dialog-refresh-button'; import mapper from '../../forms/mappers/componentMapper'; import NotificationMessage from '../notification-message'; @@ -45,9 +45,7 @@ const OrderServiceForm = ({ initialData }) => { }, []); const onSubmit = (values) => { - let submitData = { action: 'order', ...values }; - - submitData = prepareSubmitData(values, setShowDateError); + let submitData = prepareSubmitData('order', values, setShowDateError); if (submitData !== false) { if (apiSubmitEndpoint.includes('/generic_objects/')) { @@ -83,7 +81,7 @@ const OrderServiceForm = ({ initialData }) => { const componentMapper = { ...mapper, - 'refresh-button': OrderServiceRefreshButton, + 'refresh-button': ServiceDialogRefreshButton, }; return ( diff --git a/app/javascript/components/order-service-form/fields.schema.js b/app/javascript/components/service-dialog-builder/dialog-fields-builder.js similarity index 84% rename from app/javascript/components/order-service-form/fields.schema.js rename to app/javascript/components/service-dialog-builder/dialog-fields-builder.js index f869beff8150..5dbf4fb43dff 100644 --- a/app/javascript/components/order-service-form/fields.schema.js +++ b/app/javascript/components/service-dialog-builder/dialog-fields-builder.js @@ -9,7 +9,7 @@ const generateDynamicFields = (field) => { }; /** Function to build a text box. */ -export const buildTextBox = (field, validate) => { +export const buildTextBox = (field, validate, apiAction) => { let component = {}; generateDynamicFields(field); @@ -21,7 +21,7 @@ export const buildTextBox = (field, validate) => { label: field.label, hideField: !field.visible, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, @@ -34,7 +34,7 @@ export const buildTextBox = (field, validate) => { label: field.label, hideField: !field.visible, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, @@ -92,35 +92,35 @@ export const buildTextBox = (field, validate) => { }; /** Function to build a text area */ -export const buildTextAreaBox = (field, validate) => ({ +export const buildTextAreaBox = (field, validate, apiAction) => ({ component: componentTypes.TEXTAREA, id: field.id, name: field.name, label: field.label, hideField: !field.visible, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, }); /** Function to build a check box. */ -export const buildCheckBox = (field, validate) => ({ +export const buildCheckBox = (field, validate, apiAction) => ({ component: componentTypes.CHECKBOX, id: field.id, name: field.name, label: field.label, hideField: !field.visible, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, }); /** Function to build a drop down select box. */ -export const buildDropDownList = (field, validate) => { +export const buildDropDownList = (field, validate, apiAction) => { let options = []; let placeholder = __(''); let start; @@ -165,7 +165,7 @@ export const buildDropDownList = (field, validate) => { labelText: field.label, hideField: !field.visible, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, @@ -181,7 +181,7 @@ export const buildDropDownList = (field, validate) => { }; /** Function to build a tag control field. */ -export const buildTagControl = (field, validate) => { +export const buildTagControl = (field, validate, apiAction) => { const options = []; field.values.forEach((value) => { if (!value.id) { @@ -196,7 +196,7 @@ export const buildTagControl = (field, validate) => { label: field.label, hideField: !field.visible, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, @@ -205,13 +205,13 @@ export const buildTagControl = (field, validate) => { }; /** Function to build a date control field */ -export const buildDateControl = (field, validate) => ({ +export const buildDateControl = (field, validate, apiAction) => ({ component: componentTypes.DATE_PICKER, id: field.id, name: field.name, label: field.label, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, @@ -219,13 +219,13 @@ export const buildDateControl = (field, validate) => ({ }); /** Function to build a time control field */ -export const buildTimeControl = (field, validate, dateTime) => ([{ +export const buildTimeControl = (field, validate, dateTime, apiAction) => ([{ component: componentTypes.DATE_PICKER, id: field.id, name: field.name, label: field.label, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: dateTime.toISOString(), description: field.description, validate, @@ -236,7 +236,7 @@ export const buildTimeControl = (field, validate, dateTime) => ([{ id: `${field.id}-time`, name: `${field.name}-time`, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: dateTime, validate, twelveHoursFormat: true, @@ -244,7 +244,7 @@ export const buildTimeControl = (field, validate, dateTime) => ([{ }]); /** Function to build radio buttons fields */ -export const buildRadioButtons = (field, validate) => { +export const buildRadioButtons = (field, validate, apiAction) => { const options = []; field.values.forEach((value) => { options.push({ value: value[0], label: value[1] }); @@ -255,7 +255,7 @@ export const buildRadioButtons = (field, validate) => { name: field.name, label: field.label, isRequired: field.required, - isDisabled: field.read_only, + isDisabled: field.read_only || (!field.reconfigurable && apiAction !== 'order'), initialValue: field.default_value, description: field.description, validate, @@ -271,7 +271,8 @@ const fieldSpinner = (fieldName, show) => { /** Function to update the response and build the fileds again after field refresh. */ const updateResponseFields = (response, fieldPosition, fieldName, result) => { - response.content[0].dialog_tabs.map((tab, tabIndex) => { + const responseContent = response.content ? response.content[0].dialog_tabs : response.reconfigure_dialog[0].dialog_tabs; + responseContent.map((tab, tabIndex) => { if (tabIndex === fieldPosition.tabIndex) { tab.dialog_groups.map((group, groupIndex) => { if (groupIndex === fieldPosition.groupIndex) { @@ -280,9 +281,10 @@ const updateResponseFields = (response, fieldPosition, fieldName, result) => { field.data_type = data.data_type; field.options = data.options; field.read_only = data.read_only; + field.reconfigurable = data.reconfigurable; field.required = data.required; field.visible = data.visible; - field.values = [['001', 'one'], ['002', 'two']]; // data.values; + field.values = data.values; field.default_value = data.default_value; field.validator_rule = data.validator_rule; field.validator_type = data.validator_type; @@ -300,7 +302,10 @@ const updateResponseFields = (response, fieldPosition, fieldName, result) => { */ const refreshFields = (response, params, fieldName, initialData, resource, data, setData, fieldPosition) => { fieldSpinner(fieldName, true); - API.post(`/api/service_dialogs/${response.id}`, params).then(({ result }) => { + + const dialogId = response.reconfigure_dialog ? response.reconfigure_dialog[0].id : response.id; + + API.post(`/api/service_dialogs/${dialogId}`, params).then(({ result }) => { const responders = result[fieldName].dialog_field_responders; const newResponse = updateResponseFields(response, fieldPosition, fieldName, result); buildFields(newResponse, data, setData, initialData); @@ -322,7 +327,7 @@ const onRefreshField = (response, field, initialData, data, setData, fieldPositi fields: [field.name], resource_action_id: initialData.resourceActionId, target_id: initialData.targetId, - target_type: initialData.targetType, + target_type: initialData.targetType ? initialData.targetType : 'service', real_target_type: initialData.realTargetType, }; const params = { diff --git a/app/javascript/components/order-service-form/helper.js b/app/javascript/components/service-dialog-builder/helper.js similarity index 89% rename from app/javascript/components/order-service-form/helper.js rename to app/javascript/components/service-dialog-builder/helper.js index adb568612770..48156d6ce902 100644 --- a/app/javascript/components/order-service-form/helper.js +++ b/app/javascript/components/service-dialog-builder/helper.js @@ -10,7 +10,7 @@ import { buildTimeControl, buildRadioButtons, buildRefreshButton, -} from './fields.schema'; +} from './dialog-fields-builder'; const dates = []; const showPastDates = []; @@ -61,30 +61,30 @@ const formatTimeControl = (field) => { return newDate; }; -const buildComponent = (field, validate) => { +const buildComponent = (field, validate, apiAction) => { switch (field.type) { case DIALOG_FIELDS.textBox: - return buildTextBox(field, validate); + return buildTextBox(field, validate, apiAction); case DIALOG_FIELDS.textArea: - return buildTextAreaBox(field, validate); + return buildTextAreaBox(field, validate, apiAction); case DIALOG_FIELDS.checkBox: - return buildCheckBox(field, validate); + return buildCheckBox(field, validate, apiAction); case DIALOG_FIELDS.dropDown: - return buildDropDownList(field, validate); + return buildDropDownList(field, validate, apiAction); case DIALOG_FIELDS.tag: - return buildTagControl(field, validate); + return buildTagControl(field, validate, apiAction); case DIALOG_FIELDS.date: { formatDateControl(field); - return buildDateControl(field, validate); + return buildDateControl(field, validate, apiAction); } case DIALOG_FIELDS.dateTime: { const dateTime = formatTimeControl(field); - return buildTimeControl(field, validate, dateTime); + return buildTimeControl(field, validate, dateTime, apiAction); } case DIALOG_FIELDS.radio: - return buildRadioButtons(field, validate); + return buildRadioButtons(field, validate, apiAction); default: return {}; } @@ -127,7 +127,10 @@ const buildValidator = (field) => { /** Function to build the form fields. */ export const buildFields = (response, data, setData, initialData) => { const dialogTabs = []; - response.content[0].dialog_tabs.forEach((tab, tabIndex) => { + const responseContent = response.content ? response.content[0].dialog_tabs : response.reconfigure_dialog[0].dialog_tabs; + const { apiAction } = initialData; + + responseContent.forEach((tab, tabIndex) => { const dialogSections = []; tab.dialog_groups.forEach((group, groupIndex) => { const dialogFields = []; @@ -135,7 +138,7 @@ export const buildFields = (response, data, setData, initialData) => { const validate = buildValidator(field); const fieldPosition = { tabIndex, groupIndex }; const fieldData = [ - buildComponent(field, validate), + buildComponent(field, validate, apiAction), buildRefreshButton(response, field, initialData, data, setData, fieldPosition), ]; dialogFields.push(fieldData); @@ -274,8 +277,8 @@ const handleCheckboxSubmit = (submitData) => { }; /** Function to handle the form data on form submit. */ -export const prepareSubmitData = (values, setShowDateError) => { - let submitData = { action: 'order', ...values }; +export const prepareSubmitData = (submitAction, values, setShowDateError) => { + let submitData = { action: submitAction, ...values }; stopSubmit = false; invalidDateFields = []; diff --git a/app/javascript/components/order-service-form/order-service-form.schema.js b/app/javascript/components/service-dialog-builder/service-dialog-builder.schema.js similarity index 100% rename from app/javascript/components/order-service-form/order-service-form.schema.js rename to app/javascript/components/service-dialog-builder/service-dialog-builder.schema.js diff --git a/app/javascript/components/order-service-form/order-service-refresh-button.jsx b/app/javascript/components/service-dialog-builder/service-dialog-refresh-button.jsx similarity index 81% rename from app/javascript/components/order-service-form/order-service-refresh-button.jsx rename to app/javascript/components/service-dialog-builder/service-dialog-refresh-button.jsx index 1567164e692b..5eedc0591792 100644 --- a/app/javascript/components/order-service-form/order-service-refresh-button.jsx +++ b/app/javascript/components/service-dialog-builder/service-dialog-refresh-button.jsx @@ -3,7 +3,7 @@ import { Button, Loading } from 'carbon-components-react'; import { Renew16 } from '@carbon/icons-react'; import PropTypes from 'prop-types'; -const OrderServiceRefreshButton = ({ onRefresh, showRefreshButton, fieldName }) => ( +const ServiceDialogRefreshButton = ({ onRefresh, showRefreshButton, fieldName }) => ( <> {showRefreshButton && ( + + + )} + + ); }; +FormTemplate.propTypes = { + formFields: PropTypes.arrayOf(PropTypes.any).isRequired, +}; + ServiceReconfigureForm.propTypes = { dialogLocals: PropTypes.shape({ - resource_action_id: PropTypes.string, - target_id: PropTypes.string, + resourceActionId: PropTypes.string, + targetId: PropTypes.string, }), }; ServiceReconfigureForm.defaultProps = { diff --git a/app/javascript/components/service-reconfigure-form/service-reconfigure-form.schema.js b/app/javascript/components/service-reconfigure-form/service-reconfigure-form.schema.js deleted file mode 100644 index 14bf630f75ea..000000000000 --- a/app/javascript/components/service-reconfigure-form/service-reconfigure-form.schema.js +++ /dev/null @@ -1,24 +0,0 @@ -import { componentTypes, validatorTypes } from '@@ddf'; - -const createSchema = (initialValues) => ({ - fields: [ - { - component: componentTypes.TEXT_FIELD, - name: 'associations_name', - label: __('Name'), - validate: [{ type: validatorTypes.REQUIRED }], - }, - { - component: componentTypes.SELECT, - name: 'class', - id: 'class', - label: __('Class'), - className: 'class', - placeholder: __(''), - options: [], - validate: [{ type: validatorTypes.REQUIRED }], - }, - ], -}); - -export default createSchema; diff --git a/app/javascript/oldjs/controllers/dialog_user/dialog_user_controller.js b/app/javascript/oldjs/controllers/dialog_user/dialog_user_controller.js index 5c573890e7c6..f761e21db6cd 100644 --- a/app/javascript/oldjs/controllers/dialog_user/dialog_user_controller.js +++ b/app/javascript/oldjs/controllers/dialog_user/dialog_user_controller.js @@ -1,14 +1,14 @@ ManageIQ.angular.app.controller('dialogUserController', ['API', 'dialogFieldRefreshService', 'miqService', 'dialogUserSubmitErrorHandlerService', 'dialogId', 'apiSubmitEndpoint', 'apiAction', 'finishSubmitEndpoint', 'cancelEndpoint', 'resourceActionId', 'targetId', 'targetType', 'realTargetType', 'openUrl', '$http', '$window', 'dialogReplaceData', 'DialogData', function(API, dialogFieldRefreshService, miqService, dialogUserSubmitErrorHandlerService, dialogId, apiSubmitEndpoint, apiAction, finishSubmitEndpoint, cancelEndpoint, resourceActionId, targetId, targetType, realTargetType, openUrl, $http, $window, dialogReplaceData, DialogData) { - var vm = this; + const vm = this; vm.$onInit = function() { - var apiCall = new Promise(function(resolve) { - var url = '/api/service_dialogs/' + dialogId + - '?resource_action_id=' + resourceActionId + - '&target_id=' + targetId + - '&target_type=' + targetType; + const apiCall = new Promise((resolve) => { + const url = `/api/service_dialogs/${dialogId + }?resource_action_id=${resourceActionId + }&target_id=${targetId + }&target_type=${targetType}`; - resolve(API.get(url, {expand: 'resources', attributes: 'content'}).then(init)); + resolve(API.get(url, { expand: 'resources', attributes: 'content' }).then(init)); }); Promise.resolve(apiCall).then(miqService.refreshSelectpicker); @@ -18,16 +18,15 @@ ManageIQ.angular.app.controller('dialogUserController', ['API', 'dialogFieldRefr vm.dialog = dialog.content[0]; vm.dialogLoaded = true; - console.log(vm.dialog); - _.forEach(vm.dialog.dialog_tabs, function(tab) { - _.forEach(tab.dialog_groups, function(group) { - _.forEach(group.dialog_fields, function(field) { - const replaceField = dialogReplaceData ? JSON.parse(dialogReplaceData).find(function (replace) { return replace.name === field.name }) : false; + _.forEach(vm.dialog.dialog_tabs, (tab) => { + _.forEach(tab.dialog_groups, (group) => { + _.forEach(group.dialog_fields, (field) => { + const replaceField = dialogReplaceData ? JSON.parse(dialogReplaceData).find((replace) => replace.name === field.name) : false; if (replaceField) { field.default_value = replaceField.value; } if (field.type === 'DialogFieldDropDownList') { - _.forEach(field.values, function(value) { + _.forEach(field.values, (value) => { if (value[0] === null) { value[1] = __(value[1]); } @@ -50,16 +49,16 @@ ManageIQ.angular.app.controller('dialogUserController', ['API', 'dialogFieldRefr vm.isValid = false; function refreshField(field) { - console.log("111=", field); + console.log('111=', field); // API.post(field.href).then((data) => { // console.log(data); // }); - var idList = { - dialogId: dialogId, - resourceActionId: resourceActionId, - targetId: targetId, - targetType: targetType, - realTargetType: realTargetType, + const idList = { + dialogId, + resourceActionId, + targetId, + targetType, + realTargetType, }; return dialogFieldRefreshService.refreshField(vm.dialogData, [field.name], vm.refreshUrl, idList); @@ -74,23 +73,22 @@ ManageIQ.angular.app.controller('dialogUserController', ['API', 'dialogFieldRefr vm.dialogData.action = apiAction; // miqService.sparkleOn(); - var apiData = DialogData.outputConversion(vm.dialogData); + let apiData = DialogData.outputConversion(vm.dialogData); if (apiSubmitEndpoint.match(/generic_objects/)) { - apiData = {action: apiAction, parameters: _.omit(apiData, 'action')}; + apiData = { action: apiAction, parameters: _.omit(apiData, 'action') }; } else if (apiAction === 'reconfigure') { - apiData = {action: apiAction, resource: _.omit(apiData, 'action')}; + apiData = { action: apiAction, resource: _.omit(apiData, 'action') }; } - return API.post(apiSubmitEndpoint, apiData, {skipErrors: [400]}) - .then(function(response) { - console.log(openUrl); + return API.post(apiSubmitEndpoint, apiData, { skipErrors: [400] }) + .then((response) => { if (vm.openUrl === 'true') { return API.wait_for_task(response.task_id) - .then(function() { + .then(() => { console.log(API.wait_for_task(response.task_id)); - return $http.post('open_url_after_dialog', {targetId: vm.targetId, realTargetType: realTargetType}); + return $http.post('open_url_after_dialog', { targetId: vm.targetId, realTargetType }); }) - .then(function(response) { + .then((response) => { if (response.data.open_url) { $window.open(response.data.open_url); miqService.redirectBack(__('Order Request was Submitted'), 'success', finishSubmitEndpoint); @@ -99,13 +97,11 @@ ManageIQ.angular.app.controller('dialogUserController', ['API', 'dialogFieldRefr miqService.sparkleOff(); } }) - .catch(function() { - return Promise.reject({data: {error: {message: '-'.concat(__('Automate failed to obtain URL.')) }}}); - }); + .catch(() => Promise.reject({ data: { error: { message: '-'.concat(__('Automate failed to obtain URL.')) } } })); } miqService.redirectBack(__('Order Request was Submitted'), 'success', finishSubmitEndpoint); }) - .catch(function(err) { + .catch((err) => { dialogUserSubmitErrorHandlerService.handleError(err); }); } diff --git a/app/javascript/oldjs/controllers/dialog_user/dialog_user_reconfigure_controller.js b/app/javascript/oldjs/controllers/dialog_user/dialog_user_reconfigure_controller.js index 6f3f9be07b7e..341527ec4c18 100644 --- a/app/javascript/oldjs/controllers/dialog_user/dialog_user_reconfigure_controller.js +++ b/app/javascript/oldjs/controllers/dialog_user/dialog_user_reconfigure_controller.js @@ -34,7 +34,6 @@ ManageIQ.angular.app.controller('dialogUserReconfigureController', ['API', 'dial targetId, targetType: 'service', }; - console.log('vm.dialogData=',vm.dialogData) return dialogFieldRefreshService.refreshField(vm.dialogData, [field.name], vm.refreshUrl, idList); } diff --git a/app/javascript/oldjs/services/dialog_field_refresh_service.js b/app/javascript/oldjs/services/dialog_field_refresh_service.js index 8a5f316a0ecd..1aafcd636d9d 100644 --- a/app/javascript/oldjs/services/dialog_field_refresh_service.js +++ b/app/javascript/oldjs/services/dialog_field_refresh_service.js @@ -2,7 +2,6 @@ ManageIQ.angular.app.service('dialogFieldRefreshService', ['API', 'DialogData', var self = this; self.refreshField = function(dialogData, dialogField, url, idList) { - console.log('222') self.areFieldsBeingRefreshed = true; var data = { @@ -17,6 +16,8 @@ ManageIQ.angular.app.service('dialogFieldRefreshService', ['API', 'DialogData', }, }; + console.log(data); + return API.post(url + idList.dialogId, angular.toJson(data)) .then(function(response) { console.log('333=', response); diff --git a/app/javascript/packs/component-definitions-common.js b/app/javascript/packs/component-definitions-common.js index 1ec657c7dfd8..bb1effc3e128 100644 --- a/app/javascript/packs/component-definitions-common.js +++ b/app/javascript/packs/component-definitions-common.js @@ -82,7 +82,7 @@ import OpsTenantForm from '../components/ops-tenant-form/ops-tenant-form'; import OrcherstrationTemplateForm from '../components/orchestration-template/orcherstration-template-form'; import ProvGrid from '../components/prov-grid'; import OrderServiceForm from '../components/order-service-form'; -import OrderServiceRefreshButton from '../components/order-service-form/order-service-refresh-button'; +import OrderServiceRefreshButton from '../components/service-dialog-builder/service-dialog-refresh-button'; import PxeImageForm from '../components/pxe-image-type-form'; import PxeCustomizationTemplateForm from '../components/pxe-customization-template-form'; import PxeIsoDatastoreForm from '../components/pxe-iso-datastore-form'; diff --git a/app/views/service/reconfigure_dialog.html.haml b/app/views/service/reconfigure_dialog.html.haml index 7be3f3eee6c6..6126b73f9c9c 100644 --- a/app/views/service/reconfigure_dialog.html.haml +++ b/app/views/service/reconfigure_dialog.html.haml @@ -1,2 +1,2 @@ -= react 'ServiceReconfigureForm', :dialogLocals => params[:dialog_locals] += react 'ServiceReconfigureForm', :dialogLocals => { :resourceActionId => params[:dialog_locals][:resource_action_id], :targetId => params[:dialog_locals][:target_id] } = render :partial => "shared/dialogs/reconfigure_dialog" diff --git a/app/views/shared/dialogs/_dialog_user.html.haml b/app/views/shared/dialogs/_dialog_user.html.haml index 837f4a642a5b..a1ee30d97a37 100644 --- a/app/views/shared/dialogs/_dialog_user.html.haml +++ b/app/views/shared/dialogs/_dialog_user.html.haml @@ -11,7 +11,7 @@ - target_id ||= dialog[:targetId] - target_type ||= dialog[:targetType] -= react('OrderServiceForm', :initialData => dialog) + = react('OrderServiceForm', :initialData => dialog) .row.wrapper{"ng-controller" => "dialogUserController as vm"}