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.
- checksums.yaml +4 -4
- data/lib/foreman_acd/version.rb +1 -1
- data/package.json +5 -3
- data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +210 -121
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +79 -91
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +30 -15
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +15 -15
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +96 -63
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +22 -11
- data/webpack/components/ApplicationDefinition/__fixtures__/{applicationDefinitionConfData_1.fixtures.js → applicationDefinitionConfData1.fixtures.js} +77 -105
- data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +49 -29
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +4 -4
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionHelper.test.js +16 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +0 -5
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +25 -25
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +9 -1
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +11 -11
- data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +30 -25
- data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +3 -3
- data/webpack/components/ApplicationDefinition/index.js +0 -1
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +91 -105
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +59 -84
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +12 -6
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +21 -27
- data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +14 -7
- data/webpack/components/ApplicationDefinitionImport/__fixtures__/{applicationDefinitionImportConfData_1.fixtures.js → applicationDefinitionImportConfData1.fixtures.js} +32 -40
- data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +14 -16
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +38 -8
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +0 -2
- data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +9 -9
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +116 -2
- data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +3 -3
- data/webpack/components/ApplicationInstance/ApplicationInstance.js +344 -193
- data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +92 -105
- data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +34 -17
- data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +4 -7
- data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +114 -74
- data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +18 -9
- data/webpack/components/ApplicationInstance/__fixtures__/{applicationInstanceConfData_1.fixtures.js → applicationInstanceConfData1.fixtures.js} +68 -86
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +24 -32
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +75 -10
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +0 -8
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +27 -27
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +606 -2
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +12 -12
- data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +32 -25
- data/webpack/components/ApplicationInstance/components/Service.js +7 -18
- data/webpack/components/ApplicationInstance/components/ServiceCounter.js +25 -18
- data/webpack/components/ApplicationInstance/index.js +0 -1
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +167 -110
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +20 -25
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +10 -5
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +9 -12
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +12 -6
- data/webpack/components/ApplicationInstanceReport/__fixtures__/{applicationInstanceReportData_1.fixtures.js → applicationInstanceReportData1.fixtures.js} +154 -101
- data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +3 -10
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +28 -22
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +5 -7
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +0 -1
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +2 -2
- data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +9 -5
- data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +1 -3
- data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +35 -56
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +21 -28
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +6 -3
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +16 -19
- data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -4
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData1.fixtures.js +187 -0
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +13 -24
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +3 -2
- data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +11 -14
- data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +5 -5
- data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +31 -25
- data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +3 -9
- data/webpack/components/ParameterSelection/ParameterSelection.js +258 -174
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +110 -100
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +22 -11
- data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +13 -11
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +63 -49
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +10 -5
- data/webpack/components/ParameterSelection/__fixtures__/{parameterSelectionData_1.fixtures.js → parameterSelectionData1.fixtures.js} +67 -104
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +22 -26
- data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +50 -36
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionHelper.test.js +76 -0
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +0 -2
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +23 -25
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +100 -0
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +99 -112
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +18 -19
- data/webpack/components/ParameterSelection/index.js +1 -4
- data/webpack/components/SyncGitRepo/SyncGitRepo.js +124 -117
- data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +64 -74
- data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +17 -17
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData1.fixtures.js +7 -0
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +10 -18
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +80 -6
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +9 -11
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +192 -1
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +4 -4
- data/webpack/components/SyncGitRepo/components/FormTextInput.js +26 -21
- data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +29 -24
- data/webpack/components/SyncGitRepo/index.js +2 -5
- data/webpack/components/common/AddTableEntry.js +3 -10
- data/webpack/components/common/DeleteTableEntry.js +7 -15
- data/webpack/components/common/EditTableEntry.js +7 -7
- data/webpack/components/common/ExtSelect.js +12 -8
- data/webpack/components/common/ExtTextInput.js +12 -7
- data/webpack/components/common/LockTableEntry.js +6 -6
- data/webpack/components/common/RailsData.js +6 -16
- data/webpack/components/common/__tests__/ExtSelect.test.js +2 -2
- data/webpack/components/common/__tests__/RailsData.test.js +0 -2
- data/webpack/global_test_setup.js +11 -0
- data/webpack/helper.js +10 -21
- data/webpack/helper.test.js +17 -29
- data/webpack/index.js +25 -7
- data/webpack/js-yaml.js +1563 -1135
- data/webpack/reducer.js +52 -27
- metadata +13 -11
- data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +0 -191
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +0 -153
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +0 -7
data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js
CHANGED
@@ -1,26 +1,20 @@
|
|
1
1
|
import Immutable from 'seamless-immutable';
|
2
|
-
import {
|
3
|
-
cloneDeep,
|
4
|
-
findIndex,
|
5
|
-
findLastIndex,
|
6
|
-
} from 'lodash';
|
2
|
+
import { cloneDeep, findIndex } from 'lodash';
|
7
3
|
|
8
|
-
import {
|
9
|
-
applicationDefinitionConfData_1,
|
10
|
-
} from '../__fixtures__/applicationDefinitionConfData_1.fixtures';
|
4
|
+
import { applicationDefinitionConfData1 } from '../__fixtures__/applicationDefinitionConfData1.fixtures';
|
11
5
|
|
12
|
-
export const successState = Immutable(
|
6
|
+
export const successState = Immutable(applicationDefinitionConfData1);
|
13
7
|
|
14
8
|
const EDIT_ROW_ID = 2;
|
15
9
|
|
16
|
-
const editClone =
|
17
|
-
const editIndex = findIndex(editClone.services, { id: EDIT_ROW_ID })
|
18
|
-
editClone
|
10
|
+
const editClone = applicationDefinitionConfData1;
|
11
|
+
const editIndex = findIndex(editClone.services, { id: EDIT_ROW_ID });
|
12
|
+
editClone.services[editIndex].backup = cloneDeep(editClone.services[editIndex]);
|
19
13
|
export const editState = Immutable(editClone);
|
20
14
|
|
21
15
|
// Payload Data
|
22
|
-
export const initApplicationDefinitionPayload =
|
23
|
-
export const addServicePayload = {
|
16
|
+
export const initApplicationDefinitionPayload = applicationDefinitionConfData1;
|
17
|
+
export const addServicePayload = {};
|
24
18
|
export const deleteServicePayload = {
|
25
19
|
rowData: {
|
26
20
|
id: EDIT_ROW_ID,
|
@@ -42,11 +36,11 @@ export const cancelEditServicePayload = {
|
|
42
36
|
},
|
43
37
|
};
|
44
38
|
export const changeEditServicePayload = {
|
45
|
-
value:
|
46
|
-
property:
|
39
|
+
value: 'helloworld',
|
40
|
+
property: 'name',
|
47
41
|
rowData: {
|
48
42
|
id: EDIT_ROW_ID,
|
49
|
-
}
|
43
|
+
},
|
50
44
|
};
|
51
45
|
|
52
46
|
export const loadAnsibleDataRequestPayload = {
|
@@ -55,25 +49,51 @@ export const loadAnsibleDataRequestPayload = {
|
|
55
49
|
|
56
50
|
export const loadAnsibleDataSuccessPayload = {
|
57
51
|
id: 2,
|
58
|
-
name:
|
52
|
+
name: 'LAMP',
|
59
53
|
groups: {
|
60
54
|
webservers: {
|
61
|
-
dummy_var:
|
55
|
+
dummy_var: '0',
|
62
56
|
},
|
63
57
|
dbservers: {
|
64
|
-
mysqlservice:
|
65
|
-
mysql_port:
|
66
|
-
dbuser:
|
67
|
-
dbname:
|
68
|
-
upassword:
|
69
|
-
masterpassword:
|
58
|
+
mysqlservice: 'mysqld',
|
59
|
+
mysql_port: '3306',
|
60
|
+
dbuser: 'webapp',
|
61
|
+
dbname: 'ANSAP01',
|
62
|
+
upassword: 'Bond@007',
|
63
|
+
masterpassword: 'MySQL@007',
|
70
64
|
},
|
71
65
|
all: {
|
72
|
-
repository:
|
73
|
-
}
|
74
|
-
}
|
66
|
+
repository: 'https://github.com/bennojoy/mywebapp.git',
|
67
|
+
},
|
68
|
+
},
|
75
69
|
};
|
76
70
|
|
77
71
|
export const loadAnsibleDataFailurePayload = {
|
78
|
-
error:
|
72
|
+
error: {
|
73
|
+
errorMsg: 'Something really bad happend',
|
74
|
+
statusText: {
|
75
|
+
message: 'Request failed with status code 500',
|
76
|
+
name: 'Error',
|
77
|
+
stack:
|
78
|
+
'Error: Request failed with status code 500\n at createError (https://alma8-katello-devel.example.com/webpack/foreman-vendor.bundle-v13.0.1-development-5d3e5360b2af8f65b096.js:406679:15)\n at settle (https://alma8-katello-devel.example.com/webpack/foreman-vendor.bundle-v13.0.1-development-5d3e5360b2af8f65b096.js:406954:12)\n at XMLHttpRequest.handleLoad (https://alma8-katello-devel.example.com/webpack/foreman-vendor.bundle-v13.0.1-development-5d3e5360b2af8f65b096.js:406146:7)',
|
79
|
+
config: {
|
80
|
+
url: '/acd/ui_acd_ansible_data/1',
|
81
|
+
method: 'get',
|
82
|
+
headers: {
|
83
|
+
Accept: 'application/json, text/plain, */*',
|
84
|
+
'X-Requested-With': 'XMLHttpRequest',
|
85
|
+
'X-CSRF-Token':
|
86
|
+
'gDtRPi6lnKE-V65O-datPQ2mGRQwbw3i-y_hAjjKAYQ5WC_oqTwluCJZfsGkpihmJAi3IvAi1ZAc9N47KcjCbQ',
|
87
|
+
},
|
88
|
+
params: {},
|
89
|
+
transformRequest: [null],
|
90
|
+
transformResponse: [null],
|
91
|
+
timeout: 0,
|
92
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
93
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
94
|
+
maxContentLength: -1,
|
95
|
+
maxBodyLength: -1,
|
96
|
+
},
|
97
|
+
},
|
98
|
+
},
|
79
99
|
};
|
@@ -7,11 +7,11 @@ const noop = () => {};
|
|
7
7
|
const fixtures = {
|
8
8
|
'should render application definition': {
|
9
9
|
data: {
|
10
|
-
location:
|
11
|
-
organization:
|
10
|
+
location: 'Default Location',
|
11
|
+
organization: 'Default Organization',
|
12
12
|
hostgroups: [],
|
13
|
-
foremanDataUrl:
|
14
|
-
ansibleDataUrl:
|
13
|
+
foremanDataUrl: 'url/does/not/exist',
|
14
|
+
ansibleDataUrl: 'url/does/not/exist',
|
15
15
|
services: [],
|
16
16
|
ansibleVarsAll: [],
|
17
17
|
},
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { transformAnsiblePlaybook } from '../ApplicationDefinitionHelper';
|
2
|
+
|
3
|
+
describe('transformAnsiblePlaybook()', () => {
|
4
|
+
const playbook = {
|
5
|
+
id: 42,
|
6
|
+
name: "Don't Panic",
|
7
|
+
};
|
8
|
+
|
9
|
+
it('returns empty playbook for invalid input', () => {
|
10
|
+
expect(transformAnsiblePlaybook(playbook)).toEqual({
|
11
|
+
id: playbook.id,
|
12
|
+
name: playbook.name,
|
13
|
+
groups: {},
|
14
|
+
});
|
15
|
+
});
|
16
|
+
});
|
data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js
CHANGED
@@ -27,11 +27,6 @@ import {
|
|
27
27
|
APPLICATION_DEFINITION_SERVICE_EDIT_CONFIRM,
|
28
28
|
APPLICATION_DEFINITION_SERVICE_EDIT_CHANGE,
|
29
29
|
APPLICATION_DEFINITION_SERVICE_EDIT_CANCEL,
|
30
|
-
APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_OPEN,
|
31
|
-
APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE,
|
32
|
-
APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_OPEN,
|
33
|
-
APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
|
34
|
-
APPLICATION_DEFINITION_CHANGE_PARAMETER_SELECTION_MODE,
|
35
30
|
} from '../ApplicationDefinitionConstants';
|
36
31
|
|
37
32
|
const fixtures = {
|
data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js
CHANGED
@@ -14,9 +14,7 @@ import {
|
|
14
14
|
selectParamEditMode,
|
15
15
|
} from '../ApplicationDefinitionSelectors';
|
16
16
|
|
17
|
-
import {
|
18
|
-
applicationDefinitionConfData_1,
|
19
|
-
} from '../__fixtures__/applicationDefinitionConfData_1.fixtures';
|
17
|
+
import { applicationDefinitionConfData1 } from '../__fixtures__/applicationDefinitionConfData1.fixtures';
|
20
18
|
|
21
19
|
const stateFactory = obj => ({
|
22
20
|
foremanAcd: {
|
@@ -25,28 +23,30 @@ const stateFactory = obj => ({
|
|
25
23
|
});
|
26
24
|
|
27
25
|
const fixtures = {
|
28
|
-
'should return showAlertModal from
|
29
|
-
selectShowAlertModal(stateFactory(
|
30
|
-
'should return alertModalText from
|
31
|
-
selectAlertModalText(stateFactory(
|
32
|
-
'should return alertModalTitle from
|
33
|
-
selectAlertModalTitle(stateFactory(
|
34
|
-
'should return editMode from
|
35
|
-
selectEditMode(stateFactory(
|
36
|
-
'should return ansiblePlaybook from
|
37
|
-
selectAnsiblePlaybook(stateFactory(
|
38
|
-
'should return services from
|
39
|
-
selectServices(stateFactory(
|
40
|
-
'should return parametersData from
|
41
|
-
selectParametersData(stateFactory(
|
42
|
-
'should return columns from
|
43
|
-
selectColumns(stateFactory(
|
44
|
-
'should return hiddenForemanParameterTypes from
|
45
|
-
selectHiddenForemanParameterTypes(
|
46
|
-
|
47
|
-
|
48
|
-
'should return
|
49
|
-
|
26
|
+
'should return showAlertModal from applicationDefinitionConfData1 fixtures': () =>
|
27
|
+
selectShowAlertModal(stateFactory(applicationDefinitionConfData1)),
|
28
|
+
'should return alertModalText from applicationDefinitionConfData1 fixtures': () =>
|
29
|
+
selectAlertModalText(stateFactory(applicationDefinitionConfData1)),
|
30
|
+
'should return alertModalTitle from applicationDefinitionConfData1 fixtures': () =>
|
31
|
+
selectAlertModalTitle(stateFactory(applicationDefinitionConfData1)),
|
32
|
+
'should return editMode from applicationDefinitionConfData1 fixtures': () =>
|
33
|
+
selectEditMode(stateFactory(applicationDefinitionConfData1)),
|
34
|
+
'should return ansiblePlaybook from applicationDefinitionConfData1 fixtures': () =>
|
35
|
+
selectAnsiblePlaybook(stateFactory(applicationDefinitionConfData1)),
|
36
|
+
'should return services from applicationDefinitionConfData1 fixtures': () =>
|
37
|
+
selectServices(stateFactory(applicationDefinitionConfData1)),
|
38
|
+
'should return parametersData from applicationDefinitionConfData1 fixtures': () =>
|
39
|
+
selectParametersData(stateFactory(applicationDefinitionConfData1)),
|
40
|
+
'should return columns from applicationDefinitionConfData1 fixtures': () =>
|
41
|
+
selectColumns(stateFactory(applicationDefinitionConfData1)),
|
42
|
+
'should return hiddenForemanParameterTypes from applicationDefinitionConfData1 fixtures': () =>
|
43
|
+
selectHiddenForemanParameterTypes(
|
44
|
+
stateFactory(applicationDefinitionConfData1)
|
45
|
+
),
|
46
|
+
'should return ansibleVarsAll from applicationDefinitionConfData1 fixtures': () =>
|
47
|
+
selectAnsibleVarsAll(stateFactory(applicationDefinitionConfData1)),
|
48
|
+
'should return ParamEditMode from applicationDefinitionConfData1 fixtures': () =>
|
49
|
+
selectParamEditMode(stateFactory(applicationDefinitionConfData1)),
|
50
50
|
};
|
51
51
|
|
52
52
|
describe('ApplicationDefinitionSelectors', () =>
|
@@ -2152,6 +2152,8 @@ Object {
|
|
2152
2152
|
|
2153
2153
|
exports[`ApplicationDefintionReducer should load param data be erroneous 1`] = `
|
2154
2154
|
Object {
|
2155
|
+
"alertModalText": "Failed to load Playbooks: Something really bad happend",
|
2156
|
+
"alertModalTitle": "Error",
|
2155
2157
|
"ansiblePlaybook": Object {
|
2156
2158
|
"groups": Object {
|
2157
2159
|
"all": Array [
|
@@ -2353,7 +2355,11 @@ Object {
|
|
2353
2355
|
"property": "actions",
|
2354
2356
|
},
|
2355
2357
|
],
|
2356
|
-
"error":
|
2358
|
+
"error": Object {
|
2359
|
+
"errorMsg": "",
|
2360
|
+
"status": "",
|
2361
|
+
"statusText": "",
|
2362
|
+
},
|
2357
2363
|
"loading": false,
|
2358
2364
|
"name": false,
|
2359
2365
|
"services": Array [
|
@@ -2435,6 +2441,7 @@ Object {
|
|
2435
2441
|
"name": "db",
|
2436
2442
|
},
|
2437
2443
|
],
|
2444
|
+
"showAlertModal": true,
|
2438
2445
|
}
|
2439
2446
|
`;
|
2440
2447
|
|
@@ -2646,6 +2653,7 @@ Object {
|
|
2646
2653
|
"status": "",
|
2647
2654
|
"statusText": "",
|
2648
2655
|
},
|
2656
|
+
"loading": false,
|
2649
2657
|
"name": false,
|
2650
2658
|
"services": Array [
|
2651
2659
|
Object {
|
@@ -1,12 +1,12 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
-
exports[`ApplicationDefinitionSelectors should return ParamEditMode from
|
3
|
+
exports[`ApplicationDefinitionSelectors should return ParamEditMode from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
4
4
|
|
5
|
-
exports[`ApplicationDefinitionSelectors should return alertModalText from
|
5
|
+
exports[`ApplicationDefinitionSelectors should return alertModalText from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
6
6
|
|
7
|
-
exports[`ApplicationDefinitionSelectors should return alertModalTitle from
|
7
|
+
exports[`ApplicationDefinitionSelectors should return alertModalTitle from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
8
8
|
|
9
|
-
exports[`ApplicationDefinitionSelectors should return ansiblePlaybook from
|
9
|
+
exports[`ApplicationDefinitionSelectors should return ansiblePlaybook from applicationDefinitionConfData1 fixtures 1`] = `
|
10
10
|
Object {
|
11
11
|
"groups": Object {
|
12
12
|
"all": Array [
|
@@ -61,7 +61,7 @@ Object {
|
|
61
61
|
}
|
62
62
|
`;
|
63
63
|
|
64
|
-
exports[`ApplicationDefinitionSelectors should return ansibleVarsAll from
|
64
|
+
exports[`ApplicationDefinitionSelectors should return ansibleVarsAll from applicationDefinitionConfData1 fixtures 1`] = `
|
65
65
|
Array [
|
66
66
|
Object {
|
67
67
|
"id": 0,
|
@@ -71,7 +71,7 @@ Array [
|
|
71
71
|
]
|
72
72
|
`;
|
73
73
|
|
74
|
-
exports[`ApplicationDefinitionSelectors should return columns from
|
74
|
+
exports[`ApplicationDefinitionSelectors should return columns from applicationDefinitionConfData1 fixtures 1`] = `
|
75
75
|
Array [
|
76
76
|
Object {
|
77
77
|
"cell": Object {
|
@@ -216,13 +216,13 @@ Array [
|
|
216
216
|
]
|
217
217
|
`;
|
218
218
|
|
219
|
-
exports[`ApplicationDefinitionSelectors should return editMode from
|
219
|
+
exports[`ApplicationDefinitionSelectors should return editMode from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
220
220
|
|
221
|
-
exports[`ApplicationDefinitionSelectors should return hiddenForemanParameterTypes from
|
221
|
+
exports[`ApplicationDefinitionSelectors should return hiddenForemanParameterTypes from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
222
222
|
|
223
|
-
exports[`ApplicationDefinitionSelectors should return parametersData from
|
223
|
+
exports[`ApplicationDefinitionSelectors should return parametersData from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
224
224
|
|
225
|
-
exports[`ApplicationDefinitionSelectors should return services from
|
225
|
+
exports[`ApplicationDefinitionSelectors should return services from applicationDefinitionConfData1 fixtures 1`] = `
|
226
226
|
Array [
|
227
227
|
Object {
|
228
228
|
"ansibleGroup": "webservers",
|
@@ -304,4 +304,4 @@ Array [
|
|
304
304
|
]
|
305
305
|
`;
|
306
306
|
|
307
|
-
exports[`ApplicationDefinitionSelectors should return showAlertModal from
|
307
|
+
exports[`ApplicationDefinitionSelectors should return showAlertModal from applicationDefinitionConfData1 fixtures 1`] = `undefined`;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import ExtSelect from '../../common/ExtSelect';
|
4
|
-
import RailsData from '../../common/RailsData'
|
4
|
+
import RailsData from '../../common/RailsData';
|
5
5
|
|
6
|
-
const AnsiblePlaybookSelector= ({
|
6
|
+
const AnsiblePlaybookSelector = ({
|
7
7
|
label,
|
8
8
|
hidden,
|
9
9
|
editable,
|
@@ -12,39 +12,44 @@ const AnsiblePlaybookSelector= ({
|
|
12
12
|
onChange,
|
13
13
|
options,
|
14
14
|
additionalData,
|
15
|
-
}) =>
|
16
|
-
|
17
|
-
<
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
/>
|
35
|
-
</div>
|
15
|
+
}) => (
|
16
|
+
<div className="form-group">
|
17
|
+
<label className="col-md-2 control-label">{label}</label>
|
18
|
+
<div className="col-md-4">
|
19
|
+
<ExtSelect
|
20
|
+
hidden={hidden}
|
21
|
+
editable={editable}
|
22
|
+
viewText={viewText}
|
23
|
+
selectValue={selectValue}
|
24
|
+
onChange={onChange}
|
25
|
+
options={options}
|
26
|
+
additionalData={additionalData}
|
27
|
+
/>
|
28
|
+
<RailsData
|
29
|
+
key="ansible_playbook_data"
|
30
|
+
view="app_definition"
|
31
|
+
parameter="acd_ansible_playbook_id"
|
32
|
+
value={selectValue}
|
33
|
+
/>
|
36
34
|
</div>
|
37
|
-
|
38
|
-
|
35
|
+
</div>
|
36
|
+
);
|
39
37
|
|
40
38
|
AnsiblePlaybookSelector.propTypes = {
|
41
39
|
label: PropTypes.string.isRequired,
|
42
40
|
editable: PropTypes.bool.isRequired,
|
43
41
|
viewText: PropTypes.string,
|
44
42
|
selectValue: PropTypes.string,
|
43
|
+
hidden: PropTypes.bool.isRequired,
|
45
44
|
onChange: PropTypes.func.isRequired,
|
46
45
|
options: PropTypes.object,
|
47
46
|
additionalData: PropTypes.object,
|
48
47
|
};
|
48
|
+
AnsiblePlaybookSelector.defaultProps = {
|
49
|
+
viewText: '',
|
50
|
+
selectValue: '',
|
51
|
+
options: undefined,
|
52
|
+
additionalData: undefined,
|
53
|
+
};
|
49
54
|
|
50
55
|
export default AnsiblePlaybookSelector;
|
data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js
CHANGED
@@ -12,7 +12,7 @@ const fixtures = {
|
|
12
12
|
viewText: 'myText',
|
13
13
|
selectValue: '1',
|
14
14
|
onChange: noop,
|
15
|
-
options: { first: 'first', second: 'second'},
|
15
|
+
options: { first: 'first', second: 'second' },
|
16
16
|
additionalData: { moreData: 'moooore' },
|
17
17
|
},
|
18
18
|
'should render hidden ansible playbook selector': {
|
@@ -22,7 +22,7 @@ const fixtures = {
|
|
22
22
|
viewText: 'myText',
|
23
23
|
selectValue: '1',
|
24
24
|
onChange: noop,
|
25
|
-
options: { first: 'first', second: 'second'},
|
25
|
+
options: { first: 'first', second: 'second' },
|
26
26
|
additionalData: { moreData: 'moooore' },
|
27
27
|
},
|
28
28
|
'should render not editable ansible playbook selector': {
|
@@ -32,7 +32,7 @@ const fixtures = {
|
|
32
32
|
viewText: 'myText',
|
33
33
|
selectValue: '1',
|
34
34
|
onChange: noop,
|
35
|
-
options: { first: 'first', second: 'second'},
|
35
|
+
options: { first: 'first', second: 'second' },
|
36
36
|
additionalData: { moreData: 'moooore' },
|
37
37
|
},
|
38
38
|
};
|