foreman_rh_cloud 12.0.0 → 12.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -4
  3. data/app/controllers/concerns/inventory_upload/report_actions.rb +1 -1
  4. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +2 -0
  5. data/app/controllers/foreman_inventory_upload/uploads_settings_controller.rb +2 -0
  6. data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +26 -22
  7. data/app/services/foreman_rh_cloud/cloud_request.rb +13 -3
  8. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +17 -3
  9. data/app/services/foreman_rh_cloud/rules_ingester.rb +12 -1
  10. data/config/routes.rb +4 -0
  11. data/lib/foreman_inventory_upload/generators/queries.rb +2 -0
  12. data/lib/foreman_inventory_upload/generators/slice.rb +83 -42
  13. data/lib/foreman_inventory_upload.rb +5 -0
  14. data/lib/foreman_rh_cloud/engine.rb +15 -3
  15. data/lib/foreman_rh_cloud/version.rb +1 -1
  16. data/lib/foreman_rh_cloud.rb +2 -0
  17. data/package.json +1 -1
  18. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +35 -2
  19. data/test/unit/slice_generator_test.rb +212 -4
  20. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +5 -1
  21. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +2 -1
  22. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants.js +27 -8
  23. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js +11 -3
  24. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +71 -10
  25. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js +13 -1
  26. data/webpack/ForemanInventoryUpload/Components/InventorySettings/MinimalInventoryDropdown.js +107 -0
  27. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +9 -2
  28. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +8 -0
  29. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +53 -9
  30. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +72 -58
  31. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js +61 -6
  32. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js +18 -6
  33. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js +54 -6
  34. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +2 -0
  35. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +8 -0
  36. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +4 -2
  37. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +1 -8
  38. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +4 -2
  39. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +47 -28
  40. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +46 -8
  41. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +2 -7
  42. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +1 -6
  43. data/webpack/common/Switcher/SwitcherPF4.js +11 -1
  44. metadata +4 -11
  45. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettings.test.js +0 -13
  46. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +0 -31
  47. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +0 -89
  48. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +0 -62
  49. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/__snapshots__/ToolbarButtons.test.js.snap +0 -10
  50. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +0 -43
  51. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js +0 -72
  52. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js +0 -23
@@ -1,13 +1,51 @@
1
- import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
-
1
+ import React from 'react';
2
+ import { Provider } from 'react-redux';
3
+ import configureMockStore from 'redux-mock-store';
4
+ import thunk from 'redux-thunk';
5
+ import { screen, render } from '@testing-library/react';
6
+ import { noop } from 'foremanReact/common/helpers';
3
7
  import TabHeader from '../TabHeader';
4
8
 
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
+ const middlewares = [thunk];
10
+ const mockStore = configureMockStore(middlewares);
9
11
 
10
12
  describe('TabHeader', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(TabHeader, fixtures));
13
+ test('when subscription connection is enabled', () => {
14
+ const renderOptions = {
15
+ API: {
16
+ INVENTORY_SETTINGS: {
17
+ response: { subscriptionConnectionEnabled: true },
18
+ },
19
+ },
20
+ };
21
+ const store = mockStore(renderOptions);
22
+
23
+ render(
24
+ <Provider store={store}>
25
+ <TabHeader exitCode="exit 0" onRestart={noop} toggleFullScreen={noop} />
26
+ </Provider>
27
+ );
28
+ expect(screen.queryAllByText('Generate and upload report')).toHaveLength(1);
29
+ expect(screen.queryAllByText('Full Screen')).toHaveLength(1);
30
+ });
31
+
32
+ test('when subscription connection is not enabled', () => {
33
+ const renderOptions = {
34
+ API: {
35
+ INVENTORY_SETTINGS: {
36
+ response: { subscriptionConnectionEnabled: false },
37
+ },
38
+ },
39
+ };
40
+ const store = mockStore(renderOptions);
41
+
42
+ render(
43
+ <Provider store={store}>
44
+ <TabHeader exitCode="exit 0" onRestart={noop} toggleFullScreen={noop} />
45
+ </Provider>
46
+ );
47
+
48
+ expect(screen.queryAllByText('Generate report')).toHaveLength(1);
49
+ expect(screen.queryAllByText('Full Screen')).toHaveLength(1);
50
+ });
13
51
  });
