foreman_rh_cloud 4.0.25 → 4.0.25.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/cloud_status_controller.rb +26 -0
  3. data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +10 -4
  4. data/app/controllers/insights_cloud/hits_controller.rb +0 -1
  5. data/app/services/foreman_rh_cloud/cloud_ping_service.rb +83 -0
  6. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +1 -1
  7. data/config/Gemfile.lock.gh_test +0 -8
  8. data/config/rh_cert-api_chain.pem +74 -0
  9. data/config/routes.rb +2 -0
  10. data/lib/foreman_inventory_upload/generators/queries.rb +0 -16
  11. data/lib/foreman_rh_cloud.rb +4 -0
  12. data/lib/foreman_rh_cloud/engine.rb +0 -1
  13. data/lib/foreman_rh_cloud/version.rb +1 -1
  14. data/lib/insights_cloud.rb +4 -0
  15. data/lib/tasks/rh_cloud_inventory.rake +2 -9
  16. data/package.json +2 -2
  17. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +4 -0
  18. data/test/controllers/inventory_upload/cloud_status_controller_test.rb +44 -0
  19. data/test/test_plugin_helper.rb +53 -0
  20. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +3 -34
  21. data/test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb +66 -0
  22. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +0 -4
  23. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +12 -0
  24. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +10 -0
  25. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +144 -0
  26. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.scss +5 -0
  27. data/webpack/ForemanInventoryUpload/ForemanInventoryConstants.js +2 -0
  28. data/webpack/InsightsCloudSync/Components/InsightsHeader/InsightsHeader.scss +5 -1
  29. data/webpack/InsightsCloudSync/Components/InsightsHeader/index.js +6 -4
  30. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js +9 -5
  31. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettings.test.js.snap +6 -6
  32. data/webpack/InsightsCloudSync/Components/InsightsSettings/insightsSettings.scss +0 -14
  33. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +5 -24
  34. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +11 -4
  35. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js +0 -3
  36. data/webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js +51 -0
  37. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTable.test.js.snap +3 -68
  38. data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +10 -0
  39. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +11 -10
  40. data/webpack/InsightsCloudSync/Components/RemediationModal/index.js +0 -2
  41. data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +32 -0
  42. data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap +5 -4
  43. data/webpack/InsightsCloudSync/InsightsCloudSync.js +17 -13
  44. data/webpack/InsightsCloudSync/InsightsCloudSync.scss +82 -2
  45. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +15 -6
  46. data/webpack/common/Switcher/SwitcherPF4.js +1 -1
  47. data/webpack/common/Switcher/SwitcherPF4.scss +6 -7
  48. data/webpack/common/Switcher/__tests__/__snapshots__/SwitcherPF4.test.js.snap +1 -1
  49. metadata +13 -23
  50. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.fixtures.js +0 -1
  51. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js +0 -45
  52. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/InsightsSyncSwitcher.test.js +0 -17
  53. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/__snapshots__/InsightsSyncSwitcher.test.js.snap +0 -38
  54. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/index.js +0 -1
  55. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/insightsSyncSwitcher.scss +0 -3
  56. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js +0 -59
@@ -1,5 +1,85 @@
1
1
  .rh-cloud-insights {
2
- .btn-toolbar {
3
- display: inherit;
2
+ #main {
3
+ padding: 4px;
4
+
5
+ #breadcrumb .form-group {
6
+ margin-bottom: 0;
7
+
8
+ h1 {
9
+ font-family: 'RedHatDisplay';
10
+ font-weight: 400;
11
+ margin-bottom: 8px;
12
+ }
13
+ }
14
+
15
+ .title_filter {
16
+ width: 520px;
17
+ }
18
+
19
+ #title_action {
20
+ width: calc(100% - 520px);
21
+ }
22
+
23
+ @media (max-width: 1138px) {
24
+ #title_action {
25
+ width: 70%;
26
+ }
27
+ }
28
+
29
+ .search-bar {
30
+ // Giving pf3 search bar a pf4 look
31
+ width: 500px;
32
+ .search-bar {
33
+ display: block;
34
+ }
35
+ .input-group {
36
+ display: table;
37
+ }
38
+ .input-group-btn {
39
+ .btn-group {
40
+ z-index: unset; // so the bookmarks drop down will be above other search boxes
41
+ }
42
+ .autocomplete-search-btn {
43
+ display: none;
44
+ }
45
+ .dropdown-toggle {
46
+ font-size: 16px;
47
+ background-color: white;
48
+ background-image: none;
49
+ padding-bottom: 4px;
50
+ padding-top: 4px;
51
+ }
52
+ .scrollable-dropdown {
53
+ max-width: 250px;
54
+ }
55
+ }
56
+ li {
57
+ font-size: 16px;
58
+ }
59
+ input {
60
+ font-size: 16px;
61
+ height: 36px;
62
+ }
63
+ .foreman-autocomplete .autocomplete-focus-shortcut {
64
+ top: 8px;
65
+ font-size: 16px;
66
+ }
67
+ .foreman-autocomplete .autocomplete-aux {
68
+ top: 8px;
69
+ font-size: 16px;
70
+ .autocomplete-clear-button {
71
+ font-size: 16px;
72
+ }
73
+ }
74
+ }
75
+
76
+ .btn-toolbar {
77
+ display: inherit;
78
+ width: 100%;
79
+ }
80
+
81
+ .pf-c-pagination {
82
+ padding-right: 0;
83
+ }
4
84
  }
