foreman_rh_cloud 3.0.17 → 3.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +3 -15
  3. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +0 -48
  4. data/app/controllers/foreman_inventory_upload/uploads_settings_controller.rb +26 -0
  5. data/app/controllers/insights_cloud/hits_controller.rb +1 -1
  6. data/app/services/foreman_rh_cloud/branch_info.rb +3 -14
  7. data/app/services/foreman_rh_cloud/cloud_connector.rb +12 -7
  8. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +31 -19
  9. data/config/routes.rb +2 -5
  10. data/db/migrate/20210307000001_add_unique_to_insights_facet.foreman_rh_cloud.rb +11 -0
  11. data/lib/foreman_inventory_upload.rb +2 -1
  12. data/lib/foreman_inventory_upload/generators/json_stream.rb +1 -1
  13. data/lib/foreman_inventory_upload/generators/slice.rb +14 -21
  14. data/lib/foreman_inventory_upload/generators/tags.rb +59 -0
  15. data/lib/foreman_rh_cloud.rb +4 -0
  16. data/lib/foreman_rh_cloud/version.rb +1 -1
  17. data/package.json +1 -1
  18. data/test/controllers/accounts_controller_test.rb +1 -5
  19. data/test/controllers/uploads_controller_test.rb +0 -13
  20. data/test/controllers/uploads_settings_controller_test.rb +31 -0
  21. data/test/test_plugin_helper.rb +13 -0
  22. data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +5 -5
  23. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +39 -4
  24. data/test/unit/slice_generator_test.rb +7 -2
  25. data/test/unit/tags_generator_test.rb +60 -0
  26. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +4 -19
  27. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +7 -7
  28. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +6 -6
  29. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -34
  30. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +0 -14
  31. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +6 -4
  32. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +6 -4
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +14 -12
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +10 -1
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +7 -7
  36. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +12 -9
  37. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js +3 -3
  38. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +0 -30
  39. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +1 -23
  40. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +6 -6
  41. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +3 -8
  42. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +3 -35
  43. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +6 -18
  44. data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +24 -22
  45. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +1 -1
  46. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +1 -1
  47. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +2 -1
  48. data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +4 -2
  49. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +2 -1
  50. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +16 -14
  51. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +2 -1
  52. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js +1 -1
  53. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +2 -1
  54. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js +3 -11
  55. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +1 -1
  56. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +3 -3
  57. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingActions.js +7 -0
  58. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants.js +26 -0
  59. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/AdvancedSettingActions.test.js +9 -0
  60. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/__snapshots__/AdvancedSettingActions.test.js.snap +18 -0
  61. data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js +29 -0
  62. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +7 -8
  63. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +15 -9
  64. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsActions.js +23 -0
  65. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsConstants.js +9 -0
  66. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js +19 -0
  67. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js +14 -0
  68. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +16 -4
  69. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap +26 -0
  70. data/webpack/ForemanInventoryUpload/Components/InventorySettings/index.js +16 -1
  71. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +1 -1
  72. data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +7 -5
  73. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +1 -1
  74. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +1 -1
  75. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/index.js +1 -1
  76. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +1 -1
  77. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +1 -1
  78. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/modal.scss +1 -1
  79. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/index.js +1 -1
  80. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +1 -1
  81. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +1 -1
  82. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +1 -1
  83. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +1 -1
  84. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -1
  85. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +8 -6
  86. data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +9 -7
  87. data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +4 -2
  88. data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +7 -5
  89. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +2 -1
  90. data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +15 -13
  91. data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +27 -25
  92. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +1 -1
  93. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +13 -8
  94. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +3 -3
  95. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js +21 -9
  96. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js +3 -8
  97. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/index.js +6 -4
  98. data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap +1 -1
  99. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettings.test.js +1 -1
  100. data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/InsightsSyncSwitcher.test.js +1 -1
  101. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/fixtures.js +1 -1
  102. data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +1 -1
  103. data/webpack/InsightsHostDetailsTab/InsightsTab.js +2 -1
  104. data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +1 -1
  105. data/webpack/common/Switcher/SwitcherPF4.scss +1 -1
  106. metadata +55 -56
  107. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +0 -3
  108. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +0 -29
  109. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +0 -29
  110. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +0 -1
  111. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +0 -14
  112. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +0 -24
  113. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +0 -15
  114. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +0 -31
  115. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js +0 -17
  116. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js +0 -1
  117. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js +0 -27
  118. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js +0 -29
  119. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js +0 -1
  120. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js +0 -13
  121. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js +0 -21
  122. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap +0 -15
  123. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap +0 -31
  124. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap +0 -46
  125. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js +0 -36
  126. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js +0 -20
  127. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js +0 -2
  128. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js +0 -27
  129. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js +0 -29
  130. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js +0 -1
  131. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js +0 -14
  132. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js +0 -24
  133. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap +0 -15
  134. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap +0 -31
  135. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js +0 -20
  136. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js +0 -1
  137. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js +0 -27
  138. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js +0 -29
  139. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js +0 -1
  140. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js +0 -13
  141. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js +0 -21
  142. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap +0 -15
  143. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap +0 -31
  144. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js +0 -20
