foreman_acd 0.9.7 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/lib/foreman_acd/version.rb +1 -1
  3. data/package.json +5 -3
  4. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +210 -121
  5. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +79 -91
  6. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +30 -15
  7. data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +15 -15
  8. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +96 -63
  9. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +22 -11
  10. data/webpack/components/ApplicationDefinition/__fixtures__/{applicationDefinitionConfData_1.fixtures.js → applicationDefinitionConfData1.fixtures.js} +77 -105
  11. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +49 -29
  12. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +4 -4
  13. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionHelper.test.js +16 -0
  14. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +0 -5
  15. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +25 -25
  16. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +9 -1
  17. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +11 -11
  18. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +30 -25
  19. data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +3 -3
  20. data/webpack/components/ApplicationDefinition/index.js +0 -1
  21. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +91 -105
  22. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +59 -84
  23. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +12 -6
  24. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +21 -27
  25. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +14 -7
  26. data/webpack/components/ApplicationDefinitionImport/__fixtures__/{applicationDefinitionImportConfData_1.fixtures.js → applicationDefinitionImportConfData1.fixtures.js} +32 -40
  27. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +14 -16
  28. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +38 -8
  29. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +0 -2
  30. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +9 -9
  31. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +116 -2
  32. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +3 -3
  33. data/webpack/components/ApplicationInstance/ApplicationInstance.js +344 -193
  34. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +92 -105
  35. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +34 -17
  36. data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +4 -7
  37. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +114 -74
  38. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +18 -9
  39. data/webpack/components/ApplicationInstance/__fixtures__/{applicationInstanceConfData_1.fixtures.js → applicationInstanceConfData1.fixtures.js} +68 -86
  40. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +24 -32
  41. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +75 -10
  42. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +0 -8
  43. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +27 -27
  44. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +606 -2
  45. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +12 -12
  46. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +32 -25
  47. data/webpack/components/ApplicationInstance/components/Service.js +7 -18
  48. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +25 -18
  49. data/webpack/components/ApplicationInstance/index.js +0 -1
  50. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +167 -110
  51. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +20 -25
  52. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +10 -5
  53. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +9 -12
  54. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +12 -6
  55. data/webpack/components/ApplicationInstanceReport/__fixtures__/{applicationInstanceReportData_1.fixtures.js → applicationInstanceReportData1.fixtures.js} +154 -101
  56. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +3 -10
  57. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +28 -22
  58. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +5 -7
  59. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +0 -1
  60. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +2 -2
  61. data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +9 -5
  62. data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +1 -3
  63. data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +35 -56
  64. data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +21 -28
  65. data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +6 -3
  66. data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +16 -19
  67. data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -4
  68. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData1.fixtures.js +187 -0
  69. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +13 -24
  70. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +3 -2
  71. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +11 -14
  72. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +5 -5
  73. data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +31 -25
  74. data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +3 -9
  75. data/webpack/components/ParameterSelection/ParameterSelection.js +258 -174
  76. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +110 -100
  77. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +22 -11
  78. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +13 -11
  79. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +63 -49
  80. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +10 -5
  81. data/webpack/components/ParameterSelection/__fixtures__/{parameterSelectionData_1.fixtures.js → parameterSelectionData1.fixtures.js} +67 -104
  82. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +22 -26
  83. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +50 -36
  84. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionHelper.test.js +76 -0
  85. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +0 -2
  86. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +23 -25
  87. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +100 -0
  88. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +99 -112
  89. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +18 -19
  90. data/webpack/components/ParameterSelection/index.js +1 -4
  91. data/webpack/components/SyncGitRepo/SyncGitRepo.js +124 -117
  92. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +64 -74
  93. data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +17 -17
  94. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData1.fixtures.js +7 -0
  95. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +10 -18
  96. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +80 -6
  97. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +9 -11
  98. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +192 -1
  99. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +4 -4
  100. data/webpack/components/SyncGitRepo/components/FormTextInput.js +26 -21
  101. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +29 -24
  102. data/webpack/components/SyncGitRepo/index.js +2 -5
  103. data/webpack/components/common/AddTableEntry.js +3 -10
  104. data/webpack/components/common/DeleteTableEntry.js +7 -15
  105. data/webpack/components/common/EditTableEntry.js +7 -7
  106. data/webpack/components/common/ExtSelect.js +12 -8
  107. data/webpack/components/common/ExtTextInput.js +12 -7
  108. data/webpack/components/common/LockTableEntry.js +6 -6
  109. data/webpack/components/common/RailsData.js +6 -16
  110. data/webpack/components/common/__tests__/ExtSelect.test.js +2 -2
  111. data/webpack/components/common/__tests__/RailsData.test.js +0 -2
  112. data/webpack/global_test_setup.js +11 -0
  113. data/webpack/helper.js +10 -21
  114. data/webpack/helper.test.js +17 -29
  115. data/webpack/index.js +25 -7
  116. data/webpack/js-yaml.js +1563 -1135
  117. data/webpack/reducer.js +52 -27
  118. metadata +13 -11
  119. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +0 -191
  120. data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +0 -153
  121. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +0 -7
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import api from 'foremanReact/API';
3
2
 
