foreman_rh_cloud 14.6.2 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +76 -88
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +87 -99
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +139 -151
  6. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +71 -83
  7. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +70 -82
  8. data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +16 -0
  9. data/app/services/foreman_rh_cloud/tags_auth.rb +28 -13
  10. data/config/routes.rb +10 -0
  11. data/lib/foreman_inventory_upload/generators/queries.rb +1 -1
  12. data/lib/foreman_inventory_upload/generators/slice.rb +14 -2
  13. data/lib/foreman_inventory_upload.rb +1 -7
  14. data/lib/foreman_rh_cloud/plugin.rb +14 -0
  15. data/lib/foreman_rh_cloud/version.rb +1 -1
  16. data/locale/foreman_rh_cloud.pot +246 -268
  17. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  18. data/locale/fr/foreman_rh_cloud.po +78 -91
  19. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  20. data/locale/ja/foreman_rh_cloud.po +87 -100
  21. data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  22. data/locale/ka/foreman_rh_cloud.po +139 -152
  23. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  24. data/locale/ko/foreman_rh_cloud.po +71 -84
  25. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  26. data/locale/zh_CN/foreman_rh_cloud.po +71 -84
  27. data/package.json +1 -1
  28. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +0 -1
  29. data/test/test_plugin_helper.rb +0 -8
  30. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +0 -1
  31. data/test/unit/services/foreman_rh_cloud/insights_api_forwarder_test.rb +22 -0
  32. data/test/unit/services/foreman_rh_cloud/tags_auth_test.rb +26 -0
  33. data/test/unit/slice_generator_test.rb +29 -0
  34. data/test/unit/tags_generator_test.rb +0 -1
  35. data/webpack/ComplianceHostDetailsTab/ComplianceHostDetailsTab.js +36 -0
  36. data/webpack/ComplianceHostDetailsTab/ComplianceHostDetailsTab.scss +3 -0
  37. data/webpack/ComplianceHostDetailsTab/__tests__/ComplianceHostDetailsTab.test.js +159 -0
  38. data/webpack/ComplianceHostDetailsTab/index.js +3 -0
  39. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +79 -49
  40. data/webpack/ForemanInventoryUpload/Components/TaskProgress/TaskProgress.js +1 -5
  41. data/webpack/ForemanRhCloudFills.js +11 -0
  42. data/webpack/ForemanRhCloudPages.js +7 -0
  43. data/webpack/InsightsCompliance/ComplianceIframe.js +34 -0
  44. data/webpack/InsightsCompliance/ComplianceIframe.scss +12 -0
  45. data/webpack/InsightsCompliance/InsightsCompliancePage.js +11 -0
  46. data/webpack/InsightsCompliance/InsightsCompliancePage.test.js +35 -0
  47. data/webpack/InsightsCompliance/complianceIframeConstants.js +7 -0
  48. data/webpack/InsightsCompliance/complianceIframeHelpers.js +23 -0
  49. data/webpack/InsightsCompliance/complianceIframeHelpers.test.js +50 -0
  50. data/webpack/common/Hooks/PermissionsHooks.js +10 -0
  51. data/webpack/common/IopIframe/IopAppIframe.js +74 -0
  52. data/webpack/common/IopIframe/IopHostDetailsIframe.js +66 -0
  53. data/webpack/common/IopIframe/IopHostDetailsIframe.scss +6 -0
  54. data/webpack/common/IopIframe/IopHostDetailsIframeTab.js +81 -0
  55. data/webpack/common/IopIframe/__tests__/IopAppIframe.test.js +92 -0
  56. data/webpack/common/IopIframe/__tests__/IopHostDetailsIframeTab.test.js +93 -0
  57. data/webpack/common/IopIframe/__tests__/iopIframeHelpers.test.js +63 -0
  58. data/webpack/common/IopIframe/__tests__/postIopChromeToIframe.test.js +60 -0
  59. data/webpack/common/IopIframe/__tests__/useIopIframeHeight.test.js +37 -0
  60. data/webpack/common/IopIframe/iopIframeConstants.js +5 -0
  61. data/webpack/common/IopIframe/iopIframeHelpers.js +49 -0
  62. data/webpack/common/IopIframe/postIopChromeToIframe.js +35 -0
  63. data/webpack/common/IopIframe/useIopIframeChrome.js +54 -0
  64. data/webpack/common/IopIframe/useIopIframeHeight.js +35 -0
  65. data/webpack/common/IopIframe/useIopIframeNavigate.js +40 -0
  66. metadata +28 -2
