foreman_rh_cloud 2.0.11 → 3.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +2 -0
  3. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +18 -0
  4. data/app/helpers/foreman_inventory_upload_host_helper.rb +2 -10
  5. data/app/models/concerns/rh_cloud_host.rb +4 -1
  6. data/app/models/insights_hit.rb +1 -1
  7. data/app/models/setting/rh_cloud.rb +2 -0
  8. data/app/overrides/hosts_list.rb +1 -1
  9. data/app/services/foreman_rh_cloud/cloud_auth.rb +28 -0
  10. data/app/views/foreman_rh_cloud/react/insights_cloud.html.erb +1 -6
  11. data/app/views/foreman_rh_cloud/react/inventory_upload.html.erb +1 -1
  12. data/app/views/hosts/_insights_tab.html.erb +1 -7
  13. data/app/views/layouts/foreman_rh_cloud/application.html.erb +0 -1
  14. data/config/routes.rb +2 -0
  15. data/db/migrate/20201007115752_add_hits_count_to_insights_facets_table.foreman_rh_cloud.rb +5 -0
  16. data/db/migrate/20201007121540_setup_hits_count_cache.foreman_rh_cloud.rb +10 -0
  17. data/lib/foreman_inventory_upload/async/upload_report_job.rb +2 -32
  18. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +35 -0
  19. data/lib/foreman_inventory_upload/generators/json_stream.rb +7 -2
  20. data/lib/foreman_inventory_upload/generators/queries.rb +2 -0
  21. data/lib/foreman_inventory_upload/generators/slice.rb +27 -25
  22. data/lib/foreman_rh_cloud.rb +55 -0
  23. data/lib/foreman_rh_cloud/engine.rb +6 -4
  24. data/lib/foreman_rh_cloud/version.rb +1 -1
  25. data/lib/insights_cloud/async/insights_full_sync.rb +5 -24
  26. data/lib/inventory_sync/async/inventory_full_sync.rb +3 -22
  27. data/lib/tasks/rh_cloud_inventory.rake +12 -10
  28. data/package.json +1 -1
  29. data/test/unit/fact_helpers_test.rb +22 -0
  30. data/test/unit/insights_facet_test.rb +7 -0
  31. data/test/unit/rh_cloud_http_proxy_test.rb +65 -0
  32. data/test/unit/slice_generator_test.rb +147 -2
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +14 -1
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +22 -18
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +16 -0
  36. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +6 -0
  37. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +7 -0
  38. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +12 -8
  39. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +9 -0
  40. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +19 -0
  41. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +11 -0
  42. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +6 -0
  43. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +2 -0
  44. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +1 -1
  45. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +10 -11
  46. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +0 -1
  47. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +12 -2
  48. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +1 -1
  49. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +17 -0
  50. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js +1 -0
  51. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js +30 -0
  52. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js +29 -0
  53. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js +1 -0
  54. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js +13 -0
  55. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js +21 -0
  56. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap +38 -0
  57. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap +31 -0
  58. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap +41 -0
  59. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js +36 -0
  60. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/excludePackagesSwitcher.scss +3 -0
  61. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js +20 -0
  62. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js +2 -1
  63. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js +1 -0
  64. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.scss +3 -0
  65. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js +10 -11
  66. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js +0 -2
  67. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js +12 -2
  68. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap +18 -1
  69. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +4 -0
  70. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +2 -0
  71. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js +1 -0
  72. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js +29 -0
  73. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js +29 -0
  74. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js +1 -0
  75. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js +13 -0
  76. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js +21 -0
  77. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap +38 -0
  78. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap +31 -0
  79. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js +20 -0
  80. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js +8 -2
  81. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +9 -11
  82. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonConstants.js +1 -1
  83. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonReducer.js +2 -2
  84. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonActions.test.js +18 -0
  85. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonReducer.test.js +1 -8
  86. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonActions.test.js.snap +62 -0
  87. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonReducer.test.js.snap +0 -7
  88. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +2 -2
  89. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +6 -1
  90. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +2 -4
  91. data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +8 -0
  92. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +92 -0
  93. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +17 -0
  94. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +106 -0
  95. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js +60 -0
  96. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js +28 -0
  97. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/index.js +22 -0
  98. data/webpack/ForemanRhCloudFills.js +23 -0
  99. data/webpack/ForemanRhCloudPages.js +6 -1
  100. data/webpack/ForemanRhCloudReducers.js +10 -1
  101. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsActions.js +17 -20
  102. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsConstants.js +0 -6
  103. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js +0 -4
  104. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsActions.test.js +16 -0
  105. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js +1 -24
  106. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsActions.test.js.snap +38 -4
  107. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsReducer.test.js.snap +0 -14
  108. data/webpack/InsightsCloudSync/InsightsCloudSync.js +3 -5
  109. data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +1 -3
  110. data/webpack/InsightsCloudSync/InsightsCloudSyncActions.js +10 -11
  111. data/webpack/InsightsCloudSync/InsightsCloudSyncConstants.js +0 -2
  112. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +1 -1
  113. data/webpack/InsightsHostDetailsTab/InsightsTab.js +13 -13
  114. data/webpack/InsightsHostDetailsTab/InsightsTab.scss +2 -2
  115. data/webpack/InsightsHostDetailsTab/InsightsTabActions.js +9 -8
  116. data/webpack/InsightsHostDetailsTab/InsightsTabConstants.js +0 -1
  117. data/webpack/InsightsHostDetailsTab/InsightsTabReducer.js +2 -9
  118. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTab.fixtures.js +12 -14
  119. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js +7 -1
  120. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabReducer.test.js +0 -9
  121. data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTab.test.js.snap +26 -22
  122. data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabActions.test.js.snap +38 -2
  123. data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabReducer.test.js.snap +10 -19
  124. data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabSelectors.test.js.snap +10 -12
  125. data/webpack/__mocks__/foremanReact/common/MountingService.js +1 -0
  126. data/webpack/common/Switcher/index.js +79 -0
  127. data/webpack/global_index.js +5 -0
  128. data/webpack/index.js +4 -14
  129. metadata +54 -20
  130. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/hostObfuscationSwitcher.scss +0 -0
  131. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/SubscriptionsPageExtensionActions.js +0 -34
  132. data/webpack/subscriptions_extension_index.js +0 -8