4
3
  import {
@@ -6,14 +5,7 @@ import {
6
5
  setModalClosed,
7
6
  } from 'foremanReact/components/ForemanModal/ForemanModalActions';
8
7
 
9
- import {
10
- actionHeaderCellFormatter,
11
- } from 'patternfly-react';
12
-
13
- import {
14
- propsToSnakeCase,
15
- propsToCamelCase,
16
- } from 'foremanReact/common/helpers';
8
+ import { actionHeaderCellFormatter } from 'patternfly-react';
17
9
 
18
10
  import {
19
11
  APPLICATION_DEFINITION_INIT,
@@ -34,13 +26,9 @@ import {
34
26
  APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE,
35
27
  } from './ApplicationDefinitionConstants';
36
28
 
37
- import {
38
- supportedPluginsToHiddenParameterTypes,
39
- } from '../../helper';
29
+ import { supportedPluginsToHiddenParameterTypes } from '../../helper';
40
30
 
41
- import {
42
- transformAnsiblePlaybook,
43
- } from './ApplicationDefinitionHelper';
31
+ import { transformAnsiblePlaybook } from './ApplicationDefinitionHelper';
44
32
 
45
33
  export const initApplicationDefinition = (
46
34
  ansiblePlaybook,
@@ -49,7 +37,7 @@ export const initApplicationDefinition = (
49
37
  supportedPlugins,
50
38
  headerFormatter,
51
39
  inlineEditFormatter,
52
- inlineEditButtonsFormatter,
40
+ inlineEditButtonsFormatter
53
41
  ) => dispatch => {
54
42
  const initialState = {};
55
43
 
@@ -62,13 +50,13 @@ export const initApplicationDefinition = (
62
50
  props: {
63
51
  index: 0,
64
52
  style: {
65
- width: '15%'
66
- }
53
+ width: '15%',
54
+ },
67
55
  },
68
56
  },
69
57
  cell: {
70
- formatters: [inlineEditFormatter]
71
- }
58
+ formatters: [inlineEditFormatter],
59
+ },
72
60
  },
73
61
  {
74
62
  property: 'description',
@@ -78,13 +66,13 @@ export const initApplicationDefinition = (
78
66
  props: {
79
67
  index: 1,
80
68
  style: {
81
- width: '10%'
82
- }
69
+ width: '10%',
70
+ },
83
71
  },
84
72
  },
85
73
  cell: {
86
- formatters: [inlineEditFormatter]
87
- }
74
+ formatters: [inlineEditFormatter],
75
+ },
88
76
  },
89
77
  {
90
78
  property: 'hostgroup',
@@ -94,13 +82,13 @@ export const initApplicationDefinition = (
94
82
  props: {
95
83
  index: 2,
96
84
  style: {
97
- width: '20%'
98
- }
85
+ width: '20%',
86
+ },
99
87
  },
100
88
  },
101
89
  cell: {
102
- formatters: [inlineEditFormatter]
103
- }
90
+ formatters: [inlineEditFormatter],
91
+ },
104
92
  },
105
93
  {
106
94
  property: 'ansibleGroup',
@@ -110,13 +98,13 @@ export const initApplicationDefinition = (
110
98
  props: {
111
99
  index: 3,
112
100
  style: {
113
- width: '20%'
114
- }
101
+ width: '20%',
102
+ },
115
103
  },
116
104
  },
117
105
  cell: {
118
- formatters: [inlineEditFormatter]
119
- }
106
+ formatters: [inlineEditFormatter],
107
+ },
120
108
  },
