foreman_acd 0.4.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +84 -84
- data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +103 -11
- data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +21 -3
- data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +1 -0
- data/app/controllers/foreman_acd/api/v2/app_instances_controller.rb +9 -1
- data/app/controllers/foreman_acd/app_definitions_controller.rb +117 -15
- data/app/controllers/foreman_acd/app_instances_controller.rb +104 -30
- data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
- data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +1 -1
- data/app/controllers/foreman_acd/remote_execution_controller.rb +36 -23
- data/app/controllers/ui_acd_controller.rb +46 -0
- data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +47 -0
- data/app/lib/actions/foreman_acd/run_configurator.rb +45 -0
- data/app/models/concerns/foreman_acd/host_managed_extensions.rb +39 -0
- data/app/models/foreman_acd/acd_provider.rb +36 -0
- data/app/models/foreman_acd/ansible_playbook.rb +32 -14
- data/app/models/foreman_acd/app_definition.rb +24 -1
- data/app/models/foreman_acd/app_instance.rb +85 -5
- data/app/models/foreman_acd/foreman_host.rb +31 -0
- data/app/models/foreman_acd/taxonomy_extensions.rb +17 -0
- data/app/services/foreman_acd/acd_proxy_proxy_selector.rb +17 -0
- data/app/services/foreman_acd/app_configurator.rb +64 -36
- data/app/services/foreman_acd/app_deployer.rb +83 -48
- data/app/services/foreman_acd/inventory_creator.rb +36 -25
- data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +50 -7
- data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +9 -1
- data/app/views/foreman_acd/ansible_playbooks/index.html.erb +3 -3
- data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +6 -0
- data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +6 -0
- data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +3 -1
- data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +2 -0
- data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +2 -0
- data/app/views/foreman_acd/app_definitions/_form.html.erb +9 -1
- data/app/views/foreman_acd/app_definitions/edit.html.erb +10 -5
- data/app/views/foreman_acd/app_definitions/import.html.erb +20 -1
- data/app/views/foreman_acd/app_definitions/index.html.erb +5 -8
- data/app/views/foreman_acd/app_instances/_form.html.erb +4 -4
- data/app/views/foreman_acd/app_instances/edit.html.erb +10 -0
- data/app/views/foreman_acd/app_instances/index.html.erb +93 -14
- data/app/views/foreman_acd/app_instances/report.html.erb +12 -4
- data/app/views/templates/job/run_acd_ansible_playbook.erb +28 -15
- data/app/views/ui_acd/app_definition.json.rabl +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 +12 -3
- data/db/migrate/20200917120220_add_ansible_playbook_id.rb +1 -1
- data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +3 -0
- data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +3 -0
- data/db/migrate/20210112111548_add_organization_to_app_instance.rb +22 -0
- data/db/migrate/20210112113853_add_location_to_app_instance.rb +8 -0
- data/db/migrate/20210202141658_create_foreman_hosts.rb +24 -0
- data/db/migrate/20210204111306_remove_hosts_from_app_instances.rb +8 -0
- data/db/migrate/20210209091014_rename_acd_tables.rb +16 -0
- data/db/migrate/20210216083522_add_last_progress_report.rb +8 -0
- data/db/migrate/20210216091529_add_last_deploy_task.rb +8 -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/62_acd_proxy_feature.rb +4 -0
- data/db/seeds.d/75-job_templates.rb +6 -1
- data/lib/foreman_acd/engine.rb +40 -3
- data/lib/foreman_acd/plugin.rb +60 -45
- 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/locale/en/foreman_acd.edit.po +326 -0
- data/locale/en/foreman_acd.po +232 -2
- data/{app/controllers/foreman_acd/api/v2/app_playbooks_controller.rb → locale/en/foreman_acd.po.time_stamp} +0 -0
- data/locale/foreman_acd.pot +343 -8
- data/package.json +8 -8
- data/test/controllers/ansible_playbooks_controller_test.rb +27 -0
- data/test/controllers/app_instances_controller_test.rb +8 -3
- data/test/controllers/ui_acd_controller_test.rb +22 -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 +55 -21
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +14 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +2 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +48 -1
- 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 +41 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +225 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +3033 -0
- data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +299 -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 +153 -45
- data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +120 -6
- data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +5 -0
- data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +15 -0
- data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +77 -22
- 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 +44 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +299 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2990 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +276 -0
- data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +1 -0
- data/webpack/components/ApplicationInstance/components/Service.js +1 -1
- 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 +128 -60
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss +17 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +40 -50
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +5 -4
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +19 -14
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +4 -1
- 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/ReportViewer.js +1 -1
- 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 -3
- 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 +138 -15
- data/webpack/components/ParameterSelection/ParameterSelection.scss +7 -0
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +52 -9
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +3 -0
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +62 -25
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +1 -0
- data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +116 -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 +6 -6
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +84 -112
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1488 -872
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +117 -79
- data/webpack/components/ParameterSelection/index.js +2 -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 +18 -4
- data/webpack/components/common/EditTableEntry.js +50 -0
- data/webpack/components/common/ExtTextInput.js +43 -0
- data/webpack/components/common/LockTableEntry.js +60 -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 +20 -1
- data/webpack/helper.test.js +37 -0
- data/webpack/index.js +7 -0
- data/webpack/js-yaml.js +3874 -0
- data/webpack/reducer.js +16 -1
- metadata +182 -11
- data/app/views/foreman_acd/app_instances/deploy.html.erb +0 -19
- 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,299 @@
|
|
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 ansiblePlaybook from applicationDefinitionConfData_1 fixtures 1`] = `
|
6
|
+
Object {
|
7
|
+
"groups": Object {
|
8
|
+
"all": Array [
|
9
|
+
Object {
|
10
|
+
"id": 0,
|
11
|
+
"name": "repository",
|
12
|
+
"value": "https://github.com/bennojoy/mywebapp.git",
|
13
|
+
},
|
14
|
+
],
|
15
|
+
"dbservers": Array [
|
16
|
+
Object {
|
17
|
+
"id": 0,
|
18
|
+
"name": "mysqlservice",
|
19
|
+
"value": "mysqld",
|
20
|
+
},
|
21
|
+
Object {
|
22
|
+
"id": 1,
|
23
|
+
"name": "mysql_port",
|
24
|
+
"value": "3306",
|
25
|
+
},
|
26
|
+
Object {
|
27
|
+
"id": 2,
|
28
|
+
"name": "dbuser",
|
29
|
+
"value": "webapp",
|
30
|
+
},
|
31
|
+
Object {
|
32
|
+
"id": 3,
|
33
|
+
"name": "dbname",
|
34
|
+
"value": "ANSAP01",
|
35
|
+
},
|
36
|
+
Object {
|
37
|
+
"id": 4,
|
38
|
+
"name": "upassword",
|
39
|
+
"value": "Bond@007",
|
40
|
+
},
|
41
|
+
Object {
|
42
|
+
"id": 5,
|
43
|
+
"name": "masterpassword",
|
44
|
+
"value": "MySQL@007",
|
45
|
+
},
|
46
|
+
],
|
47
|
+
"webservers": Array [
|
48
|
+
Object {
|
49
|
+
"id": 0,
|
50
|
+
"name": "dummy_var",
|
51
|
+
"value": "0",
|
52
|
+
},
|
53
|
+
],
|
54
|
+
},
|
55
|
+
"id": 2,
|
56
|
+
"name": "LAMP",
|
57
|
+
}
|
58
|
+
`;
|
59
|
+
|
60
|
+
exports[`ApplicationDefinitionSelectors should return ansibleVarsAll from applicationDefinitionConfData_1 fixtures 1`] = `
|
61
|
+
Array [
|
62
|
+
Object {
|
63
|
+
"id": 0,
|
64
|
+
"name": "repository",
|
65
|
+
"value": "https://github.com/bennojoy/mywebapp.git",
|
66
|
+
},
|
67
|
+
]
|
68
|
+
`;
|
69
|
+
|
70
|
+
exports[`ApplicationDefinitionSelectors should return columns from applicationDefinitionConfData_1 fixtures 1`] = `
|
71
|
+
Array [
|
72
|
+
Object {
|
73
|
+
"cell": Object {
|
74
|
+
"formatters": Array [
|
75
|
+
null,
|
76
|
+
],
|
77
|
+
},
|
78
|
+
"header": Object {
|
79
|
+
"formatters": Array [
|
80
|
+
null,
|
81
|
+
],
|
82
|
+
"label": "Name",
|
83
|
+
"props": Object {
|
84
|
+
"index": 0,
|
85
|
+
"style": Object {
|
86
|
+
"width": "15%",
|
87
|
+
},
|
88
|
+
},
|
89
|
+
},
|
90
|
+
"property": "name",
|
91
|
+
},
|
92
|
+
Object {
|
93
|
+
"cell": Object {
|
94
|
+
"formatters": Array [
|
95
|
+
null,
|
96
|
+
],
|
97
|
+
},
|
98
|
+
"header": Object {
|
99
|
+
"formatters": Array [
|
100
|
+
null,
|
101
|
+
],
|
102
|
+
"label": "Description",
|
103
|
+
"props": Object {
|
104
|
+
"index": 1,
|
105
|
+
"style": Object {
|
106
|
+
"width": "10%",
|
107
|
+
},
|
108
|
+
},
|
109
|
+
},
|
110
|
+
"property": "description",
|
111
|
+
},
|
112
|
+
Object {
|
113
|
+
"cell": Object {
|
114
|
+
"formatters": Array [
|
115
|
+
null,
|
116
|
+
],
|
117
|
+
},
|
118
|
+
"header": Object {
|
119
|
+
"formatters": Array [
|
120
|
+
null,
|
121
|
+
],
|
122
|
+
"label": "Hostgroup",
|
123
|
+
"props": Object {
|
124
|
+
"index": 2,
|
125
|
+
"style": Object {
|
126
|
+
"width": "20%",
|
127
|
+
},
|
128
|
+
},
|
129
|
+
},
|
130
|
+
"property": "hostgroup",
|
131
|
+
},
|
132
|
+
Object {
|
133
|
+
"cell": Object {
|
134
|
+
"formatters": Array [
|
135
|
+
null,
|
136
|
+
],
|
137
|
+
},
|
138
|
+
"header": Object {
|
139
|
+
"formatters": Array [
|
140
|
+
null,
|
141
|
+
],
|
142
|
+
"label": "Ansible Group",
|
143
|
+
"props": Object {
|
144
|
+
"index": 3,
|
145
|
+
"style": Object {
|
146
|
+
"width": "20%",
|
147
|
+
},
|
148
|
+
},
|
149
|
+
},
|
150
|
+
"property": "ansibleGroup",
|
151
|
+
},
|
152
|
+
Object {
|
153
|
+
"cell": Object {
|
154
|
+
"formatters": Array [
|
155
|
+
null,
|
156
|
+
],
|
157
|
+
},
|
158
|
+
"header": Object {
|
159
|
+
"formatters": Array [
|
160
|
+
null,
|
161
|
+
],
|
162
|
+
"label": "min count",
|
163
|
+
"props": Object {
|
164
|
+
"index": 4,
|
165
|
+
"style": Object {
|
166
|
+
"width": "10%",
|
167
|
+
},
|
168
|
+
},
|
169
|
+
},
|
170
|
+
"property": "minCount",
|
171
|
+
},
|
172
|
+
Object {
|
173
|
+
"cell": Object {
|
174
|
+
"formatters": Array [
|
175
|
+
null,
|
176
|
+
],
|
177
|
+
},
|
178
|
+
"header": Object {
|
179
|
+
"formatters": Array [
|
180
|
+
null,
|
181
|
+
],
|
182
|
+
"label": "max count",
|
183
|
+
"props": Object {
|
184
|
+
"index": 5,
|
185
|
+
"style": Object {
|
186
|
+
"width": "10%",
|
187
|
+
},
|
188
|
+
},
|
189
|
+
},
|
190
|
+
"property": "maxCount",
|
191
|
+
},
|
192
|
+
Object {
|
193
|
+
"cell": Object {
|
194
|
+
"formatters": Array [
|
195
|
+
null,
|
196
|
+
],
|
197
|
+
},
|
198
|
+
"header": Object {
|
199
|
+
"formatters": Array [
|
200
|
+
null,
|
201
|
+
],
|
202
|
+
"label": "Actions",
|
203
|
+
"props": Object {
|
204
|
+
"index": 6,
|
205
|
+
"style": Object {
|
206
|
+
"width": "15%",
|
207
|
+
},
|
208
|
+
},
|
209
|
+
},
|
210
|
+
"property": "actions",
|
211
|
+
},
|
212
|
+
]
|
213
|
+
`;
|
214
|
+
|
215
|
+
exports[`ApplicationDefinitionSelectors should return editMode from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
216
|
+
|
217
|
+
exports[`ApplicationDefinitionSelectors should return parametersData from applicationDefinitionConfData_1 fixtures 1`] = `undefined`;
|
218
|
+
|
219
|
+
exports[`ApplicationDefinitionSelectors should return services from applicationDefinitionConfData_1 fixtures 1`] = `
|
220
|
+
Array [
|
221
|
+
Object {
|
222
|
+
"ansibleGroup": "webservers",
|
223
|
+
"ansibleParameters": Array [
|
224
|
+
Object {
|
225
|
+
"id": 0,
|
226
|
+
"name": "dummy_var",
|
227
|
+
"value": "0",
|
228
|
+
},
|
229
|
+
],
|
230
|
+
"description": "",
|
231
|
+
"foremanParameters": Array [
|
232
|
+
Object {
|
233
|
+
"description": "",
|
234
|
+
"id": 1,
|
235
|
+
"locked": false,
|
236
|
+
"name": "CP",
|
237
|
+
"type": "computeprofile",
|
238
|
+
"value": "1",
|
239
|
+
},
|
240
|
+
Object {
|
241
|
+
"description": "",
|
242
|
+
"id": 2,
|
243
|
+
"locked": true,
|
244
|
+
"name": "LE",
|
245
|
+
"type": "lifecycleenv",
|
246
|
+
"value": "1",
|
247
|
+
},
|
248
|
+
],
|
249
|
+
"hostgroup": "1",
|
250
|
+
"id": 1,
|
251
|
+
"maxCount": "",
|
252
|
+
"minCount": "2",
|
253
|
+
"name": "web",
|
254
|
+
},
|
255
|
+
Object {
|
256
|
+
"ansibleGroup": "dbservers",
|
257
|
+
"ansibleParameters": Array [
|
258
|
+
Object {
|
259
|
+
"id": 0,
|
260
|
+
"name": "mysqlservice",
|
261
|
+
"value": "mysqld",
|
262
|
+
},
|
263
|
+
Object {
|
264
|
+
"id": 1,
|
265
|
+
"locked": true,
|
266
|
+
"name": "mysql_port",
|
267
|
+
"value": "3306",
|
268
|
+
},
|
269
|
+
Object {
|
270
|
+
"id": 2,
|
271
|
+
"name": "dbuser",
|
272
|
+
"value": "webapp",
|
273
|
+
},
|
274
|
+
Object {
|
275
|
+
"id": 3,
|
276
|
+
"name": "dbname",
|
277
|
+
"value": "ANSAP01",
|
278
|
+
},
|
279
|
+
Object {
|
280
|
+
"id": 4,
|
281
|
+
"name": "upassword",
|
282
|
+
"value": "Bond@007",
|
283
|
+
},
|
284
|
+
Object {
|
285
|
+
"id": 5,
|
286
|
+
"name": "masterpassword",
|
287
|
+
"value": "MySQL@007",
|
288
|
+
},
|
289
|
+
],
|
290
|
+
"description": "",
|
291
|
+
"foremanParameters": Array [],
|
292
|
+
"hostgroup": "1",
|
293
|
+
"id": 2,
|
294
|
+
"maxCount": "",
|
295
|
+
"minCount": "1",
|
296
|
+
"name": "db",
|
297
|
+
},
|
298
|
+
]
|
299
|
+
`;
|
@@ -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,21 +6,29 @@ 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,
|
13
16
|
selectParametersData,
|
14
17
|
selectAnsibleVarsAll,
|
18
|
+
selectParamEditMode,
|
15
19
|
} from './ApplicationDefinitionSelectors';
|
16
20
|
|
17
21
|
const mapStateToProps = state => ({
|
22
|
+
showAlertModal: selectShowAlertModal(state),
|
23
|
+
alertModalText: selectAlertModalText(state),
|
24
|
+
alertModalTitle: selectAlertModalTitle(state),
|
18
25
|
editMode: selectEditMode(state),
|
19
26
|
ansiblePlaybook: selectAnsiblePlaybook(state),
|
20
27
|
services: selectServices(state),
|
21
28
|
columns: selectColumns(state),
|
22
29
|
parametersData: selectParametersData(state),
|
23
30
|
ansibleVarsAll: selectAnsibleVarsAll(state),
|
31
|
+
paramEditMode: selectParamEditMode(state),
|
24
32
|
});
|
25
33
|
|
26
34
|
const mapDispatchToProps = dispatch =>
|