foreman_rh_cloud 1.0.4.1 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +4 -6
  3. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +33 -7
  4. data/app/controllers/foreman_rh_cloud/react_controller.rb +11 -0
  5. data/app/controllers/insights_cloud/tasks_controller.rb +8 -0
  6. data/app/helpers/foreman_inventory_upload_host_helper.rb +11 -0
  7. data/app/models/insights_facet.rb +3 -0
  8. data/app/models/insights_hit.rb +6 -0
  9. data/app/models/setting/rh_cloud.rb +15 -0
  10. data/app/overrides/hosts_list.rb +13 -0
  11. data/app/views/foreman_rh_cloud/react/insights_cloud.html.erb +6 -0
  12. data/app/views/foreman_rh_cloud/react/inventory_upload.html.erb +1 -0
  13. data/app/views/{foreman_inventory_upload/layouts/react.html.erb → layouts/foreman_rh_cloud/application.html.erb} +2 -2
  14. data/config/routes.rb +12 -1
  15. data/db/migrate/20191215104806_create_insights_hits.foreman_inventory_upload.rb +14 -0
  16. data/db/migrate/20191216062008_create_insights_facets.foreman_inventory_upload.rb +7 -0
  17. data/lib/foreman_inventory_upload.rb +12 -0
  18. data/lib/foreman_inventory_upload/async/async_helpers.rb +13 -0
  19. data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +8 -0
  20. data/lib/foreman_inventory_upload/async/shell_process.rb +3 -1
  21. data/lib/foreman_inventory_upload/generators/archived_report.rb +6 -3
  22. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +56 -0
  23. data/lib/foreman_inventory_upload/generators/json_stream.rb +10 -0
  24. data/lib/foreman_inventory_upload/generators/queries.rb +7 -0
  25. data/lib/foreman_inventory_upload/generators/slice.rb +47 -21
  26. data/lib/foreman_inventory_upload/notifications/manifest_import_success_notification_override.rb +19 -0
  27. data/lib/foreman_rh_cloud/engine.rb +33 -5
  28. data/lib/foreman_rh_cloud/version.rb +1 -1
  29. data/lib/insights_cloud.rb +15 -0
  30. data/lib/insights_cloud/async/insights_full_sync.rb +96 -0
  31. data/test/controllers/accounts_controller_test.rb +8 -3
  32. data/test/controllers/uploads_controller_test.rb +13 -0
  33. data/test/jobs/insights_full_sync_test.rb +92 -0
  34. data/test/unit/archived_report_generator_test.rb +1 -0
  35. data/test/unit/fact_helpers_test.rb +29 -0
  36. data/test/unit/slice_generator_test.rb +274 -12
  37. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +14 -2
  38. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +13 -10
  39. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +6 -3
  40. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +10 -0
  41. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +16 -0
  42. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +10 -1
  43. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/EmptyResults.js +15 -0
  44. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js +13 -0
  45. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap +18 -0
  46. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +7 -0
  47. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/index.js +1 -0
  48. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +1 -4
  49. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +1 -0
  50. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +8 -1
  51. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js +12 -0
  52. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +1 -1
  53. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +22 -0
  54. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +20 -8
  55. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +2 -3
  56. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +20 -2
  57. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +20 -0
  58. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +8 -2
  59. data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +2 -0
  60. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js +1 -0
  61. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js +32 -0
  62. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +30 -0
  63. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js +2 -0
  64. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +14 -0
  65. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +14 -0
  66. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap +38 -0
  67. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap +14 -0
  68. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss +3 -0
  69. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js +17 -0
  70. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +4 -3
  71. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +1 -1
  72. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +2 -3
  73. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +2 -1
  74. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +3 -2
  75. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js +1 -0
  76. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js +29 -0
  77. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js +30 -0
  78. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js +3 -0
  79. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js +14 -0
  80. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js +14 -0
  81. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap +38 -0
  82. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap +14 -0
  83. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/hostObfuscationSwitcher.scss +0 -0
  84. data/webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js +20 -0
  85. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +26 -0
  86. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js +1 -0
  87. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js +2 -0
  88. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +39 -0
  89. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterActions.js +16 -0
  90. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterConstants.js +3 -0
  91. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js +36 -0
  92. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterSelectors.js +7 -0
  93. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +14 -0
  94. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js +14 -0
  95. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +35 -0
  96. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js +21 -0
  97. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap +25 -0
  98. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterActions.test.js.snap +17 -0
  99. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterReducer.test.js.snap +25 -0
  100. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterSelectors.test.js.snap +9 -0
  101. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap +31 -0
  102. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +18 -0
  103. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/index.js +17 -0
  104. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +28 -0
  105. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +15 -0
  106. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettings.test.js +13 -0
  107. data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap +13 -0
  108. data/webpack/ForemanInventoryUpload/Components/InventorySettings/index.js +1 -0
  109. data/webpack/ForemanInventoryUpload/Components/InventorySettings/inventorySettings.scss +15 -0
  110. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +40 -0
  111. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +13 -0
  112. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +61 -0
  113. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/DocsButton.js +17 -0
  114. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/__tests__/DocsButton.test.js +13 -0
  115. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/__tests__/__snapshots__/DocsButton.test.js.snap +20 -0
  116. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/index.js +1 -0
  117. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/HistoryButton.js +18 -0
  118. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/__tests__/HistoryButton.test.js +14 -0
  119. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/__tests__/__snapshots__/HistoryButton.test.js.snap +21 -0
  120. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/index.js +1 -0
  121. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +24 -0
  122. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js +11 -0
  123. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +17 -0
  124. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/index.js +1 -0
  125. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js +13 -0
  126. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js +12 -0
  127. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/__snapshots__/ToolbarButtons.test.js.snap +10 -0
  128. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/index.js +1 -0
  129. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/toolbarButtons.scss +7 -0
  130. data/webpack/ForemanInventoryUpload/Components/PageHeader/index.js +1 -0
  131. data/webpack/ForemanInventoryUpload/Components/PageHeader/pageHeader.scss +3 -0
  132. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +1 -0
  133. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +4 -2
  134. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +0 -1
  135. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +0 -2
  136. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +12 -1
  137. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +1 -1
  138. data/webpack/ForemanInventoryUpload/ForemanInventoryConstants.js +7 -0
  139. data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +12 -0
  140. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +18 -9
  141. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +4 -4
  142. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/SubscriptionsPageExtensionActions.js +34 -0
  143. data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +12 -0
  144. data/webpack/ForemanInventoryUpload/{ForemanInventoryUpload.test.js → __tests__/ForemanInventoryUpload.test.js} +1 -1
  145. data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +5 -0
  146. data/webpack/ForemanInventoryUpload/{__snapshots__ → __tests__/__snapshots__}/ForemanInventoryUpload.test.js.snap +6 -5
  147. data/webpack/ForemanRhCloudHelpers.js +6 -0
  148. data/webpack/ForemanRhCloudReducers.js +10 -0
  149. data/webpack/ForemanRhCloudSelectors.js +5 -0
  150. data/webpack/ForemanRhCloudTestHelpers.js +6 -0
  151. data/webpack/InsightsCloudSync/InsightsCloudSync.js +55 -0
  152. data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +16 -0
  153. data/webpack/InsightsCloudSync/InsightsCloudSyncActions.js +23 -0
  154. data/webpack/InsightsCloudSync/InsightsCloudSyncConstants.js +6 -0
  155. data/webpack/InsightsCloudSync/InsightsCloudSyncHelpers.js +3 -0
  156. data/webpack/InsightsCloudSync/InsightsCloudSyncReducers.js +3 -0
  157. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +62 -0
  158. data/webpack/InsightsCloudSync/__tests__/InsightsCloudSyncHelpers.test.js +11 -0
  159. data/webpack/InsightsCloudSync/__tests__/__snapshots__/InsightsCloudSyncHelpers.test.js.snap +3 -0
  160. data/webpack/InsightsCloudSync/index.js +17 -0
  161. data/webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js +1 -0
  162. data/webpack/__tests__/ForemanRhCloudHelpers.test.js +11 -0
  163. data/webpack/__tests__/ForemanRhCloudSelectors.test.js +19 -0
  164. data/webpack/__tests__/ForemanRhCloudTestHelpers.test.js +10 -0
  165. data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +3 -0
  166. data/webpack/__tests__/__snapshots__/ForemanRhCloudSelectors.test.js.snap +24 -0
  167. data/webpack/__tests__/__snapshots__/ForemanRhCloudTestHelpers.test.js.snap +14 -0
  168. data/webpack/index.js +8 -1
  169. data/webpack/subscriptions_extension_index.js +8 -0
  170. metadata +124 -7
  171. data/app/controllers/foreman_inventory_upload/react_controller.rb +0 -7
  172. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +0 -4
