foreman_acd 0.7.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +17 -2
- data/app/controllers/foreman_acd/app_definitions_controller.rb +104 -7
- data/app/controllers/foreman_acd/app_instances_controller.rb +15 -30
- data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
- data/app/controllers/ui_acd_controller.rb +42 -3
- data/app/lib/actions/foreman_acd/run_configurator.rb +1 -0
- data/app/models/concerns/foreman_acd/host_managed_extensions.rb +40 -27
- data/app/models/foreman_acd/app_instance.rb +47 -2
- data/app/models/foreman_acd/foreman_host.rb +8 -0
- data/app/services/foreman_acd/app_deployer.rb +19 -2
- data/app/services/foreman_acd/inventory_creator.rb +11 -1
- data/app/views/foreman_acd/app_definitions/_form.html.erb +4 -0
- data/app/views/foreman_acd/app_definitions/import.html.erb +20 -1
- data/app/views/foreman_acd/app_definitions/index.html.erb +3 -6
- data/app/views/foreman_acd/app_instances/_form.html.erb +4 -0
- data/app/views/foreman_acd/app_instances/index.html.erb +15 -11
- data/app/views/foreman_acd/app_instances/report.html.erb +7 -2
- data/app/views/ui_acd/host_report.json.rabl +4 -0
- data/app/views/ui_acd/report_data.json.rabl +10 -0
- data/app/views/ui_acd/validate_hostname.json.rabl +6 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20210818125913_add_is_existing_host_to_foreman_host.rb +8 -0
- data/db/migrate/20210902110645_add_initial_configure_task.rb +8 -0
- data/lib/foreman_acd/plugin.rb +9 -9
- data/lib/foreman_acd/version.rb +1 -1
- data/lib/foreman_acd.rb +27 -9
- data/package.json +8 -25
- data/test/controllers/ui_acd_controller_test.rb +4 -1
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
- data/webpack/__snapshots__/helper.test.js.snap +1 -1
- data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +34 -10
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +12 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +1 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +30 -9
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +4 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +1 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +12 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +31 -5
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +8 -0
- data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +1 -1
- data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +3 -3
- data/webpack/components/ApplicationDefinition/index.js +8 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +214 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.scss +1 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +161 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +6 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +79 -0
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +8 -0
- data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportConfData_1.fixtures.js +129 -0
- data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +29 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +20 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +43 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +29 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +62 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportReducer.test.js.snap +362 -0
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +130 -0
- data/webpack/components/ApplicationDefinitionImport/index.js +32 -0
- data/webpack/components/ApplicationInstance/ApplicationInstance.js +102 -26
- data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +118 -6
- data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +4 -0
- data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +15 -0
- data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +71 -30
- data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +4 -0
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +2 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +1 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +12 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +12 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +98 -7
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +271 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +8 -0
- data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +1 -0
- data/webpack/components/ApplicationInstance/components/ServiceCounter.js +1 -1
- data/webpack/components/ApplicationInstance/helper.js +0 -0
- data/webpack/components/ApplicationInstance/index.js +8 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +81 -6
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +35 -1
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +3 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +19 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +4 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +1 -124
- data/webpack/components/ApplicationInstanceReport/index.js +8 -1
- data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +104 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelection.scss +15 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +71 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +4 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionHelper.js +0 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +90 -0
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -0
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +191 -0
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +203 -0
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +19 -0
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionReducer.test.js +59 -0
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +36 -0
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelection.test.js.snap +35 -0
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionReducer.test.js.snap +614 -0
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +27 -0
- data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +48 -0
- data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +35 -0
- data/webpack/components/ExistingHostSelection/components/__tests__/__snapshots__/ServiceSelector.test.js.snap +77 -0
- data/webpack/components/ExistingHostSelection/index.js +26 -0
- data/webpack/components/ParameterSelection/ParameterSelection.js +103 -1
- data/webpack/components/ParameterSelection/ParameterSelection.scss +7 -0
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +46 -4
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +2 -0
- data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +5 -1
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +52 -11
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +8 -0
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +2 -0
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +6 -0
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +96 -0
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +117 -17
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +13 -0
- data/webpack/components/ParameterSelection/index.js +4 -1
- data/webpack/components/SyncGitRepo/SyncGitRepo.js +2 -10
- data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +2 -3
- data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +0 -1
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +1 -0
- data/webpack/components/SyncGitRepo/components/FormTextInput.js +1 -1
- data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +3 -2
- data/webpack/components/common/DeleteTableEntry.js +16 -2
- data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +38 -0
- data/webpack/helper.js +21 -1
- data/webpack/helper.test.js +20 -1
- data/webpack/index.js +5 -0
- data/webpack/js-yaml.js +3874 -0
- data/webpack/reducer.js +13 -2
- data/webpack/test_setup.js +0 -2
- metadata +46 -2
@@ -0,0 +1,362 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ApplicationDefinitionImportReducer should change edit service 1`] = `
|
4
|
+
Object {
|
5
|
+
"ansiblePlaybookServices": Array [
|
6
|
+
Object {
|
7
|
+
"ansibleGroup": "webservers",
|
8
|
+
"ansibleParameters": Array [
|
9
|
+
Object {
|
10
|
+
"id": 0,
|
11
|
+
"name": "dummy_var",
|
12
|
+
"value": "0",
|
13
|
+
},
|
14
|
+
],
|
15
|
+
"description": "",
|
16
|
+
"foremanParameters": Array [
|
17
|
+
Object {
|
18
|
+
"description": "",
|
19
|
+
"id": 1,
|
20
|
+
"locked": false,
|
21
|
+
"name": "CP",
|
22
|
+
"type": "computeprofile",
|
23
|
+
"value": "1",
|
24
|
+
},
|
25
|
+
Object {
|
26
|
+
"description": "",
|
27
|
+
"id": 2,
|
28
|
+
"locked": true,
|
29
|
+
"name": "LE",
|
30
|
+
"type": "lifecycleenv",
|
31
|
+
"value": "1",
|
32
|
+
},
|
33
|
+
],
|
34
|
+
"hostgroup": "1",
|
35
|
+
"id": 1,
|
36
|
+
"maxCount": "",
|
37
|
+
"minCount": "2",
|
38
|
+
"name": "web",
|
39
|
+
},
|
40
|
+
Object {
|
41
|
+
"ansibleGroup": "dbservers",
|
42
|
+
"ansibleParameters": Array [
|
43
|
+
Object {
|
44
|
+
"id": 0,
|
45
|
+
"name": "mysqlservice",
|
46
|
+
"value": "mysqld",
|
47
|
+
},
|
48
|
+
Object {
|
49
|
+
"id": 1,
|
50
|
+
"locked": true,
|
51
|
+
"name": "mysql_port",
|
52
|
+
"value": "3306",
|
53
|
+
},
|
54
|
+
Object {
|
55
|
+
"id": 2,
|
56
|
+
"name": "dbuser",
|
57
|
+
"value": "webapp",
|
58
|
+
},
|
59
|
+
Object {
|
60
|
+
"id": 3,
|
61
|
+
"name": "dbname",
|
62
|
+
"value": "ANSAP01",
|
63
|
+
},
|
64
|
+
Object {
|
65
|
+
"id": 4,
|
66
|
+
"name": "upassword",
|
67
|
+
"value": "Bond@007",
|
68
|
+
},
|
69
|
+
Object {
|
70
|
+
"id": 5,
|
71
|
+
"name": "masterpassword",
|
72
|
+
"value": "MySQL@007",
|
73
|
+
},
|
74
|
+
],
|
75
|
+
"backup": Object {
|
76
|
+
"ansibleGroup": "dbservers",
|
77
|
+
"ansibleParameters": Array [
|
78
|
+
Object {
|
79
|
+
"id": 0,
|
80
|
+
"name": "mysqlservice",
|
81
|
+
"value": "mysqld",
|
82
|
+
},
|
83
|
+
Object {
|
84
|
+
"id": 1,
|
85
|
+
"locked": true,
|
86
|
+
"name": "mysql_port",
|
87
|
+
"value": "3306",
|
88
|
+
},
|
89
|
+
Object {
|
90
|
+
"id": 2,
|
91
|
+
"name": "dbuser",
|
92
|
+
"value": "webapp",
|
93
|
+
},
|
94
|
+
Object {
|
95
|
+
"id": 3,
|
96
|
+
"name": "dbname",
|
97
|
+
"value": "ANSAP01",
|
98
|
+
},
|
99
|
+
Object {
|
100
|
+
"id": 4,
|
101
|
+
"name": "upassword",
|
102
|
+
"value": "Bond@007",
|
103
|
+
},
|
104
|
+
Object {
|
105
|
+
"id": 5,
|
106
|
+
"name": "masterpassword",
|
107
|
+
"value": "MySQL@007",
|
108
|
+
},
|
109
|
+
],
|
110
|
+
"description": "",
|
111
|
+
"foremanParameters": Array [],
|
112
|
+
"hostgroup": "1",
|
113
|
+
"id": 2,
|
114
|
+
"maxCount": "",
|
115
|
+
"minCount": "1",
|
116
|
+
"name": "db",
|
117
|
+
},
|
118
|
+
"description": "",
|
119
|
+
"foremanParameters": Array [],
|
120
|
+
"hostgroup": "1",
|
121
|
+
"id": 2,
|
122
|
+
"maxCount": "",
|
123
|
+
"minCount": "1",
|
124
|
+
"name": "helloworld",
|
125
|
+
},
|
126
|
+
],
|
127
|
+
"columns": Array [
|
128
|
+
Object {
|
129
|
+
"cell": Object {
|
130
|
+
"formatters": Array [
|
131
|
+
null,
|
132
|
+
],
|
133
|
+
},
|
134
|
+
"header": Object {
|
135
|
+
"formatters": Array [
|
136
|
+
null,
|
137
|
+
],
|
138
|
+
"label": "Service name",
|
139
|
+
"props": Object {
|
140
|
+
"index": 3,
|
141
|
+
"style": Object {
|
142
|
+
"width": "20%",
|
143
|
+
},
|
144
|
+
},
|
145
|
+
},
|
146
|
+
"property": "name",
|
147
|
+
},
|
148
|
+
Object {
|
149
|
+
"cell": Object {
|
150
|
+
"formatters": Array [
|
151
|
+
null,
|
152
|
+
],
|
153
|
+
},
|
154
|
+
"header": Object {
|
155
|
+
"formatters": Array [
|
156
|
+
null,
|
157
|
+
],
|
158
|
+
"label": "Hostgroup",
|
159
|
+
"props": Object {
|
160
|
+
"index": 2,
|
161
|
+
"style": Object {
|
162
|
+
"width": "20%",
|
163
|
+
},
|
164
|
+
},
|
165
|
+
},
|
166
|
+
"property": "hostgroup",
|
167
|
+
},
|
168
|
+
],
|
169
|
+
"error": Object {
|
170
|
+
"errorMsg": "",
|
171
|
+
"status": "",
|
172
|
+
"statusText": "",
|
173
|
+
},
|
174
|
+
"name": false,
|
175
|
+
}
|
176
|
+
`;
|
177
|
+
|
178
|
+
exports[`ApplicationDefinitionImportReducer should initialize component 1`] = `
|
179
|
+
Object {
|
180
|
+
"ansiblePlaybookServices": Array [
|
181
|
+
Object {
|
182
|
+
"ansibleGroup": "webservers",
|
183
|
+
"ansibleParameters": Array [
|
184
|
+
Object {
|
185
|
+
"id": 0,
|
186
|
+
"name": "dummy_var",
|
187
|
+
"value": "0",
|
188
|
+
},
|
189
|
+
],
|
190
|
+
"description": "",
|
191
|
+
"foremanParameters": Array [
|
192
|
+
Object {
|
193
|
+
"description": "",
|
194
|
+
"id": 1,
|
195
|
+
"locked": false,
|
196
|
+
"name": "CP",
|
197
|
+
"type": "computeprofile",
|
198
|
+
"value": "1",
|
199
|
+
},
|
200
|
+
Object {
|
201
|
+
"description": "",
|
202
|
+
"id": 2,
|
203
|
+
"locked": true,
|
204
|
+
"name": "LE",
|
205
|
+
"type": "lifecycleenv",
|
206
|
+
"value": "1",
|
207
|
+
},
|
208
|
+
],
|
209
|
+
"hostgroup": "1",
|
210
|
+
"id": 1,
|
211
|
+
"maxCount": "",
|
212
|
+
"minCount": "2",
|
213
|
+
"name": "web",
|
214
|
+
},
|
215
|
+
Object {
|
216
|
+
"ansibleGroup": "dbservers",
|
217
|
+
"ansibleParameters": Array [
|
218
|
+
Object {
|
219
|
+
"id": 0,
|
220
|
+
"name": "mysqlservice",
|
221
|
+
"value": "mysqld",
|
222
|
+
},
|
223
|
+
Object {
|
224
|
+
"id": 1,
|
225
|
+
"locked": true,
|
226
|
+
"name": "mysql_port",
|
227
|
+
"value": "3306",
|
228
|
+
},
|
229
|
+
Object {
|
230
|
+
"id": 2,
|
231
|
+
"name": "dbuser",
|
232
|
+
"value": "webapp",
|
233
|
+
},
|
234
|
+
Object {
|
235
|
+
"id": 3,
|
236
|
+
"name": "dbname",
|
237
|
+
"value": "ANSAP01",
|
238
|
+
},
|
239
|
+
Object {
|
240
|
+
"id": 4,
|
241
|
+
"name": "upassword",
|
242
|
+
"value": "Bond@007",
|
243
|
+
},
|
244
|
+
Object {
|
245
|
+
"id": 5,
|
246
|
+
"name": "masterpassword",
|
247
|
+
"value": "MySQL@007",
|
248
|
+
},
|
249
|
+
],
|
250
|
+
"backup": Object {
|
251
|
+
"ansibleGroup": "dbservers",
|
252
|
+
"ansibleParameters": Array [
|
253
|
+
Object {
|
254
|
+
"id": 0,
|
255
|
+
"name": "mysqlservice",
|
256
|
+
"value": "mysqld",
|
257
|
+
},
|
258
|
+
Object {
|
259
|
+
"id": 1,
|
260
|
+
"locked": true,
|
261
|
+
"name": "mysql_port",
|
262
|
+
"value": "3306",
|
263
|
+
},
|
264
|
+
Object {
|
265
|
+
"id": 2,
|
266
|
+
"name": "dbuser",
|
267
|
+
"value": "webapp",
|
268
|
+
},
|
269
|
+
Object {
|
270
|
+
"id": 3,
|
271
|
+
"name": "dbname",
|
272
|
+
"value": "ANSAP01",
|
273
|
+
},
|
274
|
+
Object {
|
275
|
+
"id": 4,
|
276
|
+
"name": "upassword",
|
277
|
+
"value": "Bond@007",
|
278
|
+
},
|
279
|
+
Object {
|
280
|
+
"id": 5,
|
281
|
+
"name": "masterpassword",
|
282
|
+
"value": "MySQL@007",
|
283
|
+
},
|
284
|
+
],
|
285
|
+
"description": "",
|
286
|
+
"foremanParameters": Array [],
|
287
|
+
"hostgroup": "1",
|
288
|
+
"id": 2,
|
289
|
+
"maxCount": "",
|
290
|
+
"minCount": "1",
|
291
|
+
"name": "db",
|
292
|
+
},
|
293
|
+
"description": "",
|
294
|
+
"foremanParameters": Array [],
|
295
|
+
"hostgroup": "1",
|
296
|
+
"id": 2,
|
297
|
+
"maxCount": "",
|
298
|
+
"minCount": "1",
|
299
|
+
"name": "db",
|
300
|
+
},
|
301
|
+
],
|
302
|
+
"columns": Array [
|
303
|
+
Object {
|
304
|
+
"cell": Object {
|
305
|
+
"formatters": Array [
|
306
|
+
null,
|
307
|
+
],
|
308
|
+
},
|
309
|
+
"header": Object {
|
310
|
+
"formatters": Array [
|
311
|
+
null,
|
312
|
+
],
|
313
|
+
"label": "Service name",
|
314
|
+
"props": Object {
|
315
|
+
"index": 3,
|
316
|
+
"style": Object {
|
317
|
+
"width": "20%",
|
318
|
+
},
|
319
|
+
},
|
320
|
+
},
|
321
|
+
"property": "name",
|
322
|
+
},
|
323
|
+
Object {
|
324
|
+
"cell": Object {
|
325
|
+
"formatters": Array [
|
326
|
+
null,
|
327
|
+
],
|
328
|
+
},
|
329
|
+
"header": Object {
|
330
|
+
"formatters": Array [
|
331
|
+
null,
|
332
|
+
],
|
333
|
+
"label": "Hostgroup",
|
334
|
+
"props": Object {
|
335
|
+
"index": 2,
|
336
|
+
"style": Object {
|
337
|
+
"width": "20%",
|
338
|
+
},
|
339
|
+
},
|
340
|
+
},
|
341
|
+
"property": "hostgroup",
|
342
|
+
},
|
343
|
+
],
|
344
|
+
"error": Object {
|
345
|
+
"errorMsg": "",
|
346
|
+
"status": "",
|
347
|
+
"statusText": "",
|
348
|
+
},
|
349
|
+
"name": false,
|
350
|
+
}
|
351
|
+
`;
|
352
|
+
|
353
|
+
exports[`ApplicationDefinitionImportReducer should return initial state 1`] = `
|
354
|
+
Object {
|
355
|
+
"error": Object {
|
356
|
+
"errorMsg": "",
|
357
|
+
"status": "",
|
358
|
+
"statusText": "",
|
359
|
+
},
|
360
|
+
"name": false,
|
361
|
+
}
|
362
|
+
`;
|
@@ -0,0 +1,130 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ApplicationDefinitionImportSelectors should return columns from applicationDefinitionImportConfData_1 fixtures 1`] = `
|
4
|
+
Array [
|
5
|
+
Object {
|
6
|
+
"cell": Object {
|
7
|
+
"formatters": Array [
|
8
|
+
null,
|
9
|
+
],
|
10
|
+
},
|
11
|
+
"header": Object {
|
12
|
+
"formatters": Array [
|
13
|
+
null,
|
14
|
+
],
|
15
|
+
"label": "Service name",
|
16
|
+
"props": Object {
|
17
|
+
"index": 3,
|
18
|
+
"style": Object {
|
19
|
+
"width": "20%",
|
20
|
+
},
|
21
|
+
},
|
22
|
+
},
|
23
|
+
"property": "name",
|
24
|
+
},
|
25
|
+
Object {
|
26
|
+
"cell": Object {
|
27
|
+
"formatters": Array [
|
28
|
+
null,
|
29
|
+
],
|
30
|
+
},
|
31
|
+
"header": Object {
|
32
|
+
"formatters": Array [
|
33
|
+
null,
|
34
|
+
],
|
35
|
+
"label": "Hostgroup",
|
36
|
+
"props": Object {
|
37
|
+
"index": 2,
|
38
|
+
"style": Object {
|
39
|
+
"width": "20%",
|
40
|
+
},
|
41
|
+
},
|
42
|
+
},
|
43
|
+
"property": "hostgroup",
|
44
|
+
},
|
45
|
+
]
|
46
|
+
`;
|
47
|
+
|
48
|
+
exports[`ApplicationDefinitionImportSelectors should return editMode from applicationDefinitionImportConfData_1 fixtures 1`] = `undefined`;
|
49
|
+
|
50
|
+
exports[`ApplicationDefinitionImportSelectors should return services from applicationDefinitionImportConfData_1 fixtures 1`] = `
|
51
|
+
Array [
|
52
|
+
Object {
|
53
|
+
"ansibleGroup": "webservers",
|
54
|
+
"ansibleParameters": Array [
|
55
|
+
Object {
|
56
|
+
"id": 0,
|
57
|
+
"name": "dummy_var",
|
58
|
+
"value": "0",
|
59
|
+
},
|
60
|
+
],
|
61
|
+
"description": "",
|
62
|
+
"foremanParameters": Array [
|
63
|
+
Object {
|
64
|
+
"description": "",
|
65
|
+
"id": 1,
|
66
|
+
"locked": false,
|
67
|
+
"name": "CP",
|
68
|
+
"type": "computeprofile",
|
69
|
+
"value": "1",
|
70
|
+
},
|
71
|
+
Object {
|
72
|
+
"description": "",
|
73
|
+
"id": 2,
|
74
|
+
"locked": true,
|
75
|
+
"name": "LE",
|
76
|
+
"type": "lifecycleenv",
|
77
|
+
"value": "1",
|
78
|
+
},
|
79
|
+
],
|
80
|
+
"hostgroup": "1",
|
81
|
+
"id": 1,
|
82
|
+
"maxCount": "",
|
83
|
+
"minCount": "2",
|
84
|
+
"name": "web",
|
85
|
+
},
|
86
|
+
Object {
|
87
|
+
"ansibleGroup": "dbservers",
|
88
|
+
"ansibleParameters": Array [
|
89
|
+
Object {
|
90
|
+
"id": 0,
|
91
|
+
"name": "mysqlservice",
|
92
|
+
"value": "mysqld",
|
93
|
+
},
|
94
|
+
Object {
|
95
|
+
"id": 1,
|
96
|
+
"locked": true,
|
97
|
+
"name": "mysql_port",
|
98
|
+
"value": "3306",
|
99
|
+
},
|
100
|
+
Object {
|
101
|
+
"id": 2,
|
102
|
+
"name": "dbuser",
|
103
|
+
"value": "webapp",
|
104
|
+
},
|
105
|
+
Object {
|
106
|
+
"id": 3,
|
107
|
+
"name": "dbname",
|
108
|
+
"value": "ANSAP01",
|
109
|
+
},
|
110
|
+
Object {
|
111
|
+
"id": 4,
|
112
|
+
"name": "upassword",
|
113
|
+
"value": "Bond@007",
|
114
|
+
},
|
115
|
+
Object {
|
116
|
+
"id": 5,
|
117
|
+
"name": "masterpassword",
|
118
|
+
"value": "MySQL@007",
|
119
|
+
},
|
120
|
+
],
|
121
|
+
"description": "",
|
122
|
+
"foremanParameters": Array [],
|
123
|
+
"hostgroup": "1",
|
124
|
+
"id": 2,
|
125
|
+
"maxCount": "",
|
126
|
+
"minCount": "1",
|
127
|
+
"name": "db",
|
128
|
+
},
|
129
|
+
]
|
130
|
+
`;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { bindActionCreators } from 'redux';
|
2
|
+
import { connect } from 'react-redux';
|
3
|
+
|
4
|
+
import './ApplicationDefinitionImport.scss';
|
5
|
+
import ApplicationDefinitionImport from './ApplicationDefinitionImport';
|
6
|
+
import * as ApplicationDefinitionImportActions from './ApplicationDefinitionImportActions';
|
7
|
+
|
8
|
+
import {
|
9
|
+
selectEditMode,
|
10
|
+
selectColumns,
|
11
|
+
selectAnsiblePlaybookServices,
|
12
|
+
selectShowAlertModal,
|
13
|
+
selectAlertModalText,
|
14
|
+
selectAlertModalTitle,
|
15
|
+
} from './ApplicationDefinitionImportSelectors';
|
16
|
+
|
17
|
+
const mapStateToProps = state => ({
|
18
|
+
editMode: selectEditMode(state),
|
19
|
+
columns: selectColumns(state),
|
20
|
+
showAlertModal: selectShowAlertModal(state),
|
21
|
+
alertModalText: selectAlertModalText(state),
|
22
|
+
alertModalTitle: selectAlertModalTitle(state),
|
23
|
+
ansiblePlaybookServices: selectAnsiblePlaybookServices(state),
|
24
|
+
});
|
25
|
+
|
26
|
+
const mapDispatchToProps = dispatch =>
|
27
|
+
bindActionCreators(ApplicationDefinitionImportActions, dispatch);
|
28
|
+
|
29
|
+
export default connect(
|
30
|
+
mapStateToProps,
|
31
|
+
mapDispatchToProps
|
32
|
+
)(ApplicationDefinitionImport);
|