foreman_rh_cloud 13.0.9 → 13.0.10

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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/inventory_upload/report_actions.rb +8 -1
  3. data/app/controllers/foreman_inventory_upload/accounts_controller.rb +82 -7
  4. data/app/controllers/foreman_inventory_upload/api/tasks_controller.rb +110 -0
  5. data/app/controllers/foreman_inventory_upload/reports_controller.rb +41 -17
  6. data/app/controllers/foreman_inventory_upload/uploads_controller.rb +0 -9
  7. data/config/routes.rb +4 -2
  8. data/db/migrate/20251209163012_drop_task_output_tables.foreman_rh_cloud.rb +24 -0
  9. data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +1 -1
  10. data/lib/foreman_inventory_upload/async/host_inventory_report_job.rb +39 -0
  11. data/lib/foreman_inventory_upload/async/upload_report_direct_job.rb +28 -57
  12. data/lib/foreman_rh_cloud/plugin.rb +1 -0
  13. data/lib/foreman_rh_cloud/version.rb +1 -1
  14. data/lib/tasks/rh_cloud_inventory.rake +4 -2
  15. data/package.json +1 -1
  16. data/test/controllers/accounts_controller_test.rb +10 -11
  17. data/test/controllers/insights_cloud/api/cloud_request_controller_test.rb +1 -2
  18. data/test/jobs/host_inventory_report_job_test.rb +161 -97
  19. data/test/jobs/single_host_report_job_test.rb +36 -54
  20. data/test/jobs/upload_report_direct_job_test.rb +132 -132
  21. data/test/unit/rh_cloud_permissions_test.rb +2 -0
  22. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +6 -6
  23. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +49 -34
  24. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +2 -2
  25. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +2 -2
  26. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +15 -9
  27. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +6 -5
  28. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +2 -2
  29. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +10 -14
  30. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +9 -4
  31. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +4 -4
  32. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +15 -9
  33. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +7 -7
  34. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +6 -6
  35. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +12 -12
  36. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +36 -132
  37. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +60 -17
  38. data/webpack/ForemanInventoryUpload/Components/Dashboard/index.js +1 -34
  39. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap +0 -1
  40. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +1 -26
  41. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +2 -2
  42. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +22 -9
  43. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +67 -4
  44. data/webpack/ForemanInventoryUpload/Components/TaskHistory/TaskHistory.js +140 -0
  45. data/webpack/ForemanInventoryUpload/Components/TaskHistory/index.js +1 -0
  46. data/webpack/ForemanInventoryUpload/Components/TaskHistory/taskHistory.scss +40 -0
  47. data/webpack/ForemanInventoryUpload/Components/TaskProgress/TaskProgress.js +340 -0
  48. data/webpack/ForemanInventoryUpload/Components/TaskProgress/index.js +1 -0
  49. data/webpack/ForemanInventoryUpload/Components/TaskProgress/taskProgress.scss +8 -0
  50. data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +2 -2
  51. data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +0 -2
  52. data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +1 -1
  53. data/webpack/ForemanRhCloudPages.js +0 -1
  54. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationHelpers.js +1 -2
  55. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +2 -4
  56. data/webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js +14 -0
  57. data/webpack/__tests__/ForemanRhCloudHelpers.test.js +5 -1
  58. metadata +10 -61
  59. data/app/models/task_output_line.rb +0 -2
  60. data/app/models/task_output_status.rb +0 -2
  61. data/lib/foreman_inventory_upload/async/generate_report_job.rb +0 -61
  62. data/lib/foreman_inventory_upload/async/progress_output.rb +0 -38
  63. data/lib/foreman_inventory_upload/async/shell_process.rb +0 -77
  64. data/test/controllers/reports_controller_test.rb +0 -21
  65. data/test/controllers/uploads_controller_test.rb +0 -21
  66. data/test/jobs/generate_report_job_test.rb +0 -146
  67. data/test/unit/shell_process_job_test.rb +0 -29
  68. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +0 -88
  69. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js +0 -9
  70. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js +0 -68
  71. data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +0 -17
  72. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +0 -51
  73. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +0 -17
  74. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +0 -64
  75. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +0 -46
  76. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +0 -36
  77. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap +0 -76
  78. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap +0 -44
  79. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap +0 -42
  80. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
  81. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +0 -55
  82. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
  83. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +0 -13
  84. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +0 -65
  85. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +0 -20
  86. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js +0 -1
  87. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +0 -18
  88. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +0 -65
  89. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js +0 -0
  90. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +0 -14
  91. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +0 -47
  92. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js +0 -1
  93. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss +0 -0
  94. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +0 -18
  95. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +0 -46
  96. data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js +0 -0
  97. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +0 -14
  98. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +0 -47
  99. data/webpack/ForemanInventoryUpload/Components/ReportUpload/index.js +0 -1
  100. data/webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss +0 -0
  101. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
  102. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +0 -31
  103. data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
  104. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +0 -13
  105. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +0 -19
  106. data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +0 -1
  107. data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +0 -5
  108. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js +0 -10
  109. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +0 -110
  110. data/webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js +0 -6
  111. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +0 -34
  112. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +0 -98
  113. data/webpack/ForemanInventoryUpload/Components/Terminal/index.js +0 -1
  114. data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +0 -32