@@ -1,12 +1,5 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`AccountList reducer should handle INSIGHTS_HITS_FAILURE 1`] = `
4
- Object {
5
- "error": "some-error",
6
- "hits": Array [],
7
- }
8
- `;
9
-
10
3
  exports[`AccountList reducer should handle INSIGHTS_HITS_REQUEST 1`] = `
11
4
  Object {
12
5
  "hits": Array [],
@@ -17,18 +10,16 @@ exports[`AccountList reducer should handle INSIGHTS_HITS_SUCCESS 1`] = `
17
10
  Object {
18
11
  "hits": Array [
19
12
  Object {
20
- "insights_hit": Object {
21
- "hostname": "my-host.example.com",
22
- "last_seen": "2020-08-19T04:43:09.068706Z",
23
- "likelihood": 2,
24
- "publish_date": "2018-04-16T10:03:16Z",
25
- "results_url": "https://cloud.redhat.com/insights/advisor/recommendations/ansible_deprecated_repo%7CANSIBLE_DEPRECATED_REPO/4739b323-a343-4e89-b71b-81991b8dc656/",
26
- "rhel_version": "7.8",
27
- "solution_url": "https://access.redhat.com/node/3359651",
28
- "title": "New Ansible Engine packages are inaccessible when dedicated Ansible repo is not enabled",
29
- "total_risk": 2,
30
- "uuid": "4739b323-a343-4e89-b71b-81991b8dc656",
31
- },
13
+ "hostname": "my-host.example.com",
14
+ "last_seen": "2020-08-19T04:43:09.068706Z",
15
+ "likelihood": 2,
16
+ "publish_date": "2018-04-16T10:03:16Z",
17
+ "results_url": "https://cloud.redhat.com/insights/advisor/recommendations/ansible_deprecated_repo%7CANSIBLE_DEPRECATED_REPO/4739b323-a343-4e89-b71b-81991b8dc656/",
18
+ "rhel_version": "7.8",
19
+ "solution_url": "https://access.redhat.com/node/3359651",
20
+ "title": "New Ansible Engine packages are inaccessible when dedicated Ansible repo is not enabled",
21
+ "total_risk": 2,
22
+ "uuid": "4739b323-a343-4e89-b71b-81991b8dc656",
32
23
  },
33
24
  ],
34
25
  }
