foreman_acd 0.9.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -19
  3. data/app/controllers/ui_acd_controller.rb +1 -1
  4. data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +1 -1
  5. data/lib/foreman_acd/engine.rb +4 -10
  6. data/lib/foreman_acd/plugin.rb +1 -1
  7. data/lib/foreman_acd/version.rb +1 -1
  8. data/package.json +5 -3
  9. data/test/controllers/ui_acd_controller_test.rb +1 -1
  10. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +210 -121
  11. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +79 -91
  12. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +30 -15
  13. data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +15 -15
  14. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +96 -63
  15. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +22 -11
  16. data/webpack/components/ApplicationDefinition/__fixtures__/{applicationDefinitionConfData_1.fixtures.js → applicationDefinitionConfData1.fixtures.js} +77 -105
  17. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +49 -29
  18. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +4 -4
  19. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionHelper.test.js +16 -0
  20. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +0 -5
  21. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +25 -25
  22. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +9 -1
  23. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +11 -11
  24. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +30 -25
  25. data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +3 -3
  26. data/webpack/components/ApplicationDefinition/index.js +0 -1
  27. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +91 -105
  28. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +59 -84
  29. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +12 -6
  30. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +21 -27
  31. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +14 -7
  32. data/webpack/components/ApplicationDefinitionImport/__fixtures__/{applicationDefinitionImportConfData_1.fixtures.js → applicationDefinitionImportConfData1.fixtures.js} +32 -40
  33. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +14 -16
  34. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +38 -8
  35. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +0 -2
  36. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +9 -9
  37. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +116 -2
  38. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +3 -3
  39. data/webpack/components/ApplicationInstance/ApplicationInstance.js +344 -193
  40. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +92 -105
  41. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +34 -17
  42. data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +4 -7
  43. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +114 -74
  44. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +18 -9
  45. data/webpack/components/ApplicationInstance/__fixtures__/{applicationInstanceConfData_1.fixtures.js → applicationInstanceConfData1.fixtures.js} +68 -86
  46. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +24 -32
  47. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +75 -10
  48. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +0 -8
  49. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +27 -27
  50. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +606 -2
  51. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +12 -12
  52. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +32 -25
  53. data/webpack/components/ApplicationInstance/components/Service.js +7 -18
  54. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +25 -18
  55. data/webpack/components/ApplicationInstance/index.js +0 -1
  56. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +167 -110
  57. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +20 -25
  58. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +10 -5
  59. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +9 -12
  60. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +12 -6
  61. data/webpack/components/ApplicationInstanceReport/__fixtures__/{applicationInstanceReportData_1.fixtures.js → applicationInstanceReportData1.fixtures.js} +154 -101
  62. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +3 -10
  63. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +28 -22
  64. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +5 -7
  65. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +0 -1
  66. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +2 -2
  67. data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +9 -5
  68. data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +1 -3
  69. data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +35 -56
  70. data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +21 -28
  71. data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +6 -3
  72. data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +16 -19
  73. data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -4
  74. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData1.fixtures.js +187 -0
  75. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +13 -24
  76. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +3 -2
  77. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +11 -14
  78. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +5 -5
  79. data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +31 -25
  80. data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +3 -9
  81. data/webpack/components/ParameterSelection/ParameterSelection.js +258 -174
  82. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +110 -100
  83. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +22 -11
  84. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +13 -11
  85. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +63 -49
  86. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +10 -5
  87. data/webpack/components/ParameterSelection/__fixtures__/{parameterSelectionData_1.fixtures.js → parameterSelectionData1.fixtures.js} +67 -104
  88. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +22 -26
  89. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +50 -36
  90. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionHelper.test.js +76 -0
  91. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +0 -2
  92. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +23 -25
  93. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +100 -0
  94. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +99 -112
  95. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +18 -19
  96. data/webpack/components/ParameterSelection/index.js +1 -4
  97. data/webpack/components/SyncGitRepo/SyncGitRepo.js +124 -117
  98. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +64 -74
  99. data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +17 -17
  100. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData1.fixtures.js +7 -0
  101. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +10 -18
  102. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +80 -6
  103. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +9 -11
  104. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +192 -1
  105. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +4 -4
  106. data/webpack/components/SyncGitRepo/components/FormTextInput.js +26 -21
  107. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +29 -24
  108. data/webpack/components/SyncGitRepo/index.js +2 -5
  109. data/webpack/components/common/AddTableEntry.js +3 -10
  110. data/webpack/components/common/DeleteTableEntry.js +7 -15
  111. data/webpack/components/common/EditTableEntry.js +7 -7
  112. data/webpack/components/common/ExtSelect.js +12 -8
  113. data/webpack/components/common/ExtTextInput.js +12 -7
  114. data/webpack/components/common/LockTableEntry.js +6 -6
  115. data/webpack/components/common/RailsData.js +6 -16
  116. data/webpack/components/common/__tests__/ExtSelect.test.js +2 -2
  117. data/webpack/components/common/__tests__/RailsData.test.js +0 -2
  118. data/webpack/global_test_setup.js +11 -0
  119. data/webpack/helper.js +10 -21
  120. data/webpack/helper.test.js +17 -29
  121. data/webpack/index.js +25 -7
  122. data/webpack/js-yaml.js +1563 -1135
  123. data/webpack/reducer.js +52 -27
  124. metadata +16 -14
  125. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +0 -191
  126. data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +0 -153
  127. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +0 -7