121
109
  {
122
110
  property: 'minCount',
@@ -126,13 +114,13 @@ export const initApplicationDefinition = (
126
114
  props: {
127
115
  index: 4,
128
116
  style: {
129
- width: '10%'
130
- }
117
+ width: '10%',
118
+ },
131
119
  },
132
120
  },
133
121
  cell: {
134
- formatters: [inlineEditFormatter]
135
- }
122
+ formatters: [inlineEditFormatter],
123
+ },
136
124
  },
137
125
  {
138
126
  property: 'maxCount',
@@ -142,13 +130,13 @@ export const initApplicationDefinition = (
142
130
  props: {
143
131
  index: 5,
144
132
  style: {
145
- width: '10%'
146
- }
133
+ width: '10%',
134
+ },
147
135
  },
148
136
  },
149
137
  cell: {
150
- formatters: [inlineEditFormatter]
151
- }
138
+ formatters: [inlineEditFormatter],
139
+ },
152
140
  },
153
141
  {
154
142
  property: 'actions',
@@ -158,14 +146,14 @@ export const initApplicationDefinition = (
158
146
  props: {
159
147
  index: 6,
160
148
  style: {
161
- width: '15%'
162
- }
149
+ width: '15%',
150
+ },
163
151
  },
164
152
  },
165
153
  cell: {
166
- formatters: [inlineEditButtonsFormatter]
167
- }
168
- }
154
+ formatters: [inlineEditButtonsFormatter],
155
+ },
156
+ },
169
157
  ];
170
158
 