@@ -3,18 +3,16 @@
3
3
  exports[`InsightsTab selectors should return hits 1`] = `
4
4
  Array [
5
5
  Object {
6
- "insights_hit": Object {
7
- "hostname": "my-host.example.com",
8
- "last_seen": "2020-08-19T04:43:09.068706Z",
9
- "likelihood": 2,
10
- "publish_date": "2018-04-16T10:03:16Z",
11
- "results_url": "https://cloud.redhat.com/insights/advisor/recommendations/ansible_deprecated_repo%7CANSIBLE_DEPRECATED_REPO/4739b323-a343-4e89-b71b-81991b8dc656/",
12
- "rhel_version": "7.8",
13
- "solution_url": "https://access.redhat.com/node/3359651",
14
- "title": "New Ansible Engine packages are inaccessible when dedicated Ansible repo is not enabled",
15
- "total_risk": 2,
16
- "uuid": "4739b323-a343-4e89-b71b-81991b8dc656",
17
- },
6
+ "hostname": "my-host.example.com",
7
+ "last_seen": "2020-08-19T04:43:09.068706Z",
8
+ "likelihood": 2,
9
+ "publish_date": "2018-04-16T10:03:16Z",
10
+ "results_url": "https://cloud.redhat.com/insights/advisor/recommendations/ansible_deprecated_repo%7CANSIBLE_DEPRECATED_REPO/4739b323-a343-4e89-b71b-81991b8dc656/",
11
+ "rhel_version": "7.8",
12
+ "solution_url": "https://access.redhat.com/node/3359651",
13
+ "title": "New Ansible Engine packages are inaccessible when dedicated Ansible repo is not enabled",
14
+ "total_risk": 2,
15
+ "uuid": "4739b323-a343-4e89-b71b-81991b8dc656",
18
16
  },
19
17
  ]
20
18
  `;
