foreman_rh_cloud 13.2.8 → 14.0.1

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +61 -61
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +68 -68
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +9 -9
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +60 -60
  6. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +60 -60
  7. data/app/models/concerns/rh_cloud_host.rb +1 -31
  8. data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +5 -12
  9. data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +2 -8
  10. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +0 -8
  11. data/lib/foreman_inventory_upload/generators/queries.rb +1 -1
  12. data/lib/foreman_inventory_upload/generators/slice.rb +1 -1
  13. data/lib/foreman_rh_cloud/version.rb +1 -1
  14. data/lib/insights_cloud/async/vmaas_reposcan_sync.rb +8 -23
  15. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  16. data/locale/fr/foreman_rh_cloud.edit.po +1032 -0
  17. data/locale/fr/foreman_rh_cloud.po +65 -66
  18. data/locale/fr/foreman_rh_cloud.po.time_stamp +0 -0
  19. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  20. data/locale/ja/foreman_rh_cloud.edit.po +1026 -0
  21. data/locale/ja/foreman_rh_cloud.po +70 -72
  22. data/locale/ja/foreman_rh_cloud.po.time_stamp +0 -0
  23. data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  24. data/locale/ka/foreman_rh_cloud.edit.po +1025 -0
  25. data/locale/ka/foreman_rh_cloud.po +10 -11
  26. data/locale/ka/foreman_rh_cloud.po.time_stamp +0 -0
  27. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  28. data/locale/ko/foreman_rh_cloud.edit.po +1029 -0
  29. data/locale/ko/foreman_rh_cloud.po +63 -64
  30. data/locale/ko/foreman_rh_cloud.po.time_stamp +0 -0
  31. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  32. data/locale/zh_CN/foreman_rh_cloud.edit.po +1031 -0
  33. data/locale/zh_CN/foreman_rh_cloud.po +64 -65
  34. data/locale/zh_CN/foreman_rh_cloud.po.time_stamp +0 -0
  35. data/package.json +1 -1
  36. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +1 -1
  37. data/test/jobs/inventory_full_sync_test.rb +4 -7
  38. data/test/jobs/inventory_hosts_sync_test.rb +5 -7
  39. data/test/jobs/inventory_self_host_sync_test.rb +1 -1
  40. data/test/unit/archived_report_generator_test.rb +1 -2
  41. data/test/unit/fact_helpers_test.rb +0 -16
  42. data/test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb +25 -80
  43. data/test/unit/rh_cloud_host_test.rb +0 -154
  44. data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +1 -1
  45. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +1 -1
  46. data/test/unit/slice_generator_test.rb +2 -21
  47. data/webpack/CVEsHostDetailsTab/CVEsHostDetailsTab.js +1 -6
  48. data/webpack/CVEsHostDetailsTab/__tests__/CVEsHostDetailsTab.test.js +6 -45
  49. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +1 -3
  50. data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +0 -7
  51. data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +14 -44
  52. metadata +16 -4
  53. data/webpack/InsightsHostDetailsTab/__tests__/NewHostDetailsTab.test.js +0 -154
@@ -1,154 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import { Provider } from 'react-redux';
5
- import configureMockStore from 'redux-mock-store';
6
- import thunk from 'redux-thunk';
7
- import NewHostDetailsTab from '../NewHostDetailsTab';
8
-
9
- jest.mock('../../common/Hooks/ConfigHooks', () => ({
10
- useIopConfig: jest.fn(() => false),
11
- }));
12
-
13
- jest.mock('foremanReact/common/I18n', () => ({
14
- translate: jest.fn(str => str),
15
- }));
16
-
17
- const mockStore = configureMockStore([thunk]);
18
-
19
- describe('NewHostDetailsTab', () => {
20
- let store;
21
- let mockRouter;
22
-
23
- beforeEach(() => {
24
- mockRouter = {
25
- push: jest.fn(),
26
- replace: jest.fn(),
27
- location: {
28
- pathname: '/new/hosts/test-host.example.com',
29
- search: '?page=1&per_page=20',
30
- hash: '#/Insights',
31
- query: { page: '1', per_page: '20' },
32
- },
33
- };
34
-
35
- store = mockStore({
36
- API: {},
37
- ForemanRhCloud: {
38
- InsightsCloudSync: {
39
- table: {
40
- selectedIds: {},
41
- isAllSelected: false,
42
- showSelectAllAlert: false,
43
- },
44
- },
45
- },
46
- insightsHostDetailsTab: {
47
- query: '',
48
- hits: [],
49
- selectedIds: {},
50
- error: null,
51
- },
52
- router: {
53
- location: {
54
- pathname: '/new/hosts/test-host.example.com',
55
- search: '?page=1&per_page=20',
56
- hash: '#/Insights',
57
- query: { page: '1', per_page: '20' },
58
- },
59
- },
60
- });
61
- });
62
-
63
- afterEach(() => {
64
- jest.clearAllMocks();
65
- });
66
-
67
- describe('cleanup effect', () => {
68
- it('should preserve hash when clearing search params on unmount', () => {
69
- const { unmount } = render(
70
- <Provider store={store}>
71
- <NewHostDetailsTab
72
- hostName="test-host.example.com"
73
- router={mockRouter}
74
- />
75
- </Provider>
76
- );
77
-
78
- // Unmount the component to trigger cleanup
79
- unmount();
80
-
81
- // Verify router.replace was called with both search: null AND the existing hash
82
- expect(mockRouter.replace).toHaveBeenCalledWith({
83
- search: null,
84
- hash: '#/Insights',
85
- });
86
- });
87
-
88
- it('should only clear search params when no hash exists', () => {
89
- mockRouter.location.hash = '';
90
-
91
- const { unmount } = render(
92
- <Provider store={store}>
93
- <NewHostDetailsTab
94
- hostName="test-host.example.com"
95
- router={mockRouter}
96
- />
97
- </Provider>
98
- );
99
-
100
- unmount();
101
-
102
- // When there's no hash, should only pass search: null
103
- expect(mockRouter.replace).toHaveBeenCalledWith({
104
- search: null,
105
- });
106
- });
107
-
108
- it('should handle router.location being undefined gracefully', () => {
109
- const routerWithoutLocation = {
110
- push: jest.fn(),
111
- replace: jest.fn(),
112
- location: undefined,
113
- };
114
-
115
- const { unmount } = render(
116
- <Provider store={store}>
117
- <NewHostDetailsTab
118
- hostName="test-host.example.com"
119
- router={routerWithoutLocation}
120
- />
121
- </Provider>
122
- );
123
-
124
- unmount();
125
-
126
- // Should still call replace with search: null even if location is undefined
127
- expect(routerWithoutLocation.replace).toHaveBeenCalledWith({
128
- search: null,
129
- });
130
- });
131
-
132
- it('should use the latest hash value at unmount time, not a stale captured value', () => {
133
- const { unmount } = render(
134
- <Provider store={store}>
135
- <NewHostDetailsTab
136
- hostName="test-host.example.com"
137
- router={mockRouter}
138
- />
139
- </Provider>
140
- );
141
-
142
- // Change the hash after mount, before unmount
143
- mockRouter.location.hash = '#/Overview';
144
-
145
- unmount();
146
-
147
- // Verify router.replace was called with the UPDATED hash, not the initial '#/Insights'
148
- expect(mockRouter.replace).toHaveBeenCalledWith({
149
- search: null,
150
- hash: '#/Overview',
151
- });
152
- });
153
- });
154
- });