@@ -0,0 +1,40 @@
1
+ import { useEffect } from 'react';
2
+
3
+ /**
4
+ * Listens for iframe NAVIGATE messages and pushes matching Foreman paths.
5
+ *
6
+ * @param {Object} options
7
+ * @param {Object} options.history react-router v5 history
8
+ * @param {string} options.navigateMessageType
9
+ * @param {(appRoute: string) => string} options.getForemanPath
10
+ * @param {string} options.defaultAppRoute fallback when payload.appRoute is missing
11
+ */
12
+ export const useIopIframeNavigate = ({
13
+ history,
14
+ navigateMessageType,
15
+ getForemanPath,
16
+ defaultAppRoute,
17
+ }) => {
18
+ useEffect(() => {
19
+ const handleMessage = event => {
20
+ if (event.origin !== window.location.origin) {
21
+ return;
22
+ }
23
+
24
+ if (event.data?.type !== navigateMessageType) {
25
+ return;
26
+ }
27
+
28
+ const appRoute = event.data.payload?.appRoute || defaultAppRoute;
29
+ const nextPath = getForemanPath(appRoute);
30
+
31
+ if (window.location.pathname !== nextPath) {
32
+ history.push(nextPath);
33
+ }
34
+ };
35
+
36
+ window.addEventListener('message', handleMessage);
37
+
38
+ return () => window.removeEventListener('message', handleMessage);
39
+ }, [defaultAppRoute, getForemanPath, history, navigateMessageType]);
40
+ };
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.6.2
4
+ version: 15.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
@@ -282,6 +282,10 @@ files:
282
282
  - webpack/CVEsHostDetailsTab/CVEsHostDetailsTab.scss
283
283
  - webpack/CVEsHostDetailsTab/__tests__/CVEsHostDetailsTab.test.js
284
284
  - webpack/CVEsHostDetailsTab/index.js
285
+ - webpack/ComplianceHostDetailsTab/ComplianceHostDetailsTab.js
286
+ - webpack/ComplianceHostDetailsTab/ComplianceHostDetailsTab.scss
287
+ - webpack/ComplianceHostDetailsTab/__tests__/ComplianceHostDetailsTab.test.js
288
+ - webpack/ComplianceHostDetailsTab/index.js
285
289
  - webpack/CveDetailsPage/CveDetailsPage.js
286
290
  - webpack/CveDetailsPage/CveDetailsPage.test.js
287
291
  - webpack/CveDetailsPage/index.js
@@ -447,6 +451,13 @@ files:
447
451
  - webpack/InsightsCloudSync/InsightsCloudSyncReducers.js
448
452
  - webpack/InsightsCloudSync/__tests__/InsightsCloudSyncActions.test.js
449
453
  - webpack/InsightsCloudSync/index.js
454
+ - webpack/InsightsCompliance/ComplianceIframe.js
455
+ - webpack/InsightsCompliance/ComplianceIframe.scss
456
+ - webpack/InsightsCompliance/InsightsCompliancePage.js
457
+ - webpack/InsightsCompliance/InsightsCompliancePage.test.js
458
+ - webpack/InsightsCompliance/complianceIframeConstants.js
459
+ - webpack/InsightsCompliance/complianceIframeHelpers.js
460
+ - webpack/InsightsCompliance/complianceIframeHelpers.test.js
450
461
  - webpack/InsightsHostDetailsTab/InsightsTab.js
451
462
  - webpack/InsightsHostDetailsTab/InsightsTab.scss
452
463
  - webpack/InsightsHostDetailsTab/InsightsTabActions.js
@@ -494,6 +505,21 @@ files:
494
505
  - webpack/common/ForemanTasks/index.js
495
506
  - webpack/common/Hooks/ConfigHooks.js
496
507
  - webpack/common/Hooks/PermissionsHooks.js
508
+ - webpack/common/IopIframe/IopAppIframe.js
509
+ - webpack/common/IopIframe/IopHostDetailsIframe.js
510
+ - webpack/common/IopIframe/IopHostDetailsIframe.scss
511
+ - webpack/common/IopIframe/IopHostDetailsIframeTab.js
512
+ - webpack/common/IopIframe/__tests__/IopAppIframe.test.js
513
+ - webpack/common/IopIframe/__tests__/IopHostDetailsIframeTab.test.js
514
+ - webpack/common/IopIframe/__tests__/iopIframeHelpers.test.js
515
+ - webpack/common/IopIframe/__tests__/postIopChromeToIframe.test.js
516
+ - webpack/common/IopIframe/__tests__/useIopIframeHeight.test.js
517
+ - webpack/common/IopIframe/iopIframeConstants.js
518
+ - webpack/common/IopIframe/iopIframeHelpers.js
519
+ - webpack/common/IopIframe/postIopChromeToIframe.js
520
+ - webpack/common/IopIframe/useIopIframeChrome.js
521
+ - webpack/common/IopIframe/useIopIframeHeight.js
522
+ - webpack/common/IopIframe/useIopIframeNavigate.js
497
523
  - webpack/common/ScalprumModule/ScalprumContext.js
498
524
  - webpack/common/ScalprumModule/__tests__/ScalprumContext.test.js
499
525
  - webpack/common/Switcher/HelpLabel.js
@@ -528,7 +554,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
528
554
  - !ruby/object:Gem::Version
529
555
  version: '0'
530
556
  requirements: []
531
- rubygems_version: 4.0.16
557
+ rubygems_version: 4.0.20
532
558
  specification_version: 4
533
559
  summary: Summary of ForemanRhCloud.
534
560
  test_files: