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,19 +1,11 @@
1
- import React from 'react';
1
+ import { actionHeaderCellFormatter } from 'patternfly-react';
2
2
  import api from 'foremanReact/API';
3
+ import { translate as __ } from 'foremanReact/common/I18n';
3
4
  import {
4
5
  setModalOpen,
5
6
  setModalClosed,
6
7
  } from 'foremanReact/components/ForemanModal/ForemanModalActions';
7
8
 
8
- import {
9
- actionHeaderCellFormatter,
10
- } from 'patternfly-react';
11
-
12
- import {
13
- propsToSnakeCase,
14
- propsToCamelCase,
15
- } from 'foremanReact/common/helpers';
16
-
17
9
  import {
18
10
  APPLICATION_INSTANCE_INIT,
19
11
  APPLICATION_INSTANCE_CLOSE_ALERT_MODAL,
@@ -36,9 +28,7 @@ import {
36
28
  APPLICATION_INSTANCE_CHANGE_PARAMETER_SELECTION_MODE,
37
29
  } from './ApplicationInstanceConstants';
38
30
 
39
- import {
40
- supportedPluginsToHiddenParameterTypes,
41
- } from '../../helper';
31
+ import { supportedPluginsToHiddenParameterTypes } from '../../helper';
42
32
 
43
33
  export const initApplicationInstance = (
44
34
  appDefinition,
@@ -47,7 +37,7 @@ export const initApplicationInstance = (
47
37
  supportedPlugins,
48
38
  headerFormatter,
49
39
  inlineEditFormatter,
50
- inlineEditButtonsFormatter,
40
+ inlineEditButtonsFormatter
51
41
  ) => dispatch => {
52
42
  const initialState = {};
53
43
 
@@ -60,13 +50,13 @@ export const initApplicationInstance = (
60
50
  props: {
61
51
  index: 0,
62
52
  style: {
63
- width: '30%'
64
- }
53
+ width: '30%',
54
+ },
65
55
  },
66
56
  },
67
57
  cell: {
68
- formatters: [inlineEditFormatter]
69
- }
58
+ formatters: [inlineEditFormatter],
59
+ },
70
60
  },
71
61
  {
72
62
  property: 'description',
@@ -76,13 +66,13 @@ export const initApplicationInstance = (
76
66
  props: {
77
67
  index: 1,
78
68
  style: {
79
- width: '30%'
80
- }
69
+ width: '30%',
70
+ },
81
71
  },
82
72
  },
83
73
  cell: {
84
- formatters: [inlineEditFormatter]
85
- }
74
+ formatters: [inlineEditFormatter],
75
+ },
86
76
  },
87
77
  {
88
78
  property: 'service',
@@ -92,13 +82,13 @@ export const initApplicationInstance = (
92
82
  props: {
93
83
  index: 2,
94
84
  style: {
95
- width: '20%'
96
- }
85
+ width: '20%',
86
+ },
97
87
  },
98
88
  },
99
89
  cell: {
100
- formatters: [inlineEditFormatter]
101
- }
90
+ formatters: [inlineEditFormatter],
91
+ },
102
92
  },
103
93
  {
104
94
  property: 'actions',
@@ -108,20 +98,22 @@ export const initApplicationInstance = (
108
98
  props: {
109
99
  index: 4,
110
100
  style: {
111
- width: '20%'
112
- }
101
+ width: '20%',
102
+ },
113
103
  },
114
104
  },
115
105
  cell: {
116
- formatters: [inlineEditButtonsFormatter]
117
- }
118
- }
106
+ formatters: [inlineEditButtonsFormatter],
107
+ },
108
+ },
119
109
  ];
120
110
 
121
111
  initialState.appDefinition = appDefinition;
122
112
  initialState.hosts = hosts;
123
113
  initialState.ansibleVarsAll = ansibleVarsAll;
124
- initialState.hiddenForemanParameterTypes = supportedPluginsToHiddenParameterTypes(supportedPlugins);
114
+ initialState.hiddenForemanParameterTypes = supportedPluginsToHiddenParameterTypes(
115
+ supportedPlugins
116
+ );
125
117
 