@@ -0,0 +1,340 @@
1
+ /* eslint-disable max-lines */
2
+ import React, { useState, useEffect } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import {
5
+ Progress,
6
+ ProgressVariant,
7
+ Card,
8
+ CardTitle,
9
+ CardBody,
10
+ DescriptionList,
11
+ DescriptionListGroup,
12
+ DescriptionListTerm,
13
+ DescriptionListDescription,
14
+ Button,
15
+ EmptyState,
16
+ EmptyStateIcon,
17
+ EmptyStateBody,
18
+ Title,
19
+ Flex,
20
+ FlexItem,
21
+ Tooltip,
22
+ } from '@patternfly/react-core';
23
+ import { ClockIcon, DownloadIcon } from '@patternfly/react-icons';
24
+ import { translate as __ } from 'foremanReact/common/I18n';
25
+ import RelativeDateTime from 'foremanReact/components/common/dates/RelativeDateTime';
26
+ import { API } from 'foremanReact/redux/API';
27
+ import { addToast } from 'foremanReact/components/ToastsList';
28
+ import { useDispatch, useSelector } from 'react-redux';
29
+ import { inventoryUrl } from '../../ForemanInventoryHelpers';
30
+ import { selectSubscriptionConnectionEnabled } from '../InventorySettings/InventorySettingsSelectors';
31
+ import { useIopConfig } from '../../../common/Hooks/ConfigHooks';
32
+ import './taskProgress.scss';
33
+
34
+ const TaskProgress = ({
35
+ task,
36
+ title,
37
+ emptyMessage,
38
+ organizationId,
39
+ taskType,
40
+ onTaskStart,
41
+ }) => {
42
+ const dispatch = useDispatch();
43
+ const [isLoading, setIsLoading] = useState(false);
44
+ const [lastTaskId, setLastTaskId] = useState(null);
45
+
46
+ // Clear lastTaskId when the task data updates to match it
47
+ useEffect(() => {
48
+ if (lastTaskId && task?.id === lastTaskId) {
49
+ setLastTaskId(null);
50
+ }
51
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52
+ }, [task?.id, lastTaskId]);
53
+
54
+ // Track when a new task starts so we can show optimistic UI
55
+ // Show optimistic UI if we've started a new task but haven't received the updated task data yet
56
+ const isStartingNewTask = lastTaskId && task?.id !== lastTaskId;
57
+
58
+ // Check IoP mode and subscription connection settings
59
+ const subscriptionConnectionEnabled = useSelector(
60
+ selectSubscriptionConnectionEnabled
61
+ );
62
+ const isIop = Boolean(useIopConfig());
63
+ const isUploadDisabled = !isIop && !subscriptionConnectionEnabled;
64
+ const uploadDisabledTooltip = __(
65
+ 'Upload is disabled because subscription connection is not enabled. Enable it in Administer > Settings > Content.'
66
+ );
67
+
68
+ // Helper to render action buttons for generate tasks
69
+ const renderGenerateButtons = (buttonsDisabled, ouiaIdSuffix = '') => {
70
+ if (taskType !== 'generate' || !organizationId) return null;
71
+
72
+ return (
73
+ <>
74
+ <FlexItem>
75
+ {isUploadDisabled ? (
76
+ <Tooltip content={uploadDisabledTooltip}>
77
+ <span>
78
+ <Button
79
+ ouiaId={`generate-and-upload-disabled-button${ouiaIdSuffix}`}
80
+ variant="primary"
81
+ onClick={() => handleGenerateReport(false)}
82
+ isDisabled
83
+ >
84
+ {__('Generate and upload report')}
85
+ </Button>
86
+ </span>
87
+ </Tooltip>
88
+ ) : (
89
+ <Button
90
+ ouiaId={`generate-and-upload-button${ouiaIdSuffix}`}
91
+ variant="primary"
92
+ onClick={() => handleGenerateReport(false)}
93
+ isDisabled={buttonsDisabled}
94
+ >
95
+ {__('Generate and upload report')}
96
+ </Button>
97
+ )}
98
+ </FlexItem>
99
+ <FlexItem>
100
+ <Button
101
+ ouiaId={`generate-report-button${ouiaIdSuffix}`}
102
+ variant="secondary"
103
+ onClick={() => handleGenerateReport(true)}
104
+ isDisabled={buttonsDisabled}
105
+ >
106
+ {__('Generate report')}
107
+ </Button>
108
+ </FlexItem>
109
+ </>
110
+ );
111
+ };
112
+
113
+ const handleGenerateReport = async disconnected => {
114
+ setIsLoading(true);
115
+ try {
116
+ const { data } = await API.post(
117
+ inventoryUrl(`${organizationId}/reports`),
118
+ {
119
+ disconnected,
120
+ }
121
+ );
122
+
123
+ // Validate API response
124
+ if (!data || !data.id) {
125
+ throw new Error(__('Invalid response from server'));
126
+ }
127
+
128
+ // Update last task ID only if it's a new task
129
+ if (data.id !== task?.id) {
130
+ setLastTaskId(data.id);
131
+ }
132
+
133
+ // Trigger immediate poll to update UI faster
134
+ if (onTaskStart) {
135
+ onTaskStart();
136
+ }
137
+
138
+ // Use Foreman's toast notification with task link
139
+ const message = disconnected
140
+ ? __('Report generation started')
141
+ : __('Report generation and upload started');
142
+
143
+ dispatch(
144
+ addToast({
145
+ type: 'success',
146
+ message,
147
+ link: (
148
+ <a href={`/foreman_tasks/tasks/${data.id}`}>{__('View task')}</a>
149
+ ),
150
+ })
151
+ );
152
+ } catch (error) {
153
+ dispatch(
154
+ addToast({
155
+ sticky: true,
156
+ type: 'error',
157
+ message: error.message,
158
+ })
159
+ );
160
+ } finally {
161
+ setIsLoading(false);
162
+ }
163
+ };
164
+
165
+ const handleDownloadReport = () => {
166
+ window.location.href = `/api/v2/organizations/${organizationId}/rh_cloud/report`;
167
+ };
168
+
169
+ if (!task) {
170
+ return (
171
+ <EmptyState>
172
+ <EmptyStateIcon icon={ClockIcon} />
173
+ <Title headingLevel="h4" size="lg" ouiaId="task-progress-empty-title">
174
+ {__('No recent tasks')}
175
+ </Title>
176
+ <EmptyStateBody>
177
+ {emptyMessage || __('No tasks have been run yet.')}
178
+ </EmptyStateBody>
179
+ <Flex className="task-progress-actions">
180
+ {renderGenerateButtons(isLoading)}
181
+ </Flex>
182
+ </EmptyState>
183
+ );
184
+ }
185
+
186
+ const getProgressVariant = () => {
187
+ if (task.state !== 'stopped') return ProgressVariant.info;
188
+ if (task.result === 'success') return ProgressVariant.success;
189
+ if (task.result === 'error') return ProgressVariant.danger;
190
+ if (task.result === 'warning') return ProgressVariant.warning;
191
+ return ProgressVariant.info;
192
+ };
193
+
194
+ const getStateLabel = () => {
195
+ if (task.state === 'running') return __('Running');
196
+ if (task.state === 'paused') return __('Paused');
197
+ if (task.state === 'stopped') {
198
+ if (task.result === 'success') return __('Completed');
199
+ if (task.result === 'error') return __('Failed');
200
+ if (task.result === 'warning') return __('Completed with warnings');
201
+ return __('Stopped');
202
+ }
203
+ return task.state;
204
+ };
205
+
206
+ const formatDuration = seconds => {
207
+ if (
208
+ seconds === null ||
209
+ seconds === undefined ||
210
+ typeof seconds !== 'number' ||
211
+ Number.isNaN(seconds) ||
212
+ seconds < 0
213
+ ) {
214
+ return '';
215
+ }
216
+ const mins = Math.floor(seconds / 60);
217
+ const secs = Math.floor(seconds % 60);
218
+ if (mins > 0) {
219
+ return `${mins}m ${secs}s`;
220
+ }
221
+ return `${secs}s`;
222
+ };
223
+
224
+ const isTaskRunning = task.state === 'running' || task.state === 'paused';
225
+
226
+ // Buttons should be disabled if loading, task is running, or we're waiting for new task data
227
+ const areButtonsDisabled = isLoading || isTaskRunning || isStartingNewTask;
228
+
229
+ // Show 100% for completed tasks, otherwise use reported progress
230
+ // If starting a new task, show 0% to give immediate feedback
231
+ let progressValue = 0;
232
+ if (isStartingNewTask) {
233
+ progressValue = 0;
234
+ } else if (task.state === 'stopped') {
235
+ progressValue = 100;
236
+ } else {
237
+ progressValue = task.progress || 0;
238
+ }
239
+
240
+ // Override state label and variant when starting new task
241
+ const displayStateLabel = isStartingNewTask ? __('Running') : getStateLabel();
242
+ const displayVariant = isStartingNewTask
243
+ ? ProgressVariant.info
244
+ : getProgressVariant();
245
+
246
+ return (
247
+ <Card className="task-progress-card" ouiaId="task-progress-card">
248
+ {title && <CardTitle>{title}</CardTitle>}
249
+ <CardBody>
250
+ <Progress
251
+ value={progressValue}
252
+ title={displayStateLabel}
253
+ variant={displayVariant}
254
+ measureLocation="outside"
255
+ aria-label="task-progress"
256
+ />
257
+ <DescriptionList
258
+ isHorizontal
259
+ className="task-progress-details"
260
+ ouiaId="task-progress-details"
261
+ >
262
+ <DescriptionListGroup>
263
+ <DescriptionListTerm>{__('Started')}</DescriptionListTerm>
264
+ <DescriptionListDescription>
265
+ {!isStartingNewTask && task.started_at && (
266
+ <RelativeDateTime date={task.started_at} />
267
+ )}
268
+ </DescriptionListDescription>
269
+ </DescriptionListGroup>
270
+ <DescriptionListGroup>
271
+ <DescriptionListTerm>{__('Duration')}</DescriptionListTerm>
272
+ <DescriptionListDescription>
273
+ {!isStartingNewTask && formatDuration(task.duration)}
274
+ </DescriptionListDescription>
275
+ </DescriptionListGroup>
276
+ <DescriptionListGroup>
277
+ <DescriptionListTerm>{__('Report saved to')}</DescriptionListTerm>
278
+ <DescriptionListDescription>
279
+ {!isStartingNewTask && task.report_file_path}
280
+ </DescriptionListDescription>
281
+ </DescriptionListGroup>
282
+ </DescriptionList>
283
+ <Flex className="task-progress-actions">
284
+ <FlexItem>
285
+ <Button
286
+ ouiaId="view-task-details-button"
287
+ component="a"
288
+ href={`/foreman_tasks/tasks/${task.id}`}
289
+ variant="link"
290
+ isInline
291
+ >
292
+ {__('View task details')}
293
+ </Button>
294
+ </FlexItem>
295
+ <FlexItem>
296
+ <Button
297
+ ouiaId="download-report-button"
298
+ variant="secondary"
299
+ onClick={handleDownloadReport}
300
+ icon={<DownloadIcon />}
301
+ isDisabled={!task.report_file_path || areButtonsDisabled}
302
+ >
303
+ {__('Download report')}
304
+ </Button>
305
+ </FlexItem>
306
+ {renderGenerateButtons(areButtonsDisabled, '-task-view')}
307
+ </Flex>
308
+ </CardBody>
309
+ </Card>
310
+ );
311
+ };
312
+
313
+ TaskProgress.propTypes = {
314
+ task: PropTypes.shape({
315
+ id: PropTypes.string.isRequired,
316
+ state: PropTypes.string.isRequired,
317
+ result: PropTypes.string,
318
+ progress: PropTypes.number,
319
+ started_at: PropTypes.string,
320
+ ended_at: PropTypes.string,
321
+ duration: PropTypes.number,
322
+ report_file_path: PropTypes.string,
323
+ }),
324
+ title: PropTypes.string,
325
+ emptyMessage: PropTypes.string,
326
+ organizationId: PropTypes.number,
327
+ taskType: PropTypes.oneOf(['generate', 'upload']),
328
+ onTaskStart: PropTypes.func,
329
+ };
330
+
331
+ TaskProgress.defaultProps = {
332
+ task: null,
333
+ title: null,
334
+ emptyMessage: null,
335
+ organizationId: null,
336
+ taskType: null,
337
+ onTaskStart: null,
338
+ };
339
+
340
+ export default TaskProgress;
@@ -0,0 +1 @@
1
+ export { default } from './TaskProgress';
@@ -0,0 +1,8 @@
1
+ .task-progress-card {
2
+ margin-bottom: 1rem;
3
+
4
+ .task-progress-details {
5
+ margin-top: 1rem;
6
+ margin-bottom: 1rem;
7
+ }
8
+ }
@@ -7,13 +7,13 @@ export const inventoryUrl = path =>
7
7
  export const getInventoryDocsUrl = () =>