5
85
  }
@@ -28,13 +28,22 @@ exports[`InsightsCloudSync render 1`] = `
28
28
  searchable={true}
29
29
  toolbarButtons={
30
30
  <React.Fragment>
31
- <UNDEFINED />
32
- <Button
33
- onClick={[Function]}
34
- variant="secondary"
31
+ <span
32
+ className="insights-toolbar-buttons"
35
33
  >
36
- Start recommendations sync
37
- </Button>
34
+ <UNDEFINED />
35
+ <ToolbarDropdown
36
+ onRecommendationSync={[Function]}
37
+ />
38
+ </span>
39
+ <span
40
+ className="pull-right"
41
+ >
42
+ <Pagination
43
+ isCompact={true}
44
+ variant="top"
45
+ />
46
+ </span>
38
47
  </React.Fragment>
39
48
  }
40
49
  >
@@ -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-inventory-page {
2
- label.foreman-switcher {
3
- font-weight: 400;
4
- margin-bottom: 5px;
1
+ label.foreman-rh-cloud-switcher {
2
+ display: block;
3
+ font-weight: 400;
4
+ margin-bottom: 5px;
5
5
 
6
- .switcher-help-label {
7
- padding-left: 5px;
8
- }
6
+ .switcher-help-label {
7
+ padding-left: 5px;
9
8
  }
10
9
  }
@@ -3,7 +3,7 @@
3
3
  exports[`InsightsCloudSync helpers should return insights cloud Url 1`] = `
4
4
  <Switch
5
5
  aria-label=""
6
- className="foreman-switcher"
6
+ className="foreman-rh-cloud-switcher"
7
7
  id="rh-cloud-switcher-some-id"
8
8
  isChecked={true}
9
9
  isDisabled={false}
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.25
4
+ version: 4.0.25.1
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-08-01 00:00:00.000000000 Z
11
+ date: 2021-08-05 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
@@ -270,6 +260,7 @@ files:
270
260
  - test/unit/rh_cloud_http_proxy_test.rb
271
261
  - test/unit/services/foreman_rh_cloud/branch_info_test.rb
272
262
  - test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
263
+ - test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb
273
264
  - test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb
274
265
  - test/unit/services/foreman_rh_cloud/remediations_retriever_test.rb
275
266
  - test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb
@@ -418,6 +409,8 @@ files:
418
409
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorActions.test.js.snap
419
410
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorButton.test.js.snap
420
411
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
412
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js
413
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.scss
421
414
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js
422
415
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js
423
416
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap
@@ -548,18 +541,13 @@ files:
548
541
  - webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsSelectors.test.js.snap
549
542
  - webpack/InsightsCloudSync/Components/InsightsSettings/index.js
550
543
  - 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
544
  - webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js
558
545
  - webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js
559
546
  - webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js
560
547
  - webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableHelpers.js
561
548
  - webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableReducer.js
562
549
  - webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js
550
+ - webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js
563
551
  - webpack/InsightsCloudSync/Components/InsightsTable/SelectAllAlert.js
564
552
  - webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTable.test.js
565
553
  - webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableActions.test.js
@@ -571,7 +559,6 @@ files:
571
559
  - webpack/InsightsCloudSync/Components/InsightsTable/index.js
572
560
  - webpack/InsightsCloudSync/Components/InsightsTable/table.scss
573
561
  - webpack/InsightsCloudSync/Components/NoTokenEmptyState.js
574
- - webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js
575
562
  - webpack/InsightsCloudSync/Components/RemediationModal/RemediationActions.js
576
563
  - webpack/InsightsCloudSync/Components/RemediationModal/RemediationHelpers.js
577
564
  - webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js
@@ -580,6 +567,7 @@ files:
580
567
  - webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js
581
568
  - webpack/InsightsCloudSync/Components/RemediationModal/Resolutions.js
582
569
  - webpack/InsightsCloudSync/Components/RemediationModal/index.js
570
+ - webpack/InsightsCloudSync/Components/ToolbarDropdown.js
583
571
  - webpack/InsightsCloudSync/Components/__tests__/InsightsHeader.test.js
584
572
  - webpack/InsightsCloudSync/Components/__tests__/NoTokenEmptyState.test.js
585
573
  - webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap
@@ -678,6 +666,7 @@ test_files:
678
666
  - test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb
679
667
  - test/controllers/insights_sync/settings_controller_test.rb
680
668
  - test/controllers/inventory_upload/api/inventory_controller_test.rb
669
+ - test/controllers/inventory_upload/cloud_status_controller_test.rb
681
670
  - test/controllers/reports_controller_test.rb
682
671
  - test/controllers/uploads_controller_test.rb
683
672
  - test/controllers/uploads_settings_controller_test.rb
@@ -701,6 +690,7 @@ test_files:
701
690
  - test/unit/rh_cloud_http_proxy_test.rb
702
691
  - test/unit/services/foreman_rh_cloud/branch_info_test.rb
703
692
  - test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
693
+ - test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb
704
694
  - test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb
705
695
  - test/unit/services/foreman_rh_cloud/remediations_retriever_test.rb
706
696
  - test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb
@@ -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,3 +0,0 @@
1
- .insights_sync_switcher {
2
- margin-bottom: 5px;
3
- }
@@ -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;