foreman_rh_cloud 12.0.0 → 12.1.0

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/inventory_upload/report_actions.rb +1 -1
  3. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +2 -0
  4. data/app/controllers/foreman_inventory_upload/uploads_settings_controller.rb +2 -0
  5. data/app/services/foreman_rh_cloud/cloud_request.rb +4 -0
  6. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +17 -1
  7. data/app/services/foreman_rh_cloud/rules_ingester.rb +12 -1
  8. data/config/routes.rb +4 -0
  9. data/lib/foreman_inventory_upload/generators/queries.rb +2 -0
  10. data/lib/foreman_inventory_upload/generators/slice.rb +83 -42
  11. data/lib/foreman_inventory_upload.rb +5 -0
  12. data/lib/foreman_rh_cloud/engine.rb +15 -3
  13. data/lib/foreman_rh_cloud/version.rb +1 -1
  14. data/lib/foreman_rh_cloud.rb +2 -0
  15. data/package.json +1 -1
  16. data/test/unit/slice_generator_test.rb +212 -4
  17. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +5 -1
  18. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +2 -1
  19. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants.js +27 -8
  20. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js +11 -3
  21. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +71 -10
  22. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js +13 -1
  23. data/webpack/ForemanInventoryUpload/Components/InventorySettings/MinimalInventoryDropdown.js +107 -0
  24. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +9 -2
  25. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +8 -0
  26. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +53 -9
  27. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +72 -58
  28. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js +61 -6
  29. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js +18 -6
  30. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js +54 -6
  31. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +2 -0
  32. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +8 -0
  33. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +4 -2
  34. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +1 -8
  35. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +4 -2
  36. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +47 -28
  37. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +46 -8
  38. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +2 -7
  39. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +1 -6
  40. data/webpack/common/Switcher/SwitcherPF4.js +11 -1
  41. metadata +4 -11
  42. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettings.test.js +0 -13
  43. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +0 -31
  44. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +0 -89
  45. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +0 -62
  46. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/__snapshots__/ToolbarButtons.test.js.snap +0 -10
  47. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +0 -43
  48. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js +0 -72
  49. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js +0 -23
@@ -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);