@@ -6,8 +6,8 @@ import { FormGroup, Grid } from 'patternfly-react';
6
6
  import { translate as __ } from 'foremanReact/common/I18n';
7
7
  import { foremanUrl } from '../../../ForemanRhCloudHelpers';
8
8
  import Switcher from '../../../common/Switcher';
9
- import AdvancedSettings from './components/AdvancedSettings';
10
9
  import { settingsDict } from '../../Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants';
10
+ import InventorySettings from '../../Components/InventorySettings/InventorySettings';
11
11
 
12
12
  const InventoryAutoUploadSwitcher = ({
13
13
  autoUploadEnabled,
@@ -44,12 +44,7 @@ const InventoryAutoUploadSwitcher = ({
44
44
  headerContent={
45
45
  <strong>{__('Advanced Inventory Settings')}</strong>
46
46
  }
47
- bodyContent={
48
- <AdvancedSettings
49
- autoUploadEnabled={autoUploadEnabled}
50
- handleToggle={handleToggle}
51
- />
52
- }
47
+ bodyContent={<InventorySettings />}
53
48
  position="right"
54
49
  >
55
50
  <Button
@@ -32,12 +32,7 @@ exports[`InventoryAutoUpload rendering render with props 1`] = `
32
32
  sm={5}
33
33
  >
34
34
  <Popover
35
- bodyContent={
36
- <Memo(Connect(AdvancedSettings))
37
- autoUploadEnabled={true}
38
- handleToggle={[Function]}
39
- />
40
- }
35
+ bodyContent={<InventorySettings />}
41
36
  headerContent={
42
37
  <strong>
43
38
  Advanced Inventory Settings
@@ -4,11 +4,19 @@ import { Switch } from '@patternfly/react-core';
4
4
  import { HelpLabel } from './HelpLabel';
5
5
  import './SwitcherPF4.scss';
6
6
 
7
- const SwitcherPF4 = ({ id, label, tooltip, isChecked, onChange }) => (
7
+ const SwitcherPF4 = ({
8
+ id,
9
+ label,
10
+ tooltip,
11
+ isChecked,
12
+ onChange,
13
+ isDisabled,
14
+ }) => (
8
15
  <Switch
9
16
  className="foreman-rh-cloud-switcher"
10
17
  id={`rh-cloud-switcher-${id}`}
11
18
  isChecked={isChecked}
19
+ isDisabled={isDisabled}
12
20
  onChange={onChange}
13
21
  label={
14
22
  <div>
@@ -24,6 +32,7 @@ SwitcherPF4.propTypes = {
24
32
  label: PropTypes.string,
25
33
  tooltip: PropTypes.string,
26
34
  isChecked: PropTypes.bool,
35
+ isDisabled: PropTypes.bool,
27
36
  onChange: PropTypes.func.isRequired,
28
37
  };
29
38
 
@@ -31,6 +40,7 @@ SwitcherPF4.defaultProps = {
31
40
  label: null,
32
41
  tooltip: null,
33
42
  isChecked: true,
43
+ isDisabled: false,
34
44
  };
35
45
 
36
46
  export default SwitcherPF4;
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 12.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foreman_ansible
@@ -392,16 +392,14 @@ files:
392
392
  - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsActions.js
393
393
  - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsConstants.js
394
394
  - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js
395
- - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettings.test.js
395
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/MinimalInventoryDropdown.js
396
396
  - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js
397
- - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap
398
397
  - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap
399
398
  - webpack/ForemanInventoryUpload/Components/InventorySettings/index.js
400
399
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js
401
400
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js
402
401
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js
403
402
  - webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js
404
- - webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap
405
403
  - webpack/ForemanInventoryUpload/Components/NavContainer/index.js
406
404
  - webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss
407
405
  - webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js
@@ -423,7 +421,6 @@ files:
423
421
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js
424
422
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js
425
423
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js
426
- - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap
427
424
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/index.js
428
425
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.js
429
426
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.test.js
@@ -444,7 +441,6 @@ files:
444
441
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/index.js
445
442
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js
446
443
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js
447
- - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/__snapshots__/ToolbarButtons.test.js.snap
448
444
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/index.js
449
445
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/toolbarButtons.scss
450
446
  - webpack/ForemanInventoryUpload/Components/PageHeader/index.js
@@ -501,7 +497,6 @@ files:
501
497
  - webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
502
498
  - webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js
503
499
  - webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js
504
- - webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap
505
500
  - webpack/ForemanInventoryUpload/Components/TabHeader/index.js
506
501
  - webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss
507
502
  - webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js
@@ -518,8 +513,6 @@ files:
518
513
  - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js
519
514
  - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js
520
515
  - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap
521
- - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js
522
- - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js
523
516
  - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/index.js
524
517
  - webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js
525
518
  - webpack/ForemanInventoryUpload/__tests__/ForemanInventoryUpload.test.js
@@ -665,7 +658,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
665
658
  - !ruby/object:Gem::Version
666
659
  version: '0'
667
660
  requirements: []
668
- rubygems_version: 3.6.2
661
+ rubygems_version: 3.6.7
669
662
  specification_version: 4
670
663
  summary: Summary of ForemanRhCloud.
671
664
  test_files:
@@ -1,13 +0,0 @@
1
- import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
-
3
- import InventorySettings from '../InventorySettings';
4
-
5
- const fixtures = {
6
- 'render without Props': {},
7
- /** fixtures, props for the component */
8
- };
9
-
10
- describe('InventorySettings', () => {
11
- describe('rendering', () =>
12
- testComponentSnapshotsWithFixtures(InventorySettings, fixtures));
13
- });
@@ -1,31 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`InventorySettings rendering render without Props 1`] = `
4
- <div
5
- className="inventory-settings"
6
- >
7
- <h3>
8
- Settings
9
- </h3>
10
- <AdvancedSetting
11
- key="autoUploadEnabled"
12
- setting="autoUploadEnabled"
13
- />
14
- <AdvancedSetting
15
- key="hostObfuscationEnabled"
16
- setting="hostObfuscationEnabled"
17
- />
18
- <AdvancedSetting
19
- key="ipsObfuscationEnabled"
20
- setting="ipsObfuscationEnabled"
21
- />
22
- <AdvancedSetting
23
- key="excludePackagesEnabled"
24
- setting="excludePackagesEnabled"
25
- />
26
- <AdvancedSetting
27
- key="allowAutoInsightsMismatchDelete"
28
- setting="allowAutoInsightsMismatchDelete"
29
- />
30
- </div>
31
- `;
@@ -1,89 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`NavContainer rendering render with Props 1`] = `
4
- <ForwardRef
5
- defaultActiveKey={0}
6
- id="basic-tabs-pf"
7
- >
8
- <div
9
- className="dashboard"
10
- >
11
- <Nav
12
- bsClass="nav nav-tabs nav-tabs-pf"
13
- justified={false}
14
- pullLeft={false}
15
- pullRight={false}
16
- stacked={false}
17
- >
18
- <NavItem
19
- active={false}
20
- className="nav_item"
21
- disabled={false}
22
- eventKey={0}
23
- key="0"
24
- onClick={[Function]}
25
- >
26
- <Icon
27
- name="some-icon"
28
- size="2x"
29
- type="fa"
30
- />
31
- <p>
32
- some-name
33
- </p>
34
- </NavItem>
35
- </Nav>
36
- <TabContent
37
- animation={true}
38
- bsClass="tab"
39
- componentClass="div"
40
- mountOnEnter={false}
41
- unmountOnExit={false}
42
- >
43
- <TabPane
44
- bsClass="tab-pane"
45
- eventKey={0}
46
- key="0"
47
- >
48
- <component />
49
- </TabPane>
50
- </TabContent>
51
- <FullScreenModal
52
- showFullScreen={false}
53
- terminalProps={Object {}}
54
- toggleFullScreen={[Function]}
55
- />
56
- </div>
57
- </ForwardRef>
58
- `;
59
-
60
- exports[`NavContainer rendering render without Props 1`] = `
61
- <ForwardRef
62
- defaultActiveKey={0}
63
- id="basic-tabs-pf"
64
- >
65
- <div
66
- className="dashboard"
67
- >
68
- <Nav
69
- bsClass="nav nav-tabs nav-tabs-pf"
70
- justified={false}
71
- pullLeft={false}
72
- pullRight={false}
73
- stacked={false}
74
- />
75
- <TabContent
76
- animation={true}
77
- bsClass="tab"
78
- componentClass="div"
79
- mountOnEnter={false}
80
- unmountOnExit={false}
81
- />
82
- <FullScreenModal
83
- showFullScreen={false}
84
- terminalProps={Object {}}
85
- toggleFullScreen={[Function]}
86
- />
87
- </div>
88
- </ForwardRef>
89
- `;
@@ -1,62 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`PageDescription rendering render without Props 1`] = `
4
- <div
5
- id="inventory_page_description"
6
- >
7
- <Text>
8
- The Red Hat Hybrid Cloud Console provides a set of cloud services, including Red Hat Insights and Subscriptions, that provide predictive analysis, remediation of issues, and unified subscription reporting for this Foreman instance.
9
- </Text>
10
- <Text>
11
- The Foreman inventory upload plugin automatically uploads Foreman host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required.
12
- </Text>
13
- <Text>
14
- <FormattedMessage
15
- defaultMessage="To enable this reporting for all Foreman organizations, set {uploadButtonName} to on. The data will be reported automatically once per day."
16
- id="enable-upload-hint"
17
- values={
18
- Object {
19
- "uploadButtonName": <strong>
20
- Automatic inventory upload
21
- </strong>,
22
- }
23
- }
24
- />
25
- </Text>
26
- <Text>
27
- <FormattedMessage
28
- defaultMessage="To manually upload the data for a specific organization, select an organization and click {restartButtonName}."
29
- id="restart-button-hint"
30
- values={
31
- Object {
32
- "restartButtonName": <strong>
33
- Generate and upload report
34
- </strong>,
35
- }
36
- }
37
- />
38
- </Text>
39
- <Text>
40
- For more information about the Subscriptions service, see:
41
-  
42
- <a
43
- href="https://docs.redhat.com/en/documentation/subscription_central/1-latest/html/getting_started_with_the_subscriptions_service/index"
44
- rel="noopener noreferrer"
45
- target="_blank"
46
- >
47
- About subscription watch
48
- </a>
49
- </Text>
50
- <Text>
51
- For more information about Insights and Cloud Connector, see:
52
-  
53
- <a
54
- href="https://console.redhat.com/security/insights/"
55
- rel="noopener noreferrer"
56
- target="_blank"
57
- >
58
- Red Hat Insights Data and Application Security
59
- </a>
60
- </Text>
61
- </div>
62
- `;
@@ -1,10 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`ToolbarButtons rendering render without Props 1`] = `
4
- <div
5
- className="inventory_toolbar_buttons"
6
- >
7
- <ConnectedCloudConnectorButton />
8
- <Connect(SyncButton) />
9
- </div>
10
- `;
@@ -1,43 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`TabHeader rendering render without Props 1`] = `
4
- <Row
5
- bsClass="row"
6
- className="tab-header"
7
- componentClass="div"
8
- >
9
- <Col
10
- bsClass="col"
11
- componentClass="div"
12
- sm={6}
13
- >
14
- <p>
15
- Exit Code:
16
- </p>
17
- </Col>
18
- <Col
19
- bsClass="col"
20
- componentClass="div"
21
- sm={6}
22
- >
23
- <div
24
- className="tab-action-buttons"
25
- >
26
- <Button
27
- active={false}
28
- block={false}
29
- bsClass="btn"
30
- bsStyle="default"
31
- disabled={false}
32
- onClick={[Function]}
33
- >
34
- Full Screen
35
- <Icon
36
- name="arrows-alt"
37
- type="fa"
38
- />
39
- </Button>
40
- </div>
41
- </Col>
42
- </Row>
43
- `;
@@ -1,72 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid } from 'patternfly-react';
4
- import { translate as __ } from 'foremanReact/common/I18n';
5
- import Switcher from '../../../../../common/Switcher';
6
- import { settingsDict } from '../../../../Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants';
7
-
8
- const AdvancedSettings = ({
9
- setSetting,
10
- hostObfuscationEnabled,
11
- ipsObfuscationEnabled,
12
- excludePackagesEnabled,
13
- }) => (
14
- <form style={{ padding: '5px' }}>
15
- <Grid.Row>
16
- <Switcher
17
- id="obfuscate-hostnames"
18
- label={__('Obfuscate host names')}
19
- tooltip={__('Obfuscate host names sent to the Red Hat cloud')}
20
- isChecked={hostObfuscationEnabled}
21
- onChange={() =>
22
- setSetting({
23
- setting: settingsDict.hostObfuscationEnabled.name,
24
- value: !hostObfuscationEnabled,
25
- })
26
- }
27
- labelCol={8}
28
- />
29
- </Grid.Row>
30
- <Grid.Row>
31
- <Switcher
32
- id="obfuscate-ip"
33
- label={__('Obfuscate IPs')}
34
- tooltip={__('Obfuscate ipv4 addresses sent to the Red Hat cloud')}
35
- isChecked={ipsObfuscationEnabled}
36
- onChange={() =>
37
- setSetting({
38
- setting: settingsDict.ipsObfuscationEnabled.name,
39
- value: !ipsObfuscationEnabled,
40
- })
41
- }
42
- labelCol={8}
43
- />
44
- </Grid.Row>
45
- <Grid.Row>
46
- <Switcher
47
- id="exclude-packages"
48
- label={__('Exclude packages')}
49
- tooltip={__(
50
- 'Exclude packages from being uploaded to the Red Hat cloud'
51
- )}
52
- isChecked={excludePackagesEnabled}
53
- onChange={() =>
54
- setSetting({
55
- setting: settingsDict.excludePackagesEnabled.name,
56
- value: !excludePackagesEnabled,
57
- })
58
- }
59
- labelCol={8}
60
- />
61
- </Grid.Row>
62
- </form>
63
- );
64
-
65
- AdvancedSettings.propTypes = {
66
- setSetting: PropTypes.func.isRequired,
67
- hostObfuscationEnabled: PropTypes.bool.isRequired,
68
- ipsObfuscationEnabled: PropTypes.bool.isRequired,
69
- excludePackagesEnabled: PropTypes.bool.isRequired,
70
- };
71
-
72
- export default AdvancedSettings;
@@ -1,23 +0,0 @@
1
- import { bindActionCreators } from 'redux';
2
- import { connect } from 'react-redux';
3
- import { setSetting } from '../../../../Components/InventorySettings/InventorySettingsActions';
4
- import AdvancedSettings from './AdvancedSettings';
5
- import {
6
- selectExcludePackages,
7
- selectHostObfuscationEnabled,
8
- selectIpsObfuscationEnabled,
9
- } from '../../../../Components/InventorySettings/InventorySettingsSelectors';
10
-
11
- // map state to props
12
- const mapStateToProps = state => ({
13
- hostObfuscationEnabled: selectHostObfuscationEnabled(state),
14
- ipsObfuscationEnabled: selectIpsObfuscationEnabled(state),
15
- excludePackagesEnabled: selectExcludePackages(state),
16
- });
17
-
18
- // map action dispatchers to props
19
- const mapDispatchToProps = dispatch =>
20
- bindActionCreators({ setSetting }, dispatch);
21
-
22
- // export connected component
23
- export default connect(mapStateToProps, mapDispatchToProps)(AdvancedSettings);