@@ -0,0 +1 @@
1
+ export const registerReducer = jest.fn;
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Switch, Level, LevelItem } from '@patternfly/react-core';
4
+ import {
5
+ OverlayTrigger,
6
+ Tooltip,
7
+ Icon,
8
+ Grid,
9
+ ControlLabel,
10
+ noop,
11
+ } from 'patternfly-react';
12
+
13
+ const Switcher = ({
14
+ id,
15
+ label,
16
+ tooltip,
17
+ isChecked,
18
+ onChange,
19
+ labelCol = 5,
20
+ SwitchCol = 2,
21
+ }) => (
22
+ <React.Fragment>
23
+ <Grid.Col sm={labelCol}>
24
+ <ControlLabel className="control-label" style={{ paddingTop: '0' }}>
25
+ <Level>
26
+ <LevelItem>
27
+ <span className={`rh-cloud-switcher-${id}-label`}>{label}</span>
28
+ </LevelItem>
29
+ <LevelItem>
30
+ <OverlayTrigger
31
+ overlay={
32
+ <Tooltip
33
+ id={`rh-cloud-switcher-${id}-tooltip`}
34
+ style={{ zIndex: 10000 }}
35
+ >
36
+ {tooltip}
37
+ </Tooltip>
38
+ }
39
+ placement="bottom"
40
+ trigger={['hover', 'focus']}
41
+ rootClose={false}
42
+ >
43
+ <Icon type="pf" name="info" />
44
+ </OverlayTrigger>
45
+ </LevelItem>
46
+ </Level>
47
+ </ControlLabel>
48
+ </Grid.Col>
49
+ <Grid.Col sm={SwitchCol} style={{ marginBottom: '5px' }}>
50
+ <Switch
51
+ id={`rh-cloud-switcher-${id}`}
52
+ isChecked={isChecked}
53
+ onChange={onChange}
54
+ label=" "
55
+ />
56
+ </Grid.Col>
57
+ </React.Fragment>
58
+ );
59
+
60
+ Switcher.propTypes = {
61
+ id: PropTypes.string.isRequired,
62
+ label: PropTypes.string,
63
+ tooltip: PropTypes.string,
64
+ isChecked: PropTypes.bool,
65
+ onChange: PropTypes.func,
66
+ labelCol: PropTypes.number,
67
+ SwitchCol: PropTypes.number,
68
+ };
69
+
70
+ Switcher.defaultProps = {
71
+ label: null,
72
+ tooltip: null,
73
+ isChecked: true,
74
+ onChange: noop,
75
+ labelCol: 5,
76
+ SwitchCol: 2,
77
+ };
78
+
79
+ export default Switcher;
@@ -0,0 +1,5 @@
1
+ import { registerReducers } from './ForemanRhCloudReducers';
2
+ import { registerFills } from './ForemanRhCloudFills';
3
+
4
+ registerReducers();
5
+ registerFills();
@@ -1,15 +1,5 @@
1
- /* eslint import/no-unresolved: [2, { ignore: [foremanReact/*] }] */
2
- /* eslint-disable import/no-extraneous-dependencies */
3
- /* eslint-disable import/extensions */
4
- import componentRegistry from 'foremanReact/components/componentRegistry';
5
- import { registerReducer } from 'foremanReact/common/MountingService';
6
- import reducers from './ForemanRhCloudReducers';
7
- import pages from './ForemanRhCloudPages';
1
+ import { registerReducers } from './ForemanRhCloudReducers';
2
+ import { registerPages } from './ForemanRhCloudPages';
8
3
 
9
- // register reducers
10
- Object.entries(reducers).forEach(([key, reducer]) =>
11
- registerReducer(key, reducer)
12
- );
13
-
14
- // register components
15
- pages.forEach(page => componentRegistry.register(page));
4
+ registerReducers();
5
+ registerPages();
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: 2.0.11
4
+ version: 3.0.14
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: 2020-09-16 00:00:00.000000000 Z
11
+ date: 2020-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -120,6 +120,7 @@ files:
120
120
  - app/models/inventory_sync/inventory_status.rb
121
121
  - app/models/setting/rh_cloud.rb
122
122
  - app/overrides/hosts_list.rb
123
+ - app/services/foreman_rh_cloud/cloud_auth.rb
123
124
  - app/views/foreman_rh_cloud/react/insights_cloud.html.erb
124
125
  - app/views/foreman_rh_cloud/react/inventory_upload.html.erb
125
126
  - app/views/hosts/_insights_tab.html.erb
@@ -128,6 +129,8 @@ files:
128
129
  - db/migrate/20191215104806_create_insights_hits.foreman_inventory_upload.rb
129
130
  - db/migrate/20191216062008_create_insights_facets.foreman_inventory_upload.rb
130
131
  - db/migrate/20200727111529_add_uuid_column_to_insights_facets.foreman_rh_cloud.rb
132
+ - db/migrate/20201007115752_add_hits_count_to_insights_facets_table.foreman_rh_cloud.rb
133
+ - db/migrate/20201007121540_setup_hits_count_cache.foreman_rh_cloud.rb
131
134
  - lib/foreman_inventory_upload.rb