126
118
  dispatch({
127
119
  type: APPLICATION_INSTANCE_INIT,
@@ -139,59 +131,62 @@ const errorHandler = (msg, err) => {
139
131
 
140
132
  export const closeAlertModal = () => ({
141
133
  type: APPLICATION_INSTANCE_CLOSE_ALERT_MODAL,
142
- payload: {}
134
+ payload: {},
143
135
  });
144
136
 
145
137
  export const loadApplicationDefinition = (
146
138
  applicationDefinitionId,
147
- additionalData,
148
- ) => dispatch => {
139
+ additionalData
140
+ ) => async dispatch => {
149
141
  dispatch({ type: APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_REQUEST });
150
142
 
151
- const realUrl = additionalData.url.replace("__id__", applicationDefinitionId);
143
+ const realUrl = additionalData.url.replace('__id__', applicationDefinitionId);
152
144
 
153
- return api
154
- .get(realUrl, {}, {})
155
- .then(({ data }) =>
156
- dispatch({
157
- type: APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_SUCCESS,
158
- payload: data,
159
- })
160
- )
161
- .catch(error => dispatch(errorHandler(APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_FAILURE, error)));
145
+ try {
146
+ const { data } = await api.get(realUrl, {}, {});
147
+
148
+ dispatch({
149
+ type: APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_SUCCESS,
150
+ payload: data,
151
+ });
152
+ } catch (error) {
153
+ dispatch(
154
+ errorHandler(
155
+ APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_FAILURE,
156
+ error
157
+ )
158
+ );
159
+ }
162
160
  };
163
161
 
164
- export const addApplicationInstanceHost = (additionalData) => ({
162
+ export const addApplicationInstanceHost = additionalData => ({
165
163
  type: APPLICATION_INSTANCE_HOST_ADD,
166
164
  payload: {
167
165
  ...additionalData,
168
166
  },
169
167
  });
170
168
 
171
- export const deleteApplicationInstanceHost = (additionalData) => ({
169
+ export const deleteApplicationInstanceHost = additionalData => ({
172
170
  type: APPLICATION_INSTANCE_HOST_DELETE,
173
171
  payload: {
174
172
  ...additionalData,
175
173
  },
176
174
  });
177
175
 
178
- export const activateEditApplicationInstanceHost = (additionalData) => ({
176
+ export const activateEditApplicationInstanceHost = additionalData => ({
179
177
  type: APPLICATION_INSTANCE_HOST_EDIT_ACTIVATE,
180
178
  payload: {
181
179
  ...additionalData,
182
180
  },
183
181
  });
184
182
 
185
- export const confirmEditApplicationInstanceHost = (
186
- allData
187
- ) => async(dispatch) => {
188
-
183
+ export const confirmEditApplicationInstanceHost = allData => async dispatch => {
189
184
  // Host name can not be empty
190
185
 
191
- if (allData.rowData.hostname == '') {
186
+ if (allData.rowData.hostname === '') {
192
187
  dispatch({
193
188
  type: APPLICATION_INSTANCE_HOST_EDIT_ERROR,
194
- payload: __("Every host needs to have a valid name"),
189
+ payload: __('Every host needs to have a valid name'),
195
190
  });
196
191
  return;
197
192
  }
@@ -199,34 +194,36 @@ export const confirmEditApplicationInstanceHost = (
199
194
  // Host name can only have specific characters
200
195
 
201
196
  const hostname = allData.rowData.hostname.toLowerCase();
202
- const hostnameRegex = /^[0-9a-z]([0-9a-z\-]{0,61}[0-9a-z])$/;
197
+ const hostnameRegex = /^[0-9a-z]([0-9a-z-]{0,61}[0-9a-z])$/;
203
198
 
204
- if (hostname.match(hostnameRegex) == undefined) {
199
+ if (hostname.match(hostnameRegex) === undefined) {
205
200
  dispatch({
206
201
  type: APPLICATION_INSTANCE_HOST_EDIT_ERROR,
207
- payload: __("The hostname uses not allowed characters. See https://en.wikipedia.org/wiki/Hostname#Syntax for more details."),
202
+ payload: __(
203
+ 'The hostname uses not allowed characters. See https://en.wikipedia.org/wiki/Hostname#Syntax for more details.'
204
+ ),
208
205
  });
209
206
  return;
210
207
  }
211
208
 
212
209
  // Service can not be empty
213
210
 
214
- if (allData.rowData.service == '') {
211
+ if (allData.rowData.service === '') {
215
212
  dispatch({
216
213
  type: APPLICATION_INSTANCE_HOST_EDIT_ERROR,
217
- payload: __("Every host needs to be assigned to a service."),
214
+ payload: __('Every host needs to be assigned to a service.'),
218
215
  });
219
216
  return;
220
217
  }
221
218
 
222
219
  // Validation if host name is already used (only for new host entrys)
223
220
 
224
- const url = '/acd/ui_acd_validate_hostname'
221
+ const url = '/acd/ui_acd_validate_hostname';
225
222
  const validationData = {};
226
223
 
227
- validationData['appDefId'] = allData.appDefinition.id;
228
- validationData['serviceId'] = allData.rowData.service;
229
- validationData['hostname'] = allData.rowData.hostname;
224
+ validationData.appDefId = allData.appDefinition.id;
225
+ validationData.serviceId = allData.rowData.service;
226
+ validationData.hostname = allData.rowData.hostname;
230
227
 
231
228
  if (allData.rowData.newEntry === true) {
232
229
  try {
@@ -237,12 +234,14 @@ export const confirmEditApplicationInstanceHost = (
237
234
  type: APPLICATION_INSTANCE_HOST_EDIT_CONFIRM,
238
235
  payload: {
239
236
  ...allData,
240
- }
237
+ },
241
238
  });
242
239
  } else {
243
240
  dispatch({
244
241
  type: APPLICATION_INSTANCE_HOST_EDIT_ERROR,
245
- payload: __('Hostname \''+ allData.rowData.hostname +'\' is already used. This check also includes hosts outside this application instance.'),
242
+ payload: __(
243
+ `Hostname '${allData.rowData.hostname}' is already used. This check also includes hosts outside this application instance.`
244
+ ),
246
245
  });
247
246
  }
248
247
  } catch (error) {
@@ -256,12 +255,12 @@ export const confirmEditApplicationInstanceHost = (
256
255
  type: APPLICATION_INSTANCE_HOST_EDIT_CONFIRM,
257
256
  payload: {
258
257
  ...allData,
259
- }
258
+ },
260
259
  });
261
260
  }
262
261
  };
263
262
 
264
- export const cancelEditApplicationInstanceHost = (rowData) => ({
263
+ export const cancelEditApplicationInstanceHost = rowData => ({
265
264
  type: APPLICATION_INSTANCE_HOST_EDIT_CANCEL,
266
265
  payload: {
267
266
  ...rowData,
@@ -276,84 +275,72 @@ export const changeEditApplicationInstanceHost = (value, additionalData) => ({
276
275
  },
277
276
  });
278
277
 
279
- export const openForemanParameterSelectionModal = (additionalData) => dispatch => {
278
+ export const openForemanParameterSelectionModal = additionalData => dispatch => {
280
279
  dispatch({
281
280
  type: APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN,
282
281
  payload: {
283
282
  ...additionalData,
284
- }
283
+ },
285
284
  });
286
- dispatch(
287
- setModalOpen({ id: 'AppInstanceForemanParamSelection' })
288
- );
289
- }
285
+ dispatch(setModalOpen({ id: 'AppInstanceForemanParamSelection' }));
286
+ };
290
287
 
291
- export const closeForemanParameterSelectionModal = (additionalData) => dispatch => {
288
+ export const closeForemanParameterSelectionModal = additionalData => dispatch => {
292
289
  dispatch({
293
290
  type: APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE,
294
291
  payload: {
295
292
  ...additionalData,
296
- }
293
+ },
297
294
  });
298
295
 
299
- dispatch(
300
- setModalClosed({ id: 'AppInstanceForemanParamSelection' })
301
- );
302
- }
296
+ dispatch(setModalClosed({ id: 'AppInstanceForemanParamSelection' }));
297
+ };
303
298
 
304
- export const openAnsibleParameterSelectionModal = (additionalData) => dispatch => {
299
+ export const openAnsibleParameterSelectionModal = additionalData => dispatch => {
305
300
  dispatch({
306
301
  type: APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN,
307
302
  payload: {
308
303
  ...additionalData,
309
- }
304
+ },
310
305
  });
311
- dispatch(
312
- setModalOpen({ id: 'AppInstanceAnsibleParamSelection' })
313
- );
314
- }
306
+ dispatch(setModalOpen({ id: 'AppInstanceAnsibleParamSelection' }));
307
+ };
315
308
 
316
- export const closeAnsibleParameterSelectionModal = (additionalData) => dispatch => {
309
+ export const closeAnsibleParameterSelectionModal = additionalData => dispatch => {
317
310
  dispatch({
318
311
  type: APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
319
312
  payload: {
320
313
  ...additionalData,
321
- }
314
+ },
322
315
  });
323
316
 
324
- dispatch(
325
- setModalClosed({ id: 'AppInstanceAnsibleParamSelection' })
326
- );
327
- }
317
+ dispatch(setModalClosed({ id: 'AppInstanceAnsibleParamSelection' }));
318
+ };
328
319
 
329
- export const openAddExistingHostsModal = (additionalData) => dispatch => {
320
+ export const openAddExistingHostsModal = additionalData => dispatch => {
330
321
  dispatch({
331
322
  type: APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_OPEN,
332
323
  payload: {
333
324
  ...additionalData,
334
- }
325
+ },
335
326
  });
336
- dispatch(
337
- setModalOpen({ id: 'AppInstanceAddExistingHosts' })
338
- );
339
- }
327
+ dispatch(setModalOpen({ id: 'AppInstanceAddExistingHosts' }));
328
+ };
340
329
 
341
- export const closeAddExistingHostsModal = (additionalData) => dispatch => {
330
+ export const closeAddExistingHostsModal = additionalData => dispatch => {
342
331
  dispatch({
343
332
  type: APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE,
344
333
  payload: {
345
334
  ...additionalData,
346
- }
335
+ },
347
336
  });
348
337
 
349
- dispatch(
350
- setModalClosed({ id: 'AppInstanceAddExistingHosts' })
351
- );
352
- }
338
+ dispatch(setModalClosed({ id: 'AppInstanceAddExistingHosts' }));
339
+ };
353
340
 
354
- export const changeParameterSelectionMode = (additionalData) => ({
341
+ export const changeParameterSelectionMode = additionalData => ({
355
342
  type: APPLICATION_INSTANCE_CHANGE_PARAMETER_SELECTION_MODE,
356
343
  payload: {
357
344
  ...additionalData,
358
345
  },
359
- })
346
+ });
@@ -1,19 +1,36 @@
1
1
  export const APPLICATION_INSTANCE_INIT = 'APPLICATION_INSTANCE_INIT';
2
- export const APPLICATION_INSTANCE_CLOSE_ALERT_MODAL = 'APPLICATION_INSTANCE_CLOSE_ALERT_MODAL';
3
- export const APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_REQUEST = 'APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_REQUEST';
4
- export const APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_SUCCESS = 'APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_SUCCESS';
5
- export const APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_FAILURE = 'APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_FAILURE';
6
- export const APPLICATION_INSTANCE_HOST_DELETE = 'APPLICATION_INSTANCE_HOST_DELETE';
2
+ export const APPLICATION_INSTANCE_CLOSE_ALERT_MODAL =
3
+ 'APPLICATION_INSTANCE_CLOSE_ALERT_MODAL';
4
+ export const APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_REQUEST =
5
+ 'APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_REQUEST';
6
+ export const APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_SUCCESS =
7
+ 'APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_SUCCESS';
8
+ export const APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_FAILURE =
9
+ 'APPLICATION_INSTANCE_LOAD_APPLICATION_DEFINITION_FAILURE';
10
+ export const APPLICATION_INSTANCE_HOST_DELETE =
11
+ 'APPLICATION_INSTANCE_HOST_DELETE';
7
12
  export const APPLICATION_INSTANCE_HOST_ADD = 'APPLICATION_INSTANCE_HOST_ADD';
8
- export const APPLICATION_INSTANCE_HOST_EDIT_ACTIVATE = 'APPLICATION_INSTANCE_HOST_EDIT_ACTIVATE';
9
- export const APPLICATION_INSTANCE_HOST_EDIT_CONFIRM = 'APPLICATION_INSTANCE_HOST_EDIT_CONFIRM';
10
- export const APPLICATION_INSTANCE_HOST_EDIT_CHANGE = 'APPLICATION_INSTANCE_HOST_EDIT_CHANGE';
11
- export const APPLICATION_INSTANCE_HOST_EDIT_CANCEL = 'APPLICATION_INSTANCE_HOST_EDIT_CANCEL';
12
- export const APPLICATION_INSTANCE_HOST_EDIT_ERROR = 'APPLICATION_INSTANCE_HOST_EDIT_ERROR';
13
- export const APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN = 'APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN';
14
- export const APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE = 'APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE';
15
- export const APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN = 'APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN';
16
- export const APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE = 'APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE';
17
- export const APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_OPEN = 'APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_OPEN';
18
- export const APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE = 'APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE';
19
- export const APPLICATION_INSTANCE_CHANGE_PARAMETER_SELECTION_MODE = 'APPLICATION_INSTANCE_CHANGE_PARAMETER_SELECTION_MODE';
13
+ export const APPLICATION_INSTANCE_HOST_EDIT_ACTIVATE =
14
+ 'APPLICATION_INSTANCE_HOST_EDIT_ACTIVATE';
15
+ export const APPLICATION_INSTANCE_HOST_EDIT_CONFIRM =
16
+ 'APPLICATION_INSTANCE_HOST_EDIT_CONFIRM';
17
+ export const APPLICATION_INSTANCE_HOST_EDIT_CHANGE =
18
+ 'APPLICATION_INSTANCE_HOST_EDIT_CHANGE';
19
+ export const APPLICATION_INSTANCE_HOST_EDIT_CANCEL =
20
+ 'APPLICATION_INSTANCE_HOST_EDIT_CANCEL';
21
+ export const APPLICATION_INSTANCE_HOST_EDIT_ERROR =
22
+ 'APPLICATION_INSTANCE_HOST_EDIT_ERROR';
23
+ export const APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN =
24
+ 'APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN';
25
+ export const APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE =
26
+ 'APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE';
27
+ export const APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN =
28
+ 'APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN';
29
+ export const APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE =
30
+ 'APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE';
31
+ export const APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_OPEN =
32
+ 'APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_OPEN';
33
+ export const APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE =
34
+ 'APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE';
35
+ export const APPLICATION_INSTANCE_CHANGE_PARAMETER_SELECTION_MODE =
36
+ 'APPLICATION_INSTANCE_CHANGE_PARAMETER_SELECTION_MODE';
@@ -1,15 +1,12 @@
1
-
2
1
  function calculateServiceUsage(hostServiceId, services) {
3
- const service = services.find(serv => serv['id'] == hostServiceId);
2
+ const service = services.find(serv => serv.id === hostServiceId);
4
3
  if ('currentCount' in service) {
5
- service['currentCount'] += 1;
4
+ service.currentCount += 1;
6
5
  } else {
7
- service['currentCount'] = 1;
6
+ service.currentCount = 1;
8
7
  }
9
8
 
10
9
  return services;
11
10
  }
12
11
 
13
- export {
14
- calculateServiceUsage,
15
- };
12
+ export { calculateServiceUsage };