foreman_acd 0.6.0 → 0.9.1
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 +90 -0
- data/app/controllers/foreman_acd/app_definitions_controller.rb +104 -7
- data/app/controllers/foreman_acd/app_instances_controller.rb +34 -32
- data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
- data/app/controllers/foreman_acd/remote_execution_controller.rb +37 -21
- data/app/controllers/ui_acd_controller.rb +42 -3
- data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +12 -7
- data/app/lib/actions/foreman_acd/run_configurator.rb +11 -7
- data/app/models/concerns/foreman_acd/host_managed_extensions.rb +41 -28
- data/app/models/foreman_acd/acd_provider.rb +7 -1
- data/app/models/foreman_acd/ansible_playbook.rb +2 -1
- data/app/models/foreman_acd/app_instance.rb +48 -3
- data/app/models/foreman_acd/foreman_host.rb +8 -0
- data/app/services/foreman_acd/acd_proxy_proxy_selector.rb +17 -0
- data/app/services/foreman_acd/app_configurator.rb +59 -15
- data/app/services/foreman_acd/app_deployer.rb +27 -4
- data/app/services/foreman_acd/inventory_creator.rb +25 -1
- data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +41 -7
- data/app/views/foreman_acd/app_definitions/_form.html.erb +5 -1
- 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 +5 -1
- data/app/views/foreman_acd/app_instances/index.html.erb +18 -12
- data/app/views/foreman_acd/app_instances/report.html.erb +8 -3
- data/app/views/templates/job/run_acd_ansible_playbook.erb +1 -1
- 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 +6 -0
- data/db/migrate/20210316151145_add_git_commit_to_ansible_playbooks.rb +8 -0
- data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +8 -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/db/seeds.d/75-job_templates.rb +1 -1
- data/lib/foreman_acd/engine.rb +26 -4
- data/lib/foreman_acd/plugin.rb +9 -18
- data/lib/foreman_acd/version.rb +1 -1
- data/lib/foreman_acd.rb +30 -0
- data/lib/tasks/foreman_acd_tasks.rake +0 -12
- data/package.json +8 -22
- data/test/controllers/ansible_playbooks_controller_test.rb +1 -1
- data/test/controllers/app_instances_controller_test.rb +8 -3
- data/test/controllers/ui_acd_controller_test.rb +25 -6
- data/test/factories/foreman_acd_factories.rb +18 -4
- data/test/models/acd_provider_test.rb +37 -0
- data/test/models/ansible_playbook_test.rb +11 -0
- data/test/models/app_definition_test.rb +1 -1
- data/test/models/app_instance_test.rb +2 -0
- data/test/models/concerns/host_extensions_test.rb +26 -0
- data/test/models/foreman_host_test.rb +12 -0
- data/webpack/__mocks__/foremanReact/API.js +2 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +3 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
- data/webpack/__mocks__/foremanReact/components/ForemanModal.js +7 -0
- data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +2 -0
- data/webpack/__mocks__/foremanReact/components/common/forms/TextInput.js +2 -0
- data/webpack/__mocks__/foremanReact/components/hosts/powerStatus.js +1 -0
- data/webpack/__snapshots__/helper.test.js.snap +14 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +35 -11
- 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/__fixtures__/applicationDefinitionConfData_1.fixtures.js +288 -0
- data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +79 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +26 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +119 -0
- data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +53 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +226 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +3033 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +307 -0
- data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +2 -1
- data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +41 -0
- data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +121 -0
- 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 +105 -31
- 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__/applicationInstanceConfData_1.fixtures.js +263 -0
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +80 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +24 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +131 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +56 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +300 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2990 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +284 -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/__fixtures__/applicationInstanceReportData_1.fixtures.js +349 -0
- data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +20 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +47 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportReducer.test.js +41 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +26 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +7 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +718 -0
- data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +347 -0
- data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +24 -0
- data/webpack/components/ApplicationInstanceReport/components/__tests__/__snapshots__/ReportViewer.test.js.snap +24 -0
- 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 +51 -29
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +124 -84
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +10 -4
- data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +36 -46
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +33 -25
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +12 -6
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +84 -112
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1589 -878
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +130 -79
- data/webpack/components/ParameterSelection/index.js +4 -1
- data/webpack/components/SyncGitRepo/SyncGitRepo.js +202 -0
- data/webpack/components/SyncGitRepo/SyncGitRepo.scss +1 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +123 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +8 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +80 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoSelectors.js +6 -0
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +7 -0
- data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +44 -0
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +27 -0
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoReducer.test.js +95 -0
- data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +32 -0
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +31 -0
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoReducer.test.js.snap +137 -0
- data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +13 -0
- data/webpack/components/SyncGitRepo/components/FormTextInput.js +42 -0
- data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +47 -0
- data/webpack/components/SyncGitRepo/index.js +28 -0
- data/webpack/components/common/DeleteTableEntry.js +16 -2
- data/webpack/components/common/ExtTextInput.js +43 -0
- data/webpack/components/common/__tests__/EditTableEntry.test.js +53 -0
- data/webpack/components/common/__tests__/LockTableEntry.test.js +35 -0
- data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +40 -2
- data/webpack/components/common/__tests__/__snapshots__/EditTableEntry.test.js.snap +81 -0
- data/webpack/components/common/__tests__/__snapshots__/LockTableEntry.test.js.snap +60 -0
- data/webpack/helper.js +35 -1
- data/webpack/helper.test.js +56 -0
- data/webpack/index.js +7 -0
- data/webpack/js-yaml.js +3874 -0
- data/webpack/reducer.js +16 -1
- data/webpack/test_setup.js +0 -2
- metadata +136 -11
- data/webpack/components/common/EasyHeaderFormatter.js +0 -18
- data/webpack/components/common/__tests__/__snapshots__/AddParameter.test.js.snap +0 -35
- data/webpack/components/common/__tests__/__snapshots__/DeleteParameter.test.js.snap +0 -41
@@ -0,0 +1,307 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ApplicationDefinitionSelectors should return ParamEditMode from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
4
|
+
|
5
|
+
exports[`ApplicationDefinitionSelectors should return alertModalText from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
6
|
+
|
7
|
+
exports[`ApplicationDefinitionSelectors should return alertModalTitle from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
8
|
+
|
9
|
+
exports[`ApplicationDefinitionSelectors should return ansiblePlaybook from applicationDefinitionConfData_1 fixtures 1`] = `
|
10
|
+
Object {
|
11
|
+
"groups": Object {
|
12
|
+
"all": Array [
|
13
|
+
Object {
|
14
|
+
"id": 0,
|
15
|
+
"name": "repository",
|
16
|
+
"value": "https://github.com/bennojoy/mywebapp.git",
|
17
|
+
},
|
18
|
+
],
|
19
|
+
"dbservers": Array [
|
20
|
+
Object {
|
21
|
+
"id": 0,
|
22
|
+
"name": "mysqlservice",
|
23
|
+
"value": "mysqld",
|
24
|
+
},
|
25
|
+
Object {
|
26
|
+
"id": 1,
|
27
|
+
"name": "mysql_port",
|
28
|
+
"value": "3306",
|
29
|
+
},
|
30
|
+
Object {
|
31
|
+
"id": 2,
|
32
|
+
"name": "dbuser",
|
33
|
+
"value": "webapp",
|
34
|
+
},
|
35
|
+
Object {
|
36
|
+
"id": 3,
|
37
|
+
"name": "dbname",
|
38
|
+
"value": "ANSAP01",
|
39
|
+
},
|
40
|
+
Object {
|
41
|
+
"id": 4,
|
42
|
+
"name": "upassword",
|
43
|
+
"value": "Bond@007",
|
44
|
+
},
|
45
|
+
Object {
|
46
|
+
"id": 5,
|
47
|
+
"name": "masterpassword",
|
48
|
+
"value": "MySQL@007",
|
49
|
+
},
|
50
|
+
],
|
51
|
+
"webservers": Array [
|
52
|
+
Object {
|
53
|
+
"id": 0,
|
54
|
+
"name": "dummy_var",
|
55
|
+
"value": "0",
|
56
|
+
},
|
57
|
+
],
|
58
|
+
},
|
59
|
+
"id": 2,
|
60
|
+
"name": "LAMP",
|
61
|
+
}
|
62
|
+
`;
|
63
|
+
|
64
|
+
exports[`ApplicationDefinitionSelectors should return ansibleVarsAll from applicationDefinitionConfData_1 fixtures 1`] = `
|
65
|
+
Array [
|
66
|
+
Object {
|
67
|
+
"id": 0,
|
68
|
+
"name": "repository",
|
69
|
+
"value": "https://github.com/bennojoy/mywebapp.git",
|
70
|
+
},
|
71
|
+
]
|
72
|
+
`;
|
73
|
+
|
74
|
+
exports[`ApplicationDefinitionSelectors should return columns from applicationDefinitionConfData_1 fixtures 1`] = `
|
75
|
+
Array [
|
76
|
+
Object {
|
77
|
+
"cell": Object {
|
78
|
+
"formatters": Array [
|
79
|
+
null,
|
80
|
+
],
|
81
|
+
},
|
82
|
+
"header": Object {
|
83
|
+
"formatters": Array [
|
84
|
+
null,
|
85
|
+
],
|
86
|
+
"label": "Name",
|
87
|
+
"props": Object {
|
88
|
+
"index": 0,
|
89
|
+
"style": Object {
|
90
|
+
"width": "15%",
|
91
|
+
},
|
92
|
+
},
|
93
|
+
},
|
94
|
+
"property": "name",
|
95
|
+
},
|
96
|
+
Object {
|
97
|
+
"cell": Object {
|
98
|
+
"formatters": Array [
|
99
|
+
null,
|
100
|
+
],
|
101
|
+
},
|
102
|
+
"header": Object {
|
103
|
+
"formatters": Array [
|
104
|
+
null,
|
105
|
+
],
|
106
|
+
"label": "Description",
|
107
|
+
"props": Object {
|
108
|
+
"index": 1,
|
109
|
+
"style": Object {
|
110
|
+
"width": "10%",
|
111
|
+
},
|
112
|
+
},
|
113
|
+
},
|
114
|
+
"property": "description",
|
115
|
+
},
|
116
|
+
Object {
|
117
|
+
"cell": Object {
|
118
|
+
"formatters": Array [
|
119
|
+
null,
|
120
|
+
],
|
121
|
+
},
|
122
|
+
"header": Object {
|
123
|
+
"formatters": Array [
|
124
|
+
null,
|
125
|
+
],
|
126
|
+
"label": "Hostgroup",
|
127
|
+
"props": Object {
|
128
|
+
"index": 2,
|
129
|
+
"style": Object {
|
130
|
+
"width": "20%",
|
131
|
+
},
|
132
|
+
},
|
133
|
+
},
|
134
|
+
"property": "hostgroup",
|
135
|
+
},
|
136
|
+
Object {
|
137
|
+
"cell": Object {
|
138
|
+
"formatters": Array [
|
139
|
+
null,
|
140
|
+
],
|
141
|
+
},
|
142
|
+
"header": Object {
|
143
|
+
"formatters": Array [
|
144
|
+
null,
|
145
|
+
],
|
146
|
+
"label": "Ansible Group",
|
147
|
+
"props": Object {
|
148
|
+
"index": 3,
|
149
|
+
"style": Object {
|
150
|
+
"width": "20%",
|
151
|
+
},
|
152
|
+
},
|
153
|
+
},
|
154
|
+
"property": "ansibleGroup",
|
155
|
+
},
|
156
|
+
Object {
|
157
|
+
"cell": Object {
|
158
|
+
"formatters": Array [
|
159
|
+
null,
|
160
|
+
],
|
161
|
+
},
|
162
|
+
"header": Object {
|
163
|
+
"formatters": Array [
|
164
|
+
null,
|
165
|
+
],
|
166
|
+
"label": "min count",
|
167
|
+
"props": Object {
|
168
|
+
"index": 4,
|
169
|
+
"style": Object {
|
170
|
+
"width": "10%",
|
171
|
+
},
|
172
|
+
},
|
173
|
+
},
|
174
|
+
"property": "minCount",
|
175
|
+
},
|
176
|
+
Object {
|
177
|
+
"cell": Object {
|
178
|
+
"formatters": Array [
|
179
|
+
null,
|
180
|
+
],
|
181
|
+
},
|
182
|
+
"header": Object {
|
183
|
+
"formatters": Array [
|
184
|
+
null,
|
185
|
+
],
|
186
|
+
"label": "max count",
|
187
|
+
"props": Object {
|
188
|
+
"index": 5,
|
189
|
+
"style": Object {
|
190
|
+
"width": "10%",
|
191
|
+
},
|
192
|
+
},
|
193
|
+
},
|
194
|
+
"property": "maxCount",
|
195
|
+
},
|
196
|
+
Object {
|
197
|
+
"cell": Object {
|
198
|
+
"formatters": Array [
|
199
|
+
null,
|
200
|
+
],
|
201
|
+
},
|
202
|
+
"header": Object {
|
203
|
+
"formatters": Array [
|
204
|
+
null,
|
205
|
+
],
|
206
|
+
"label": "Actions",
|
207
|
+
"props": Object {
|
208
|
+
"index": 6,
|
209
|
+
"style": Object {
|
210
|
+
"width": "15%",
|
211
|
+
},
|
212
|
+
},
|
213
|
+
},
|
214
|
+
"property": "actions",
|
215
|
+
},
|
216
|
+
]
|
217
|
+
`;
|
218
|
+
|
219
|
+
exports[`ApplicationDefinitionSelectors should return editMode from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
220
|
+
|
221
|
+
exports[`ApplicationDefinitionSelectors should return hiddenForemanParameterTypes from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
222
|
+
|
223
|
+
exports[`ApplicationDefinitionSelectors should return parametersData from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
224
|
+
|
225
|
+
exports[`ApplicationDefinitionSelectors should return services from applicationDefinitionConfData_1 fixtures 1`] = `
|
226
|
+
Array [
|
227
|
+
Object {
|
228
|
+
"ansibleGroup": "webservers",
|
229
|
+
"ansibleParameters": Array [
|
230
|
+
Object {
|
231
|
+
"id": 0,
|
232
|
+
"name": "dummy_var",
|
233
|
+
"value": "0",
|
234
|
+
},
|
235
|
+
],
|
236
|
+
"description": "",
|
237
|
+
"foremanParameters": Array [
|
238
|
+
Object {
|
239
|
+
"description": "",
|
240
|
+
"id": 1,
|
241
|
+
"locked": false,
|
242
|
+
"name": "CP",
|
243
|
+
"type": "computeprofile",
|
244
|
+
"value": "1",
|
245
|
+
},
|
246
|
+
Object {
|
247
|
+
"description": "",
|
248
|
+
"id": 2,
|
249
|
+
"locked": true,
|
250
|
+
"name": "LE",
|
251
|
+
"type": "lifecycleenv",
|
252
|
+
"value": "1",
|
253
|
+
},
|
254
|
+
],
|
255
|
+
"hostgroup": "1",
|
256
|
+
"id": 1,
|
257
|
+
"maxCount": "",
|
258
|
+
"minCount": "2",
|
259
|
+
"name": "web",
|
260
|
+
},
|
261
|
+
Object {
|
262
|
+
"ansibleGroup": "dbservers",
|
263
|
+
"ansibleParameters": Array [
|
264
|
+
Object {
|
265
|
+
"id": 0,
|
266
|
+
"name": "mysqlservice",
|
267
|
+
"value": "mysqld",
|
268
|
+
},
|
269
|
+
Object {
|
270
|
+
"id": 1,
|
271
|
+
"locked": true,
|
272
|
+
"name": "mysql_port",
|
273
|
+
"value": "3306",
|
274
|
+
},
|
275
|
+
Object {
|
276
|
+
"id": 2,
|
277
|
+
"name": "dbuser",
|
278
|
+
"value": "webapp",
|
279
|
+
},
|
280
|
+
Object {
|
281
|
+
"id": 3,
|
282
|
+
"name": "dbname",
|
283
|
+
"value": "ANSAP01",
|
284
|
+
},
|
285
|
+
Object {
|
286
|
+
"id": 4,
|
287
|
+
"name": "upassword",
|
288
|
+
"value": "Bond@007",
|
289
|
+
},
|
290
|
+
Object {
|
291
|
+
"id": 5,
|
292
|
+
"name": "masterpassword",
|
293
|
+
"value": "MySQL@007",
|
294
|
+
},
|
295
|
+
],
|
296
|
+
"description": "",
|
297
|
+
"foremanParameters": Array [],
|
298
|
+
"hostgroup": "1",
|
299
|
+
"id": 2,
|
300
|
+
"maxCount": "",
|
301
|
+
"minCount": "1",
|
302
|
+
"name": "db",
|
303
|
+
},
|
304
|
+
]
|
305
|
+
`;
|
306
|
+
|
307
|
+
exports[`ApplicationDefinitionSelectors should return showAlertModal from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
@@ -18,6 +18,7 @@ const AnsiblePlaybookSelector= ({
|
|
18
18
|
<label className="col-md-2 control-label">{label}</label>
|
19
19
|
<div className="col-md-4">
|
20
20
|
<ExtSelect
|
21
|
+
hidden={hidden}
|
21
22
|
editable={editable}
|
22
23
|
viewText={viewText}
|
23
24
|
selectValue={selectValue}
|
@@ -26,7 +27,7 @@ const AnsiblePlaybookSelector= ({
|
|
26
27
|
additionalData={additionalData}
|
27
28
|
/>
|
28
29
|
<RailsData
|
29
|
-
key='
|
30
|
+
key='ansible_playbook_data'
|
30
31
|
view='app_definition'
|
31
32
|
parameter='acd_ansible_playbook_id'
|
32
33
|
value={selectValue}
|
data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import AnsiblePlaybookSelector from '../AnsiblePlaybookSelector';
|
4
|
+
|
5
|
+
const noop = () => {};
|
6
|
+
|
7
|
+
const fixtures = {
|
8
|
+
'should render ansible playbook selector': {
|
9
|
+
label: 'myLabel',
|
10
|
+
hidden: false,
|
11
|
+
editable: true,
|
12
|
+
viewText: 'myText',
|
13
|
+
selectValue: '1',
|
14
|
+
onChange: noop,
|
15
|
+
options: { first: 'first', second: 'second'},
|
16
|
+
additionalData: { moreData: 'moooore' },
|
17
|
+
},
|
18
|
+
'should render hidden ansible playbook selector': {
|
19
|
+
label: 'myLabel',
|
20
|
+
hidden: true,
|
21
|
+
editable: true,
|
22
|
+
viewText: 'myText',
|
23
|
+
selectValue: '1',
|
24
|
+
onChange: noop,
|
25
|
+
options: { first: 'first', second: 'second'},
|
26
|
+
additionalData: { moreData: 'moooore' },
|
27
|
+
},
|
28
|
+
'should render not editable ansible playbook selector': {
|
29
|
+
label: 'myLabel',
|
30
|
+
hidden: false,
|
31
|
+
editable: false,
|
32
|
+
viewText: 'myText',
|
33
|
+
selectValue: '1',
|
34
|
+
onChange: noop,
|
35
|
+
options: { first: 'first', second: 'second'},
|
36
|
+
additionalData: { moreData: 'moooore' },
|
37
|
+
},
|
38
|
+
};
|
39
|
+
|
40
|
+
describe('AnsiblePlaybookSelector', () =>
|
41
|
+
testComponentSnapshotsWithFixtures(AnsiblePlaybookSelector, fixtures));
|
@@ -0,0 +1,121 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`AnsiblePlaybookSelector should render ansible playbook selector 1`] = `
|
4
|
+
<div
|
5
|
+
className="form-group"
|
6
|
+
>
|
7
|
+
<label
|
8
|
+
className="col-md-2 control-label"
|
9
|
+
>
|
10
|
+
myLabel
|
11
|
+
</label>
|
12
|
+
<div
|
13
|
+
className="col-md-4"
|
14
|
+
>
|
15
|
+
<ExtSelect
|
16
|
+
additionalData={
|
17
|
+
Object {
|
18
|
+
"moreData": "moooore",
|
19
|
+
}
|
20
|
+
}
|
21
|
+
editable={true}
|
22
|
+
hidden={false}
|
23
|
+
onChange={[Function]}
|
24
|
+
options={
|
25
|
+
Object {
|
26
|
+
"first": "first",
|
27
|
+
"second": "second",
|
28
|
+
}
|
29
|
+
}
|
30
|
+
selectValue="1"
|
31
|
+
viewText="myText"
|
32
|
+
/>
|
33
|
+
<RailsData
|
34
|
+
key="ansible_playbook_data"
|
35
|
+
parameter="acd_ansible_playbook_id"
|
36
|
+
value="1"
|
37
|
+
view="app_definition"
|
38
|
+
/>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
`;
|
42
|
+
|
43
|
+
exports[`AnsiblePlaybookSelector should render hidden ansible playbook selector 1`] = `
|
44
|
+
<div
|
45
|
+
className="form-group"
|
46
|
+
>
|
47
|
+
<label
|
48
|
+
className="col-md-2 control-label"
|
49
|
+
>
|
50
|
+
myLabel
|
51
|
+
</label>
|
52
|
+
<div
|
53
|
+
className="col-md-4"
|
54
|
+
>
|
55
|
+
<ExtSelect
|
56
|
+
additionalData={
|
57
|
+
Object {
|
58
|
+
"moreData": "moooore",
|
59
|
+
}
|
60
|
+
}
|
61
|
+
editable={true}
|
62
|
+
hidden={true}
|
63
|
+
onChange={[Function]}
|
64
|
+
options={
|
65
|
+
Object {
|
66
|
+
"first": "first",
|
67
|
+
"second": "second",
|
68
|
+
}
|
69
|
+
}
|
70
|
+
selectValue="1"
|
71
|
+
viewText="myText"
|
72
|
+
/>
|
73
|
+
<RailsData
|
74
|
+
key="ansible_playbook_data"
|
75
|
+
parameter="acd_ansible_playbook_id"
|
76
|
+
value="1"
|
77
|
+
view="app_definition"
|
78
|
+
/>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
`;
|
82
|
+
|
83
|
+
exports[`AnsiblePlaybookSelector should render not editable ansible playbook selector 1`] = `
|
84
|
+
<div
|
85
|
+
className="form-group"
|
86
|
+
>
|
87
|
+
<label
|
88
|
+
className="col-md-2 control-label"
|
89
|
+
>
|
90
|
+
myLabel
|
91
|
+
</label>
|
92
|
+
<div
|
93
|
+
className="col-md-4"
|
94
|
+
>
|
95
|
+
<ExtSelect
|
96
|
+
additionalData={
|
97
|
+
Object {
|
98
|
+
"moreData": "moooore",
|
99
|
+
}
|
100
|
+
}
|
101
|
+
editable={false}
|
102
|
+
hidden={false}
|
103
|
+
onChange={[Function]}
|
104
|
+
options={
|
105
|
+
Object {
|
106
|
+
"first": "first",
|
107
|
+
"second": "second",
|
108
|
+
}
|
109
|
+
}
|
110
|
+
selectValue="1"
|
111
|
+
viewText="myText"
|
112
|
+
/>
|
113
|
+
<RailsData
|
114
|
+
key="ansible_playbook_data"
|
115
|
+
parameter="acd_ansible_playbook_id"
|
116
|
+
value="1"
|
117
|
+
view="app_definition"
|
118
|
+
/>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
`;
|
@@ -6,20 +6,28 @@ import ApplicationDefinition from './ApplicationDefinition';
|
|
6
6
|
import * as ApplicationDefinitionActions from './ApplicationDefinitionActions';
|
7
7
|
|
8
8
|
import {
|
9
|
+
selectShowAlertModal,
|
10
|
+
selectAlertModalText,
|
11
|
+
selectAlertModalTitle,
|
9
12
|
selectEditMode,
|
10
13
|
selectAnsiblePlaybook,
|
11
14
|
selectServices,
|
12
15
|
selectColumns,
|
16
|
+
selectHiddenForemanParameterTypes,
|
13
17
|
selectParametersData,
|
14
18
|
selectAnsibleVarsAll,
|
15
19
|
selectParamEditMode,
|
16
20
|
} from './ApplicationDefinitionSelectors';
|
17
21
|
|
18
22
|
const mapStateToProps = state => ({
|
23
|
+
showAlertModal: selectShowAlertModal(state),
|
24
|
+
alertModalText: selectAlertModalText(state),
|
25
|
+
alertModalTitle: selectAlertModalTitle(state),
|
19
26
|
editMode: selectEditMode(state),
|
20
27
|
ansiblePlaybook: selectAnsiblePlaybook(state),
|
21
28
|
services: selectServices(state),
|
22
29
|
columns: selectColumns(state),
|
30
|
+
hiddenForemanParameterTypes: selectHiddenForemanParameterTypes(state),
|
23
31
|
parametersData: selectParametersData(state),
|
24
32
|
ansibleVarsAll: selectAnsibleVarsAll(state),
|
25
33
|
paramEditMode: selectParamEditMode(state),
|