132
135
  - lib/foreman_inventory_upload/async/async_helpers.rb
133
136
  - lib/foreman_inventory_upload/async/generate_all_reports_job.rb
@@ -174,6 +177,7 @@ files:
174
177
  - test/unit/fact_helpers_test.rb
175
178
  - test/unit/insights_facet_test.rb
176
179
  - test/unit/metadata_generator_test.rb
180
+ - test/unit/rh_cloud_http_proxy_test.rb
177
181
  - test/unit/shell_process_job_test.rb
178
182
  - test/unit/slice_generator_test.rb
179
183
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js
@@ -258,6 +262,18 @@ files:
258
262
  - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap
259
263
  - webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss
260
264
  - webpack/ForemanInventoryUpload/Components/Dashboard/index.js
265
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js
266
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js
267
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
268
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js
269
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js
270
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
271
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap
272
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap
273
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap
274
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js
275
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/excludePackagesSwitcher.scss
276
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js
261
277
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js
262
278
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js
263
279
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js
@@ -274,13 +290,13 @@ files:
274
290
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js
275
291
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js
276
292
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js
293
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.scss
277
294
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js
278
295
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js
279
296
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js
280
297
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js
281
298
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap
282
299
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap
283
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/hostObfuscationSwitcher.scss
284
300
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js
285
301
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js
286
302
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js
@@ -307,6 +323,15 @@ files:
307
323
  - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap
308
324
  - webpack/ForemanInventoryUpload/Components/InventorySettings/index.js
309
325
  - webpack/ForemanInventoryUpload/Components/InventorySettings/inventorySettings.scss
326
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js
327
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js
328
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js
329
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js
330
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js
331
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js
332
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap
333
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap
334
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js
310
335
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js
311
336
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js
312
337
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js
@@ -421,12 +446,18 @@ files:
421
446
  - webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js
422
447
  - webpack/ForemanInventoryUpload/ForemanInventoryUpload.js
423
448
  - webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js
424
- - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/SubscriptionsPageExtensionActions.js
449
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js
450
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js
451
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap
452
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/AdvancedSettings.js
453
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/components/AdvancedSettings/index.js
454
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/index.js
425
455
  - webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js
426
456
  - webpack/ForemanInventoryUpload/__tests__/ForemanInventoryUpload.test.js
427
457
  - webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap
428
458
  - webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap
429
459
  - webpack/ForemanInventoryUpload/index.js
460
+ - webpack/ForemanRhCloudFills.js
430
461
  - webpack/ForemanRhCloudHelpers.js
431
462
  - webpack/ForemanRhCloudPages.js
432
463
  - webpack/ForemanRhCloudReducers.js
@@ -484,6 +515,7 @@ files:
484
515
  - webpack/InsightsHostDetailsTab/index.js
485
516
  - webpack/__mocks__/foremanReact/API.js
486
517
  - webpack/__mocks__/foremanReact/common/I18n.js
518
+ - webpack/__mocks__/foremanReact/common/MountingService.js
487
519
  - webpack/__mocks__/foremanReact/common/helpers.js
488
520
  - webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js
489
521
  - webpack/__mocks__/foremanReact/constants.js
@@ -494,13 +526,14 @@ files:
494
526
  - webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap
495
527
  - webpack/__tests__/__snapshots__/ForemanRhCloudSelectors.test.js.snap
496
528
  - webpack/__tests__/__snapshots__/ForemanRhCloudTestHelpers.test.js.snap
529
+ - webpack/common/Switcher/index.js
530
+ - webpack/global_index.js
497
531
  - webpack/index.js
498
- - webpack/subscriptions_extension_index.js
499
532
  homepage: https://github.com/theforeman/foreman_rh_cloud
500
533
  licenses:
501
534
  - GPL-3.0
