foreman_acd 0.2.1 → 0.7.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 +107 -56
- data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +199 -0
- data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +72 -0
- data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +1 -0
- data/app/controllers/foreman_acd/api/v2/app_instances_controller.rb +62 -0
- data/app/controllers/foreman_acd/app_definitions_controller.rb +19 -10
- data/app/controllers/foreman_acd/app_instances_controller.rb +111 -137
- data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +23 -0
- data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +1 -1
- data/app/controllers/foreman_acd/remote_execution_controller.rb +62 -0
- data/app/controllers/ui_acd_controller.rb +20 -3
- data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +47 -0
- data/app/lib/actions/foreman_acd/run_configurator.rb +44 -0
- data/app/models/concerns/foreman_acd/host_managed_extensions.rb +51 -0
- data/app/models/foreman_acd/acd_provider.rb +36 -0
- data/app/models/foreman_acd/ansible_playbook.rb +68 -0
- data/app/models/foreman_acd/app_definition.rb +25 -0
- data/app/models/foreman_acd/app_instance.rb +42 -0
- data/app/models/foreman_acd/foreman_host.rb +23 -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 +98 -0
- data/app/services/foreman_acd/app_deployer.rb +157 -0
- data/app/services/foreman_acd/inventory_creator.rb +68 -0
- data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +64 -0
- data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +11 -0
- data/app/views/foreman_acd/ansible_playbooks/index.html.erb +30 -0
- data/app/views/foreman_acd/ansible_playbooks/new.html.erb +3 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +5 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +5 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +9 -0
- data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +5 -0
- data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +5 -0
- data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +9 -0
- data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +5 -0
- data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +5 -0
- data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +5 -0
- data/app/views/foreman_acd/app_definitions/_form.html.erb +34 -12
- data/app/views/foreman_acd/app_definitions/edit.html.erb +10 -0
- data/app/views/foreman_acd/app_definitions/index.html.erb +4 -4
- data/app/views/foreman_acd/app_instances/_form.html.erb +11 -9
- data/app/views/foreman_acd/app_instances/edit.html.erb +10 -0
- data/app/views/foreman_acd/app_instances/index.html.erb +89 -10
- data/app/views/foreman_acd/app_instances/report.html.erb +6 -3
- data/app/views/templates/job/run_acd_ansible_playbook.erb +62 -0
- data/app/views/ui_acd/ansible_data.json.rabl +6 -0
- data/app/views/ui_acd/app.json.rabl +6 -2
- data/app/views/ui_acd/app_definition.json.rabl +1 -1
- data/app/views/ui_acd/{fdata.json.rabl → foreman_data.json.rabl} +1 -1
- data/config/routes.rb +32 -2
- data/db/migrate/20200916091018_create_ansible_playbooks.rb +20 -0
- data/db/migrate/20200917120220_add_ansible_playbook_id.rb +14 -0
- data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +8 -0
- data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +8 -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/seeds.d/62_acd_proxy_feature.rb +4 -0
- data/db/seeds.d/75-job_templates.rb +13 -0
- data/lib/foreman_acd.rb +12 -0
- data/lib/foreman_acd/engine.rb +43 -3
- data/lib/foreman_acd/plugin.rb +88 -22
- data/lib/foreman_acd/version.rb +1 -1
- 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/locale/en/foreman_acd.po.time_stamp +0 -0
- data/locale/foreman_acd.pot +343 -8
- data/package.json +9 -9
- 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.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 +159 -29
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +106 -14
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +8 -2
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +26 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +143 -21
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +3 -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 +25 -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 +200 -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 +50 -0
- 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 +6 -0
- data/webpack/components/ApplicationInstance/ApplicationInstance.js +151 -44
- data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +47 -10
- data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +5 -2
- data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +114 -28
- data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +3 -1
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceConfData_1.fixtures.js +263 -0
- data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +78 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +23 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +119 -0
- data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +44 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +209 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2719 -0
- data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +276 -0
- data/webpack/components/ApplicationInstance/components/Service.js +1 -1
- data/webpack/components/ApplicationInstance/index.js +4 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +53 -60
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss +17 -0
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +7 -51
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +2 -4
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +4 -18
- data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +0 -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 +130 -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 +0 -2
- data/webpack/components/ParameterSelection/ParameterSelection.js +85 -50
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +68 -62
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +6 -3
- data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +0 -32
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +47 -35
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -2
- 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 +31 -25
- data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +6 -6
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +2 -126
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1483 -872
- data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +117 -79
- data/webpack/components/ParameterSelection/index.js +4 -4
- data/webpack/components/SyncGitRepo/SyncGitRepo.js +210 -0
- data/webpack/components/SyncGitRepo/SyncGitRepo.scss +1 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +124 -0
- data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +9 -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 +30 -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 +46 -0
- data/webpack/components/SyncGitRepo/index.js +28 -0
- data/webpack/components/common/DeleteTableEntry.js +3 -3
- 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 +2 -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 +15 -1
- data/webpack/helper.test.js +37 -0
- data/webpack/index.js +2 -0
- data/webpack/reducer.js +18 -11
- metadata +184 -10
- data/app/views/foreman_acd/app_instances/deploy.html.erb +0 -19
- 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,347 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ApplicationInstanceSelectors should return activeHostId from applicationInstanceReportData_1 fixtures 1`] = `undefined`;
|
4
|
+
|
5
|
+
exports[`ApplicationInstanceSelectors should return hosts from applicationInstanceReportData_1 fixtures 1`] = `
|
6
|
+
Array [
|
7
|
+
Object {
|
8
|
+
"build": false,
|
9
|
+
"hostUrl": "/hosts/great-web-app-db-1.deploy3.dev.atix",
|
10
|
+
"id": 8,
|
11
|
+
"name": "great-web-app-db-1",
|
12
|
+
"powerStatusUrl": "/api/v2/hosts/great-web-app-db-1.deploy3.dev.atix/power",
|
13
|
+
"progress_report": Array [
|
14
|
+
Object {
|
15
|
+
"created": 1615542728.8466988,
|
16
|
+
"id": "Set up compute instance great-web-app-db-1.deploy3.dev.atix",
|
17
|
+
"name": "Set up compute instance great-web-app-db-1.deploy3.dev.atix",
|
18
|
+
"priority": 3,
|
19
|
+
"status": "completed",
|
20
|
+
"timestamp": "2021-03-12T09:52:10.190Z",
|
21
|
+
},
|
22
|
+
Object {
|
23
|
+
"created": 1615542728.8474095,
|
24
|
+
"id": "Query instance details for great-web-app-db-1.deploy3.dev.atix",
|
25
|
+
"name": "Query instance details for great-web-app-db-1.deploy3.dev.atix",
|
26
|
+
"priority": 5,
|
27
|
+
"status": "completed",
|
28
|
+
"timestamp": "2021-03-12T09:52:10.385Z",
|
29
|
+
},
|
30
|
+
Object {
|
31
|
+
"created": 1615542728.0081317,
|
32
|
+
"id": "dhcp_create_192.168.171.103",
|
33
|
+
"name": "Create DHCP Settings for great-web-app-db-1.deploy3.dev.atix",
|
34
|
+
"priority": 10,
|
35
|
+
"status": "completed",
|
36
|
+
"timestamp": "2021-03-12T09:52:10.584Z",
|
37
|
+
},
|
38
|
+
Object {
|
39
|
+
"created": 1615542728.04177,
|
40
|
+
"id": "Create IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
|
41
|
+
"name": "Create IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
|
42
|
+
"priority": 10,
|
43
|
+
"status": "completed",
|
44
|
+
"timestamp": "2021-03-12T09:52:10.679Z",
|
45
|
+
},
|
46
|
+
Object {
|
47
|
+
"created": 1615542728.0424814,
|
48
|
+
"id": "Create Reverse IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
|
49
|
+
"name": "Create Reverse IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
|
50
|
+
"priority": 10,
|
51
|
+
"status": "completed",
|
52
|
+
"timestamp": "2021-03-12T09:52:10.798Z",
|
53
|
+
},
|
54
|
+
Object {
|
55
|
+
"created": 1615542728.0881674,
|
56
|
+
"id": "Deploy TFTP PXELinux config for great-web-app-db-1.deploy3.dev.atix",
|
57
|
+
"name": "Deploy TFTP PXELinux config for great-web-app-db-1.deploy3.dev.atix",
|
58
|
+
"priority": 20,
|
59
|
+
"status": "completed",
|
60
|
+
"timestamp": "2021-03-12T09:52:11.178Z",
|
61
|
+
},
|
62
|
+
Object {
|
63
|
+
"created": 1615542728.0883749,
|
64
|
+
"id": "Deploy TFTP PXEGrub2 config for great-web-app-db-1.deploy3.dev.atix",
|
65
|
+
"name": "Deploy TFTP PXEGrub2 config for great-web-app-db-1.deploy3.dev.atix",
|
66
|
+
"priority": 20,
|
67
|
+
"status": "completed",
|
68
|
+
"timestamp": "2021-03-12T09:52:11.615Z",
|
69
|
+
},
|
70
|
+
Object {
|
71
|
+
"created": 1615542728.088634,
|
72
|
+
"id": "Deploy TFTP PXEGrub config for great-web-app-db-1.deploy3.dev.atix",
|
73
|
+
"name": "Deploy TFTP PXEGrub config for great-web-app-db-1.deploy3.dev.atix",
|
74
|
+
"priority": 20,
|
75
|
+
"status": "completed",
|
76
|
+
"timestamp": "2021-03-12T09:52:11.642Z",
|
77
|
+
},
|
78
|
+
Object {
|
79
|
+
"created": 1615542728.0888274,
|
80
|
+
"id": "Deploy TFTP iPXE config for great-web-app-db-1.deploy3.dev.atix",
|
81
|
+
"name": "Deploy TFTP iPXE config for great-web-app-db-1.deploy3.dev.atix",
|
82
|
+
"priority": 20,
|
83
|
+
"status": "completed",
|
84
|
+
"timestamp": "2021-03-12T09:52:11.874Z",
|
85
|
+
},
|
86
|
+
Object {
|
87
|
+
"created": 1615542728.0894718,
|
88
|
+
"id": "Fetch TFTP boot files for great-web-app-db-1.deploy3.dev.atix",
|
89
|
+
"name": "Fetch TFTP boot files for great-web-app-db-1.deploy3.dev.atix",
|
90
|
+
"priority": 25,
|
91
|
+
"status": "completed",
|
92
|
+
"timestamp": "2021-03-12T09:52:11.981Z",
|
93
|
+
},
|
94
|
+
Object {
|
95
|
+
"created": 1615542728.8482428,
|
96
|
+
"id": "Power up compute instance great-web-app-db-1.deploy3.dev.atix",
|
97
|
+
"name": "Power up compute instance great-web-app-db-1.deploy3.dev.atix",
|
98
|
+
"priority": 1000,
|
99
|
+
"status": "completed",
|
100
|
+
"timestamp": "2021-03-12T09:52:12.950Z",
|
101
|
+
},
|
102
|
+
Object {
|
103
|
+
"created": 1615542728.8508224,
|
104
|
+
"id": "Cleanup PuppetCA certificates for great-web-app-db-1.deploy3.dev.atix",
|
105
|
+
"name": "Cleanup PuppetCA certificates for great-web-app-db-1.deploy3.dev.atix",
|
106
|
+
"priority": 51,
|
107
|
+
"status": "completed",
|
108
|
+
"timestamp": "2021-03-12T09:52:13.390Z",
|
109
|
+
},
|
110
|
+
Object {
|
111
|
+
"created": 1615542728.8514216,
|
112
|
+
"id": "Enable PuppetCA autosigning for great-web-app-db-1.deploy3.dev.atix",
|
113
|
+
"name": "Enable PuppetCA autosigning for great-web-app-db-1.deploy3.dev.atix",
|
114
|
+
"priority": 55,
|
115
|
+
"status": "completed",
|
116
|
+
"timestamp": "2021-03-12T09:52:13.442Z",
|
117
|
+
},
|
118
|
+
],
|
119
|
+
},
|
120
|
+
Object {
|
121
|
+
"build": false,
|
122
|
+
"hostUrl": "/hosts/great-web-app-web-1.deploy3.dev.atix",
|
123
|
+
"id": 9,
|
124
|
+
"name": "great-web-app-web-1",
|
125
|
+
"powerStatusUrl": "/api/v2/hosts/great-web-app-web-1.deploy3.dev.atix/power",
|
126
|
+
"progress_report": Array [
|
127
|
+
Object {
|
128
|
+
"created": 1615542733.824889,
|
129
|
+
"id": "Set up compute instance great-web-app-web-1.deploy3.dev.atix",
|
130
|
+
"name": "Set up compute instance great-web-app-web-1.deploy3.dev.atix",
|
131
|
+
"priority": 3,
|
132
|
+
"status": "completed",
|
133
|
+
"timestamp": "2021-03-12T09:52:14.825Z",
|
134
|
+
},
|
135
|
+
Object {
|
136
|
+
"created": 1615542733.825672,
|
137
|
+
"id": "Query instance details for great-web-app-web-1.deploy3.dev.atix",
|
138
|
+
"name": "Query instance details for great-web-app-web-1.deploy3.dev.atix",
|
139
|
+
"priority": 5,
|
140
|
+
"status": "completed",
|
141
|
+
"timestamp": "2021-03-12T09:52:15.007Z",
|
142
|
+
},
|
143
|
+
Object {
|
144
|
+
"created": 1615542733.5710943,
|
145
|
+
"id": "dhcp_create_192.168.171.104",
|
146
|
+
"name": "Create DHCP Settings for great-web-app-web-1.deploy3.dev.atix",
|
147
|
+
"priority": 10,
|
148
|
+
"status": "completed",
|
149
|
+
"timestamp": "2021-03-12T09:52:15.181Z",
|
150
|
+
},
|
151
|
+
Object {
|
152
|
+
"created": 1615542733.599793,
|
153
|
+
"id": "Create IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
|
154
|
+
"name": "Create IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
|
155
|
+
"priority": 10,
|
156
|
+
"status": "completed",
|
157
|
+
"timestamp": "2021-03-12T09:52:15.251Z",
|
158
|
+
},
|
159
|
+
Object {
|
160
|
+
"created": 1615542733.600369,
|
161
|
+
"id": "Create Reverse IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
|
162
|
+
"name": "Create Reverse IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
|
163
|
+
"priority": 10,
|
164
|
+
"status": "completed",
|
165
|
+
"timestamp": "2021-03-12T09:52:15.328Z",
|
166
|
+
},
|
167
|
+
Object {
|
168
|
+
"created": 1615542733.6356068,
|
169
|
+
"id": "Deploy TFTP PXELinux config for great-web-app-web-1.deploy3.dev.atix",
|
170
|
+
"name": "Deploy TFTP PXELinux config for great-web-app-web-1.deploy3.dev.atix",
|
171
|
+
"priority": 20,
|
172
|
+
"status": "completed",
|
173
|
+
"timestamp": "2021-03-12T09:52:15.681Z",
|
174
|
+
},
|
175
|
+
Object {
|
176
|
+
"created": 1615542733.635817,
|
177
|
+
"id": "Deploy TFTP PXEGrub2 config for great-web-app-web-1.deploy3.dev.atix",
|
178
|
+
"name": "Deploy TFTP PXEGrub2 config for great-web-app-web-1.deploy3.dev.atix",
|
179
|
+
"priority": 20,
|
180
|
+
"status": "completed",
|
181
|
+
"timestamp": "2021-03-12T09:52:16.152Z",
|
182
|
+
},
|
183
|
+
Object {
|
184
|
+
"created": 1615542733.6360064,
|
185
|
+
"id": "Deploy TFTP PXEGrub config for great-web-app-web-1.deploy3.dev.atix",
|
186
|
+
"name": "Deploy TFTP PXEGrub config for great-web-app-web-1.deploy3.dev.atix",
|
187
|
+
"priority": 20,
|
188
|
+
"status": "completed",
|
189
|
+
"timestamp": "2021-03-12T09:52:16.183Z",
|
190
|
+
},
|
191
|
+
Object {
|
192
|
+
"created": 1615542733.6362345,
|
193
|
+
"id": "Deploy TFTP iPXE config for great-web-app-web-1.deploy3.dev.atix",
|
194
|
+
"name": "Deploy TFTP iPXE config for great-web-app-web-1.deploy3.dev.atix",
|
195
|
+
"priority": 20,
|
196
|
+
"status": "completed",
|
197
|
+
"timestamp": "2021-03-12T09:52:16.417Z",
|
198
|
+
},
|
199
|
+
Object {
|
200
|
+
"created": 1615542733.6365006,
|
201
|
+
"id": "Fetch TFTP boot files for great-web-app-web-1.deploy3.dev.atix",
|
202
|
+
"name": "Fetch TFTP boot files for great-web-app-web-1.deploy3.dev.atix",
|
203
|
+
"priority": 25,
|
204
|
+
"status": "completed",
|
205
|
+
"timestamp": "2021-03-12T09:52:16.523Z",
|
206
|
+
},
|
207
|
+
Object {
|
208
|
+
"created": 1615542733.8267431,
|
209
|
+
"id": "Power up compute instance great-web-app-web-1.deploy3.dev.atix",
|
210
|
+
"name": "Power up compute instance great-web-app-web-1.deploy3.dev.atix",
|
211
|
+
"priority": 1000,
|
212
|
+
"status": "completed",
|
213
|
+
"timestamp": "2021-03-12T09:52:17.533Z",
|
214
|
+
},
|
215
|
+
Object {
|
216
|
+
"created": 1615542733.8292165,
|
217
|
+
"id": "Cleanup PuppetCA certificates for great-web-app-web-1.deploy3.dev.atix",
|
218
|
+
"name": "Cleanup PuppetCA certificates for great-web-app-web-1.deploy3.dev.atix",
|
219
|
+
"priority": 51,
|
220
|
+
"status": "completed",
|
221
|
+
"timestamp": "2021-03-12T09:52:17.944Z",
|
222
|
+
},
|
223
|
+
Object {
|
224
|
+
"created": 1615542733.8294067,
|
225
|
+
"id": "Enable PuppetCA autosigning for great-web-app-web-1.deploy3.dev.atix",
|
226
|
+
"name": "Enable PuppetCA autosigning for great-web-app-web-1.deploy3.dev.atix",
|
227
|
+
"priority": 55,
|
228
|
+
"status": "completed",
|
229
|
+
"timestamp": "2021-03-12T09:52:17.995Z",
|
230
|
+
},
|
231
|
+
],
|
232
|
+
},
|
233
|
+
Object {
|
234
|
+
"build": false,
|
235
|
+
"hostUrl": "/hosts/great-web-app-web-2.deploy3.dev.atix",
|
236
|
+
"id": 10,
|
237
|
+
"name": "great-web-app-web-2",
|
238
|
+
"powerStatusUrl": "/api/v2/hosts/great-web-app-web-2.deploy3.dev.atix/power",
|
239
|
+
"progress_report": Array [
|
240
|
+
Object {
|
241
|
+
"created": 1615542738.3446305,
|
242
|
+
"id": "Set up compute instance great-web-app-web-2.deploy3.dev.atix",
|
243
|
+
"name": "Set up compute instance great-web-app-web-2.deploy3.dev.atix",
|
244
|
+
"priority": 3,
|
245
|
+
"status": "completed",
|
246
|
+
"timestamp": "2021-03-12T09:52:19.221Z",
|
247
|
+
},
|
248
|
+
Object {
|
249
|
+
"created": 1615542738.3449144,
|
250
|
+
"id": "Query instance details for great-web-app-web-2.deploy3.dev.atix",
|
251
|
+
"name": "Query instance details for great-web-app-web-2.deploy3.dev.atix",
|
252
|
+
"priority": 5,
|
253
|
+
"status": "completed",
|
254
|
+
"timestamp": "2021-03-12T09:52:19.419Z",
|
255
|
+
},
|
256
|
+
Object {
|
257
|
+
"created": 1615542738.1321318,
|
258
|
+
"id": "dhcp_create_192.168.171.105",
|
259
|
+
"name": "Create DHCP Settings for great-web-app-web-2.deploy3.dev.atix",
|
260
|
+
"priority": 10,
|
261
|
+
"status": "completed",
|
262
|
+
"timestamp": "2021-03-12T09:52:19.668Z",
|
263
|
+
},
|
264
|
+
Object {
|
265
|
+
"created": 1615542738.1576574,
|
266
|
+
"id": "Create IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
|
267
|
+
"name": "Create IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
|
268
|
+
"priority": 10,
|
269
|
+
"status": "completed",
|
270
|
+
"timestamp": "2021-03-12T09:52:19.749Z",
|
271
|
+
},
|
272
|
+
Object {
|
273
|
+
"created": 1615542738.1582346,
|
274
|
+
"id": "Create Reverse IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
|
275
|
+
"name": "Create Reverse IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
|
276
|
+
"priority": 10,
|
277
|
+
"status": "completed",
|
278
|
+
"timestamp": "2021-03-12T09:52:19.859Z",
|
279
|
+
},
|
280
|
+
Object {
|
281
|
+
"created": 1615542738.1885784,
|
282
|
+
"id": "Deploy TFTP PXELinux config for great-web-app-web-2.deploy3.dev.atix",
|
283
|
+
"name": "Deploy TFTP PXELinux config for great-web-app-web-2.deploy3.dev.atix",
|
284
|
+
"priority": 20,
|
285
|
+
"status": "completed",
|
286
|
+
"timestamp": "2021-03-12T09:52:20.221Z",
|
287
|
+
},
|
288
|
+
Object {
|
289
|
+
"created": 1615542738.1888642,
|
290
|
+
"id": "Deploy TFTP PXEGrub2 config for great-web-app-web-2.deploy3.dev.atix",
|
291
|
+
"name": "Deploy TFTP PXEGrub2 config for great-web-app-web-2.deploy3.dev.atix",
|
292
|
+
"priority": 20,
|
293
|
+
"status": "completed",
|
294
|
+
"timestamp": "2021-03-12T09:52:20.604Z",
|
295
|
+
},
|
296
|
+
Object {
|
297
|
+
"created": 1615542738.1890883,
|
298
|
+
"id": "Deploy TFTP PXEGrub config for great-web-app-web-2.deploy3.dev.atix",
|
299
|
+
"name": "Deploy TFTP PXEGrub config for great-web-app-web-2.deploy3.dev.atix",
|
300
|
+
"priority": 20,
|
301
|
+
"status": "completed",
|
302
|
+
"timestamp": "2021-03-12T09:52:20.636Z",
|
303
|
+
},
|
304
|
+
Object {
|
305
|
+
"created": 1615542738.1892834,
|
306
|
+
"id": "Deploy TFTP iPXE config for great-web-app-web-2.deploy3.dev.atix",
|
307
|
+
"name": "Deploy TFTP iPXE config for great-web-app-web-2.deploy3.dev.atix",
|
308
|
+
"priority": 20,
|
309
|
+
"status": "completed",
|
310
|
+
"timestamp": "2021-03-12T09:52:20.895Z",
|
311
|
+
},
|
312
|
+
Object {
|
313
|
+
"created": 1615542738.1898031,
|
314
|
+
"id": "Fetch TFTP boot files for great-web-app-web-2.deploy3.dev.atix",
|
315
|
+
"name": "Fetch TFTP boot files for great-web-app-web-2.deploy3.dev.atix",
|
316
|
+
"priority": 25,
|
317
|
+
"status": "completed",
|
318
|
+
"timestamp": "2021-03-12T09:52:20.992Z",
|
319
|
+
},
|
320
|
+
Object {
|
321
|
+
"created": 1615542738.3453662,
|
322
|
+
"id": "Power up compute instance great-web-app-web-2.deploy3.dev.atix",
|
323
|
+
"name": "Power up compute instance great-web-app-web-2.deploy3.dev.atix",
|
324
|
+
"priority": 1000,
|
325
|
+
"status": "completed",
|
326
|
+
"timestamp": "2021-03-12T09:52:21.864Z",
|
327
|
+
},
|
328
|
+
Object {
|
329
|
+
"created": 1615542738.34748,
|
330
|
+
"id": "Cleanup PuppetCA certificates for great-web-app-web-2.deploy3.dev.atix",
|
331
|
+
"name": "Cleanup PuppetCA certificates for great-web-app-web-2.deploy3.dev.atix",
|
332
|
+
"priority": 51,
|
333
|
+
"status": "completed",
|
334
|
+
"timestamp": "2021-03-12T09:52:22.316Z",
|
335
|
+
},
|
336
|
+
Object {
|
337
|
+
"created": 1615542738.3476808,
|
338
|
+
"id": "Enable PuppetCA autosigning for great-web-app-web-2.deploy3.dev.atix",
|
339
|
+
"name": "Enable PuppetCA autosigning for great-web-app-web-2.deploy3.dev.atix",
|
340
|
+
"priority": 55,
|
341
|
+
"status": "completed",
|
342
|
+
"timestamp": "2021-03-12T09:52:22.368Z",
|
343
|
+
},
|
344
|
+
],
|
345
|
+
},
|
346
|
+
]
|
347
|
+
`;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ReportViewer from '../ReportViewer';
|
4
|
+
|
5
|
+
const noop = () => {};
|
6
|
+
|
7
|
+
const data = [
|
8
|
+
{ name: 'report 1', status: 'done' },
|
9
|
+
{ name: 'report 2', status: 'pending' }
|
10
|
+
];
|
11
|
+
|
12
|
+
const fixtures = {
|
13
|
+
'should render the report viewer': {
|
14
|
+
hidden: false,
|
15
|
+
report: data,
|
16
|
+
},
|
17
|
+
'should render the hidden report viewer': {
|
18
|
+
hidden: true,
|
19
|
+
report: data,
|
20
|
+
},
|
21
|
+
};
|
22
|
+
|
23
|
+
describe('ReportViewer', () =>
|
24
|
+
testComponentSnapshotsWithFixtures(ReportViewer, fixtures));
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`ReportViewer should render the hidden report viewer 1`] = `""`;
|
4
|
+
|
5
|
+
exports[`ReportViewer should render the report viewer 1`] = `
|
6
|
+
Array [
|
7
|
+
<div
|
8
|
+
className="report_task"
|
9
|
+
key="report_task_0"
|
10
|
+
>
|
11
|
+
report 1
|
12
|
+
--
|
13
|
+
done
|
14
|
+
</div>,
|
15
|
+
<div
|
16
|
+
className="report_task"
|
17
|
+
key="report_task_1"
|
18
|
+
>
|
19
|
+
report 2
|
20
|
+
--
|
21
|
+
pending
|
22
|
+
</div>,
|
23
|
+
]
|
24
|
+
`;
|
@@ -7,13 +7,11 @@ import * as ApplicationInstanceReportActions from './ApplicationInstanceReportAc
|
|
7
7
|
|
8
8
|
import {
|
9
9
|
selectHosts,
|
10
|
-
selectReport,
|
11
10
|
selectActiveHostId,
|
12
11
|
} from './ApplicationInstanceReportSelectors';
|
13
12
|
|
14
13
|
const mapStateToProps = state => ({
|
15
14
|
hosts: selectHosts(state),
|
16
|
-
report: selectReport(state),
|
17
15
|
activeHostId: selectActiveHostId(state),
|
18
16
|
});
|
19
17
|
|
@@ -6,16 +6,12 @@ import { orderBy } from 'lodash';
|
|
6
6
|
import * as resolve from 'table-resolver';
|
7
7
|
import Select from 'foremanReact/components/common/forms/Select';
|
8
8
|
import AddTableEntry from '../common/AddTableEntry';
|
9
|
+
import EditTableEntry from '../common/EditTableEntry';
|
9
10
|
import DeleteTableEntry from '../common/DeleteTableEntry';
|
11
|
+
import LockTableEntry from '../common/LockTableEntry';
|
10
12
|
import ExtSelect from '../common/ExtSelect';
|
11
13
|
|
12
14
|
import {
|
13
|
-
isNewDefinition,
|
14
|
-
isEditDefinition,
|
15
|
-
isDefinition,
|
16
|
-
isNewInstance,
|
17
|
-
isEditInstance,
|
18
|
-
isInstance,
|
19
15
|
transformForemanData,
|
20
16
|
} from './ParameterSelectionHelper';
|
21
17
|
|
@@ -27,6 +23,8 @@ import {
|
|
27
23
|
|
28
24
|
import {
|
29
25
|
PARAMETER_SELECTION_TYPES,
|
26
|
+
PARAMETER_SELECTION_PARAM_TYPE_FOREMAN,
|
27
|
+
PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE,
|
30
28
|
} from './ParameterSelectionConstants';
|
31
29
|
|
32
30
|
import {
|
@@ -60,32 +58,50 @@ class ParameterSelection extends React.Component {
|
|
60
58
|
|
61
59
|
componentDidMount() {
|
62
60
|
const {
|
63
|
-
data: {
|
61
|
+
data: { useDefaultValue, allowRowAdjustment, allowNameAdjustment, allowDescriptionAdjustment, parameters, paramDefinition },
|
64
62
|
location,
|
65
63
|
organization,
|
66
|
-
|
64
|
+
paramType,
|
65
|
+
paramDataUrl,
|
67
66
|
initParameterSelection,
|
68
67
|
sortParameter,
|
69
68
|
deleteParameter,
|
69
|
+
lockParameter,
|
70
70
|
activateEditParameter,
|
71
71
|
changeEditParameter,
|
72
|
-
|
72
|
+
loadParamData,
|
73
73
|
} = this.props;
|
74
74
|
|
75
|
-
|
75
|
+
if (paramDataUrl !== undefined) {
|
76
|
+
switch (paramType) {
|
77
|
+
case PARAMETER_SELECTION_PARAM_TYPE_FOREMAN: {
|
78
|
+
loadParamData({ paramDefinition: paramDefinition, url: paramDataUrl, dataType: paramType, clearParameters: false });
|
79
|
+
break;
|
80
|
+
}
|
81
|
+
default: { }
|
82
|
+
}
|
83
|
+
}
|
76
84
|
|
77
85
|
const inlineEditButtonsFormatter = inlineEditFormatterFactory({
|
78
86
|
isEditing: additionalData => this.props.editMode,
|
79
87
|
renderValue: (value, additionalData) => (
|
80
88
|
<td style={{ padding: '2px' }}>
|
81
|
-
<
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
<EditTableEntry
|
90
|
+
disabled={false}
|
91
|
+
handleLocking={!allowRowAdjustment}
|
92
|
+
onEditTableEntry={() => activateEditParameter(additionalData)}
|
93
|
+
additionalData={additionalData}
|
94
|
+
/>
|
95
|
+
|
96
|
+
<LockTableEntry
|
97
|
+
hidden={!allowRowAdjustment}
|
98
|
+
disabled={!allowRowAdjustment}
|
99
|
+
onLockTableEntry={lockParameter}
|
100
|
+
additionalData={additionalData}
|
101
|
+
/>
|
102
|
+
|
87
103
|
<DeleteTableEntry
|
88
|
-
hidden={
|
104
|
+
hidden={!allowRowAdjustment}
|
89
105
|
disabled={false}
|
90
106
|
onDeleteTableEntry={deleteParameter}
|
91
107
|
additionalData={additionalData}
|
@@ -94,11 +110,21 @@ class ParameterSelection extends React.Component {
|
|
94
110
|
),
|
95
111
|
renderEdit: (value, additionalData) => (
|
96
112
|
<td style={{ padding: '2px' }}>
|
97
|
-
<
|
98
|
-
|
99
|
-
|
113
|
+
<EditTableEntry
|
114
|
+
disabled={true}
|
115
|
+
onEditTableEntry={() => activateEditParameter(additionalData)}
|
116
|
+
additionalData={additionalData}
|
117
|
+
/>
|
118
|
+
|
119
|
+
<LockTableEntry
|
120
|
+
hidden={!allowRowAdjustment}
|
121
|
+
disabled={true}
|
122
|
+
onLockTableEntry={lockParameter}
|
123
|
+
additionalData={additionalData}
|
124
|
+
/>
|
125
|
+
|
100
126
|
<DeleteTableEntry
|
101
|
-
hidden={
|
127
|
+
hidden={!allowRowAdjustment}
|
102
128
|
disabled={true}
|
103
129
|
onDeleteTableEntry={deleteParameter}
|
104
130
|
additionalData={additionalData}
|
@@ -152,6 +178,8 @@ class ParameterSelection extends React.Component {
|
|
152
178
|
),
|
153
179
|
};
|
154
180
|
|
181
|
+
// TODO: should we differentiate between paramType FOREMAN and ANSIBLE?
|
182
|
+
|
155
183
|
const inlineEditFormatter = inlineEditFormatterFactory({
|
156
184
|
isEditing: additionalData => this.isEditing(additionalData),
|
157
185
|
renderValue: (value, additionalData) => {
|
@@ -161,22 +189,25 @@ class ParameterSelection extends React.Component {
|
|
161
189
|
} else if (additionalData.property == 'value') {
|
162
190
|
switch (additionalData.rowData.type) {
|
163
191
|
case 'computeprofile':
|
164
|
-
prettyValue = transformForemanData(this.props.
|
192
|
+
prettyValue = transformForemanData(this.props.paramData['computeprofiles'])[value]
|
165
193
|
break;
|
166
194
|
case 'domain':
|
167
|
-
prettyValue = transformForemanData(this.props.
|
195
|
+
prettyValue = transformForemanData(this.props.paramData['domains'])[value]
|
168
196
|
break;
|
169
197
|
case 'lifecycleenv':
|
170
|
-
prettyValue = transformForemanData(this.props.
|
198
|
+
prettyValue = transformForemanData(this.props.paramData['lifecycle_environments'])[value]
|
171
199
|
break;
|
172
200
|
case 'ptable':
|
173
|
-
prettyValue = transformForemanData(this.props.
|
201
|
+
prettyValue = transformForemanData(this.props.paramData['ptables'])[value]
|
174
202
|
break;
|
175
203
|
case 'password':
|
176
204
|
prettyValue = '****************'
|
177
205
|
break;
|
178
206
|
case 'puppetenv':
|
179
|
-
prettyValue = transformForemanData(this.props.
|
207
|
+
prettyValue = transformForemanData(this.props.paramData['environments'])[value]
|
208
|
+
break;
|
209
|
+
case 'text':
|
210
|
+
prettyValue = value
|
180
211
|
break;
|
181
212
|
}
|
182
213
|
}
|
@@ -192,15 +223,15 @@ class ParameterSelection extends React.Component {
|
|
192
223
|
case 'value':
|
193
224
|
switch (additionalData.rowData.type) {
|
194
225
|
case 'computeprofile':
|
195
|
-
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.
|
226
|
+
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.paramData['computeprofiles']));
|
196
227
|
case 'domain':
|
197
|
-
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.
|
228
|
+
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.paramData['domains']));
|
198
229
|
case 'lifecycleenv':
|
199
|
-
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.
|
230
|
+
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.paramData['lifecycle_environments']));
|
200
231
|
case 'puppetenv':
|
201
|
-
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.
|
232
|
+
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.paramData['environments']));
|
202
233
|
case 'ptable':
|
203
|
-
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.
|
234
|
+
return inlineEditFormatterImpl.renderEditSelect(value, additionalData, transformForemanData(this.props.paramData['ptables']));
|
204
235
|
case 'password':
|
205
236
|
return inlineEditFormatterImpl.renderEditText(value, additionalData, 'password');
|
206
237
|
case 'text':
|
@@ -215,9 +246,12 @@ class ParameterSelection extends React.Component {
|
|
215
246
|
this.inlineEditFormatter = inlineEditFormatter;
|
216
247
|
|
217
248
|
initParameterSelection(
|
218
|
-
|
219
|
-
|
249
|
+
paramType,
|
250
|
+
paramDefinition,
|
220
251
|
parameters,
|
252
|
+
useDefaultValue,
|
253
|
+
allowNameAdjustment,
|
254
|
+
allowDescriptionAdjustment,
|
221
255
|
this.sortingFormatter,
|
222
256
|
this.sortableTransform,
|
223
257
|
this.inlineEditFormatter,
|
@@ -230,10 +264,9 @@ class ParameterSelection extends React.Component {
|
|
230
264
|
|
231
265
|
render() {
|
232
266
|
const {
|
233
|
-
data: {
|
267
|
+
data: { allowRowAdjustment, applications },
|
234
268
|
location,
|
235
269
|
organization,
|
236
|
-
loadForemanDataUrl,
|
237
270
|
parameters,
|
238
271
|
columns,
|
239
272
|
sortingColumns,
|
@@ -241,8 +274,7 @@ class ParameterSelection extends React.Component {
|
|
241
274
|
addParameter,
|
242
275
|
confirmEditParameter,
|
243
276
|
cancelEditParameter,
|
244
|
-
|
245
|
-
serviceDefinition,
|
277
|
+
editModeCallback,
|
246
278
|
} = this.props;
|
247
279
|
|
248
280
|
let sortedParameters;
|
@@ -274,15 +306,16 @@ class ParameterSelection extends React.Component {
|
|
274
306
|
)(parameters);
|
275
307
|
}
|
276
308
|
|
309
|
+
// Make sure that the component which includes the
|
310
|
+
// ParameterSelection is aware of the current editMode state
|
311
|
+
if (editModeCallback !== undefined) {
|
312
|
+
editModeCallback(this.props.editMode);
|
313
|
+
}
|
314
|
+
|
277
315
|
return(
|
278
316
|
<div>
|
279
317
|
<div className="clearfix">
|
280
318
|
<div className="form-group">
|
281
|
-
<AddTableEntry
|
282
|
-
hidden={isInstance(mode)}
|
283
|
-
disabled={ this.props.editMode }
|
284
|
-
onAddTableEntry={ addParameter }
|
285
|
-
/>
|
286
319
|
<Table.PfProvider
|
287
320
|
striped
|
288
321
|
bordered
|
@@ -319,7 +352,7 @@ class ParameterSelection extends React.Component {
|
|
319
352
|
/>
|
320
353
|
</Table.PfProvider>
|
321
354
|
<AddTableEntry
|
322
|
-
hidden={
|
355
|
+
hidden={!allowRowAdjustment}
|
323
356
|
disabled={ this.props.editMode }
|
324
357
|
onAddTableEntry={ addParameter }
|
325
358
|
/>
|
@@ -334,39 +367,41 @@ ParameterSelection.defaultProps = {
|
|
334
367
|
error: {},
|
335
368
|
editMode: false,
|
336
369
|
loading: false,
|
337
|
-
|
370
|
+
paramData: {},
|
338
371
|
parameters: [],
|
339
372
|
columns: [],
|
340
373
|
sortingColumns: {},
|
374
|
+
editModeCallback: undefined,
|
341
375
|
};
|
342
376
|
|
343
377
|
ParameterSelection.propTypes = {
|
344
378
|
data: PropTypes.shape({
|
345
|
-
mode: PropTypes.string.isRequired,
|
346
379
|
parameters: PropTypes.array,
|
347
|
-
|
380
|
+
paramDefinition: PropTypes.object,
|
348
381
|
applications: PropTypes.object,
|
349
382
|
}).isRequired,
|
350
383
|
location: PropTypes.string.isRequired,
|
351
384
|
organization: PropTypes.string.isRequired,
|
352
|
-
|
385
|
+
paramDataUrl: PropTypes.string,
|
353
386
|
initParameterSelection: PropTypes.func,
|
354
387
|
editMode: PropTypes.bool.isRequired,
|
355
388
|
loading: PropTypes.bool.isRequired,
|
356
|
-
|
389
|
+
paramData: PropTypes.object.isRequired,
|
357
390
|
parameterTypes: PropTypes.object,
|
358
391
|
parameters: PropTypes.array,
|
359
392
|
sortingColumns: PropTypes.object,
|
393
|
+
editModeCallback: PropTypes.func,
|
360
394
|
columns: PropTypes.array,
|
361
395
|
sortParameter: PropTypes.func,
|
362
396
|
addParameter: PropTypes.func,
|
363
397
|
deleteParameter: PropTypes.func,
|
398
|
+
lockParameter: PropTypes.func,
|
364
399
|
activateEditParameter: PropTypes.func,
|
365
400
|
confirmEditParameter: PropTypes.func,
|
366
401
|
cancelEditParameter: PropTypes.func,
|
367
402
|
changeEditParameter: PropTypes.func,
|
368
|
-
|
369
|
-
|
403
|
+
loadParamData: PropTypes.func,
|
404
|
+
paramDefinition: PropTypes.object,
|
370
405
|
};
|
371
406
|
|
372
407
|
export default ParameterSelection;
|