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.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +90 -0
  4. data/app/controllers/foreman_acd/app_definitions_controller.rb +104 -7
  5. data/app/controllers/foreman_acd/app_instances_controller.rb +34 -32
  6. data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +1 -1
  7. data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
  8. data/app/controllers/foreman_acd/remote_execution_controller.rb +37 -21
  9. data/app/controllers/ui_acd_controller.rb +42 -3
  10. data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +12 -7
  11. data/app/lib/actions/foreman_acd/run_configurator.rb +11 -7
  12. data/app/models/concerns/foreman_acd/host_managed_extensions.rb +41 -28
  13. data/app/models/foreman_acd/acd_provider.rb +7 -1
  14. data/app/models/foreman_acd/ansible_playbook.rb +2 -1
  15. data/app/models/foreman_acd/app_instance.rb +48 -3
  16. data/app/models/foreman_acd/foreman_host.rb +8 -0
  17. data/app/services/foreman_acd/acd_proxy_proxy_selector.rb +17 -0
  18. data/app/services/foreman_acd/app_configurator.rb +59 -15
  19. data/app/services/foreman_acd/app_deployer.rb +27 -4
  20. data/app/services/foreman_acd/inventory_creator.rb +25 -1
  21. data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +41 -7
  22. data/app/views/foreman_acd/app_definitions/_form.html.erb +5 -1
  23. data/app/views/foreman_acd/app_definitions/import.html.erb +20 -1
  24. data/app/views/foreman_acd/app_definitions/index.html.erb +3 -6
  25. data/app/views/foreman_acd/app_instances/_form.html.erb +5 -1
  26. data/app/views/foreman_acd/app_instances/index.html.erb +18 -12
  27. data/app/views/foreman_acd/app_instances/report.html.erb +8 -3
  28. data/app/views/templates/job/run_acd_ansible_playbook.erb +1 -1
  29. data/app/views/ui_acd/host_report.json.rabl +4 -0
  30. data/app/views/ui_acd/report_data.json.rabl +10 -0
  31. data/app/views/ui_acd/validate_hostname.json.rabl +6 -0
  32. data/config/routes.rb +6 -0
  33. data/db/migrate/20210316151145_add_git_commit_to_ansible_playbooks.rb +8 -0
  34. data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +8 -0
  35. data/db/migrate/20210818125913_add_is_existing_host_to_foreman_host.rb +8 -0
  36. data/db/migrate/20210902110645_add_initial_configure_task.rb +8 -0
  37. data/db/seeds.d/75-job_templates.rb +1 -1
  38. data/lib/foreman_acd/engine.rb +26 -4
  39. data/lib/foreman_acd/plugin.rb +9 -18
  40. data/lib/foreman_acd/version.rb +1 -1
  41. data/lib/foreman_acd.rb +30 -0
  42. data/lib/tasks/foreman_acd_tasks.rake +0 -12
  43. data/package.json +8 -22
  44. data/test/controllers/ansible_playbooks_controller_test.rb +1 -1
  45. data/test/controllers/app_instances_controller_test.rb +8 -3
  46. data/test/controllers/ui_acd_controller_test.rb +25 -6
  47. data/test/factories/foreman_acd_factories.rb +18 -4
  48. data/test/models/acd_provider_test.rb +37 -0
  49. data/test/models/ansible_playbook_test.rb +11 -0
  50. data/test/models/app_definition_test.rb +1 -1
  51. data/test/models/app_instance_test.rb +2 -0
  52. data/test/models/concerns/host_extensions_test.rb +26 -0
  53. data/test/models/foreman_host_test.rb +12 -0
  54. data/webpack/__mocks__/foremanReact/API.js +2 -0
  55. data/webpack/__mocks__/foremanReact/common/I18n.js +3 -0
  56. data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
  57. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
  58. data/webpack/__mocks__/foremanReact/components/ForemanModal.js +7 -0
  59. data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +2 -0
  60. data/webpack/__mocks__/foremanReact/components/common/forms/TextInput.js +2 -0
  61. data/webpack/__mocks__/foremanReact/components/hosts/powerStatus.js +1 -0
  62. data/webpack/__snapshots__/helper.test.js.snap +14 -0
  63. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +35 -11
  64. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +12 -0
  65. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +1 -0
  66. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +30 -9
  67. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +4 -0
  68. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionConfData_1.fixtures.js +288 -0
  69. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +79 -0
  70. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +26 -0
  71. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +119 -0
  72. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +53 -0
  73. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +226 -0
  74. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +3033 -0
  75. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +307 -0
  76. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +2 -1
  77. data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +41 -0
  78. data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +121 -0
  79. data/webpack/components/ApplicationDefinition/index.js +8 -0
  80. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +214 -0
  81. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.scss +1 -0
  82. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +161 -0
  83. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +6 -0
  84. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +79 -0
  85. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +8 -0
  86. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportConfData_1.fixtures.js +129 -0
  87. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +29 -0
  88. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +20 -0
  89. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +43 -0
  90. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +29 -0
  91. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +62 -0
  92. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportReducer.test.js.snap +362 -0
  93. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +130 -0
  94. data/webpack/components/ApplicationDefinitionImport/index.js +32 -0
  95. data/webpack/components/ApplicationInstance/ApplicationInstance.js +105 -31
  96. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +118 -6
  97. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +4 -0
  98. data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +15 -0
  99. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +71 -30
  100. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +4 -0
  101. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceConfData_1.fixtures.js +263 -0
  102. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +80 -0
  103. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +24 -0
  104. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +131 -0
  105. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +56 -0
  106. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +300 -0
  107. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2990 -0
  108. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +284 -0
  109. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +1 -0
  110. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +1 -1
  111. data/webpack/components/ApplicationInstance/helper.js +0 -0
  112. data/webpack/components/ApplicationInstance/index.js +8 -0
  113. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +81 -6
  114. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +35 -1
  115. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +3 -0
  116. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +19 -0
  117. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +4 -0
  118. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportData_1.fixtures.js +349 -0
  119. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +20 -0
  120. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +47 -0
  121. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportReducer.test.js +41 -0
  122. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +26 -0
  123. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +7 -0
  124. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +718 -0
  125. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +347 -0
  126. data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +24 -0
  127. data/webpack/components/ApplicationInstanceReport/components/__tests__/__snapshots__/ReportViewer.test.js.snap +24 -0
  128. data/webpack/components/ApplicationInstanceReport/index.js +8 -1
  129. data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +104 -0
  130. data/webpack/components/ExistingHostSelection/ExistingHostSelection.scss +15 -0
  131. data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +71 -0
  132. data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +4 -0
  133. data/webpack/components/ExistingHostSelection/ExistingHostSelectionHelper.js +0 -0
  134. data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +90 -0
  135. data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -0
  136. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +191 -0
  137. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +203 -0
  138. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +19 -0
  139. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionReducer.test.js +59 -0
  140. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +36 -0
  141. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelection.test.js.snap +35 -0
  142. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionReducer.test.js.snap +614 -0
  143. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +27 -0
  144. data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +48 -0
  145. data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +35 -0
  146. data/webpack/components/ExistingHostSelection/components/__tests__/__snapshots__/ServiceSelector.test.js.snap +77 -0
  147. data/webpack/components/ExistingHostSelection/index.js +26 -0
  148. data/webpack/components/ParameterSelection/ParameterSelection.js +103 -1
  149. data/webpack/components/ParameterSelection/ParameterSelection.scss +7 -0
  150. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +46 -4
  151. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +2 -0
  152. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +5 -1
  153. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +51 -29
  154. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -0
  155. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +124 -84
  156. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +10 -4
  157. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +36 -46
  158. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +33 -25
  159. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +12 -6
  160. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +84 -112
  161. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1589 -878
  162. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +130 -79
  163. data/webpack/components/ParameterSelection/index.js +4 -1
  164. data/webpack/components/SyncGitRepo/SyncGitRepo.js +202 -0
  165. data/webpack/components/SyncGitRepo/SyncGitRepo.scss +1 -0
  166. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +123 -0
  167. data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +8 -0
  168. data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +80 -0
  169. data/webpack/components/SyncGitRepo/SyncGitRepoSelectors.js +6 -0
  170. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +7 -0
  171. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +44 -0
  172. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +27 -0
  173. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoReducer.test.js +95 -0
  174. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +32 -0
  175. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +31 -0
  176. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoReducer.test.js.snap +137 -0
  177. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +13 -0
  178. data/webpack/components/SyncGitRepo/components/FormTextInput.js +42 -0
  179. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +47 -0
  180. data/webpack/components/SyncGitRepo/index.js +28 -0
  181. data/webpack/components/common/DeleteTableEntry.js +16 -2
  182. data/webpack/components/common/ExtTextInput.js +43 -0
  183. data/webpack/components/common/__tests__/EditTableEntry.test.js +53 -0
  184. data/webpack/components/common/__tests__/LockTableEntry.test.js +35 -0
  185. data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +40 -2
  186. data/webpack/components/common/__tests__/__snapshots__/EditTableEntry.test.js.snap +81 -0
  187. data/webpack/components/common/__tests__/__snapshots__/LockTableEntry.test.js.snap +60 -0
  188. data/webpack/helper.js +35 -1
  189. data/webpack/helper.test.js +56 -0
  190. data/webpack/index.js +7 -0
  191. data/webpack/js-yaml.js +3874 -0
  192. data/webpack/reducer.js +16 -1
  193. data/webpack/test_setup.js +0 -2
  194. metadata +136 -11
  195. data/webpack/components/common/EasyHeaderFormatter.js +0 -18
  196. data/webpack/components/common/__tests__/__snapshots__/AddParameter.test.js.snap +0 -35
  197. data/webpack/components/common/__tests__/__snapshots__/DeleteParameter.test.js.snap +0 -41
