foreman_rh_cloud 1.0.11 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) 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 -3
  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 +5 -3
  8. data/app/overrides/hosts_list.rb +1 -1
  9. data/app/services/foreman_rh_cloud/cloud_auth.rb +28 -0
  10. data/config/Gemfile.lock.gh_test +757 -0
  11. data/config/database.yml.example +17 -0
  12. data/config/package-lock.json.gh_test +30855 -0
  13. data/config/routes.rb +2 -0
  14. data/db/migrate/20201007115752_add_hits_count_to_insights_facets_table.foreman_rh_cloud.rb +5 -0
  15. data/db/migrate/20201007121540_setup_hits_count_cache.foreman_rh_cloud.rb +10 -0
  16. data/lib/foreman_inventory_upload.rb +1 -1
  17. data/lib/foreman_inventory_upload/async/upload_report_job.rb +2 -8
  18. data/lib/foreman_inventory_upload/generators/archived_report.rb +1 -1
  19. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +35 -0
  20. data/lib/foreman_inventory_upload/generators/json_stream.rb +7 -2
  21. data/lib/foreman_inventory_upload/generators/queries.rb +2 -0
  22. data/lib/foreman_inventory_upload/generators/slice.rb +27 -25
  23. data/lib/foreman_rh_cloud.rb +55 -0
  24. data/lib/foreman_rh_cloud/engine.rb +3 -3
  25. data/lib/foreman_rh_cloud/version.rb +1 -1
  26. data/lib/insights_cloud/async/insights_full_sync.rb +5 -24
  27. data/lib/inventory_sync/async/inventory_full_sync.rb +3 -22
  28. data/lib/tasks/rh_cloud_inventory.rake +12 -10
  29. data/package.json +1 -1
  30. data/test/unit/fact_helpers_test.rb +22 -0
  31. data/test/unit/insights_facet_test.rb +7 -0
  32. data/test/unit/rh_cloud_http_proxy_test.rb +65 -0
  33. data/test/unit/slice_generator_test.rb +150 -2
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +14 -1
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +22 -18
  36. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +16 -0
  37. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +6 -0
  38. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +7 -0
  39. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +12 -8
  40. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +9 -0
  41. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +19 -0
  42. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +11 -0
  43. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +6 -0
  44. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +2 -0
  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__/AutoUploadSwitcherActions.test.js.snap +17 -0
  49. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js +1 -0
  50. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js +30 -0
  51. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js +29 -0
  52. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js +1 -0
  53. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js +13 -0
  54. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js +21 -0
  55. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap +38 -0
  56. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap +31 -0
  57. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap +41 -0
  58. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js +38 -0
  59. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/excludePackagesSwitcher.scss +3 -0
  60. data/webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js +20 -0
  61. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js +2 -1
  62. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js +1 -0
  63. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.scss +3 -0
  64. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js +10 -11
  65. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js +0 -2
  66. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js +12 -2
  67. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap +18 -1
  68. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +4 -0
  69. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +2 -0
  70. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js +1 -0
  71. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js +29 -0
  72. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js +29 -0
  73. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js +1 -0
  74. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js +13 -0
  75. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js +21 -0
  76. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap +38 -0
  77. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap +31 -0
  78. data/webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js +20 -0
  79. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js +8 -2
  80. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +9 -11
  81. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonConstants.js +1 -1
  82. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonReducer.js +2 -2
  83. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonActions.test.js +18 -0
  84. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonReducer.test.js +1 -8
  85. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonActions.test.js.snap +62 -0
  86. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonReducer.test.js.snap +0 -7
  87. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +2 -2
  88. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +6 -1
  89. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +2 -4
  90. data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +8 -0
  91. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsActions.js +17 -20
  92. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsConstants.js +0 -6
  93. data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js +0 -4
  94. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsActions.test.js +16 -0
  95. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/InsightsSettingsReducer.test.js +1 -24
  96. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsActions.test.js.snap +38 -4
  97. data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettingsReducer.test.js.snap +0 -14
  98. data/webpack/InsightsCloudSync/InsightsCloudSync.js +1 -1
  99. data/webpack/InsightsCloudSync/InsightsCloudSyncActions.js +10 -11
  100. data/webpack/InsightsCloudSync/InsightsCloudSyncConstants.js +0 -2
  101. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +1 -1
  102. data/webpack/InsightsHostDetailsTab/InsightsTab.scss +1 -1
  103. data/webpack/InsightsHostDetailsTab/InsightsTabActions.js +9 -8
  104. data/webpack/InsightsHostDetailsTab/InsightsTabConstants.js +0 -1
  105. data/webpack/InsightsHostDetailsTab/InsightsTabReducer.js +2 -9
  106. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js +7 -1
  107. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTabReducer.test.js +0 -9
  108. data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabActions.test.js.snap +40 -2
  109. data/webpack/InsightsHostDetailsTab/__tests__/__snapshots__/InsightsTabReducer.test.js.snap +0 -7
  110. metadata +43 -14
  111. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/hostObfuscationSwitcher.scss +0 -0
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`InsightsSettings actions should generate INSIGHTS_SYNC_SETTINGS_GET_SUCCESS action 1`] = `
3
+ exports[`InsightsSettings actions should generate INSIGHTS_SYNC_SETTING_SET action 1`] = `
4
4
  Array [
5
5
  Array [
6
6
  Object {
@@ -9,13 +9,13 @@ Array [
9
9
  "insightsSyncEnabled": true,
10
10
  },
11
11
  },
12
- "type": "INSIGHTS_SYNC_SETTINGS_GET_SUCCESS",
12
+ "type": "INSIGHTS_SYNC_SETTING_SET",
13
13
  },
14
14
  ],