171
159
  if (ansiblePlaybook !== undefined) {
@@ -173,7 +161,9 @@ export const initApplicationDefinition = (
173
161
  }
174
162
  initialState.services = services;
175
163
  initialState.ansibleVarsAll = ansibleVarsAll;
176
- initialState.hiddenForemanParameterTypes = supportedPluginsToHiddenParameterTypes(supportedPlugins);
164
+ initialState.hiddenForemanParameterTypes = supportedPluginsToHiddenParameterTypes(
165
+ supportedPlugins
166
+ );
177
167
 
178
168
  dispatch({
179
169
  type: APPLICATION_DEFINITION_INIT,
@@ -191,65 +181,71 @@ const errorHandler = (msg, err) => {
191
181
 
192
182
  export const closeAlertModal = () => ({
193
183
  type: APPLICATION_DEFINITION_CLOSE_ALERT_MODAL,
194
- payload: {}
184
+ payload: {},
195
185
  });
196
186
 
197
187
  export const loadAnsibleData = (
198
188
  ansiblePlaybookId,
199
189
  additionalData
200
- ) => dispatch => {
190
+ ) => async dispatch => {
201
191
  dispatch({ type: APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_REQUEST });
202
192
 
203
- const baseUrl = additionalData.url;
204
- const realUrl = baseUrl.replace("__id__", ansiblePlaybookId);
193
+ try {
194
+ const baseUrl = additionalData.url;
195
+ const realUrl = baseUrl.replace('__id__', ansiblePlaybookId);
196
+
197
+ const { data } = await api.get(realUrl, {}, {});
205
198
 
206
- return api
207
- .get(realUrl, {}, {})
208
- .then(({ data }) =>
209
- dispatch({
210
- type: APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_SUCCESS,
211
- payload: { ...data }
212
- })
213
- )
214
- .catch(error => dispatch(errorHandler(APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE, error)));
199
+ dispatch({
200
+ type: APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_SUCCESS,
201
+ payload: { ...data },
202
+ });
203
+ } catch (error) {
204
+ dispatch(
205
+ errorHandler(APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE, error)
206
+ );
207
+ }
215
208
  };
216
209
 
217
- export const addApplicationDefinitionService = (additionalData) => ({
210
+ export const addApplicationDefinitionService = additionalData => ({
218
211
  type: APPLICATION_DEFINITION_SERVICE_ADD,
219
212
  payload: {
220
213
  ...additionalData,
221
214
  },
222
215
  });
223
216
 
224
- export const deleteApplicationDefinitionService = (additionalData) => ({
217
+ export const deleteApplicationDefinitionService = additionalData => ({
225
218
  type: APPLICATION_DEFINITION_SERVICE_DELETE,
226
219
  payload: {
227
220
  ...additionalData,
228
221
  },
229
222
  });
230
223
 
231
- export const activateEditApplicationDefinitionService = (additionalData) => ({
224
+ export const activateEditApplicationDefinitionService = additionalData => ({
232
225
  type: APPLICATION_DEFINITION_SERVICE_EDIT_ACTIVATE,
233
226
  payload: {
234
227
  ...additionalData,
235
228
  },
236
229
  });
237
230
 
238
- export const confirmEditApplicationDefinitionService = (rowData) => ({
231
+ export const confirmEditApplicationDefinitionService = rowData => ({
239
232
  type: APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM,
240
233
  payload: {
241
234
  ...rowData,
242
235
  },
243
236
  });
244
237
 
245
- export const cancelEditApplicationDefinitionService = (rowData) => ({
238
+ export const cancelEditApplicationDefinitionService = rowData => ({
246
239
  type: APPLICATION_DEFINITION_SERVICE_EDIT_CANCEL,
247
240
  payload: {
248
241
  ...rowData,
249
242
  },
250
243
  });
251
244
 
252
- export const changeEditApplicationDefinitionService = (value, additionalData) => ({
245
+ export const changeEditApplicationDefinitionService = (
246
+ value,
247
+ additionalData
248
+ ) => ({
253
249
  type: APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE,
254
250
  payload: {
255
251
  value,
@@ -257,59 +253,51 @@ export const changeEditApplicationDefinitionService = (value, additionalData) =>
257
253
  },
258
254
  });
259
255
 
260
- export const openForemanParameterSelectionModal = (additionalData) => dispatch => {
256
+ export const openForemanParameterSelectionModal = additionalData => dispatch => {
261
257
  dispatch({
262
258
  type: APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN,
263
259
  payload: {
264
260
  ...additionalData,
265
- }
261
+ },
266
262
  });
267
- dispatch(
268
- setModalOpen({ id: 'AppDefinitionForemanParamSelection' })
269
- );
270
- }
263
+ dispatch(setModalOpen({ id: 'AppDefinitionForemanParamSelection' }));
264
+ };
271
265
 
272
- export const closeForemanParameterSelectionModal = (additionalData) => dispatch => {
266
+ export const closeForemanParameterSelectionModal = additionalData => dispatch => {
273
267
  dispatch({
274
268
  type: APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE,
275
269
  payload: {
276
270
  ...additionalData,
277
- }
271
+ },
278
272
  });
279
273
 
280
- dispatch(
281
- setModalClosed({ id: 'AppDefinitionForemanParamSelection' })
282
- );
283
- }
274
+ dispatch(setModalClosed({ id: 'AppDefinitionForemanParamSelection' }));
275
+ };
284
276
 
285
- export const openAnsibleParameterSelectionModal = (additionalData) => dispatch => {
277
+ export const openAnsibleParameterSelectionModal = additionalData => dispatch => {
286
278
  dispatch({
287
279
  type: APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN,
288
280
  payload: {
289
281
  ...additionalData,
290
- }
282
+ },
291
283
  });
292
- dispatch(
293
- setModalOpen({ id: 'AppDefinitionAnsibleParamSelection' })
294
- );
295
- }
284
+ dispatch(setModalOpen({ id: 'AppDefinitionAnsibleParamSelection' }));
285
+ };
296
286
 
297
- export const closeAnsibleParameterSelectionModal = (additionalData) => dispatch => {
287
+ export const closeAnsibleParameterSelectionModal = additionalData => dispatch => {
298
288
  dispatch({
299
289
  type: APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
300
290
  payload: {
301
291
  ...additionalData,
302
- }
292
+ },
303
293
  });
304
294
 
305
- dispatch(
306
- setModalClosed({ id: 'AppDefinitionAnsibleParamSelection' })
307
- );
308
- }
295
+ dispatch(setModalClosed({ id: 'AppDefinitionAnsibleParamSelection' }));
296
+ };
309
297
 
310
- export const changeParameterSelectionMode = (additionalData) => ({
298
+ export const changeParameterSelectionMode = additionalData => ({
311
299
  type: APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE,
312
300
  payload: {
313
301
  ...additionalData,
314
302
  },
315
- })
303
+ });
@@ -1,16 +1,31 @@
1
1
  export const APPLICATION_DEFINITION_INIT = 'INIT_APPLICATION_DEFINITION_INIT';
2
- export const APPLICATION_DEFINITION_CLOSE_ALERT_MODAL = 'APPLICATION_DEFINITION_CLOSE_ALERT_MODAL';
3
- export const APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_REQUEST = 'APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_REQUEST';
4
- export const APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_SUCCESS = 'APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_SUCCESS';
5
- export const APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE = 'APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE';
6
- export const APPLICATION_DEFINITION_SERVICE_DELETE = 'APPLICATION_DEFINITION_SERVICE_DELETE';
7
- export const APPLICATION_DEFINITION_SERVICE_ADD = 'APPLICATION_DEFINITION_SERVICE_ADD';
8
- export const APPLICATION_DEFINITION_SERVICE_EDIT_ACTIVATE = 'APPLICATION_DEFINITION_SERVICE_EDIT_ACTIVATE';
9
- export const APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM = 'APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM';
10
- export const APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE = 'APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE';
11
- export const APPLICATION_DEFINITION_SERVICE_EDIT_CANCEL = 'APPLICATION_DEFINITION_SERVICE_EDIT_CANCEL';
12
- export const APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN = 'APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN';
13
- export const APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE = 'APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE';
14
- export const APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN = 'APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN';
15
- export const APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE = 'APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE';
16
- export const APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE = 'APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE';
2
+ export const APPLICATION_DEFINITION_CLOSE_ALERT_MODAL =
3
+ 'APPLICATION_DEFINITION_CLOSE_ALERT_MODAL';
4
+ export const APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_REQUEST =
5
+ 'APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_REQUEST';
6
+ export const APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_SUCCESS =
7
+ 'APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_SUCCESS';
8
+ export const APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE =
9
+ 'APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE';
10
+ export const APPLICATION_DEFINITION_SERVICE_DELETE =
11
+ 'APPLICATION_DEFINITION_SERVICE_DELETE';
12
+ export const APPLICATION_DEFINITION_SERVICE_ADD =
13
+ 'APPLICATION_DEFINITION_SERVICE_ADD';
14
+ export const APPLICATION_DEFINITION_SERVICE_EDIT_ACTIVATE =
15
+ 'APPLICATION_DEFINITION_SERVICE_EDIT_ACTIVATE';
16
+ export const APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM =
17
+ 'APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM';
18
+ export const APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE =
19
+ 'APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE';
20
+ export const APPLICATION_DEFINITION_SERVICE_EDIT_CANCEL =
21
+ 'APPLICATION_DEFINITION_SERVICE_EDIT_CANCEL';
22
+ export const APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN =
23
+ 'APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN';
24
+ export const APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE =
25
+ 'APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE';
26
+ export const APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN =
27
+ 'APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN';
28
+ export const APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE =
29
+ 'APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE';
30
+ export const APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE =
31
+ 'APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE';
@@ -1,22 +1,22 @@
1
1
  export function transformAnsiblePlaybook(playbook) {
2
-
3
- const ansiblePlaybook = new Object;
4
- ansiblePlaybook.id = playbook.id;
5
- ansiblePlaybook.name = playbook.name;
6
- ansiblePlaybook.groups = {};
2
+ const ansiblePlaybook = {
3
+ id: playbook.id,
4
+ name: playbook.name,
5
+ groups: {},
6
+ };
7
7
 
8
8
  if (playbook.hasOwnProperty('groups')) {
9
- Object.entries(playbook.groups).forEach(([group_name,group_vars]) => {
10
- ansiblePlaybook.groups[group_name] = [];
9
+ Object.entries(playbook.groups).forEach(([groupName, groupVars]) => {
10
+ ansiblePlaybook.groups[groupName] = [];
11
11
 
12
- let id=0;
13
- Object.entries(group_vars).forEach(([var_name,var_value]) => {
14
- let entry = {
15
- id: id,
16
- name: var_name,
17
- value: var_value
18
- }
19
- ansiblePlaybook.groups[group_name].push(entry);
12
+ let id = 0;
13
+ Object.entries(groupVars).forEach(([varName, varValue]) => {
14
+ const entry = {
15
+ id,
16
+ name: varName,
17
+ value: varValue,
18
+ };
19
+ ansiblePlaybook.groups[groupName].push(entry);
20
20
  id += 1;
21
21
  });
22
22
  });