@@ -3,14 +3,13 @@ import PropTypes from 'prop-types';
3
3
  import { Grid } from 'patternfly-react';
4
4
  import { translate as __ } from 'foremanReact/common/I18n';
5
5
  import Switcher from '../../../../../common/Switcher';
6
+ import { settingsDict } from '../../../../Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants';
6
7
 
7
8
  const AdvancedSettings = ({
9
+ setSetting,
8
10
  hostObfuscationEnabled,
9
- hostObfuscationToggle,
10
11
  ipsObfuscationEnabled,
11
- ipsObfuscationToggle,
12
12
  excludePackagesEnabled,
13
- excludePackagesToggle,
14
13
  }) => (
15
14
  <form style={{ padding: '5px' }}>
16
15
  <Grid.Row>
@@ -19,7 +18,12 @@ const AdvancedSettings = ({
19
18
  label={__('Obfuscate host names')}
20
19
  tooltip={__('Obfuscate host names sent to the Red Hat cloud')}
21
20
  isChecked={hostObfuscationEnabled}
22
- onChange={() => hostObfuscationToggle(hostObfuscationEnabled)}
21
+ onChange={() =>
22
+ setSetting({
23
+ setting: settingsDict.hostObfuscationEnabled.name,
24
+ value: !hostObfuscationEnabled,
25
+ })
26
+ }
23
27
  labelCol={8}
24
28
  />
25
29
  </Grid.Row>
@@ -29,7 +33,12 @@ const AdvancedSettings = ({
29
33
  label={__('Obfuscate IPs')}
30
34
  tooltip={__('Obfuscate ipv4 addresses sent to the Red Hat cloud')}
31
35
  isChecked={ipsObfuscationEnabled}
32
- onChange={() => ipsObfuscationToggle(ipsObfuscationEnabled)}
36
+ onChange={() =>
37
+ setSetting({
38
+ setting: settingsDict.ipsObfuscationEnabled.name,
39
+ value: !ipsObfuscationEnabled,
40
+ })
41
+ }
33
42
  labelCol={8}
34
43
  />
35
44
  </Grid.Row>
@@ -41,7 +50,12 @@ const AdvancedSettings = ({
41
50
  'Exclude packages from being uploaded to the Red Hat cloud'
42
51
  )}
43
52
  isChecked={excludePackagesEnabled}
44
- onChange={() => excludePackagesToggle(excludePackagesEnabled)}
53
+ onChange={() =>
54
+ setSetting({
55
+ setting: settingsDict.excludePackagesEnabled.name,
56
+ value: !excludePackagesEnabled,
57
+ })
58
+ }
45
59
  labelCol={8}
46
60
  />
47
61
  </Grid.Row>
@@ -49,12 +63,10 @@ const AdvancedSettings = ({
49
63
  );
50
64
 
51
65
  AdvancedSettings.propTypes = {
66
+ setSetting: PropTypes.func.isRequired,
52
67
  hostObfuscationEnabled: PropTypes.bool.isRequired,
53
- hostObfuscationToggle: PropTypes.func.isRequired,
54
68
  ipsObfuscationEnabled: PropTypes.bool.isRequired,
55
- ipsObfuscationToggle: PropTypes.func.isRequired,
56
69
  excludePackagesEnabled: PropTypes.bool.isRequired,
57
- excludePackagesToggle: PropTypes.func.isRequired,
58
70
  };
59
71
 
60
72
  export default AdvancedSettings;
@@ -1,14 +1,12 @@
1
1
  import { bindActionCreators } from 'redux';
2
2
  import { connect } from 'react-redux';
3
- import { handleToggle as hostObfuscationToggle } from '../../../../Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions';
4
- import { handleToggle as ipsObfuscationToggle } from '../../../../Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions';
5
- import { handleToggle as excludePackagesToggle } from '../../../../Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions';
3
+ import { setSetting } from '../../../../Components/InventorySettings/InventorySettingsActions';
6
4
  import AdvancedSettings from './AdvancedSettings';
7
5
  import {
8
6
  selectExcludePackages,
9
7
  selectHostObfuscationEnabled,
10
8
  selectIpsObfuscationEnabled,
11
- } from '../../../../Components/AccountList/AccountListSelectors';
9
+ } from '../../../../Components/InventorySettings/InventorySettingsSelectors';
12
10
 
13
11
  // map state to props
14
12
  const mapStateToProps = state => ({
@@ -19,10 +17,7 @@ const mapStateToProps = state => ({
19
17
 
20
18
  // map action dispatchers to props
21
19
  const mapDispatchToProps = dispatch =>
22
- bindActionCreators(
23
- { hostObfuscationToggle, ipsObfuscationToggle, excludePackagesToggle },
24
- dispatch
25
- );
20
+ bindActionCreators({ setSetting }, dispatch);
26
21
 
27
22
  // export connected component
28
23
  export default connect(mapStateToProps, mapDispatchToProps)(AdvancedSettings);
@@ -1,10 +1,12 @@
1
1
  import { bindActionCreators } from 'redux';
2
2
  import { connect } from 'react-redux';
3
3
 
4
- import * as actions from '../../Components/AutoUploadSwitcher/AutoUploadSwitcherActions';
4
+ import {
5
+ getSettings,
6
+ setSetting,
7
+ } from '../../Components/InventorySettings/InventorySettingsActions';
5
8
  import InventoryAutoUpload from './InventoryAutoUpload';
6
- import { selectAutoUploadEnabled } from '../../Components/AccountList/AccountListSelectors';
7
- import { fetchAccountsStatus as fetchSettings } from '../../Components/AccountList/AccountListActions';
9
+ import { selectAutoUploadEnabled } from '../../Components/InventorySettings/InventorySettingsSelectors';
8
10
 
9
11
  // map state to props
10
12
  const mapStateToProps = state => ({
@@ -13,7 +15,7 @@ const mapStateToProps = state => ({
13
15
 
14
16
  // map action dispatchers to props
15
17
  const mapDispatchToProps = dispatch =>
16
- bindActionCreators({ ...actions, fetchSettings }, dispatch);
18
+ bindActionCreators({ setSetting, getSettings }, dispatch);
17
19
 
18
20
  // export connected component
19
21
  export default connect(
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`ForemanInventoryUpload render without Props 1`] = `
4
4
  <div
5
- className="rh-cloud-page"
5
+ className="rh-cloud-inventory-page"
6
6
  >
7
7
  <PageLayout
8
8
  beforeToolbarComponent={<PageHeader />}
@@ -1,5 +1,5 @@
1
1
  import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
- import { noop } from 'patternfly-react';
2
+ import { noop } from 'foremanReact/common/helpers';
3
3
 
4
4
  import InsightsSettings from '../InsightsSettings';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
- import { noop } from 'patternfly-react';
2
+ import { noop } from 'foremanReact/common/helpers';
3
3
 
4
4
  import InsightsSyncSwitcher from '../InsightsSyncSwitcher';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import Immutable from 'seamless-immutable';
2
- import { noop } from 'patternfly-react';
2
+ import { noop } from 'foremanReact/common/helpers';
3
3
 
4
4
  export const hits = Immutable([
5
5
  {
@@ -1,5 +1,5 @@
1
1
  import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
- import { noop } from 'patternfly-react';
2
+ import { noop } from 'foremanReact/common/helpers';
3
3
  import InsightsCloudSync from './InsightsCloudSync';
4
4
 
5
5
  const fixtures = {
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { orderBy } from 'lodash';
4
- import { Grid, ListView, noop } from 'patternfly-react';
4
+ import { Grid, ListView } from 'patternfly-react';
5
+ import { noop } from 'foremanReact/common/helpers';
5
6
  import ListItem from './components/ListItem';
6
7
  import './InsightsTab.scss';
7
8
 
@@ -1,6 +1,6 @@
1
1
  import { STATUS } from '../../constants';
2
2
 
3
- export const selectAPI = state => state.API;
3
+ export const selectAPI = state => state.API || {};
4
4
 
5
5
  export const selectAPIByKey = (state, key) => selectAPI(state)[key] || {};
6
6
 
@@ -1,4 +1,4 @@
1
- .rh-cloud-page {
1
+ .rh-cloud-inventory-page {
2
2
  label.foreman-switcher {
3
3
  font-weight: 400;
4
4
  margin-bottom: 5px;
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: 3.0.17
4
+ version: 3.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-22 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -52,6 +52,26 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: foreman-tasks
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.3
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: 4.0.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 3.0.3
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: 4.0.0
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: foreman_ansible_core
57
77
  requirement: !ruby/object:Gem::Requirement
@@ -138,6 +158,7 @@ files:
138
158
  - app/controllers/foreman_inventory_upload/reports_controller.rb
139
159
  - app/controllers/foreman_inventory_upload/tasks_controller.rb
140
160
  - app/controllers/foreman_inventory_upload/uploads_controller.rb
161
+ - app/controllers/foreman_inventory_upload/uploads_settings_controller.rb
141
162
  - app/controllers/insights_cloud/api/machine_telemetries_controller.rb
142
163
  - app/controllers/insights_cloud/hits_controller.rb
143
164
  - app/controllers/insights_cloud/settings_controller.rb
@@ -170,6 +191,7 @@ files:
170
191
  - db/migrate/20201007121540_setup_hits_count_cache.foreman_rh_cloud.rb
171
192
  - db/migrate/20210214000001_create_rules_and_resolutions.foreman_rh_cloud.rb
172
193
  - db/migrate/20210214000002_add_rule_id_to_hits.foreman_rh_cloud.rb
194
+ - db/migrate/20210307000001_add_unique_to_insights_facet.foreman_rh_cloud.rb
173
195
  - lib/foreman_inventory_upload.rb
174
196
  - lib/foreman_inventory_upload/async/async_helpers.rb
175
197
  - lib/foreman_inventory_upload/async/generate_all_reports_job.rb
@@ -184,6 +206,7 @@ files:
184
206
  - lib/foreman_inventory_upload/generators/metadata.rb
185
207
  - lib/foreman_inventory_upload/generators/queries.rb
186
208
  - lib/foreman_inventory_upload/generators/slice.rb
209
+ - lib/foreman_inventory_upload/generators/tags.rb
187
210
  - lib/foreman_inventory_upload/notifications/manifest_import_success_notification_override.rb
188
211
  - lib/foreman_inventory_upload/scripts/uploader.sh.erb
189
212
  - lib/foreman_rh_cloud.rb
@@ -209,6 +232,7 @@ files:
209
232
  - test/controllers/insights_sync/settings_controller_test.rb
210
233
  - test/controllers/reports_controller_test.rb
211
234
  - test/controllers/uploads_controller_test.rb
235
+ - test/controllers/uploads_settings_controller_test.rb
212
236
  - test/factories/insights_factories.rb
213
237
  - test/factories/inventory_upload_factories.rb
214
238
  - test/jobs/insights_full_sync_test.rb
@@ -225,6 +249,7 @@ files:
225
249
  - test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
226
250
  - test/unit/shell_process_job_test.rb
227
251
  - test/unit/slice_generator_test.rb
252
+ - test/unit/tags_generator_test.rb
228
253
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js
229
254
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js
230
255
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js
@@ -276,15 +301,6 @@ files:
276
301
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap
277
302
  - webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss
278
303
  - webpack/ForemanInventoryUpload/Components/AccountList/index.js
279
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js
280
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js
281
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js
282
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js
283
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js
284
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
285
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap
286
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap
287
- - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js
288
304
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js
289
305
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js
290
306
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js
@@ -304,17 +320,6 @@ files:
304
320
  - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap
305
321
  - webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss
306
322
  - webpack/ForemanInventoryUpload/Components/Dashboard/index.js
307
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js
308
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js
309
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
310
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js
311
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js
312
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
313
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap
314
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap
315
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap
316
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js
317
- - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js
318
323
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js
319
324
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js
320
325
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js
@@ -329,15 +334,6 @@ files:
329
334
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap
330
335
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss
331
336
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js
332
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js
333
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js
334
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js
335
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js
336
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js
337
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js
338
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap
339
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap
340
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js
341
337
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js
342
338
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js
343
339
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js
@@ -358,20 +354,21 @@ files:
358
354
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js
359
355
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/index.js
360
356
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss
357
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingActions.js
358
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants.js
359
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/AdvancedSettingActions.test.js
360
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/__snapshots__/AdvancedSettingActions.test.js.snap
361
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
361
362
  - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js
362
363
  - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss
364
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsActions.js
365
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsConstants.js
366
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js
363
367
  - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettings.test.js
368
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js
364
369
  - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap
370
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap
365
371
  - webpack/ForemanInventoryUpload/Components/InventorySettings/index.js
366
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js
367
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js
368
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js
369
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js
370
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js
371
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js
372
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap
373
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap
374
- - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js
375
372
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js
376
373
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js
377
374
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js
@@ -618,7 +615,7 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
618
615
  licenses:
619
616
  - GPL-3.0
620
617
  metadata: {}
621
- post_install_message:
618
+ post_install_message:
622
619
  rdoc_options: []
623
620
  require_paths:
624
621
  - lib
@@ -633,29 +630,31 @@ required_rubygems_version: !ruby/object:Gem::Requirement
633
630
  - !ruby/object:Gem::Version
634
631
  version: '0'
635
632
  requirements: []
636
- rubygems_version: 3.0.6
637
- signing_key:
633
+ rubygems_version: 3.2.3
634
+ signing_key:
638
635
  specification_version: 4
639
636
  summary: Summary of ForemanRhCloud.
640
637
  test_files:
641
- - test/controllers/uploads_controller_test.rb
642
- - test/controllers/insights_sync/settings_controller_test.rb
643
638
  - test/controllers/accounts_controller_test.rb
644
639
  - test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb
640
+ - test/controllers/insights_sync/settings_controller_test.rb
645
641
  - test/controllers/reports_controller_test.rb
646
- - test/test_plugin_helper.rb
647
- - test/jobs/upload_report_job_test.rb
642
+ - test/controllers/uploads_controller_test.rb
643
+ - test/controllers/uploads_settings_controller_test.rb
644
+ - test/factories/insights_factories.rb
645
+ - test/factories/inventory_upload_factories.rb
648
646
  - test/jobs/insights_full_sync_test.rb
649
647
  - test/jobs/insights_rules_sync_test.rb
650
648
  - test/jobs/inventory_full_sync_test.rb
651
- - test/factories/inventory_upload_factories.rb
652
- - test/factories/insights_factories.rb
653
- - test/unit/shell_process_job_test.rb
654
- - test/unit/metadata_generator_test.rb
649
+ - test/jobs/upload_report_job_test.rb
650
+ - test/test_plugin_helper.rb
651
+ - test/unit/archived_report_generator_test.rb
652
+ - test/unit/fact_helpers_test.rb
655
653
  - test/unit/insights_facet_test.rb
656
- - test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
657
- - test/unit/services/foreman_rh_cloud/branch_info_test.rb
654
+ - test/unit/metadata_generator_test.rb
658
655
  - test/unit/rh_cloud_http_proxy_test.rb
659
- - test/unit/fact_helpers_test.rb
660
- - test/unit/archived_report_generator_test.rb
656
+ - test/unit/services/foreman_rh_cloud/branch_info_test.rb
657
+ - test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb
658
+ - test/unit/shell_process_job_test.rb
661
659
  - test/unit/slice_generator_test.rb
660
+ - test/unit/tags_generator_test.rb
@@ -1,3 +0,0 @@
1
- export const currentAutoUploadEnabled = false;
2
-
3
- export const handleToggleResponse = { data: { autoUploadEnabled: true } };
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { translate as __ } from 'foremanReact/common/I18n';
4
- import SwitcherPF4 from '../../../common/Switcher/SwitcherPF4';
5
-
6
- const AutoUploadSwitcher = ({ autoUploadEnabled, handleToggle }) => (
7
- <div className="auto_upload_switcher">
8
- <SwitcherPF4
9
- id="auto-upload-setting-switcher"
10
- label={__('Auto upload')}
11
- tooltip={__(
12
- 'Enable automatic upload of your hosts inventory to the Red Hat cloud'
13
- )}
14
- isChecked={autoUploadEnabled}
15
- onChange={() => handleToggle(autoUploadEnabled)}
16
- />
17
- </div>
18
- );
19
-
20
- AutoUploadSwitcher.propTypes = {
21
- autoUploadEnabled: PropTypes.bool,
22
- handleToggle: PropTypes.func.isRequired,
23
- };
24
-
25
- AutoUploadSwitcher.defaultProps = {
26
- autoUploadEnabled: true,
27
- };
28
-
29
- export default AutoUploadSwitcher;