@@ -1,11 +1,7 @@
1
1
  import Immutable from 'seamless-immutable';
2
2
  import { translate as __ } from 'foremanReact/common/I18n';
3
3
 
4
- import {
5
- cloneDeep,
6
- findIndex,
7
- findLastIndex,
8
- } from 'lodash';
4
+ import { cloneDeep, findIndex } from 'lodash';
9
5
 
10
6
  import {
11
7
  APPLICATION_DEFINITION_INIT,
@@ -31,9 +27,7 @@ import {
31
27
  PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE,
32
28
  } from '../ParameterSelection/ParameterSelectionConstants';
33
29
 
34
- import {
35
- transformAnsiblePlaybook,
36
- } from './ApplicationDefinitionHelper';
30
+ import { transformAnsiblePlaybook } from './ApplicationDefinitionHelper';
37
31
 
38
32
  export const initialState = Immutable({
39
33
  name: false,
@@ -54,9 +48,14 @@ const applicationDefinitionConf = (state = initialState, action) => {
54
48
  alertModalText: '',
55
49
  });
56
50
  }
57
- case APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE: {
58
- console.log("Error while loading ansible data: "+ payload.error);
59
- return state.merge({ error: payload.error, loading: false });
51
+ case APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_FAILURE: {
52
+ return state.merge({
53
+ showAlertModal: true,
54
+ alertModalTitle: __('Error'),
55
+ alertModalText:
56
+ __('Failed to load Playbooks: ') + payload.error.errorMsg,
57
+ loading: false,
58
+ });
60
59
  }
61
60
  case APPLICATION_DEFINITION_LOAD_ANSIBLE_DATA_REQUEST: {
62
61
  return state.set('loading', true);
@@ -68,13 +67,14 @@ const applicationDefinitionConf = (state = initialState, action) => {
68
67
  const ansiblePlaybook = transformAnsiblePlaybook(payload);
69
68
 
70
69
  if (ansiblePlaybook.hasOwnProperty('groups')) {
71
- allVars = ansiblePlaybook.groups['all']
70
+ allVars = ansiblePlaybook.groups.all;
72
71
  }
73
72
 
74
73
  newState = {
75
- ansiblePlaybook: ansiblePlaybook,
76
- ansibleVarsAll: allVars
77
- }
74
+ ansiblePlaybook,
75
+ ansibleVarsAll: allVars,
76
+ loading: false,
77
+ };
78
78
 
79
79
  return state.merge(newState);
80
80
  }
@@ -82,27 +82,40 @@ const applicationDefinitionConf = (state = initialState, action) => {
82
82
  let services = [];
83
83
  let index = 1;
84
84
 
85
- if ('services' in state && state.services !== undefined && state.services.length > 0) {
85
+ if (
86
+ 'services' in state &&
87
+ state.services !== undefined &&
88
+ state.services.length > 0
89
+ ) {
86
90
  services = cloneDeep(state.services);
87
91
  index = Math.max(...services.map(e => e.id)) + 1;
88
92
  }
89
93
 
90
- const newRow = { id: index, name: "", description: '', hostgroup: '',
91
- ansibleGroup: '', minCount: '', maxCount: '',
92
- foremanParameters: [], ansibleParameters: [], newEntry: true };
93
- newRow.backup = cloneDeep(newRow)
94
+ const newRow = {
95
+ id: index,
96
+ name: '',
97
+ description: '',
98
+ hostgroup: '',
99
+ ansibleGroup: '',
100
+ minCount: '',
101
+ maxCount: '',
102
+ foremanParameters: [],
103
+ ansibleParameters: [],
104
+ newEntry: true,
105
+ };
106
+ newRow.backup = cloneDeep(newRow);
94
107
  services.push(newRow);
95
108
 
96
109
  return state.merge({
97
110
  editMode: true,
98
- services: services
111
+ services,
99
112
  });
100
113
  }
101
114
  case APPLICATION_DEFINITION_SERVICE_DELETE: {
102
115
  const services = state.services.filter(v => v.id !== payload.rowData.id);
103
116
  return state.merge({
104
- services: services,
105
- })
117
+ services,
118
+ });
106
119
  }
107
120
  case APPLICATION_DEFINITION_SERVICE_EDIT_ACTIVATE: {
108
121
  const services = cloneDeep(state.services);
@@ -112,7 +125,7 @@ const applicationDefinitionConf = (state = initialState, action) => {
112
125
 
113
126
  return state.merge({
114
127
  editMode: true,
115
- services: services
128
+ services,
116
129
  });
117
130
  }
118
131
  case APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM: {
@@ -121,51 +134,61 @@ const applicationDefinitionConf = (state = initialState, action) => {
121
134
 
122
135
  const thisService = services[index];
123
136
 
124
- if (thisService.name == '') {
137
+ if (thisService.name === '') {
125
138
  return state.merge({
126
139
  showAlertModal: true,
127
- alertModalTitle: __("Error"),
128
- alertModalText: __("Every service needs to have a valid name."),
140
+ alertModalTitle: __('Error'),
141
+ alertModalText: __('Every service needs to have a valid name.'),
129
142
  });
130
143
  }
131
144
 
132
- if (thisService.hostgroup == '') {
145
+ if (thisService.hostgroup === '') {
133
146
  return state.merge({
134
147
  showAlertModal: true,
135
- alertModalTitle: __("Error"),
136
- alertModalText: __("Every service needs to be assigned to a hostgroup."),
148
+ alertModalTitle: __('Error'),
149
+ alertModalText: __(
150
+ 'Every service needs to be assigned to a hostgroup.'
151
+ ),
137
152
  });
138
153
  }
139
154
 
140
- if (thisService.ansibleGroup == '') {
155
+ if (thisService.ansibleGroup === '') {
141
156
  return state.merge({
142
157
  showAlertModal: true,
143
- alertModalTitle: __("Error"),
144
- alertModalText: __("Every service needs to be assigned to an ansible group."),
158
+ alertModalTitle: __('Error'),
159
+ alertModalText: __(
160
+ 'Every service needs to be assigned to an ansible group.'
161
+ ),
145
162
  });
146
163
  }
147
164
 
148
- if (state.services.filter(v => v.name === thisService.name && v.id != thisService.id).length > 0) {
165
+ if (
166
+ state.services.filter(
167
+ v => v.name === thisService.name && v.id !== thisService.id
168
+ ).length > 0
169
+ ) {
149
170
  return state.merge({
150
171
  showAlertModal: true,
151
- alertModalTitle: __("Error"),
152
- alertModalText: __("Service name already used in this Application Definition. Please make sure that every service name is unique."),
172
+ alertModalTitle: __('Error'),
173
+ alertModalText: __(
174
+ 'Service name already used in this Application Definition. Please make sure that every service name is unique.'
175
+ ),
153
176
  });
154
177
  }
155
178
 
156
179
  delete services[index].backup;
157
180
  delete services[index].newEntry;
158
181
 
159
- let ansibleParameters = [];
160
182
  const selectedGroup = services[index].ansibleGroup;
161
183
 
162
184
  if (selectedGroup) {
163
- services[index].ansibleParameters = state.ansiblePlaybook.groups[selectedGroup];
185
+ services[index].ansibleParameters =
186
+ state.ansiblePlaybook.groups[selectedGroup];
164
187
  }
165
188
 
166
189
  return state.merge({
167
190
  editMode: false,
168
- services: services,
191
+ services,
169
192
  });
170
193
  }
171
194
  case APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE: {
@@ -189,17 +212,17 @@ const applicationDefinitionConf = (state = initialState, action) => {
189
212
 
190
213
  return state.merge({
191
214
  editMode: false,
192
- services: services
215
+ services,
193
216
  });
194
217
  }
195
218
  case APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN: {
196
- let parametersData = {};
219
+ const parametersData = {};
197
220
 
198
221
  parametersData.paramDefinition = {
199
222
  id: payload.rowData.id,
200
223
  name: payload.rowData.name,
201
- dataId: payload.rowData.hostgroup
202
- }
224
+ dataId: payload.rowData.hostgroup,
225
+ };
203
226
 
204
227
  parametersData.type = PARAMETER_SELECTION_PARAM_TYPE_FOREMAN;
205
228
  parametersData.parameters = payload.rowData.foremanParameters;
@@ -209,39 +232,42 @@ const applicationDefinitionConf = (state = initialState, action) => {
209
232
  parametersData.allowDescriptionAdjustment = true;
210
233
 
211
234
  return state.merge({
212
- parametersData: parametersData,
235
+ parametersData,
213
236
  });
214
237
  }
215
238
  case APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE: {
216
- if (payload.mode == 'save') {
239
+ if (payload.mode === 'save') {
217
240
  const services = cloneDeep(state.services);
218
- const index = findIndex(services, { id: state.parametersData.paramDefinition.id });
219
- services[index].foremanParameters = cloneDeep(payload.parameterSelection);
220
-
221
- return state.merge({
222
- parametersData: null,
223
- services: services,
241
+ const index = findIndex(services, {
242
+ id: state.parametersData.paramDefinition.id,
224
243
  });
225
- } else {
244
+ services[index].foremanParameters = cloneDeep(
245
+ payload.parameterSelection
246
+ );
247
+
226
248
  return state.merge({
227
249
  parametersData: null,
250
+ services,
228
251
  });
229
252
  }
253
+ return state.merge({
254
+ parametersData: null,
255
+ });
230
256
  }
231
257
  case APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN: {
232
- let parametersData = {};
258
+ const parametersData = {};
233
259
 
234
- if ((payload.hasOwnProperty('isAllGroup')) && (payload.isAllGroup == true)) {
260
+ if (payload.hasOwnProperty('isAllGroup') && payload.isAllGroup === true) {
235
261
  parametersData.parameters = state.ansibleVarsAll;
236
262
  parametersData.paramDefinition = {
237
263
  isAllGroup: true,
238
- }
239
- } else {
264
+ };
265
+ } else {
240
266
  parametersData.parameters = payload.rowData.ansibleParameters;
241
267
  parametersData.paramDefinition = {
242
268
  id: payload.rowData.id,
243
269
  name: payload.rowData.name,
244
- }
270
+ };
245
271
  }
246
272
 
247
273
  parametersData.type = PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE;
@@ -251,25 +277,32 @@ const applicationDefinitionConf = (state = initialState, action) => {
251
277
  parametersData.allowDescriptionAdjustment = true;
252
278
 
253
279
  return state.merge({
254
- parametersData: parametersData,
280
+ parametersData,
255
281
  });
256
282
  }
257
283
  case APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE: {
258
284
  let newState = {};
259
- if (payload.mode == 'save') {
260
- if ((state.parametersData.paramDefinition.hasOwnProperty('isAllGroup')) && (state.parametersData.paramDefinition.isAllGroup == true)) {
285
+ if (payload.mode === 'save') {
286
+ if (
287
+ state.parametersData.paramDefinition.hasOwnProperty('isAllGroup') &&
288
+ state.parametersData.paramDefinition.isAllGroup === true
289
+ ) {
261
290
  newState = {
262
291
  parametersData: null,
263
292
  ansibleVarsAll: cloneDeep(payload.parameterSelection),
264
293
  };
265
294
  } else {
266
295
  const services = cloneDeep(state.services);
267
- const index = findIndex(services, { id: state.parametersData.paramDefinition.id });
268
- services[index].ansibleParameters = cloneDeep(payload.parameterSelection);
296
+ const index = findIndex(services, {
297
+ id: state.parametersData.paramDefinition.id,
298
+ });
299
+ services[index].ansibleParameters = cloneDeep(
300
+ payload.parameterSelection
301
+ );
269
302
 
270
303
  newState = {
271
304
  parametersData: null,
272
- services: services,
305
+ services,
273
306
  };
274
307
  }
275
308
  } else {
@@ -1,13 +1,24 @@
1
- const applicationDefinitionConf = state => state.foremanAcd.applicationDefinitionConf;
1
+ const applicationDefinitionConf = state =>
2
+ state.foremanAcd.applicationDefinitionConf;
2
3
 
3
- export const selectShowAlertModal = state => applicationDefinitionConf(state).showAlertModal;
4
- export const selectAlertModalText = state => applicationDefinitionConf(state).alertModalText;
5
- export const selectAlertModalTitle = state => applicationDefinitionConf(state).alertModalTitle;
6
- export const selectEditMode = state => applicationDefinitionConf(state).editMode;
7
- export const selectAnsiblePlaybook = state => applicationDefinitionConf(state).ansiblePlaybook;
8
- export const selectServices = state => applicationDefinitionConf(state).services;
4
+ export const selectShowAlertModal = state =>
5
+ applicationDefinitionConf(state).showAlertModal;
6
+ export const selectAlertModalText = state =>
7
+ applicationDefinitionConf(state).alertModalText;
8
+ export const selectAlertModalTitle = state =>
9
+ applicationDefinitionConf(state).alertModalTitle;
10
+ export const selectEditMode = state =>
11
+ applicationDefinitionConf(state).editMode;
12
+ export const selectAnsiblePlaybook = state =>
13
+ applicationDefinitionConf(state).ansiblePlaybook;
14
+ export const selectServices = state =>
15
+ applicationDefinitionConf(state).services;
9
16
  export const selectColumns = state => applicationDefinitionConf(state).columns;
10
- export const selectHiddenForemanParameterTypes = state => applicationDefinitionConf(state).hiddenForemanParameterTypes;
11
- export const selectParametersData = state => applicationDefinitionConf(state).parametersData;
12
- export const selectAnsibleVarsAll = state => applicationDefinitionConf(state).ansibleVarsAll;
13
- export const selectParamEditMode = state => applicationDefinitionConf(state).paramEditMode;
17
+ export const selectHiddenForemanParameterTypes = state =>
18
+ applicationDefinitionConf(state).hiddenForemanParameterTypes;
19
+ export const selectParametersData = state =>
20
+ applicationDefinitionConf(state).parametersData;
21
+ export const selectAnsibleVarsAll = state =>
22
+ applicationDefinitionConf(state).ansibleVarsAll;
23
+ export const selectParamEditMode = state =>
24
+ applicationDefinitionConf(state).paramEditMode;
@@ -1,151 +1,123 @@
1
- export const applicationDefinitionConfData_1 = {
1
+ export const applicationDefinitionConfData1 = {
2
2
  name: false,
3
3
  error: {
4
4
  errorMsg: '',
5
5
  status: '',
6
- statusText: ''
6
+ statusText: '',
7
7
  },
8
8
  columns: [
9
9
  {
10
10
  property: 'name',
11
11
  header: {
12
12
  label: 'Name',
13
- formatters: [
14
- null
15
- ],
13
+ formatters: [null],
16
14
  props: {
17
15
  index: 0,
18
16
  style: {
19
- width: '15%'
20
- }
21
- }
17
+ width: '15%',
18
+ },
19
+ },
22
20
  },
23
21
  cell: {
24
- formatters: [
25
- null
26
- ]
27
- }
22
+ formatters: [null],
23
+ },
28
24
  },
29
25
  {
30
26
  property: 'description',
31
27
  header: {
32
28
  label: 'Description',
33
- formatters: [
34
- null
35
- ],
29
+ formatters: [null],
36
30
  props: {
37
31
  index: 1,
38
32
  style: {
39
- width: '10%'
40
- }
41
- }
33
+ width: '10%',
34
+ },
35
+ },
42
36
  },
43
37
  cell: {
44
- formatters: [
45
- null
46
- ]
47
- }
38
+ formatters: [null],
39
+ },
48
40
  },
49
41
  {
50
42
  property: 'hostgroup',
51
43
  header: {
52
44
  label: 'Hostgroup',
53
- formatters: [
54
- null
55
- ],
45
+ formatters: [null],
56
46
  props: {
57
47
  index: 2,
58
48
  style: {
59
- width: '20%'
60
- }
61
- }
49
+ width: '20%',
50
+ },
51
+ },
62
52
  },
63
53
  cell: {
64
- formatters: [
65
- null
66
- ]
67
- }
54
+ formatters: [null],
55
+ },
68
56
  },
69
57
  {
70
58
  property: 'ansibleGroup',
71
59
  header: {
72
60
  label: 'Ansible Group',
73
- formatters: [
74
- null
75
- ],
61
+ formatters: [null],
76
62
  props: {
77
63
  index: 3,
78
64
  style: {
79
- width: '20%'
80
- }
81
- }
65
+ width: '20%',
66
+ },
67
+ },
82
68
  },
83
69
  cell: {
84
- formatters: [
85
- null
86
- ]
87
- }
70
+ formatters: [null],
71
+ },
88
72
  },
89
73
  {
90
74
  property: 'minCount',
91
75
  header: {
92
76
  label: 'min count',
93
- formatters: [
94
- null
95
- ],
77
+ formatters: [null],
96
78
  props: {
97
79
  index: 4,
98
80
  style: {
99
- width: '10%'
100
- }
101
- }
81
+ width: '10%',
82
+ },
83
+ },
102
84
  },
103
85
  cell: {
104
- formatters: [
105
- null
106
- ]
107
- }
86
+ formatters: [null],
87
+ },
108
88
  },
109
89
  {
110
90
  property: 'maxCount',
111
91
  header: {
112
92
  label: 'max count',
113
- formatters: [
114
- null
115
- ],
93
+ formatters: [null],
116
94
  props: {
117
95
  index: 5,
118
96
  style: {
119
- width: '10%'
120
- }
121
- }
97
+ width: '10%',
98
+ },
99
+ },
122
100
  },
123
101
  cell: {
124
- formatters: [
125
- null
126
- ]
127
- }
102
+ formatters: [null],
103
+ },
128
104
  },