8
8
  foremanUrl(
9
9
  `/links/manual/?root_url=${URI.encode(
10
- 'https://access.redhat.com/documentation/en-us/red_hat_insights/2023/html/red_hat_insights_remediations_guide/host-communication-with-insights_red-hat-insights-remediation-guide#uploading-satellite-host-inventory-to-insights_configuring-satellite-cloud-connector'
10
+ 'https://docs.redhat.com/en/documentation/red_hat_lightspeed/1-latest/html-single/red_hat_lightspeed_remediations_guide/index'
11
11
  )}`
12
12
  );
13
13
 
14
14
  export const getActionsHistoryUrl = () =>
15
15
  foremanUrl(
16
- '/foreman_tasks/tasks?search=label+%3D+ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateReportJob+or+label+%3D+ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateAllReportsJob&page=1'
16
+ '/foreman_tasks/tasks?search=label+%3D+ForemanInventoryUpload%3A%3AAsync%3A%3AHostInventoryReportJob+or+label+%3D+ForemanInventoryUpload%3A%3AAsync%3A%3AGenerateAllReportsJob&page=1'
17
17
  );
18
18
 
19
19
  export const isExitCodeLoading = exitCode => {
@@ -1,12 +1,10 @@
1
1
  import { combineReducers } from 'redux';
2
2
  import { reducers as accountListReducers } from './Components/AccountList';
3
- import { reducers as dashboardReducers } from './Components/Dashboard';
4
3
  import { reducers as filterReducers } from './Components/InventoryFilter';
5
4
 
6
5
  export default {
7
6
  inventoryUpload: combineReducers({
8
7
  ...accountListReducers,
9
- ...dashboardReducers,
10
8
  ...filterReducers,
11
9
  }),
12
10
  };
@@ -2,4 +2,4 @@
2
2
 
3
3
  exports[`ForemanInventoryUpload helpers should return inventory Url 1`] = `"/foreman_inventory_upload/test_path"`;
4
4
 
5
- exports[`ForemanInventoryUpload helpers should return inventory docs url 1`] = `"/links/manual/?root_url=https%3A%2F%2Faccess.redhat.com%2Fdocumentation%2Fen-us%2Fred_hat_insights%2F2023%2Fhtml%2Fred_hat_insights_remediations_guide%2Fhost-communication-with-insights_red-hat-insights-remediation-guide%23uploading-satellite-host-inventory-to-insights_configuring-satellite-cloud-connector"`;
5
+ exports[`ForemanInventoryUpload helpers should return inventory docs url 1`] = `"/links/manual/?root_url=https%3A%2F%2Fdocs.redhat.com%2Fen%2Fdocumentation%2Fred_hat_lightspeed%2F1-latest%2Fhtml-single%2Fred_hat_lightspeed_remediations_guide%2Findex"`;
@@ -1,4 +1,3 @@
1
- /* eslint-disable spellcheck/spell-checker */
2
1
  import React from 'react';
3
2
  import componentRegistry from 'foremanReact/components/componentRegistry';
4
3
  import { registerRoutes as foremanRegisterRoutes } from 'foremanReact/routes/RoutingService';
@@ -25,11 +25,11 @@ export const modifyRows = (
25
25
  ).map(({ id, host_id, hostname, title, resolutions, reboot }) => {
26
26
  hostsIdsToSubmit.add(host_id);
27
27
  const selectedResolution = resolutions[0]?.id;
28
- /* eslint-disable spellcheck/spell-checker */
29
28
 
30
29
  // For IoP:
31
30
  // All of the values will be plain strings
32
31
  // {
32
+ // eslint-disable-next-line spellcheck/spell-checker
33
33
  // hit_id: "c7c6727e-2966-4f7c-87f1-20ef14db7a2d", <-- this refers to a host by insights ID
34
34
  // rule_id: "hardening_ssh_client_alive|OPENSSH_HARDENING_CLIENT_ALIVE",
35
35
  // resolution_type: "less_secure",
@@ -41,7 +41,6 @@ export const modifyRows = (
41
41
  // rule_id refers to an InsightsRule
42
42
  // resolution_type and resolution_id both refer to an InsightsResolution (InsightsHit.find(xx).rule.resolutions)
43
43
 
44
- /* eslint-enable spellcheck/spell-checker */
45
44
  resolutionToSubmit.push({
46
45
  hit_id: isIop ? host_id : id,
47
46
  rule_id: id,
@@ -18,11 +18,10 @@ import TableEmptyState from '../../../common/table/EmptyState';
18
18
  import './RemediationModal.scss';
19
19
  import { useIopConfig } from '../../../common/Hooks/ConfigHooks';
20
20
 
21
- /* eslint-disable spellcheck/spell-checker */
22
-
23
21
  // Sample iopData:
24
22
  // const iopTestData = Immutable([
25
23
  // {
24
+ // eslint-disable-next-line spellcheck/spell-checker
26
25
  // hostid: 'c7c6727e-2966-4f7c-87f1-20ef14db7a2d',
27
26
  // host_name: 'advisor-test.local',
28
27
  // rulename: 'hardening_cryptopol_krb5|NO_CPOL_KRB5',
@@ -38,6 +37,7 @@ import { useIopConfig } from '../../../common/Hooks/ConfigHooks';
38
37
  // description: 'Decreased security: krb5 crypto-policies overridden',
39
38
  // },
40
39
  // {
40
+ // eslint-disable-next-line spellcheck/spell-checker
41
41
  // hostid: 'c7c6727e-2966-4f7c-87f1-20ef14db7a2d',
42
42
  // host_name: 'advisor-test.local',
43
43
  // rulename: 'hardening_logging_auditd|HARDENING_LOGGING_5_AUDITD',
@@ -54,8 +54,6 @@ import { useIopConfig } from '../../../common/Hooks/ConfigHooks';
54
54
  // },
55
55
  // ]);
56
56
 
57
- /* eslint-enable spellcheck/spell-checker */
58
-
59
57
  const RemediationModal = ({
60
58
  iopData,
61
59
  selectedIds,
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const RelativeDateTime = ({ date }) => <span>{date}</span>;
5
+
6
+ RelativeDateTime.propTypes = {
7
+ date: PropTypes.string,
8
+ };
9
+
10
+ RelativeDateTime.defaultProps = {
11
+ date: '',
12
+ };
13
+
14
+ export default RelativeDateTime;
@@ -1,5 +1,9 @@
1
1
  import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
2
- import { foremanUrl, vulnerabilityDisabled, hasNoInsightsFacet } from '../ForemanRhCloudHelpers';
2
+ import {
3
+ foremanUrl,
4
+ vulnerabilityDisabled,
5
+ hasNoInsightsFacet,
6
+ } from '../ForemanRhCloudHelpers';
3
7
 
4
8
  global.URL_PREFIX = 'MY_TEST_URL_PREFIX.example.com';
5
9
 
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: 13.0.9
4
+ version: 13.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
@@ -106,6 +106,7 @@ files:
106
106
  - app/controllers/concerns/inventory_upload/report_actions.rb
107
107
  - app/controllers/concerns/inventory_upload/task_actions.rb
108
108
  - app/controllers/foreman_inventory_upload/accounts_controller.rb
109
+ - app/controllers/foreman_inventory_upload/api/tasks_controller.rb
109
110
  - app/controllers/foreman_inventory_upload/cloud_status_controller.rb
110
111
  - app/controllers/foreman_inventory_upload/missing_hosts_controller.rb
111
112
  - app/controllers/foreman_inventory_upload/reports_controller.rb
@@ -130,8 +131,6 @@ files:
130
131
  - app/models/insights_resolution.rb
131
132
  - app/models/insights_rule.rb
132
133
  - app/models/inventory_sync/inventory_status.rb
133
- - app/models/task_output_line.rb
134
- - app/models/task_output_status.rb
135
134
  - app/overrides/layouts/base/styles.html.erb.deface
136
135
  - app/services/foreman_rh_cloud/branch_info.rb
137
136
  - app/services/foreman_rh_cloud/cert_auth.rb
@@ -179,6 +178,7 @@ files:
179
178
  - db/migrate/20230515140211_add_missing_hosts_table.foreman_rh_cloud.rb
180
179
  - db/migrate/20241217190624_add_unique_index_to_rule_id_and_host_id_in_insights_hits.rb
181
180
  - db/migrate/20241220184900_change_sync_insights_recommendations_to_true.rb
181
+ - db/migrate/20251209163012_drop_task_output_tables.foreman_rh_cloud.rb
182
182
  - db/seeds.d/179_ui_notifications.rb
183
183
  - db/seeds.d/189_add_host_inventory_param.rb
184
184
  - db/seeds.d/200_features.rb
@@ -189,12 +189,9 @@ files:
189
189
  - lib/foreman_inventory_upload/async/delayed_start.rb
190
190
  - lib/foreman_inventory_upload/async/generate_all_reports_job.rb
191
191
  - lib/foreman_inventory_upload/async/generate_host_report.rb
192
- - lib/foreman_inventory_upload/async/generate_report_job.rb
193
192
  - lib/foreman_inventory_upload/async/host_inventory_report_job.rb
194
- - lib/foreman_inventory_upload/async/progress_output.rb
195
193
  - lib/foreman_inventory_upload/async/queue_for_upload_job.rb
196
194
  - lib/foreman_inventory_upload/async/remove_insights_hosts_job.rb
197
- - lib/foreman_inventory_upload/async/shell_process.rb
198
195
  - lib/foreman_inventory_upload/async/single_host_report_job.rb
199
196
  - lib/foreman_inventory_upload/async/upload_report_direct_job.rb
200
197
  - lib/foreman_inventory_upload/generators/archived_report.rb
@@ -255,8 +252,6 @@ files:
255
252
  - test/controllers/insights_sync/settings_controller_test.rb
256
253
  - test/controllers/inventory_upload/api/inventory_controller_test.rb
257
254
  - test/controllers/inventory_upload/cloud_status_controller_test.rb
258
- - test/controllers/reports_controller_test.rb
259
- - test/controllers/uploads_controller_test.rb
260
255
  - test/controllers/uploads_settings_controller_test.rb
261
256
  - test/factories/insights_factories.rb
262
257
  - test/factories/inventory_upload_factories.rb
@@ -265,7 +260,6 @@ files:
265
260
  - test/jobs/create_missing_insights_facets_test.rb
266
261
  - test/jobs/exponential_backoff_test.rb
267
262
  - test/jobs/generate_host_report_test.rb
268
- - test/jobs/generate_report_job_test.rb
269
263
  - test/jobs/host_inventory_report_job_test.rb
270
264
  - test/jobs/insights_client_status_aging_test.rb
271
265
  - test/jobs/insights_full_sync_test.rb
@@ -302,7 +296,6 @@ files:
302
296
  - test/unit/services/foreman_rh_cloud/tags_auth_test.rb
303
297
  - test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb
304
298
  - test/unit/services/foreman_rh_cloud/url_remediations_retriever_test.rb
305
- - test/unit/shell_process_job_test.rb
306
299
  - test/unit/slice_generator_test.rb
307
300
  - test/unit/tags_generator_test.rb
308
301
  - webpack/CVEsHostDetailsTab/CVEsHostDetailsTab.js
@@ -367,20 +360,8 @@ files:
367
360
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js
368
361
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js
369
362
  - webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js
370
- - webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js
371
- - webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js
372
363
  - webpack/ForemanInventoryUpload/Components/Dashboard/DashboardHelper.js
373
- - webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js
374
- - webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js
375
364
  - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js
376
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js
377
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js
378
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js
379
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js
380
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap
381
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap
382
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap
383
- - webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap
384
365
  - webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss
385
366
  - webpack/ForemanInventoryUpload/Components/Dashboard/index.js
386
367
  - webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js
@@ -390,13 +371,6 @@ files:
390
371
  - webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap
391
372
  - webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss
392
373
  - webpack/ForemanInventoryUpload/Components/FileDownload/index.js
393
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js
394
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js
395
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js
396
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js
397
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap
398
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss
399
- - webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js
400
374
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js
401
375
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js
402
376
  - webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js
@@ -478,20 +452,6 @@ files:
478
452
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/index.js
479
453
  - webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/toolbarButtons.scss
480
454
  - webpack/ForemanInventoryUpload/Components/PageHeader/index.js
481
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js
482
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js
483
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js
484
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js
485
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap
486
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js
487
- - webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss
488
- - webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js
489
- - webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js
490
- - webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js
491
- - webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js
492
- - webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap
493
- - webpack/ForemanInventoryUpload/Components/ReportUpload/index.js
494
- - webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss
495
455
  - webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js
496
456
  - webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js
497
457
  - webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js
@@ -506,13 +466,6 @@ files:
506
466
  - webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap
507
467
  - webpack/ForemanInventoryUpload/Components/StatusChart/index.js
508
468
  - webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss
509
- - webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js
510
- - webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js
511
- - webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js
512
- - webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js
513
- - webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap
514
- - webpack/ForemanInventoryUpload/Components/TabBody/index.js
515
- - webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss
516
469
  - webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js
517
470
  - webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js
518
471
  - webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js
@@ -533,13 +486,12 @@ files:
533
486
  - webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js
534
487
  - webpack/ForemanInventoryUpload/Components/TabHeader/index.js
535
488
  - webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss
536
- - webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js
537
- - webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js
538
- - webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js
539
- - webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js
540
- - webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap
541
- - webpack/ForemanInventoryUpload/Components/Terminal/index.js
542
- - webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss
489
+ - webpack/ForemanInventoryUpload/Components/TaskHistory/TaskHistory.js
490
+ - webpack/ForemanInventoryUpload/Components/TaskHistory/index.js
491
+ - webpack/ForemanInventoryUpload/Components/TaskHistory/taskHistory.scss
492
+ - webpack/ForemanInventoryUpload/Components/TaskProgress/TaskProgress.js
493
+ - webpack/ForemanInventoryUpload/Components/TaskProgress/index.js
494
+ - webpack/ForemanInventoryUpload/Components/TaskProgress/taskProgress.scss
543
495
  - webpack/ForemanInventoryUpload/ForemanInventoryConstants.js
544
496
  - webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js
545
497
  - webpack/ForemanInventoryUpload/ForemanInventoryUpload.js
@@ -649,6 +601,7 @@ files:
649
601
  - webpack/__mocks__/foremanReact/components/Head.js
650
602
  - webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js
651
603
  - webpack/__mocks__/foremanReact/components/ToastsList/index.js
604
+ - webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js
652
605
  - webpack/__mocks__/foremanReact/constants.js
653
606
  - webpack/__mocks__/foremanReact/redux/API/APISelectors.js
654
607
  - webpack/__mocks__/foremanReact/redux/API/index.js
@@ -713,8 +666,6 @@ test_files:
713
666
  - test/controllers/insights_sync/settings_controller_test.rb
714
667
  - test/controllers/inventory_upload/api/inventory_controller_test.rb
715
668
  - test/controllers/inventory_upload/cloud_status_controller_test.rb
716
- - test/controllers/reports_controller_test.rb
717
- - test/controllers/uploads_controller_test.rb
718
669
  - test/controllers/uploads_settings_controller_test.rb
719
670
  - test/factories/insights_factories.rb
720
671
  - test/factories/inventory_upload_factories.rb
@@ -723,7 +674,6 @@ test_files:
723
674
  - test/jobs/create_missing_insights_facets_test.rb
724
675
  - test/jobs/exponential_backoff_test.rb
725
676
  - test/jobs/generate_host_report_test.rb
726
- - test/jobs/generate_report_job_test.rb
727
677
  - test/jobs/host_inventory_report_job_test.rb
728
678
  - test/jobs/insights_client_status_aging_test.rb
729
679
  - test/jobs/insights_full_sync_test.rb
@@ -760,6 +710,5 @@ test_files:
760
710
  - test/unit/services/foreman_rh_cloud/tags_auth_test.rb
761
711
  - test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb
762
712
  - test/unit/services/foreman_rh_cloud/url_remediations_retriever_test.rb
763
- - test/unit/shell_process_job_test.rb
764
713
  - test/unit/slice_generator_test.rb
765
714
  - test/unit/tags_generator_test.rb
@@ -1,2 +0,0 @@
1
- class TaskOutputLine < ApplicationRecord
2
- end