502
535
  metadata: {}
503
- post_install_message:
536
+ post_install_message:
504
537
  rdoc_options: []
505
538
  require_paths:
506
539
  - lib
@@ -515,24 +548,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
515
548
  - !ruby/object:Gem::Version
516
549
  version: '0'
517
550
  requirements: []
518
- rubygems_version: 3.0.8
519
- signing_key:
551
+ rubygems_version: 3.1.4
552
+ signing_key:
520
553
  specification_version: 4
521
554
  summary: Summary of ForemanRhCloud.
522
555
  test_files:
523
- - test/test_plugin_helper.rb
524
- - test/factories/inventory_upload_factories.rb
525
- - test/factories/insights_factories.rb
526
- - test/controllers/reports_controller_test.rb
527
- - test/controllers/uploads_controller_test.rb
528
556
  - test/controllers/accounts_controller_test.rb
529
557
  - test/controllers/insights_sync/settings_controller_test.rb
530
- - test/unit/slice_generator_test.rb
558
+ - test/controllers/reports_controller_test.rb
559
+ - test/controllers/uploads_controller_test.rb
560
+ - test/factories/insights_factories.rb
561
+ - test/factories/inventory_upload_factories.rb
562
+ - test/jobs/insights_full_sync_test.rb
563
+ - test/jobs/inventory_full_sync_test.rb
564
+ - test/jobs/upload_report_job_test.rb
565
+ - test/test_plugin_helper.rb
566
+ - test/unit/archived_report_generator_test.rb
531
567
  - test/unit/metadata_generator_test.rb
532
568
  - test/unit/shell_process_job_test.rb
533
- - test/unit/insights_facet_test.rb
534
- - test/unit/archived_report_generator_test.rb
535
569
  - test/unit/fact_helpers_test.rb
536
- - test/jobs/inventory_full_sync_test.rb
537
- - test/jobs/insights_full_sync_test.rb
538
- - test/jobs/upload_report_job_test.rb
570
+ - test/unit/insights_facet_test.rb
571
+ - test/unit/rh_cloud_http_proxy_test.rb
572
+ - test/unit/slice_generator_test.rb
@@ -1,34 +0,0 @@
1
- import API from 'foremanReact/API';
2
- import { translate as __ } from 'foremanReact/common/I18n';
3
- import { foremanUrl } from '../../ForemanRhCloudHelpers';
4
- import { inventoryUrl } from '../ForemanInventoryHelpers';
5
-
6
- export const subscriptionCountListener = (itemsCount, unsubscribe) => {
7
- const showToast = autoUploadEnabled => {
8
- !autoUploadEnabled &&
9
- window.tfm.toastNotifications.notify({
10
- message: __('Now you can enable Red Hat inventory upload'),
11
- type: 'info',
12
- link: {
13
- children: __('Go to inventory upload settings'),
14
- href: foremanUrl('foreman_rh_cloud/inventory_upload'),
15
- },
16
- });
17
-
18
- unsubscribe();
19
- };
20
-
21
- itemsCount && fetchInventoryAutoUploadSetting(showToast);
22
- };
23
-
24
- const fetchInventoryAutoUploadSetting = async processApiResponse => {
25
- let settingValue;
26
- try {
27
- const {
28
- data: { autoUploadEnabled },
29
- } = await API.get(inventoryUrl('auto_upload'));
30
- settingValue = autoUploadEnabled;
31
- } finally {
32
- processApiResponse(settingValue);
33
- }
34
- };
@@ -1,8 +0,0 @@
1
- import { subscriptionCountListener } from './ForemanInventoryUpload/SubscriptionsPageExtension/SubscriptionsPageExtensionActions';
2
-
3
- if (window.location.pathname === '/subscriptions') {
4
- window.tfm.store.observeStore(
5
- 'katello.subscriptions.itemCount',
6
- subscriptionCountListener
7
- );
8
- }