129
105
  {
130
106
  property: 'actions',
131
107
  header: {
132
108
  label: 'Actions',
133
- formatters: [
134
- null
135
- ],
109
+ formatters: [null],
136
110
  props: {
137
111
  index: 6,
138
112
  style: {
139
- width: '15%'
140
- }
141
- }
113
+ width: '15%',
114
+ },
115
+ },
142
116
  },
143
117
  cell: {
144
- formatters: [
145
- null
146
- ]
147
- }
148
- }
118
+ formatters: [null],
119
+ },
120
+ },
149
121
  ],
150
122
  ansiblePlaybook: {
151
123
  id: 2,
@@ -155,49 +127,49 @@ export const applicationDefinitionConfData_1 = {
155
127
  {
156
128
  id: 0,
157
129
  name: 'dummy_var',
158
- value: '0'
159
- }
130
+ value: '0',
131
+ },
160
132
  ],
161
133
  dbservers: [
162
134
  {
163
135
  id: 0,
164
136
  name: 'mysqlservice',
165
- value: 'mysqld'
137
+ value: 'mysqld',
166
138
  },
167
139
  {
168
140
  id: 1,
169
141
  name: 'mysql_port',
170
- value: '3306'
142
+ value: '3306',
171
143
  },
172
144
  {
173
145
  id: 2,
174
146
  name: 'dbuser',
175
- value: 'webapp'
147
+ value: 'webapp',
176
148
  },
177
149
  {
178
150
  id: 3,
179
151
  name: 'dbname',
180
- value: 'ANSAP01'
152
+ value: 'ANSAP01',
181
153
  },
182
154
  {
183
155
  id: 4,
184
156
  name: 'upassword',
185
- value: 'Bond@007'
157
+ value: 'Bond@007',
186
158
  },
187
159
  {
188
160
  id: 5,
189
161
  name: 'masterpassword',
190
- value: 'MySQL@007'
191
- }
162
+ value: 'MySQL@007',
163
+ },
192
164
  ],