15
15
  ]
16
16
  `;
17
17
 
18
- exports[`InsightsSettings actions should generate INSIGHTS_SYNC_SETTING_SET action 1`] = `
18
+ exports[`InsightsSettings actions should generate INSIGHTS_SYNC_SETTINGS_GET_SUCCESS action 1`] = `
19
19
  Array [
20
20
  Array [
21
21
  Object {
@@ -24,7 +24,41 @@ Array [
24
24
  "insightsSyncEnabled": true,
25
25
  },
26
26
  },
27
- "type": "INSIGHTS_SYNC_SETTING_SET",
27
+ "type": "INSIGHTS_SYNC_SETTINGS_GET_SUCCESS",
28
+ },
29
+ ],
30
+ ]
31
+ `;
32
+
33
+ exports[`InsightsSettings actions should handle getInsightsSyncSettings with error 1`] = `
34
+ Array [
35
+ Array [
36
+ Object {
37
+ "payload": Object {
38
+ "message": Object {
39
+ "message": "Network error!",
40
+ "sticky": true,
41
+ "type": "error",
42
+ },
43
+ },
44
+ "type": "TOASTS_ADD",
45
+ },
46
+ ],
47
+ ]
48
+ `;
49
+
50
+ exports[`InsightsSettings actions should handle setInsightsSyncEnabled with error 1`] = `
51
+ Array [
52
+ Array [
53
+ Object {
54
+ "payload": Object {
55
+ "message": Object {
56
+ "message": "Network error!",
57
+ "sticky": true,
58
+ "type": "error",
59
+ },
60
+ },
61
+ "type": "TOASTS_ADD",
28
62
  },
29
63
  ],
30
64
  ]
@@ -6,20 +6,6 @@ Object {
6
6
  }
7
7
  `;
8
8
 
9
- exports[`InsightsSettings reducer should handle INSIGHTS_SYNC_SETTING_SET_FAILURE 1`] = `
10
- Object {
11
- "error": "test set error",
12
- "insightsSyncEnabled": false,
13
- }
14
- `;
15
-
16
- exports[`InsightsSettings reducer should handle INSIGHTS_SYNC_SETTINGS_GET_FAILURE 1`] = `
17
- Object {
18
- "error": "test error",
19
- "insightsSyncEnabled": false,
20
- }
21
- `;
22
-
23
9
  exports[`InsightsSettings reducer should handle INSIGHTS_SYNC_SETTINGS_GET_SUCCESS 1`] = `
24
10
  Object {
25
11
  "insightsSyncEnabled": true,
@@ -19,7 +19,7 @@ const InsightsCloudSync = ({ data: { settingsUrl }, syncInsights }) => {
19
19
  recommendations output for hosts managed here`)}
20
20
  </p>
21
21
  <p>
22
- {__(`1. Obtain an RHSM API token: `)}
22
+ {__(`1. Obtain an Red Hat API token: `)}
23
23
  <a
24
24
  href="https://access.redhat.com/management/api"
25
25
  target="_blank"
@@ -1,9 +1,7 @@
1
1
  import API from 'foremanReact/API';
2
+ import { addToast } from 'foremanReact/redux/actions/toasts';
2
3
  import { insightsCloudUrl } from './InsightsCloudSyncHelpers';