@@ -0,0 +1,29 @@
1
+ import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
2
+
3
+ import {
4
+ selectEditMode,
5
+ selectAnsiblePlaybookServices,
6
+ selectColumns,
7
+ } from '../ApplicationDefinitionImportSelectors';
8
+
9
+ import {
10
+ applicationDefinitionImportConfData_1,
11
+ } from '../__fixtures__/applicationDefinitionImportConfData_1.fixtures';
12
+
13
+ const stateFactory = obj => ({
14
+ foremanAcd: {
15
+ applicationDefinitionImportConf: obj,
16
+ },
17
+ });
18
+
19
+ const fixtures = {
20
+ 'should return editMode from applicationDefinitionImportConfData_1 fixtures': () =>
21
+ selectEditMode(stateFactory(applicationDefinitionImportConfData_1)),
22
+ 'should return services from applicationDefinitionImportConfData_1 fixtures': () =>
23
+ selectAnsiblePlaybookServices(stateFactory(applicationDefinitionImportConfData_1)),
24
+ 'should return columns from applicationDefinitionImportConfData_1 fixtures': () =>
25
+ selectColumns(stateFactory(applicationDefinitionImportConfData_1)),
26
+ };
27
+
28
+ describe('ApplicationDefinitionImportSelectors', () =>
29
+ testSelectorsSnapshotWithFixtures(fixtures));
@@ -0,0 +1,62 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ApplicationDefinitionImport should render application definition import 1`] = `
4
+ <span>
5
+ <Component />
6
+ <Component />
7
+ <MessageDialog
8
+ accessibleDescription=""
9
+ accessibleName=""
10
+ className=""
11
+ enforceFocus={true}
12
+ footer={null}
13
+ icon={
14
+ <Icon
15
+ name="error-circle-o"
16
+ type="pf"
17
+ />
18
+ }
19
+ onHide={[Function]}
20
+ primaryAction={[Function]}
21
+ primaryActionButtonBsStyle="danger"
22
+ primaryActionButtonContent="OK"
23
+ primaryContent=""
24
+ secondaryAction={[Function]}
25
+ secondaryActionButtonBsStyle="default"
26
+ secondaryActionButtonContent={null}
27
+ secondaryContent={null}
28
+ show={false}
29
+ title=""
30
+ />
31
+ <div>
32
+ <CommonForm
33
+ className="custom-file-upload"
34
+ label="Application Definition file"
35
+ >
36
+ <input
37
+ onChange={[Function]}
38
+ type="file"
39
+ />
40
+ </CommonForm>
41
+ <CommonForm>
42
+ <Button
43
+ active={false}
44
+ block={false}
45
+ bsClass="btn"
46
+ bsStyle="default"
47
+ disabled={false}
48
+ onClick={[Function]}
49
+ >
50
+ Import
51
+
52
+ </Button>
53
+ </CommonForm>
54
+ </div>
55
+ <RailsData
56
+ key="applications_definition_import"
57
+ parameter="services"
58
+ value="[]"
59
+ view="app_definition_import"
60
+ />
61
+ </span>
62
+ `;
@@ -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);