193
165
  all: [
194
166
  {
195
167
  id: 0,
196
168
  name: 'repository',
197
- value: 'https://github.com/bennojoy/mywebapp.git'
198
- }
199
- ]
200
- }
169
+ value: 'https://github.com/bennojoy/mywebapp.git',
170
+ },
171
+ ],
172
+ },
201
173
  },
202
174
  services: [
203
175
  {
@@ -215,7 +187,7 @@ export const applicationDefinitionConfData_1 = {
215
187
  name: 'CP',
216
188
  description: '',
217
189
  type: 'computeprofile',
218
- value: '1'
190
+ value: '1',
219
191
  },
220
192
  {
221
193
  id: 2,
@@ -223,16 +195,16 @@ export const applicationDefinitionConfData_1 = {
223
195
  name: 'LE',
224
196
  description: '',
225
197
  type: 'lifecycleenv',
226
- value: '1'
227
- }
198
+ value: '1',
199
+ },
228
200
  ],
229
201
  ansibleParameters: [
230
202
  {
231
203
  id: 0,
232
204
  name: 'dummy_var',
233
- value: '0'
234
- }
235
- ]
205
+ value: '0',
206
+ },
207
+ ],
236
208
  },
237
209
  {
238
210
  id: 2,
@@ -247,42 +219,42 @@ export const applicationDefinitionConfData_1 = {
247
219
  {
248
220
  id: 0,
249
221
  name: 'mysqlservice',
250
- value: 'mysqld'
222
+ value: 'mysqld',
251
223
  },
252
224
  {
253
225
  id: 1,
254
226
  name: 'mysql_port',
255
227
  value: '3306',
256
- locked: true
228
+ locked: true,
257
229
  },
258
230
  {
259
231
  id: 2,
260
232
  name: 'dbuser',
261
- value: 'webapp'
233
+ value: 'webapp',
262
234
  },
263
235
  {
264
236
  id: 3,
265
237
  name: 'dbname',
266
- value: 'ANSAP01'
238
+ value: 'ANSAP01',
267
239
  },
268
240
  {
269
241
  id: 4,
270
242
  name: 'upassword',
271
- value: 'Bond@007'
243
+ value: 'Bond@007',
272
244
  },
273
245
  {
274
246
  id: 5,
275
247
  name: 'masterpassword',
276
- value: 'MySQL@007'
277
- }
278
- ]
279
- }
248
+ value: 'MySQL@007',
249
+ },
250
+ ],
251
+ },
280
252
  ],
281
253
  ansibleVarsAll: [
282
254
  {
283
255
  id: 0,
284
256
  name: 'repository',
285
- value: 'https://github.com/bennojoy/mywebapp.git'
286
- }
287
- ]
288
- }
257
+ value: 'https://github.com/bennojoy/mywebapp.git',
258
+ },
259
+ ],
260
+ };