3
- import {
4
- INSIGHTS_CLOUD_SYNC_SUCCESS,
5
- INSIGHTS_CLOUD_SYNC_FAILURE,
6
- } from './InsightsCloudSyncConstants';
4
+ import { INSIGHTS_CLOUD_SYNC_SUCCESS } from './InsightsCloudSyncConstants';
7
5
 
8
6
  export const syncInsights = () => async dispatch => {
9
7
  try {
@@ -12,12 +10,13 @@ export const syncInsights = () => async dispatch => {
12
10
  type: INSIGHTS_CLOUD_SYNC_SUCCESS,
13
11
  payload: {},
14
12
  });
15
- } catch (error) {
16
- dispatch({
17
- type: INSIGHTS_CLOUD_SYNC_FAILURE,
18
- payload: {
19
- error: error.message,
20
- },
21
- });
13
+ } catch ({ message }) {
14
+ dispatch(
15
+ addToast({
16
+ sticky: true,
17
+ type: 'error',
18
+ message,
19
+ })
20
+ );
22
21
  }
23
22
  };
@@ -1,6 +1,4 @@
1
1
  import { translate as __ } from 'foremanReact/common/I18n';
2
2
 
3
3
  export const INSIGHTS_CLOUD_SYNC_SUCCESS = 'INSIGHTS_CLOUD_SYNC_SUCCESS';
4
- export const INSIGHTS_CLOUD_SYNC_FAILURE = 'INSIGHTS_CLOUD_SYNC_FAILURE';
5
-
6
4
  export const INSIGHTS_SYNC_PAGE_TITLE = __('Red Hat Insights cloud sync');
