foreman_rh_cloud 5.0.35 → 5.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/rh_cloud/cloud_request_controller.rb +1 -1
  3. data/app/controllers/foreman_inventory_upload/uploads_settings_controller.rb +0 -1
  4. data/app/controllers/insights_cloud/hits_controller.rb +0 -1
  5. data/app/controllers/insights_cloud/settings_controller.rb +0 -8
  6. data/app/controllers/insights_cloud/tasks_controller.rb +1 -1
  7. data/app/models/insights_facet.rb +1 -0
  8. data/app/models/insights_hit.rb +1 -0
  9. data/app/models/insights_rule.rb +2 -0
  10. data/app/models/setting/rh_cloud.rb +1 -2
  11. data/app/services/foreman_rh_cloud/cert_auth.rb +22 -0
  12. data/app/services/foreman_rh_cloud/cloud_connector.rb +10 -1
  13. data/app/services/foreman_rh_cloud/cloud_ping_service.rb +0 -27
  14. data/app/services/foreman_rh_cloud/hit_remediations_retriever.rb +4 -0
  15. data/app/services/foreman_rh_cloud/remediations_retriever.rb +7 -3
  16. data/app/services/foreman_rh_cloud/template_renderer_helper.rb +4 -3
  17. data/app/services/foreman_rh_cloud/url_remediations_retriever.rb +6 -1
  18. data/app/views/job_templates/cloud_connector.erb +6 -0
  19. data/app/views/job_templates/rh_cloud_download_playbook.erb +5 -1
  20. data/config/routes.rb +0 -1
  21. data/db/migrate/20220321000001_add_unique_to_insights_rules.foreman_rh_cloud.rb +13 -0
  22. data/lib/foreman_inventory_upload.rb +1 -1
  23. data/lib/foreman_rh_cloud/engine.rb +1 -1
  24. data/lib/foreman_rh_cloud/version.rb +1 -1
  25. data/lib/foreman_rh_cloud.rb +0 -5
  26. data/lib/insights_cloud/async/connector_playbook_execution_reporter_task.rb +7 -1
  27. data/lib/insights_cloud/async/insights_full_sync.rb +40 -24
  28. data/lib/insights_cloud/async/insights_resolutions_sync.rb +10 -13
  29. data/lib/insights_cloud/async/insights_rules_sync.rb +27 -19
  30. data/lib/insights_cloud/async/insights_scheduled_sync.rb +1 -1
  31. data/lib/insights_cloud.rb +4 -8
  32. data/lib/inventory_sync/async/host_result.rb +3 -2
  33. data/lib/inventory_sync/async/inventory_full_sync.rb +3 -3
  34. data/lib/inventory_sync/async/inventory_hosts_sync.rb +11 -10
  35. data/lib/inventory_sync/async/inventory_self_host_sync.rb +5 -6
  36. data/lib/inventory_sync/async/query_inventory_job.rb +40 -12
  37. data/lib/tasks/insights.rake +1 -1
  38. data/package.json +1 -1
  39. data/test/controllers/insights_cloud/api/cloud_request_controller_test.rb +0 -1
  40. data/test/controllers/inventory_upload/cloud_status_controller_test.rb +0 -6
  41. data/test/jobs/insights_full_sync_test.rb +9 -5
  42. data/test/jobs/insights_resolutions_sync_test.rb +7 -1
  43. data/test/jobs/insights_rules_sync_test.rb +8 -4
  44. data/test/jobs/inventory_full_sync_test.rb +16 -5
  45. data/test/jobs/inventory_hosts_sync_test.rb +18 -4
  46. data/test/jobs/inventory_self_host_sync_test.rb +6 -1
  47. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +0 -1
  48. data/test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb +1 -14
  49. data/test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb +5 -1
  50. data/test/unit/services/foreman_rh_cloud/url_remediations_retriever_test.rb +3 -1
  51. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js +0 -2
  52. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +1 -10
  53. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js +3 -12
  54. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +1 -1
  55. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButton.test.js.snap +0 -4
  56. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/index.js +0 -2
  57. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js +0 -3
  58. data/webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js +16 -0
  59. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js +0 -2
  60. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTableSelectors.test.js.snap +0 -2
  61. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/fixtures.js +0 -1
  62. data/webpack/InsightsCloudSync/InsightsCloudSync.js +1 -17
  63. data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +0 -7
  64. data/webpack/InsightsCloudSync/InsightsCloudSyncConstants.js +0 -4
  65. data/webpack/InsightsCloudSync/InsightsCloudSyncHelpers.js +0 -7
  66. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +0 -9
  67. data/webpack/InsightsCloudSync/index.js +1 -5
  68. metadata +4 -9
  69. data/app/services/foreman_rh_cloud/cloud_auth.rb +0 -44
  70. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.scss +0 -5
  71. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +0 -63
  72. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/modal.scss +0 -20
  73. data/webpack/InsightsCloudSync/Components/NoTokenEmptyState.js +0 -79
  74. data/webpack/InsightsCloudSync/Components/__tests__/NoTokenEmptyState.test.js +0 -19
  75. data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/NoTokenEmptyState.test.js.snap +0 -225
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { mount } from '@theforeman/test';
3
- import { Provider } from 'react-redux';
4
- import configureMockStore from 'redux-mock-store';
5
-
6
- import { NoTokenEmptyState } from '../NoTokenEmptyState';
7
-
8
- const mockStore = configureMockStore();
9
- const store = mockStore({});
10
- describe('NoTokenEmptyState', () => {
11
- it('render', () => {
12
- const component = mount(
13
- <Provider store={store}>
14
- <NoTokenEmptyState />
15
- </Provider>
16
- );
17
- expect(component).toMatchSnapshot();
18
- });
19
- });
@@ -1,225 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`NoTokenEmptyState render 1`] = `
4
- <Provider
5
- store={
6
- Object {
7
- "clearActions": [Function],
8
- "dispatch": [Function],
9
- "getActions": [Function],
10
- "getState": [Function],
11
- "replaceReducer": [Function],
12
- "subscribe": [Function],
13
- }
14
- }
15
- >
16
- <NoTokenEmptyState>
17
- <EmptyState
18
- variant="xl"
19
- >
20
- <div
21
- className="pf-c-empty-state pf-m-xl"
22
- >
23
- <div
24
- className="pf-c-empty-state__content"
25
- >
26
- <EmptyStateIcon
27
- icon={[Function]}
28
- >
29
- <RocketIcon
30
- aria-hidden="true"
31
- className="pf-c-empty-state__icon"
32
- color="currentColor"
33
- noVerticalAlign={false}
34
- size="sm"
35
- >
36
- <svg
37
- aria-hidden="true"
38
- aria-labelledby={null}
39
- className="pf-c-empty-state__icon"
40
- fill="currentColor"
41
- height="1em"
42
- role="img"
43
- style={
44
- Object {
45
- "verticalAlign": "-0.125em",
46
- }
47
- }
48
- viewBox="0 0 512 512"
49
- width="1em"
50
- >
51
- <path
52
- d="M505.12019,19.09375c-1.18945-5.53125-6.65819-11-12.207-12.1875C460.716,0,435.507,0,410.40747,0,307.17523,0,245.26909,55.20312,199.05238,128H94.83772c-16.34763.01562-35.55658,11.875-42.88664,26.48438L2.51562,253.29688A28.4,28.4,0,0,0,0,264a24.00867,24.00867,0,0,0,24.00582,24H127.81618l-22.47457,22.46875c-11.36521,11.36133-12.99607,32.25781,0,45.25L156.24582,406.625c11.15623,11.1875,32.15619,13.15625,45.27726,0l22.47457-22.46875V488a24.00867,24.00867,0,0,0,24.00581,24,28.55934,28.55934,0,0,0,10.707-2.51562l98.72834-49.39063c14.62888-7.29687,26.50776-26.5,26.50776-42.85937V312.79688c72.59753-46.3125,128.03493-108.40626,128.03493-211.09376C512.07526,76.5,512.07526,51.29688,505.12019,19.09375ZM384.04033,168A40,40,0,1,1,424.05,128,40.02322,40.02322,0,0,1,384.04033,168Z"
53
- />
54
- </svg>
55
- </RocketIcon>
56
- </EmptyStateIcon>
57
- <EmptyStateBody>
58
- <div
59
- className="pf-c-empty-state__body"
60
- >
61
- <p>
62
- Insights synchronization process is used to provide Insights
63
- recommendations output for hosts managed here
64
- </p>
65
- <p>
66
- To use recommendations please add a token to 'Red Hat Cloud token' setting here or in the settings page
67
- <br />
68
- You can obtain a Red Hat API token here:
69
- <a
70
- href="https://access.redhat.com/management/api"
71
- rel="noopener noreferrer"
72
- target="_blank"
73
- >
74
- access.redhat.com
75
- <ExternalLinkAltIcon
76
- color="currentColor"
77
- noVerticalAlign={false}
78
- size="sm"
79
- >
80
- <svg
81
- aria-hidden={true}
82
- aria-labelledby={null}
83
- fill="currentColor"
84
- height="1em"
85
- role="img"
86
- style={
87
- Object {
88
- "verticalAlign": "-0.125em",
89
- }
90
- }
91
- viewBox="0 0 512 512"
92
- width="1em"
93
- >
94
- <path
95
- d="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"
96
- />
97
- </svg>
98
- </ExternalLinkAltIcon>
99
- </a>
100
- <br />
101
- </p>
102
- <br />
103
- <FormGroup
104
- fieldId="input-cloud-token"
105
- label="Red Hat Cloud token:"
106
- >
107
- <div
108
- className="pf-c-form__group"
109
- >
110
- <div
111
- className="pf-c-form__group-label"
112
- >
113
- <label
114
- className="pf-c-form__label"
115
- htmlFor="input-cloud-token"
116
- >
117
- <span
118
- className="pf-c-form__label-text"
119
- >
120
- Red Hat Cloud token:
121
- </span>
122
- </label>
123
-
124
- </div>
125
- <div
126
- className="pf-c-form__group-control"
127
- >
128
- <Grid>
129
- <div
130
- className="pf-l-grid"
131
- >
132
- <GridItem
133
- span={3}
134
- >
135
- <div
136
- className="pf-l-grid__item pf-m-3-col"
137
- />
138
- </GridItem>
139
- <GridItem
140
- span={6}
141
- >
142
- <div
143
- className="pf-l-grid__item pf-m-6-col"
144
- >
145
- <TextInput
146
- aria-label="input-cloud-token"
147
- onChange={[Function]}
148
- type="password"
149
- value=""
150
- >
151
- <TextInputBase
152
- aria-label="input-cloud-token"
153
- className=""
154
- innerRef={null}
155
- isDisabled={false}
156
- isLeftTruncated={false}
157
- isReadOnly={false}
158
- isRequired={false}
159
- onChange={[Function]}
160
- ouiaSafe={true}
161
- type="password"
162
- validated="default"
163
- value=""
164
- >
165
- <input
166
- aria-invalid={false}
167
- aria-label="input-cloud-token"
168
- className="pf-c-form-control"
169
- data-ouia-component-id="OUIA-Generated-TextInputBase-1"
170
- data-ouia-component-type="PF4/TextInput"
171
- data-ouia-safe={true}
172
- disabled={false}
173
- onBlur={[Function]}
174
- onChange={[Function]}
175
- onFocus={[Function]}
176
- readOnly={false}
177
- required={false}
178
- type="password"
179
- value=""
180
- />
181
- </TextInputBase>
182
- </TextInput>
183
- </div>
184
- </GridItem>
185
- </div>
186
- </Grid>
187
- </div>
188
- </div>
189
- </FormGroup>
190
- </div>
191
- </EmptyStateBody>
192
- <Button
193
- isDisabled={true}
194
- onClick={[Function]}
195
- variant="primary"
196
- >
197
- <ButtonBase
198
- innerRef={null}
199
- isDisabled={true}
200
- onClick={[Function]}
201
- variant="primary"
202
- >
203
- <button
204
- aria-disabled={true}
205
- aria-label={null}
206
- className="pf-c-button pf-m-primary pf-m-disabled"
207
- data-ouia-component-id="OUIA-Generated-Button-primary-1"
208
- data-ouia-component-type="PF4/Button"
209
- data-ouia-safe={true}
210
- disabled={true}
211
- onClick={[Function]}
212
- role={null}
213
- tabIndex={null}
214
- type="button"
215
- >
216
- Save setting and sync recommendations
217
- </button>
218
- </ButtonBase>
219
- </Button>
220
- </div>
221
- </div>
222
- </EmptyState>
223
- </NoTokenEmptyState>
224
- </Provider>
225
- `;