@@ -0,0 +1,11 @@
1
+ import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
2
+ import { insightsCloudUrl } from '../InsightsCloudSyncHelpers';
3
+
4
+ global.URL_PREFIX = '';
5
+
6
+ const fixtures = {
7
+ 'should return insights cloud Url': () => insightsCloudUrl('test_path'),
8
+ };
9
+
10
+ describe('InsightsCloudSync helpers', () =>
11
+ testSelectorsSnapshotWithFixtures(fixtures));
@@ -0,0 +1,3 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`InsightsCloudSync helpers should return insights cloud Url 1`] = `"/insights_cloud/test_path"`;
@@ -0,0 +1,17 @@
1
+ import { bindActionCreators } from 'redux';
2
+ import { connect } from 'react-redux';
3
+
4
+ import * as actions from './InsightsCloudSyncActions';
5
+ import InsightsCloudSync from './InsightsCloudSync';
6
+
7
+ // map state to props
8
+ const mapStateToProps = state => ({});
9
+
10
+ // map action dispatchers to props
11
+ const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
12
+
13
+ // export reducers
14
+ export const reducers = {};
15
+
16
+ // export connected component
17
+ export default connect(mapStateToProps, mapDispatchToProps)(InsightsCloudSync);
@@ -0,0 +1 @@
1
+ export const LAYOUT_CHANGE_ORG = 'LAYOUT_CHANGE_ORG';
@@ -0,0 +1,11 @@
1
+ import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
2
+ import { foremanUrl } from '../ForemanRhCloudHelpers';
3
+
4
+ global.URL_PREFIX = 'MY_TEST_URL_PREFIX.example.com';
5
+
6
+ const fixtures = {
7
+ 'should return foreman Url': () => foremanUrl('/test_path'),
8
+ };
9
+
10
+ describe('ForemanRhCloud helpers', () =>
11
+ testSelectorsSnapshotWithFixtures(fixtures));
@@ -0,0 +1,19 @@
1
+ import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
2
+ import { rhCloudStateWrapper } from '../ForemanRhCloudTestHelpers';
3
+ import {
4
+ selectForemanRhCloud,
5
+ selectForemanInventoryUpload,
6
+ selectInsightsCloudSync,
7
+ } from '../ForemanRhCloudSelectors';
8
+
9
+ const state = rhCloudStateWrapper({ inventoryReducersNamespaces: {} });
10
+
11
+ const fixtures = {
12
+ 'should return ForemanRhCloud': () => selectForemanRhCloud(state),
13
+ 'should return ForemanInventoryUpload': () =>
14
+ selectForemanInventoryUpload(state),
15
+ 'should return InsightsCloudSync': () => selectInsightsCloudSync(state),
16
+ };
17
+
18
+ describe('ForemanRhCloud selectors', () =>
19
+ testSelectorsSnapshotWithFixtures(fixtures));
@@ -0,0 +1,10 @@
1
+ import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
2
+ import { rhCloudStateWrapper } from '../ForemanRhCloudTestHelpers';
3
+
4
+ const fixtures = {
5
+ 'should return inventory wrapper': () =>
6
+ rhCloudStateWrapper({ inventoryChildren: null }),
7
+ };
8
+
9
+ describe('ForemanRhCloud helpers', () =>
10
+ testSelectorsSnapshotWithFixtures(fixtures));
@@ -0,0 +1,3 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ForemanRhCloud helpers should return foreman Url 1`] = `"MY_TEST_URL_PREFIX.example.com/test_path"`;
@@ -0,0 +1,24 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ForemanRhCloud selectors should return InsightsCloudSync 1`] = `
4
+ Object {
5
+ "inventoryReducersNamespaces": Object {},
6
+ }
7
+ `;
8
+
9
+ exports[`ForemanRhCloud selectors should return ForemanInventoryUpload 1`] = `
10
+ Object {
11
+ "inventoryReducersNamespaces": Object {},
12
+ }
13
+ `;
14
+
15
+ exports[`ForemanRhCloud selectors should return ForemanRhCloud 1`] = `
16
+ Object {
17
+ "InsightsCloudSync": Object {
18
+ "inventoryReducersNamespaces": Object {},
19
+ },
20
+ "inventoryUpload": Object {
21
+ "inventoryReducersNamespaces": Object {},
22
+ },
23
+ }
24
+ `;
@@ -0,0 +1,14 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ForemanRhCloud helpers should return inventory wrapper 1`] = `
4
+ Object {
5
+ "ForemanRhCloud": Object {
6
+ "InsightsCloudSync": Object {
7
+ "inventoryChildren": null,
8
+ },
9
+ "inventoryUpload": Object {
10
+ "inventoryChildren": null,
11
+ },
12
+ },
13
+ }
14
+ `;
@@ -3,8 +3,9 @@
3
3
  /* eslint-disable import/extensions */
4
4
  import componentRegistry from 'foremanReact/components/componentRegistry';
5
5
  import { registerReducer } from 'foremanReact/common/MountingService';
6
- import reducers from './ForemanInventoryUpload/ForemanInventoryUploadReducers';
6
+ import reducers from './ForemanRhCloudReducers';
7
7
  import ForemanInventoryUpload from './ForemanInventoryUpload';
8
+ import InsightsCloudSync from './InsightsCloudSync';
8
9
 
9
10
  // register reducers
10
11
  Object.entries(reducers).forEach(([key, reducer]) =>
@@ -16,3 +17,9 @@ componentRegistry.register({
16
17
  name: 'ForemanInventoryUpload',
17
18
  type: ForemanInventoryUpload,
18
19
  });
20
+
21
+ // register components
22
+ componentRegistry.register({
23
+ name: 'InsightsCloudSync',
24
+ type: InsightsCloudSync,
25
+ });
@@ -0,0 +1,8 @@
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
+ }
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.4.1
4
+ version: 1.0.9
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-03-31 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -105,13 +105,24 @@ files:
105
105
  - README.md
106
106
  - Rakefile
107
107
  - app/controllers/foreman_inventory_upload/accounts_controller.rb
108
- - app/controllers/foreman_inventory_upload/react_controller.rb
109
108
  - app/controllers/foreman_inventory_upload/reports_controller.rb
110
109
  - app/controllers/foreman_inventory_upload/uploads_controller.rb
110
+ - app/controllers/foreman_rh_cloud/react_controller.rb
111
+ - app/controllers/insights_cloud/tasks_controller.rb
111
112
  - app/helpers/foreman_inventory_upload_helper.rb
112
- - app/views/foreman_inventory_upload/layouts/react.html.erb
113
+ - app/helpers/foreman_inventory_upload_host_helper.rb
114
+ - app/models/insights_facet.rb
115
+ - app/models/insights_hit.rb
116
+ - app/models/setting/rh_cloud.rb
117
+ - app/overrides/hosts_list.rb
118
+ - app/views/foreman_rh_cloud/react/insights_cloud.html.erb
119
+ - app/views/foreman_rh_cloud/react/inventory_upload.html.erb
120
+ - app/views/layouts/foreman_rh_cloud/application.html.erb
113
121
  - config/routes.rb
122
+ - db/migrate/20191215104806_create_insights_hits.foreman_inventory_upload.rb
123
+ - db/migrate/20191216062008_create_insights_facets.foreman_inventory_upload.rb
114
124
  - lib/foreman_inventory_upload.rb
125
+ - lib/foreman_inventory_upload/async/async_helpers.rb
115
126
  - lib/foreman_inventory_upload/async/generate_all_reports_job.rb
116
127
  - lib/foreman_inventory_upload/async/generate_report_job.rb
117
128
  - lib/foreman_inventory_upload/async/progress_output.rb
@@ -124,10 +135,13 @@ files:
124
135
  - lib/foreman_inventory_upload/generators/metadata.rb
125
136
  - lib/foreman_inventory_upload/generators/queries.rb
126
137
  - lib/foreman_inventory_upload/generators/slice.rb
138
+ - lib/foreman_inventory_upload/notifications/manifest_import_success_notification_override.rb
127
139
  - lib/foreman_inventory_upload/scripts/uploader.sh.erb
128
140
  - lib/foreman_rh_cloud.rb
129
141
  - lib/foreman_rh_cloud/engine.rb
130
142
  - lib/foreman_rh_cloud/version.rb
143
+ - lib/insights_cloud.rb
144
+ - lib/insights_cloud/async/insights_full_sync.rb
131
145
  - lib/tasks/foreman_rh_cloud_tasks.rake
132
146
  - lib/tasks/generator.rake
133
147
  - locale/Makefile
@@ -139,8 +153,10 @@ files:
139
153
  - test/controllers/reports_controller_test.rb
140
154
  - test/controllers/uploads_controller_test.rb
141
155
  - test/factories/inventory_upload_factories.rb
156
+ - test/jobs/insights_full_sync_test.rb
142
157
  - test/test_plugin_helper.rb
143
158
  - test/unit/archived_report_generator_test.rb
159
+ - test/unit/fact_helpers_test.rb
144
160
  - test/unit/metadata_generator_test.rb
145
161
  - test/unit/shell_process_job_test.rb
146
162
  - test/unit/slice_generator_test.rb
@@ -152,6 +168,11 @@ files:
152
168
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js
153
169
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js
154
170
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js
171
+ - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/EmptyResults.js
172
+ - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js
173
+ - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap
174
+ - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss
175
+ - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/index.js
155
176
  - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js
156
177
  - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js
157
178
  - webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js
@@ -182,6 +203,7 @@ files:
182
203
  - webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss
183
204
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js
184
205
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js
206
+ - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js
185
207
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js
186
208
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
187
209
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js
@@ -191,6 +213,16 @@ files:
191
213
  - webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap
192
214
  - webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss
193
215
  - webpack/ForemanInventoryUpload/Components/AccountList/index.js
216
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.fixtures.js
217
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcher.js
218
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js
219
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherConstants.js
220
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js
221
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js
222
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcher.test.js.snap
223
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/__snapshots__/AutoUploadSwitcherActions.test.js.snap
224
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/autoUploadSwitcher.scss
225
+ - webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/index.js
194
226
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js
195
227
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js
196
228
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js
@@ -224,6 +256,41 @@ files:
224
256
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap
225
257
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss
226
258
  - webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js
259
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.fixtures.js
260
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcher.js
261
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherActions.js
262
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/HostObfuscationSwitcherConstants.js
263
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcher.test.js
264
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/HostObfuscationSwitcherActions.test.js
265
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcher.test.js.snap
266
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/__tests__/__snapshots__/HostObfuscationSwitcherActions.test.js.snap
267
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/hostObfuscationSwitcher.scss
268
+ - webpack/ForemanInventoryUpload/Components/HostObfuscationSwitcher/index.js
269
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js
270
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js
271
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js
272
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js
273
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterActions.js
274
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterConstants.js
275
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
276
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterSelectors.js
277
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js
278
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js
279
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js
280
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js
281
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap
282
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterActions.test.js.snap
283
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterReducer.test.js.snap
284
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterSelectors.test.js.snap
285
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap
286
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js
287
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/index.js
288
+ - webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss
289
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js
290
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettings.test.js
291
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettings.test.js.snap
292
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/index.js
293
+ - webpack/ForemanInventoryUpload/Components/InventorySettings/inventorySettings.scss
227
294
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js
228
295
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js
229
296
  - webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js
@@ -231,6 +298,28 @@ files:
231
298
  - webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap
232
299
  - webpack/ForemanInventoryUpload/Components/NavContainer/index.js
233
300
  - webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss
301
+ - webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js
302
+ - webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js
303
+ - webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap
304
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/DocsButton.js
305
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/__tests__/DocsButton.test.js
306
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/__tests__/__snapshots__/DocsButton.test.js.snap
307
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/DocsButton/index.js
308
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/HistoryButton.js
309
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/__tests__/HistoryButton.test.js
310
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/__tests__/__snapshots__/HistoryButton.test.js.snap
311
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/HistoryButton/index.js
312
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js
313
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js
314
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap
315
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/index.js
316
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js
317
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js
318
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/__snapshots__/ToolbarButtons.test.js.snap
319
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/index.js
320
+ - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/toolbarButtons.scss
321
+ - webpack/ForemanInventoryUpload/Components/PageHeader/index.js
322
+ - webpack/ForemanInventoryUpload/Components/PageHeader/pageHeader.scss
234
323
  - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js
235
324
  - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js
236
325
  - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js
@@ -294,15 +383,40 @@ files:
294
383
  - webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap
295
384
  - webpack/ForemanInventoryUpload/Components/Terminal/index.js
296
385
  - webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss
386
+ - webpack/ForemanInventoryUpload/ForemanInventoryConstants.js
387
+ - webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js
297
388
  - webpack/ForemanInventoryUpload/ForemanInventoryUpload.js
298
- - webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js
299
389
  - webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js
300
- - webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js
301
- - webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap
390
+ - webpack/ForemanInventoryUpload/SubscriptionsPageExtension/SubscriptionsPageExtensionActions.js
391
+ - webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js
392
+ - webpack/ForemanInventoryUpload/__tests__/ForemanInventoryUpload.test.js
393
+ - webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap
394
+ - webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap
302
395
  - webpack/ForemanInventoryUpload/index.js
396
+ - webpack/ForemanRhCloudHelpers.js
397
+ - webpack/ForemanRhCloudReducers.js
398
+ - webpack/ForemanRhCloudSelectors.js
399
+ - webpack/ForemanRhCloudTestHelpers.js
400
+ - webpack/InsightsCloudSync/InsightsCloudSync.js
401
+ - webpack/InsightsCloudSync/InsightsCloudSync.test.js
402
+ - webpack/InsightsCloudSync/InsightsCloudSyncActions.js
403
+ - webpack/InsightsCloudSync/InsightsCloudSyncConstants.js
404
+ - webpack/InsightsCloudSync/InsightsCloudSyncHelpers.js
405
+ - webpack/InsightsCloudSync/InsightsCloudSyncReducers.js
406
+ - webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap
407
+ - webpack/InsightsCloudSync/__tests__/InsightsCloudSyncHelpers.test.js
408
+ - webpack/InsightsCloudSync/__tests__/__snapshots__/InsightsCloudSyncHelpers.test.js.snap
409
+ - webpack/InsightsCloudSync/index.js
303
410
  - webpack/__mocks__/foremanReact/API.js
304
411
  - webpack/__mocks__/foremanReact/common/I18n.js
305
412
  - webpack/__mocks__/foremanReact/common/helpers.js
413
+ - webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js
414
+ - webpack/__tests__/ForemanRhCloudHelpers.test.js
415
+ - webpack/__tests__/ForemanRhCloudSelectors.test.js
416
+ - webpack/__tests__/ForemanRhCloudTestHelpers.test.js
417
+ - webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap
418
+ - webpack/__tests__/__snapshots__/ForemanRhCloudSelectors.test.js.snap
419
+ - webpack/__tests__/__snapshots__/ForemanRhCloudTestHelpers.test.js.snap
306
420
  - webpack/index.js
307
421
  - webpack/stories/ForemanInventoryUploadReducers.js
308
422
  - webpack/stories/configureStore.js
@@ -310,6 +424,7 @@ files:
310
424
  - webpack/stories/decorators/withCardsDecorator.js
311
425
  - webpack/stories/index.js
312
426
  - webpack/stories/index.scss
427
+ - webpack/subscriptions_extension_index.js
313
428
  - webpack/test_setup.js
314
429
  homepage: https://github.com/theforeman/foreman_rh_cloud
315
430
  licenses:
@@ -339,8 +454,10 @@ test_files:
339
454
  - test/controllers/accounts_controller_test.rb
340
455
  - test/controllers/reports_controller_test.rb
341
456
  - test/test_plugin_helper.rb
457
+ - test/jobs/insights_full_sync_test.rb
342
458
  - test/factories/inventory_upload_factories.rb
343
459
  - test/unit/shell_process_job_test.rb
344
460
  - test/unit/metadata_generator_test.rb
461
+ - test/unit/fact_helpers_test.rb
345
462
  - test/unit/archived_report_generator_test.rb
346
463
  - test/unit/slice_generator_test.rb
@@ -1,7 +0,0 @@
1
- module ForemanInventoryUpload
2
- class ReactController < ::ApplicationController
3
- def index
4
- render 'foreman_inventory_upload/layouts/react', :layout => false
5
- end
6
- end
7
- end
@@ -1,4 +0,0 @@
1
- // export const selectForemanInventoryUpload = state => state.ForemanInventoryUpload || {};
2
- // Added 'state' to use redux in storybook only, should be removed.
3
- export const selectForemanInventoryUpload = state =>
4
- state.ForemanInventoryUpload || state || {};