@@ -19,7 +19,7 @@ exports[`InsightsCloudSync render 1`] = `
19
19
  recommendations output for hosts managed here
20
20
  </p>
21
21
  <p>
22
- 1. Obtain an RHSM API token:
22
+ 1. Obtain an Red Hat API token:
23
23
  <a
24
24
  href="https://access.redhat.com/management/api"
25
25
  rel="noopener noreferrer"
@@ -77,7 +77,7 @@
77
77
  }
78
78
 
79
79
  &::-webkit-scrollbar-thumb {
80
- background: #0e0e0e6e;
80
+ background: #222;
81
81
  border-radius: 6px;
82
82
  border: 3px solid transparent;
83
83
  background-clip: content-box;
@@ -1,9 +1,9 @@
1
1
  import API from 'foremanReact/API';
2
+ import { addToast } from 'foremanReact/redux/actions/toasts';
2
3
  import { insightsCloudUrl } from '../InsightsCloudSync/InsightsCloudSyncHelpers';
3
4
  import {
4
5
  INSIGHTS_HITS_REQUEST,
5
6
  INSIGHTS_HITS_SUCCESS,
6
- INSIGHTS_HITS_FAILURE,
7
7
  } from './InsightsTabConstants';
8
8
 
9
9
  export const fetchHits = hostID => async dispatch => {
@@ -19,12 +19,13 @@ export const fetchHits = hostID => async dispatch => {
19
19
  type: INSIGHTS_HITS_SUCCESS,
20
20
  payload: { hits },
21
21
  });
22
- } catch (error) {
23
- dispatch({
24
- type: INSIGHTS_HITS_FAILURE,
25
- payload: {
26
- error: error.message,
27
- },
28
- });
22
+ } catch ({ message }) {
23
+ dispatch(
24
+ addToast({
25
+ sticky: true,
26
+ type: 'error',
27
+ message,
28
+ })
29
+ );
29
30
  }
30
31
  };
@@ -1,3 +1,2 @@
1
1
  export const INSIGHTS_HITS_REQUEST = 'INSIGHTS_HITS_REQUEST';
2
2
  export const INSIGHTS_HITS_SUCCESS = 'INSIGHTS_HITS_SUCCESS';
3
- export const INSIGHTS_HITS_FAILURE = 'INSIGHTS_HITS_FAILURE';
@@ -1,25 +1,18 @@
1
1
  import Immutable from 'seamless-immutable';
2
- import {
3
- INSIGHTS_HITS_SUCCESS,
4
- INSIGHTS_HITS_FAILURE,
5
- } from './InsightsTabConstants';
2
+ import { INSIGHTS_HITS_SUCCESS } from './InsightsTabConstants';
6
3
 
7
4
  const initialState = Immutable({
8
5
  hits: [],
9
6
  });
10
7
 
11
8
  export default (state = initialState, action) => {
12
- const { payload: { hits, error } = {} } = action;
9
+ const { payload: { hits } = {} } = action;
13
10
 
14
11
  switch (action.type) {
15
12
  case INSIGHTS_HITS_SUCCESS:
16
13
  return state.merge({
17
14
  hits,
18
15
  });
19
- case INSIGHTS_HITS_FAILURE:
20
- return state.merge({
21
- error,
22
- });
23
16
  default:
24
17
  return state;
25
18
  }
@@ -4,10 +4,16 @@ import { fetchHits } from '../InsightsTabActions';
4
4
  import { hostID, hits } from './InsightsTab.fixtures';
5
5
 
6
6
  jest.mock('foremanReact/API');
7
- API.get.mockImplementation(async () => hits);
7
+ API.get.mockImplementation(async () => ({ data: { hits } }));
8
8
 
9
9
  const fixtures = {
10
10
  'should fetchHits': () => fetchHits(hostID),
11
+ 'should fetchHits with error': () => {
12
+ API.get.mockImplementationOnce(() =>
13
+ Promise.reject(new Error('Network error!'))
14
+ );
15
+ return fetchHits(hostID);
16
+ },
11
17
  };
12
18
 
13
19
  describe('InsightsTab actions', () => testActionSnapshotWithFixtures(fixtures));
@@ -4,7 +4,6 @@ import { hits } from './InsightsTab.fixtures';
4
4
  import {
5
5
  INSIGHTS_HITS_REQUEST,
6
6
  INSIGHTS_HITS_SUCCESS,
7
- INSIGHTS_HITS_FAILURE,
8
7
  } from '../InsightsTabConstants';
9
8
 
10
9
  const fixtures = {
@@ -21,14 +20,6 @@ const fixtures = {
21
20
  payload: { hits },
22
21
  },
23
22
  },
24
- 'should handle INSIGHTS_HITS_FAILURE': {
25
- action: {
26
- type: INSIGHTS_HITS_FAILURE,
27
- payload: {
28
- error: 'some-error',
29
- },
30
- },
31
- },
32
23
  };
33
24
 
34
25
  describe('AccountList reducer', () =>
@@ -11,9 +11,47 @@ Array [
11
11
  Array [
12
12
  Object {
13
13
  "payload": Object {
14
- "error": "Cannot read property 'hits' of undefined",
14
+ "hits": Array [
15
+ Object {
16
+ "insights_hit": Object {
17
+ "hostname": "my-host.example.com",
18
+ "last_seen": "2020-08-19T04:43:09.068706Z",
19
+ "likelihood": 2,
20
+ "publish_date": "2018-04-16T10:03:16Z",
21
+ "results_url": "https://cloud.redhat.com/insights/advisor/recommendations/ansible_deprecated_repo%7CANSIBLE_DEPRECATED_REPO/4739b323-a343-4e89-b71b-81991b8dc656/",
22
+ "rhel_version": "7.8",
23
+ "solution_url": "https://access.redhat.com/node/3359651",
24
+ "title": "New Ansible Engine packages are inaccessible when dedicated Ansible repo is not enabled",
25
+ "total_risk": 2,
26
+ "uuid": "4739b323-a343-4e89-b71b-81991b8dc656",
27
+ },
28
+ },
29
+ ],
15
30
  },
16
- "type": "INSIGHTS_HITS_FAILURE",
31
+ "type": "INSIGHTS_HITS_SUCCESS",
32
+ },
33
+ ],
34
+ ]
35
+ `;
36
+
37
+ exports[`InsightsTab actions should fetchHits with error 1`] = `
38
+ Array [
39
+ Array [
40
+ Object {
41
+ "payload": Object {},
42
+ "type": "INSIGHTS_HITS_REQUEST",
43
+ },
44
+ ],
45
+ Array [
46
+ Object {
47
+ "payload": Object {
48
+ "message": Object {
49
+ "message": "Network error!",
50
+ "sticky": true,
51
+ "type": "error",
52
+ },
53
+ },
54
+ "type": "TOASTS_ADD",
17
55
  },
18
56
  ],
19
57
  ]
@@ -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 [],
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: 1.0.11
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-16 00:00:00.000000000 Z
11
+ date: 2021-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -120,14 +120,20 @@ 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
126
127
  - app/views/layouts/foreman_rh_cloud/application.html.erb
128
+ - config/Gemfile.lock.gh_test
129
+ - config/database.yml.example
130
+ - config/package-lock.json.gh_test
127
131
  - config/routes.rb
128
132
  - db/migrate/20191215104806_create_insights_hits.foreman_inventory_upload.rb
129
133
  - db/migrate/20191216062008_create_insights_facets.foreman_inventory_upload.rb
130
134
  - db/migrate/20200727111529_add_uuid_column_to_insights_facets.foreman_rh_cloud.rb
135
+ - db/migrate/20201007115752_add_hits_count_to_insights_facets_table.foreman_rh_cloud.rb
136
+ - db/migrate/20201007121540_setup_hits_count_cache.foreman_rh_cloud.rb
131
137
  - lib/foreman_inventory_upload.rb
132
138
  - lib/foreman_inventory_upload/async/async_helpers.rb
133
139
  - lib/foreman_inventory_upload/async/generate_all_reports_job.rb
@@ -174,6 +180,7 @@ files:
174
180
  - test/unit/fact_helpers_test.rb
175
181
  - test/unit/insights_facet_test.rb
176
182
  - test/unit/metadata_generator_test.rb
183
+ - test/unit/rh_cloud_http_proxy_test.rb
177
184
  - test/unit/shell_process_job_test.rb
178
185
  - test/unit/slice_generator_test.rb
179
186
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js
@@ -258,6 +265,18 @@ files:
258
265
  - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap
259
266
  - webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss
260
267
  - webpack/ForemanInventoryUpload/Components/Dashboard/index.js
268
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.fixtures.js
269
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcher.js
270
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
271
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherConstants.js
272
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcher.test.js
273
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/ExcludePackagesSwitcherActions.test.js
274
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcher.test.js.snap
275
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/ExcludePackagesSwitcherActions.test.js.snap
276
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/__snapshots__/integration.test.js.snap
277
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/__tests__/integration.test.js
278
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/excludePackagesSwitcher.scss
279
+ - webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/index.js
261
280
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js
262
281
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js
263
282
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js
@@ -274,13 +293,13 @@ files:
274
293
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js
275
294
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js
276
295
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js
296
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.scss
277
297
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js
278
298
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js
279
299
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js
280
300
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js
281
301
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap
282
302
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap
283
- - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/hostObfuscationSwitcher.scss
284
303
  - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js
285
304
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js
286
305
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js
@@ -307,6 +326,15 @@ files:
307
326
  - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap
308
327
  - webpack/ForemanInventoryUpload/Components/InventorySettings/index.js
309
328
  - webpack/ForemanInventoryUpload/Components/InventorySettings/inventorySettings.scss
329
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.fixtures.js
330
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcher.js
331
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherActions.js
332
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/IpsObfuscationSwitcherConstants.js
333
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcher.test.js
334
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/IpsObfuscationSwitcherActions.test.js
335
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcher.test.js.snap
336
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/__tests__/__snapshots__/IpsObfuscationSwitcherActions.test.js.snap
337
+ - webpack/ForemanInventoryUpload/Components/IpsObfuscationSwitcher/index.js
310
338
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js
311
339
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js
312
340
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js
@@ -522,24 +550,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
522
550
  - !ruby/object:Gem::Version
523
551
  version: '0'
524
552
  requirements: []
525
- rubygems_version: 3.0.8
553
+ rubygems_version: 3.0.6
526
554
  signing_key:
527
555
  specification_version: 4
528
556
  summary: Summary of ForemanRhCloud.
529
557
  test_files:
558
+ - test/controllers/uploads_controller_test.rb
559
+ - test/controllers/insights_sync/settings_controller_test.rb
560
+ - test/controllers/accounts_controller_test.rb
561
+ - test/controllers/reports_controller_test.rb
530
562
  - test/test_plugin_helper.rb
563
+ - test/jobs/upload_report_job_test.rb
564
+ - test/jobs/insights_full_sync_test.rb
565
+ - test/jobs/inventory_full_sync_test.rb
531
566
  - test/factories/inventory_upload_factories.rb
532
567
  - test/factories/insights_factories.rb
533
- - test/controllers/reports_controller_test.rb
534
- - test/controllers/uploads_controller_test.rb
535
- - test/controllers/accounts_controller_test.rb
536
- - test/controllers/insights_sync/settings_controller_test.rb
537
- - test/unit/slice_generator_test.rb
538
- - test/unit/metadata_generator_test.rb
539
568
  - test/unit/shell_process_job_test.rb
569
+ - test/unit/metadata_generator_test.rb
540
570
  - test/unit/insights_facet_test.rb
541
- - test/unit/archived_report_generator_test.rb
571
+ - test/unit/rh_cloud_http_proxy_test.rb
542
572
  - test/unit/fact_helpers_test.rb
543
- - test/jobs/inventory_full_sync_test.rb
544
- - test/jobs/insights_full_sync_test.rb
545
- - test/jobs/upload_report_job_test.rb
573
+ - test/unit/archived_report_generator_test.rb
574
+ - test/unit/slice_generator_test.rb