Skip to content

Commit bdae559

Browse files
committed
refactor code and remove unwanted lines
1 parent 11b3ab9 commit bdae559

File tree

3 files changed

+2
-51
lines changed

3 files changed

+2
-51
lines changed

app/helpers/application_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module ApplicationHelper
1414
include Title
1515
include ReactjsHelper
1616
include Webpack
17-
include OrderServiceHelper
1817

1918
VALID_PERF_PARENTS = {
2019
"EmsCluster" => :ems_cluster,

app/helpers/catalog_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module CatalogHelper
22
include_concern 'TextualSummary'
33
include RequestInfoHelper
44
include Mixins::AutomationMixin
5+
include OrderServiceHelper
56

67
def miq_catalog_resource(resources)
78
headers = ["", _("Name"), _("Description"), _("Action Order"), _("Provision Order"), _("Action Start"), _("Action Stop"), _("Delay (mins) Start"), _("Delay (mins) Stop")]

app/javascript/components/order-service-form/fields.schema.js

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -40,52 +40,7 @@ export const buildTextBox = (field, validate) => {
4040
validate,
4141
resolveProps: (props, { meta, input }, formOptions) => {
4242
dynamicFields[input.name] = input.value;
43-
},
44-
// resolveProps: (props, { meta, input }, formOptions) => {
45-
// console.log(props);
46-
// console.log(meta);
47-
// console.log(input);
48-
// console.log(formOptions);
49-
// if (!formOptions.pristine) {
50-
// if (field.dialog_field_responders.length > 0) {
51-
// field.dialog_field_responders.forEach((tempField) => {
52-
// console.log(tempField);
53-
// dynamicFields.forEach((fieldToRefresh) => {
54-
// if (fieldToRefresh.field === tempField) {
55-
// const refreshData = {
56-
// action: 'refresh_dialog_fields',
57-
// resource: {
58-
// dialog_fields: {
59-
// // credential: null,
60-
// hosts: 'localhost0',
61-
// // param_provider_id: '38',
62-
// // param_miq_username: 'admin',
63-
// // param_miq_password: 'smartvm',
64-
// // check_box_1: 't',
65-
// // dropdown_list_1_1: null,
66-
// // textarea_box_1: '',
67-
// // date_time_control_1: '2022-10-12T20:50:45.180Z',
68-
// // date_time_control_2: '2022-10-12T20:50:45.180Z',
69-
// // date_control_1: '2022-10-12',
70-
// // date_control_2_1: '2022-09-27',
71-
// },
72-
// fields: ['credential'],
73-
// resource_action_id: '2018',
74-
// target_id: '14',
75-
// target_type: 'service_template',
76-
// real_target_type: 'ServiceTemplate',
77-
// },
78-
// };
79-
// fieldToRefresh.values = API.post(`/api/service_dialogs/10`, refreshData).then((data) => {
80-
// console.log(data);
81-
// });
82-
// console.log(fieldToRefresh);
83-
// }
84-
// });
85-
// });
86-
// }
87-
// }
88-
// },
43+
}
8944
};
9045
}
9146
return component;
@@ -336,11 +291,7 @@ const onRefreshField = (response, field, initialData, data, setData, fieldPositi
336291
/** Function to build a refresh button near to drop down. */
337292
export const buildRefreshButton = (response, field, initialData, data, setData, fieldPosition) => ({
338293
component: 'refresh-button',
339-
id: `refresh_${field.id}`,
340294
name: `refresh_${field.name}`,
341-
label: 'Refresh',
342-
hideField: !field.visible,
343-
className: 'refresh-button',
344295
showRefreshButton: !!(field.dynamic && field.show_refresh_button),
345296
fieldName: field.name,
346297
onRefresh: () => onRefreshField(response, field, initialData, data, setData, fieldPosition),

0 commit comments

Comments
 (0)