foreman_rh_cloud 4.0.25 → 4.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +4 -1
- data/app/controllers/foreman_inventory_upload/cloud_status_controller.rb +26 -0
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +18 -4
- data/app/controllers/insights_cloud/hits_controller.rb +0 -1
- data/app/services/foreman_rh_cloud/cloud_ping_service.rb +83 -0
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +15 -3
- data/config/Gemfile.lock.gh_test +169 -160
- data/config/database.yml.example +2 -2
- data/config/rh_cert-api_chain.pem +74 -0
- data/config/routes.rb +3 -1
- data/lib/foreman_inventory_upload/generators/queries.rb +1 -16
- data/lib/foreman_inventory_upload/generators/tags.rb +1 -2
- data/lib/foreman_rh_cloud/engine.rb +2 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/foreman_rh_cloud.rb +16 -1
- data/lib/insights_cloud/async/insights_client_status_aging.rb +4 -0
- data/lib/insights_cloud/async/insights_full_sync.rb +4 -0
- data/lib/insights_cloud/async/insights_generate_notifications.rb +4 -0
- data/lib/insights_cloud/async/insights_resolutions_sync.rb +7 -2
- data/lib/insights_cloud/async/insights_rules_sync.rb +10 -2
- data/lib/insights_cloud.rb +4 -0
- data/lib/inventory_sync/async/host_result.rb +0 -5
- data/lib/inventory_sync/async/inventory_full_sync.rb +18 -9
- data/lib/inventory_sync/async/inventory_hosts_sync.rb +6 -6
- data/lib/inventory_sync/async/inventory_scheduled_sync.rb +4 -0
- data/lib/inventory_sync/async/inventory_self_host_sync.rb +4 -0
- data/lib/inventory_sync/async/query_inventory_job.rb +4 -0
- data/lib/tasks/rh_cloud_inventory.rake +2 -9
- data/package.json +1 -1
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +20 -39
- data/test/controllers/inventory_upload/cloud_status_controller_test.rb +44 -0
- data/test/factories/inventory_upload_factories.rb +14 -0
- data/test/jobs/insights_resolutions_sync_test.rb +10 -1
- data/test/jobs/inventory_full_sync_test.rb +28 -2
- data/test/jobs/inventory_hosts_sync_test.rb +15 -0
- data/test/test_plugin_helper.rb +53 -0
- data/test/unit/foreman_rh_cloud_self_host_test.rb +28 -0
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +29 -34
- data/test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb +66 -0
- data/test/unit/slice_generator_test.rb +36 -4
- data/test/unit/tags_generator_test.rb +16 -16
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +0 -4
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +12 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +10 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +144 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.scss +5 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryConstants.js +2 -0
- data/webpack/InsightsCloudSync/Components/InsightsHeader/InsightsHeader.scss +5 -1
- data/webpack/InsightsCloudSync/Components/InsightsHeader/index.js +6 -6
- data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js +9 -5
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettings.test.js.snap +6 -6
- data/webpack/InsightsCloudSync/Components/InsightsSettings/insightsSettings.scss +1 -14
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +5 -24
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +11 -4
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js +0 -3
- data/webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js +51 -0
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTable.test.js.snap +3 -68
- data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +10 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +11 -10
- data/webpack/InsightsCloudSync/Components/RemediationModal/index.js +0 -2
- data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +32 -0
- data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap +5 -5
- data/webpack/InsightsCloudSync/InsightsCloudSync.js +19 -13
- data/webpack/InsightsCloudSync/InsightsCloudSync.scss +82 -2
- data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +16 -6
- data/webpack/common/Switcher/HelpLabel.js +1 -1
- data/webpack/common/Switcher/SwitcherPF4.js +1 -1
- data/webpack/common/Switcher/SwitcherPF4.scss +6 -7
- data/webpack/common/Switcher/__tests__/__snapshots__/HelpLabel.test.js.snap +1 -1
- data/webpack/common/Switcher/__tests__/__snapshots__/SwitcherPF4.test.js.snap +1 -1
- metadata +16 -24
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.fixtures.js +0 -1
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js +0 -45
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/InsightsSyncSwitcher.test.js +0 -17
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/__snapshots__/InsightsSyncSwitcher.test.js.snap +0 -38
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/index.js +0 -1
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/insightsSyncSwitcher.scss +0 -3
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js +0 -59
@@ -6,7 +6,7 @@ import './SwitcherPF4.scss';
|
|
6
6
|
|
7
7
|
const SwitcherPF4 = ({ id, label, tooltip, isChecked, onChange }) => (
|
8
8
|
<Switch
|
9
|
-
className="foreman-switcher"
|
9
|
+
className="foreman-rh-cloud-switcher"
|
10
10
|
id={`rh-cloud-switcher-${id}`}
|
11
11
|
isChecked={isChecked}
|
12
12
|
onChange={onChange}
|
@@ -1,10 +1,9 @@
|
|
1
|
-
.rh-cloud-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
label.foreman-rh-cloud-switcher {
|
2
|
+
display: block;
|
3
|
+
font-weight: 400;
|
4
|
+
margin-bottom: 5px;
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
}
|
6
|
+
.switcher-help-label {
|
7
|
+
padding-left: 5px;
|
9
8
|
}
|
10
9
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_rh_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Red Hat Cloud team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: redhat_access
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: foreman_ansible
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +138,7 @@ files:
|
|
152
138
|
- app/controllers/concerns/inventory_upload/report_actions.rb
|
153
139
|
- app/controllers/concerns/inventory_upload/task_actions.rb
|
154
140
|
- app/controllers/foreman_inventory_upload/accounts_controller.rb
|
141
|
+
- app/controllers/foreman_inventory_upload/cloud_status_controller.rb
|
155
142
|
- app/controllers/foreman_inventory_upload/reports_controller.rb
|
156
143
|
- app/controllers/foreman_inventory_upload/tasks_controller.rb
|
157
144
|
- app/controllers/foreman_inventory_upload/uploads_controller.rb
|
@@ -176,6 +163,7 @@ files:
|
|
176
163
|
- app/services/foreman_rh_cloud/branch_info.rb
|
177
164
|
- app/services/foreman_rh_cloud/cloud_auth.rb
|
178
165
|
- app/services/foreman_rh_cloud/cloud_connector.rb
|
166
|
+
- app/services/foreman_rh_cloud/cloud_ping_service.rb
|
179
167
|
- app/services/foreman_rh_cloud/cloud_request.rb
|
180
168
|
- app/services/foreman_rh_cloud/cloud_request_forwarder.rb
|
181
169
|
- app/services/foreman_rh_cloud/insights_status_cleaner.rb
|
@@ -188,6 +176,7 @@ files:
|
|
188
176
|
- config/database.yml.example
|
189
177
|
- config/package-lock.json.gh_test
|
190
178
|
- config/package-lock.json.plugin
|
179
|
+
- config/rh_cert-api_chain.pem
|
191
180
|
- config/routes.rb
|
192
181
|
- db/migrate/20191215104806_create_insights_hits.foreman_inventory_upload.rb
|
193
182
|
- db/migrate/20191216062008_create_insights_facets.foreman_inventory_upload.rb
|
@@ -247,6 +236,7 @@ files:
|
|
247
236
|
- test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb
|
248
237
|
- test/controllers/insights_sync/settings_controller_test.rb
|
249
238
|
- test/controllers/inventory_upload/api/inventory_controller_test.rb
|
239
|
+
- test/controllers/inventory_upload/cloud_status_controller_test.rb
|
250
240
|
- test/controllers/reports_controller_test.rb
|
251
241
|
- test/controllers/uploads_controller_test.rb
|
252
242
|
- test/controllers/uploads_settings_controller_test.rb
|
@@ -265,11 +255,13 @@ files:
|
|
265
255
|
- test/test_plugin_helper.rb
|
266
256
|
- test/unit/archived_report_generator_test.rb
|
267
257
|
- test/unit/fact_helpers_test.rb
|
258
|
+
- test/unit/foreman_rh_cloud_self_host_test.rb
|
268
259
|
- test/unit/insights_facet_test.rb
|
269
260
|
- test/unit/metadata_generator_test.rb
|
270
261
|
- test/unit/rh_cloud_http_proxy_test.rb
|
271
262
|
- test/unit/services/foreman_rh_cloud/branch_info_test.rb
|
272
263
|
- test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
|
264
|
+
- test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb
|
273
265
|
- test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb
|
274
266
|
- test/unit/services/foreman_rh_cloud/remediations_retriever_test.rb
|
275
267
|
- test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb
|
@@ -418,6 +410,8 @@ files:
|
|
418
410
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorActions.test.js.snap
|
419
411
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorButton.test.js.snap
|
420
412
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
|
413
|
+
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js
|
414
|
+
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.scss
|
421
415
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js
|
422
416
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js
|
423
417
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap
|
@@ -548,18 +542,13 @@ files:
|
|
548
542
|
- webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsSelectors.test.js.snap
|
549
543
|
- webpack/InsightsCloudSync/Components/InsightsSettings/index.js
|
550
544
|
- webpack/InsightsCloudSync/Components/InsightsSettings/insightsSettings.scss
|
551
|
-
- webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.fixtures.js
|
552
|
-
- webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
|
553
|
-
- webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/InsightsSyncSwitcher.test.js
|
554
|
-
- webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/__snapshots__/InsightsSyncSwitcher.test.js.snap
|
555
|
-
- webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/index.js
|
556
|
-
- webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/insightsSyncSwitcher.scss
|
557
545
|
- webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js
|
558
546
|
- webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js
|
559
547
|
- webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
|
560
548
|
- webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableHelpers.js
|
561
549
|
- webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableReducer.js
|
562
550
|
- webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js
|
551
|
+
- webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js
|
563
552
|
- webpack/InsightsCloudSync/Components/InsightsTable/SelectAllAlert.js
|
564
553
|
- webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTable.test.js
|
565
554
|
- webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableActions.test.js
|
@@ -571,7 +560,6 @@ files:
|
|
571
560
|
- webpack/InsightsCloudSync/Components/InsightsTable/index.js
|
572
561
|
- webpack/InsightsCloudSync/Components/InsightsTable/table.scss
|
573
562
|
- webpack/InsightsCloudSync/Components/NoTokenEmptyState.js
|
574
|
-
- webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js
|
575
563
|
- webpack/InsightsCloudSync/Components/RemediationModal/RemediationActions.js
|
576
564
|
- webpack/InsightsCloudSync/Components/RemediationModal/RemediationHelpers.js
|
577
565
|
- webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js
|
@@ -580,6 +568,7 @@ files:
|
|
580
568
|
- webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js
|
581
569
|
- webpack/InsightsCloudSync/Components/RemediationModal/Resolutions.js
|
582
570
|
- webpack/InsightsCloudSync/Components/RemediationModal/index.js
|
571
|
+
- webpack/InsightsCloudSync/Components/ToolbarDropdown.js
|
583
572
|
- webpack/InsightsCloudSync/Components/__tests__/InsightsHeader.test.js
|
584
573
|
- webpack/InsightsCloudSync/Components/__tests__/NoTokenEmptyState.test.js
|
585
574
|
- webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap
|
@@ -669,7 +658,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
669
658
|
- !ruby/object:Gem::Version
|
670
659
|
version: '0'
|
671
660
|
requirements: []
|
672
|
-
rubygems_version: 3.2.
|
661
|
+
rubygems_version: 3.2.22
|
673
662
|
signing_key:
|
674
663
|
specification_version: 4
|
675
664
|
summary: Summary of ForemanRhCloud.
|
@@ -678,6 +667,7 @@ test_files:
|
|
678
667
|
- test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb
|
679
668
|
- test/controllers/insights_sync/settings_controller_test.rb
|
680
669
|
- test/controllers/inventory_upload/api/inventory_controller_test.rb
|
670
|
+
- test/controllers/inventory_upload/cloud_status_controller_test.rb
|
681
671
|
- test/controllers/reports_controller_test.rb
|
682
672
|
- test/controllers/uploads_controller_test.rb
|
683
673
|
- test/controllers/uploads_settings_controller_test.rb
|
@@ -696,11 +686,13 @@ test_files:
|
|
696
686
|
- test/test_plugin_helper.rb
|
697
687
|
- test/unit/archived_report_generator_test.rb
|
698
688
|
- test/unit/fact_helpers_test.rb
|
689
|
+
- test/unit/foreman_rh_cloud_self_host_test.rb
|
699
690
|
- test/unit/insights_facet_test.rb
|
700
691
|
- test/unit/metadata_generator_test.rb
|
701
692
|
- test/unit/rh_cloud_http_proxy_test.rb
|
702
693
|
- test/unit/services/foreman_rh_cloud/branch_info_test.rb
|
703
694
|
- test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
|
695
|
+
- test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb
|
704
696
|
- test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb
|
705
697
|
- test/unit/services/foreman_rh_cloud/remediations_retriever_test.rb
|
706
698
|
- test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb
|
data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.fixtures.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export const handleToggleResponse = { data: { insightsSyncEnabled: true } };
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import React, { Component } from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { Switch, FieldLevelHelp } from 'patternfly-react';
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
-
import './insightsSyncSwitcher.scss';
|
6
|
-
|
7
|
-
class InsightsSyncSwitcher extends Component {
|
8
|
-
handleToggle = () => {
|
9
|
-
const { insightsSyncEnabled, setInsightsSyncEnabled } = this.props;
|
10
|
-
|
11
|
-
const toggledInsightsSyncEnabled = !insightsSyncEnabled;
|
12
|
-
setInsightsSyncEnabled(toggledInsightsSyncEnabled);
|
13
|
-
};
|
14
|
-
|
15
|
-
render() {
|
16
|
-
const { insightsSyncEnabled } = this.props;
|
17
|
-
|
18
|
-
return (
|
19
|
-
<div className="insights_sync_switcher">
|
20
|
-
<span>{__('Synchronize Automatically')}</span>
|
21
|
-
<FieldLevelHelp
|
22
|
-
content={__(
|
23
|
-
'Enable automatic synchronization of Insights recommendations from the Red Hat cloud'
|
24
|
-
)}
|
25
|
-
/>
|
26
|
-
<Switch
|
27
|
-
size="mini"
|
28
|
-
value={insightsSyncEnabled}
|
29
|
-
onChange={this.handleToggle}
|
30
|
-
/>
|
31
|
-
</div>
|
32
|
-
);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
InsightsSyncSwitcher.propTypes = {
|
37
|
-
insightsSyncEnabled: PropTypes.bool,
|
38
|
-
setInsightsSyncEnabled: PropTypes.func.isRequired,
|
39
|
-
};
|
40
|
-
|
41
|
-
InsightsSyncSwitcher.defaultProps = {
|
42
|
-
insightsSyncEnabled: true,
|
43
|
-
};
|
44
|
-
|
45
|
-
export default InsightsSyncSwitcher;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
2
|
-
import { noop } from 'foremanReact/common/helpers';
|
3
|
-
|
4
|
-
import InsightsSyncSwitcher from '../InsightsSyncSwitcher';
|
5
|
-
|
6
|
-
const fixtures = {
|
7
|
-
'render with props': {
|
8
|
-
insightsSyncEnabled: true,
|
9
|
-
setInsightsSyncEnabled: noop,
|
10
|
-
},
|
11
|
-
/** fixtures, props for the component */
|
12
|
-
};
|
13
|
-
|
14
|
-
describe('InsightsSyncSwitcher', () => {
|
15
|
-
describe('rendering', () =>
|
16
|
-
testComponentSnapshotsWithFixtures(InsightsSyncSwitcher, fixtures));
|
17
|
-
});
|
@@ -1,38 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`InsightsSyncSwitcher rendering render with props 1`] = `
|
4
|
-
<div
|
5
|
-
className="insights_sync_switcher"
|
6
|
-
>
|
7
|
-
<span>
|
8
|
-
Synchronize Automatically
|
9
|
-
</span>
|
10
|
-
<FieldLevelHelp
|
11
|
-
buttonClass=""
|
12
|
-
content="Enable automatic synchronization of Insights recommendations from the Red Hat cloud"
|
13
|
-
placement="top"
|
14
|
-
rootClose={true}
|
15
|
-
/>
|
16
|
-
<Switch
|
17
|
-
animate={true}
|
18
|
-
baseClass="bootstrap-switch"
|
19
|
-
bsSize={null}
|
20
|
-
defaultValue={true}
|
21
|
-
disabled={false}
|
22
|
-
handleWidth="auto"
|
23
|
-
inverse={false}
|
24
|
-
labelText=" "
|
25
|
-
labelWidth="auto"
|
26
|
-
offColor="default"
|
27
|
-
offText="OFF"
|
28
|
-
onChange={[Function]}
|
29
|
-
onColor="primary"
|
30
|
-
onText="ON"
|
31
|
-
readonly={false}
|
32
|
-
size="mini"
|
33
|
-
tristate={false}
|
34
|
-
value={true}
|
35
|
-
wrapperClass="wrapper"
|
36
|
-
/>
|
37
|
-
</div>
|
38
|
-
`;
|
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from './InsightsSyncSwitcher';
|
@@ -1,59 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { isEmpty } from 'lodash';
|
4
|
-
import { Button, Popover } from '@patternfly/react-core';
|
5
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
6
|
-
import { foremanUrl } from '../../../ForemanRhCloudHelpers';
|
7
|
-
|
8
|
-
const RemediateButton = ({ isExperimentalMode, selectedIds, toggleModal }) => {
|
9
|
-
const [isVisible, setVisible] = React.useState(true);
|
10
|
-
|
11
|
-
const popoverContent = __(
|
12
|
-
`To use this feature, please enable <a href=${foremanUrl(
|
13
|
-
'/settings?search=name+%3D+lab_features'
|
14
|
-
)}>Show Experimental Labs</a> in settings.`
|
15
|
-
);
|
16
|
-
|
17
|
-
let button = (
|
18
|
-
<Button
|
19
|
-
variant="primary"
|
20
|
-
isDisabled={isEmpty(selectedIds)}
|
21
|
-
onClick={() => {
|
22
|
-
if (!isExperimentalMode) {
|
23
|
-
setVisible(value => !value);
|
24
|
-
} else {
|
25
|
-
toggleModal();
|
26
|
-
}
|
27
|
-
}}
|
28
|
-
>
|
29
|
-
{__('Remediate')}
|
30
|
-
</Button>
|
31
|
-
);
|
32
|
-
|
33
|
-
if (!isExperimentalMode) {
|
34
|
-
button = (
|
35
|
-
<Popover
|
36
|
-
isVisible={isVisible}
|
37
|
-
bodyContent={
|
38
|
-
<div dangerouslySetInnerHTML={{ __html: popoverContent }} />
|
39
|
-
}
|
40
|
-
>
|
41
|
-
{button}
|
42
|
-
</Popover>
|
43
|
-
);
|
44
|
-
}
|
45
|
-
return button;
|
46
|
-
};
|
47
|
-
|
48
|
-
RemediateButton.propTypes = {
|
49
|
-
selectedIds: PropTypes.object,
|
50
|
-
isExperimentalMode: PropTypes.bool,
|
51
|
-
toggleModal: PropTypes.func.isRequired,
|
52
|
-
};
|
53
|
-
|
54
|
-
RemediateButton.defaultProps = {
|
55
|
-
selectedIds: {},
|
56
|
-
isExperimentalMode: false,
|
57
|
-
};
|
58
|
-
|
59
|
-
export default RemediateButton;
|