foreman_leapp 3.3.0 → 4.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.
- checksums.yaml +4 -4
- data/Rakefile +0 -15
- data/lib/foreman_leapp/engine.rb +1 -1
- data/lib/foreman_leapp/version.rb +1 -1
- data/webpack/components/PreupgradeReports/PreupgradeReports.js +11 -4
- data/webpack/components/PreupgradeReports/__tests__/PreupgradeReports.fixtures.js +43 -0
- data/webpack/components/PreupgradeReports/__tests__/PreupgradeReports.test.js +151 -46
- data/webpack/components/PreupgradeReports/components/__snapshots__/NoReports.test.js.snap +2 -0
- data/webpack/components/PreupgradeReportsTable/PreupgradeReportsTable.scss +9 -0
- data/webpack/components/PreupgradeReportsTable/__tests__/PreupgradeReportsTable.test.js +276 -53
- data/webpack/components/PreupgradeReportsTable/index.js +319 -92
- metadata +3 -18
- data/webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReports.test.js.snap +0 -121
|
@@ -1,163 +1,374 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React, {
|
|
3
|
+
import React, {
|
|
4
|
+
useCallback,
|
|
5
|
+
useEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from 'react';
|
|
3
10
|
import { useDispatch } from 'react-redux';
|
|
4
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Button,
|
|
13
|
+
ExpandableSection,
|
|
14
|
+
Toolbar,
|
|
15
|
+
ToolbarContent,
|
|
16
|
+
ToolbarGroup,
|
|
17
|
+
ToolbarItem,
|
|
18
|
+
Tooltip,
|
|
19
|
+
} from '@patternfly/react-core';
|
|
5
20
|
import { ExpandableRowContent, Tbody, Td, Tr } from '@patternfly/react-table';
|
|
6
21
|
import { translate as __ } from 'foremanReact/common/I18n';
|
|
22
|
+
import { foremanUrl } from 'foremanReact/common/helpers';
|
|
7
23
|
import { Table } from 'foremanReact/components/PF4/TableIndexPage/Table/Table';
|
|
24
|
+
import SelectAllCheckbox from 'foremanReact/components/PF4/TableIndexPage/Table/SelectAllCheckbox';
|
|
25
|
+
import { useBulkSelect } from 'foremanReact/components/PF4/TableIndexPage/Table/TableHooks';
|
|
26
|
+
import { RowSelectTd } from 'foremanReact/components/PF4/TableIndexPage/RowSelectTd';
|
|
8
27
|
import { getColumnHelpers } from 'foremanReact/components/PF4/TableIndexPage/Table/helpers';
|
|
9
28
|
import { APIActions } from 'foremanReact/redux/API';
|
|
10
29
|
import { STATUS } from 'foremanReact/constants';
|
|
11
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
entriesPage,
|
|
32
|
+
entryFixable,
|
|
33
|
+
} from '../PreupgradeReports/PreupgradeReportsHelpers';
|
|
12
34
|
import ReportDetails, { renderSeverityLabel } from './ReportDetails';
|
|
35
|
+
import './PreupgradeReportsTable.scss';
|
|
36
|
+
|
|
37
|
+
const LEAPP_TEMPLATE_NAME = 'Run preupgrade via Leapp';
|
|
38
|
+
|
|
39
|
+
const isRowFixable = entryFixable;
|
|
40
|
+
|
|
41
|
+
const submitJobInvocation = (
|
|
42
|
+
dispatch,
|
|
43
|
+
setError,
|
|
44
|
+
feature,
|
|
45
|
+
hostIds,
|
|
46
|
+
remediationIds
|
|
47
|
+
) => {
|
|
48
|
+
const payload = {
|
|
49
|
+
job_invocation: {
|
|
50
|
+
feature,
|
|
51
|
+
host_ids: hostIds,
|
|
52
|
+
...(remediationIds != null
|
|
53
|
+
? { inputs: { remediation_ids: remediationIds } }
|
|
54
|
+
: {}),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
dispatch(
|
|
59
|
+
APIActions.post({
|
|
60
|
+
key: `CREATE_JOB_INVOCATION_${feature}`,
|
|
61
|
+
url: foremanUrl('/api/job_invocations'),
|
|
62
|
+
params: payload,
|
|
63
|
+
handleSuccess: response => {
|
|
64
|
+
const result = response.data || response;
|
|
65
|
+
if (result?.id) {
|
|
66
|
+
window.location.assign(foremanUrl(`/job_invocations/${result.id}`));
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
handleError: err => setError(err),
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
};
|
|
13
73
|
|
|
14
74
|
const PreupgradeReportsTable = ({ data = {} }) => {
|
|
15
75
|
const [error, setError] = useState(null);
|
|
16
|
-
|
|
17
|
-
const [isReportExpanded, setIsReportExpanded] = useState(false); // Outer expansion state (Leapp Report Section)
|
|
76
|
+
const [isReportExpanded, setIsReportExpanded] = useState(false);
|
|
18
77
|
const [pagination, setPagination] = useState({ page: 1, perPage: 5 });
|
|
19
78
|
const [reportData, setReportData] = useState(null);
|
|
20
79
|
const [status, setStatus] = useState(STATUS.RESOLVED);
|
|
21
|
-
const [expandedRowIds, setExpandedRowIds] = useState(new Set());
|
|
80
|
+
const [expandedRowIds, setExpandedRowIds] = useState(new Set());
|
|
22
81
|
|
|
23
82
|
const dispatch = useDispatch();
|
|
24
83
|
// eslint-disable-next-line camelcase
|
|
25
|
-
const isLeappJob = data?.template_name?.includes(
|
|
84
|
+
const isLeappJob = data?.template_name?.includes(LEAPP_TEMPLATE_NAME);
|
|
26
85
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
86
|
+
// eslint-disable-next-line camelcase
|
|
87
|
+
const jobStatusLabel = data?.status_label;
|
|
88
|
+
|
|
89
|
+
const lastFetchedKeyRef = useRef(null);
|
|
90
|
+
|
|
91
|
+
const columns = useMemo(
|
|
92
|
+
() => ({
|
|
93
|
+
title: { title: __('Title') },
|
|
94
|
+
host: {
|
|
95
|
+
title: __('Host'),
|
|
96
|
+
wrapper: entry => entry.hostname || reportData?.hostname || '-',
|
|
97
|
+
},
|
|
98
|
+
risk_factor: {
|
|
99
|
+
title: __('Risk Factor'),
|
|
100
|
+
wrapper: ({ severity }) => renderSeverityLabel(severity),
|
|
101
|
+
},
|
|
102
|
+
has_remediation: {
|
|
103
|
+
title: __('Has Remediation?'),
|
|
104
|
+
wrapper: entry => (entry.detail?.remediations ? __('Yes') : __('No')),
|
|
105
|
+
},
|
|
106
|
+
inhibitor: {
|
|
107
|
+
title: __('Inhibitor?'),
|
|
108
|
+
wrapper: entry =>
|
|
109
|
+
entry.flags?.some(flag => flag === 'inhibitor') ? (
|
|
110
|
+
<Tooltip content={__('This issue inhibits the upgrade.')}>
|
|
111
|
+
<span>{__('Yes')}</span>
|
|
112
|
+
</Tooltip>
|
|
113
|
+
) : (
|
|
114
|
+
__('No')
|
|
115
|
+
),
|
|
116
|
+
},
|
|
117
|
+
}),
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
+
[reportData?.hostname]
|
|
120
|
+
);
|
|
57
121
|
|
|
58
122
|
useEffect(() => {
|
|
59
123
|
let isMounted = true;
|
|
60
|
-
|
|
124
|
+
const fetchKey = `${data.id}:${jobStatusLabel}`;
|
|
125
|
+
|
|
126
|
+
if (
|
|
127
|
+
!isLeappJob ||
|
|
128
|
+
!isReportExpanded ||
|
|
129
|
+
lastFetchedKeyRef.current === fetchKey
|
|
130
|
+
)
|
|
61
131
|
return undefined;
|
|
62
|
-
}
|
|
63
|
-
setStatus(STATUS.PENDING);
|
|
64
132
|
|
|
133
|
+
const fail = err => {
|
|
134
|
+
if (!isMounted) return;
|
|
135
|
+
setError(err);
|
|
136
|
+
setStatus(STATUS.ERROR);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const succeed = response => {
|
|
140
|
+
if (!isMounted) return;
|
|
141
|
+
lastFetchedKeyRef.current = fetchKey;
|
|
142
|
+
setReportData(response?.data || response || null);
|
|
143
|
+
setStatus(STATUS.RESOLVED);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
setStatus(STATUS.PENDING);
|
|
65
147
|
dispatch(
|
|
66
148
|
APIActions.get({
|
|
67
149
|
key: `GET_LEAPP_REPORT_LIST_${data.id}`,
|
|
68
150
|
url: `/api/job_invocations/${data.id}/preupgrade_reports`,
|
|
69
151
|
handleSuccess: listResponse => {
|
|
70
152
|
if (!isMounted) return;
|
|
71
|
-
const
|
|
72
|
-
const summary = listPayload.results?.[0];
|
|
153
|
+
const summary = (listResponse.data || listResponse).results?.[0];
|
|
73
154
|
if (summary?.id) {
|
|
74
155
|
dispatch(
|
|
75
156
|
APIActions.get({
|
|
76
157
|
key: `GET_LEAPP_REPORT_DETAIL_${summary.id}`,
|
|
77
158
|
url: `/api/preupgrade_reports/${summary.id}`,
|
|
78
|
-
handleSuccess: detailResponse =>
|
|
79
|
-
|
|
80
|
-
const detailPayload = detailResponse.data || detailResponse;
|
|
81
|
-
setReportData(detailPayload);
|
|
82
|
-
setStatus(STATUS.RESOLVED);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
handleError: err => {
|
|
86
|
-
if (isMounted) {
|
|
87
|
-
setError(err);
|
|
88
|
-
setStatus(STATUS.ERROR);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
159
|
+
handleSuccess: detailResponse => succeed(detailResponse),
|
|
160
|
+
handleError: err => fail(err),
|
|
91
161
|
})
|
|
92
162
|
);
|
|
93
|
-
|
|
94
|
-
setReportData({});
|
|
95
|
-
setStatus(STATUS.RESOLVED);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
handleError: err => {
|
|
99
|
-
if (isMounted) {
|
|
100
|
-
setError(err);
|
|
101
|
-
setStatus(STATUS.ERROR);
|
|
163
|
+
return;
|
|
102
164
|
}
|
|
165
|
+
succeed(null);
|
|
103
166
|
},
|
|
167
|
+
handleError: err => fail(err),
|
|
104
168
|
})
|
|
105
169
|
);
|
|
106
170
|
|
|
107
171
|
return () => {
|
|
108
172
|
isMounted = false;
|
|
109
173
|
};
|
|
110
|
-
}, [isReportExpanded, data.id, isLeappJob,
|
|
174
|
+
}, [isReportExpanded, data.id, isLeappJob, dispatch, jobStatusLabel]);
|
|
111
175
|
|
|
112
176
|
// eslint-disable-next-line camelcase
|
|
113
|
-
const entries = reportData?.preupgrade_report_entries || []
|
|
114
|
-
|
|
177
|
+
const entries = useMemo(() => reportData?.preupgrade_report_entries || [], [
|
|
178
|
+
reportData,
|
|
179
|
+
]);
|
|
115
180
|
|
|
116
|
-
const
|
|
181
|
+
const pagedEntries = useMemo(
|
|
182
|
+
() => entriesPage(entries, pagination),
|
|
183
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
|
+
[entries, pagination.page, pagination.perPage]
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
const getHostId = useCallback(
|
|
188
|
+
entry =>
|
|
189
|
+
entry.host_id ||
|
|
190
|
+
entry.hostId ||
|
|
191
|
+
// eslint-disable-next-line camelcase
|
|
192
|
+
reportData?.host_id ||
|
|
193
|
+
reportData?.host?.id ||
|
|
194
|
+
// eslint-disable-next-line camelcase
|
|
195
|
+
data?.targeting?.host_id,
|
|
196
|
+
[reportData, data]
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
const handleParamsChange = useCallback(newParams => {
|
|
117
200
|
setPagination(prev => ({
|
|
118
201
|
...prev,
|
|
119
202
|
page: newParams.page || prev.page,
|
|
120
203
|
perPage: newParams.per_page || prev.perPage,
|
|
121
204
|
}));
|
|
122
205
|
setExpandedRowIds(new Set());
|
|
123
|
-
};
|
|
206
|
+
}, []);
|
|
124
207
|
|
|
125
|
-
const toggleRowExpansion = (id, isExpanding) => {
|
|
208
|
+
const toggleRowExpansion = useCallback((id, isExpanding) => {
|
|
126
209
|
setExpandedRowIds(prev => {
|
|
127
|
-
const
|
|
128
|
-
if (isExpanding)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
newSet.delete(id);
|
|
132
|
-
}
|
|
133
|
-
return newSet;
|
|
210
|
+
const next = new Set(prev);
|
|
211
|
+
if (isExpanding) next.add(id);
|
|
212
|
+
else next.delete(id);
|
|
213
|
+
return next;
|
|
134
214
|
});
|
|
135
|
-
};
|
|
215
|
+
}, []);
|
|
216
|
+
|
|
217
|
+
const { inclusionSet, exclusionSet, ...selectAllOptions } = useBulkSelect({
|
|
218
|
+
results: pagedEntries,
|
|
219
|
+
metadata: {
|
|
220
|
+
total: entries.length,
|
|
221
|
+
page: pagination.page,
|
|
222
|
+
selectable: entries.length,
|
|
223
|
+
},
|
|
224
|
+
initialSearchQuery: '',
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const {
|
|
228
|
+
selectAll,
|
|
229
|
+
selectPage,
|
|
230
|
+
selectNone,
|
|
231
|
+
selectOne,
|
|
232
|
+
areAllRowsSelected,
|
|
233
|
+
isSelected,
|
|
234
|
+
} = selectAllOptions;
|
|
235
|
+
|
|
236
|
+
const rawSelectedIds =
|
|
237
|
+
areAllRowsSelected() || exclusionSet.size > 0
|
|
238
|
+
? entries.map(e => e.id).filter(id => !exclusionSet.has(id))
|
|
239
|
+
: Array.from(inclusionSet);
|
|
240
|
+
|
|
241
|
+
const validFixableIds = useMemo(
|
|
242
|
+
() => entries.filter(isRowFixable).map(e => e.id),
|
|
243
|
+
[entries]
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
247
|
+
const selectedIds = useMemo(
|
|
248
|
+
() => rawSelectedIds.filter(id => validFixableIds.includes(id)),
|
|
249
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
250
|
+
[rawSelectedIds.join(','), validFixableIds]
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
const pagedFixableEntries = useMemo(() => pagedEntries.filter(isRowFixable), [
|
|
254
|
+
pagedEntries,
|
|
255
|
+
]);
|
|
256
|
+
|
|
257
|
+
const areAllPageFixableSelected =
|
|
258
|
+
pagedFixableEntries.length > 0 &&
|
|
259
|
+
pagedFixableEntries.every(e => selectedIds.includes(e.id));
|
|
260
|
+
|
|
261
|
+
const areAllFixableSelected =
|
|
262
|
+
validFixableIds.length > 0 &&
|
|
263
|
+
validFixableIds.every(id => selectedIds.includes(id));
|
|
136
264
|
|
|
137
265
|
const areAllRowsExpanded =
|
|
138
266
|
pagedEntries.length > 0 &&
|
|
139
267
|
pagedEntries.every(entry => expandedRowIds.has(entry.id));
|
|
140
268
|
|
|
141
|
-
const onExpandAll = () => {
|
|
142
|
-
setExpandedRowIds(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
269
|
+
const onExpandAll = useCallback(() => {
|
|
270
|
+
setExpandedRowIds(
|
|
271
|
+
areAllRowsExpanded ? new Set() : new Set(pagedEntries.map(e => e.id))
|
|
272
|
+
);
|
|
273
|
+
}, [areAllRowsExpanded, pagedEntries]);
|
|
274
|
+
|
|
275
|
+
const [columnKeys, keysToColumnNames] = useMemo(
|
|
276
|
+
() => getColumnHelpers(columns),
|
|
277
|
+
[columns]
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
const hostIdsForSelected = useMemo(
|
|
281
|
+
() =>
|
|
282
|
+
Array.from(
|
|
283
|
+
new Set(
|
|
284
|
+
entries
|
|
285
|
+
.filter(e => selectedIds.includes(e.id))
|
|
286
|
+
.map(getHostId)
|
|
287
|
+
.filter(Boolean)
|
|
288
|
+
)
|
|
289
|
+
),
|
|
290
|
+
[entries, selectedIds, getHostId]
|
|
291
|
+
);
|
|
149
292
|
|
|
150
|
-
const
|
|
293
|
+
const allHostIds = useMemo(
|
|
294
|
+
() => Array.from(new Set(entries.map(getHostId).filter(Boolean))),
|
|
295
|
+
[entries, getHostId]
|
|
296
|
+
);
|
|
151
297
|
|
|
152
298
|
if (!isLeappJob) return null;
|
|
153
299
|
|
|
300
|
+
const isFixSelectedDisabled =
|
|
301
|
+
validFixableIds.length === 0 ||
|
|
302
|
+
selectedIds.length === 0 ||
|
|
303
|
+
hostIdsForSelected.length === 0;
|
|
304
|
+
|
|
154
305
|
return (
|
|
155
306
|
<ExpandableSection
|
|
156
|
-
className="leapp-report-section"
|
|
157
307
|
isExpanded={isReportExpanded}
|
|
158
308
|
onToggle={(_event, val) => setIsReportExpanded(val)}
|
|
159
309
|
toggleText={__('Leapp preupgrade report')}
|
|
160
310
|
>
|
|
311
|
+
{entries.length > 0 && status === STATUS.RESOLVED && (
|
|
312
|
+
<Toolbar ouiaId="leapp-report-toolbar">
|
|
313
|
+
<ToolbarContent>
|
|
314
|
+
<ToolbarGroup variant="filter-group">
|
|
315
|
+
<ToolbarItem>
|
|
316
|
+
<SelectAllCheckbox
|
|
317
|
+
selectAll={selectAll}
|
|
318
|
+
selectPage={selectPage}
|
|
319
|
+
selectNone={selectNone}
|
|
320
|
+
selectedCount={selectedIds.length}
|
|
321
|
+
pageRowCount={pagedFixableEntries.length}
|
|
322
|
+
totalCount={validFixableIds.length}
|
|
323
|
+
areAllRowsOnPageSelected={areAllPageFixableSelected}
|
|
324
|
+
areAllRowsSelected={areAllFixableSelected}
|
|
325
|
+
/>
|
|
326
|
+
</ToolbarItem>
|
|
327
|
+
</ToolbarGroup>
|
|
328
|
+
<ToolbarGroup
|
|
329
|
+
align={{ default: 'alignRight' }}
|
|
330
|
+
variant="button-group"
|
|
331
|
+
>
|
|
332
|
+
<ToolbarItem>
|
|
333
|
+
<Button
|
|
334
|
+
variant="secondary"
|
|
335
|
+
isDisabled={isFixSelectedDisabled}
|
|
336
|
+
onClick={() =>
|
|
337
|
+
submitJobInvocation(
|
|
338
|
+
dispatch,
|
|
339
|
+
setError,
|
|
340
|
+
'leapp_remediation_plan',
|
|
341
|
+
hostIdsForSelected,
|
|
342
|
+
selectedIds.join(',')
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
ouiaId="fix-selected-button"
|
|
346
|
+
>
|
|
347
|
+
{__('Fix Selected')}
|
|
348
|
+
</Button>
|
|
349
|
+
</ToolbarItem>
|
|
350
|
+
<ToolbarItem>
|
|
351
|
+
<Button
|
|
352
|
+
variant="primary"
|
|
353
|
+
isDisabled={allHostIds.length === 0}
|
|
354
|
+
onClick={() =>
|
|
355
|
+
submitJobInvocation(
|
|
356
|
+
dispatch,
|
|
357
|
+
setError,
|
|
358
|
+
'leapp_upgrade',
|
|
359
|
+
allHostIds
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
ouiaId="run-upgrade-button"
|
|
363
|
+
>
|
|
364
|
+
{__('Run Upgrade')}
|
|
365
|
+
</Button>
|
|
366
|
+
</ToolbarItem>
|
|
367
|
+
</ToolbarGroup>
|
|
368
|
+
</ToolbarContent>
|
|
369
|
+
</Toolbar>
|
|
370
|
+
)}
|
|
371
|
+
|
|
161
372
|
<Table
|
|
162
373
|
ouiaId="leapp-report-table"
|
|
163
374
|
columns={columns}
|
|
@@ -174,20 +385,24 @@ const PreupgradeReportsTable = ({ data = {} }) => {
|
|
|
174
385
|
errorMessage={
|
|
175
386
|
status === STATUS.ERROR && error?.message ? error.message : null
|
|
176
387
|
}
|
|
177
|
-
showCheckboxes
|
|
388
|
+
showCheckboxes
|
|
178
389
|
refreshData={() => {}}
|
|
179
390
|
isDeleteable={false}
|
|
180
391
|
emptyMessage={__('The preupgrade report shows no issues.')}
|
|
181
392
|
setParams={handleParamsChange}
|
|
182
393
|
childrenOutsideTbody
|
|
183
394
|
onExpandAll={onExpandAll}
|
|
184
|
-
// Inverted per PatternFly implementation to ensure correct toggle icon state
|
|
185
395
|
areAllRowsExpanded={!areAllRowsExpanded}
|
|
186
396
|
>
|
|
187
397
|
{pagedEntries.map((entry, rowIndex) => {
|
|
188
398
|
const isRowExpanded = expandedRowIds.has(entry.id);
|
|
399
|
+
|
|
189
400
|
return (
|
|
190
|
-
<Tbody
|
|
401
|
+
<Tbody
|
|
402
|
+
key={entry.id}
|
|
403
|
+
isExpanded={isRowExpanded}
|
|
404
|
+
className={isRowExpanded ? 'leapp-expanded-tbody' : ''}
|
|
405
|
+
>
|
|
191
406
|
<Tr ouiaId={`table-row-${rowIndex}`}>
|
|
192
407
|
<Td
|
|
193
408
|
expand={{
|
|
@@ -197,6 +412,12 @@ const PreupgradeReportsTable = ({ data = {} }) => {
|
|
|
197
412
|
toggleRowExpansion(entry.id, isOpen),
|
|
198
413
|
}}
|
|
199
414
|
/>
|
|
415
|
+
<RowSelectTd
|
|
416
|
+
rowData={entry}
|
|
417
|
+
selectOne={selectOne}
|
|
418
|
+
isSelected={id => isRowFixable(entry) && isSelected(id)}
|
|
419
|
+
isSelectable={isRowFixable}
|
|
420
|
+
/>
|
|
200
421
|
{columnKeys.map(key => (
|
|
201
422
|
<Td key={key} dataLabel={keysToColumnNames[key]}>
|
|
202
423
|
{columns[key].wrapper
|
|
@@ -209,7 +430,7 @@ const PreupgradeReportsTable = ({ data = {} }) => {
|
|
|
209
430
|
isExpanded={isRowExpanded}
|
|
210
431
|
ouiaId={`table-row-details-${rowIndex}`}
|
|
211
432
|
>
|
|
212
|
-
<Td colSpan={columnKeys.length +
|
|
433
|
+
<Td colSpan={columnKeys.length + 2}>
|
|
213
434
|
<ExpandableRowContent>
|
|
214
435
|
{isRowExpanded && <ReportDetails entry={entry} />}
|
|
215
436
|
</ExpandableRowContent>
|
|
@@ -226,7 +447,13 @@ const PreupgradeReportsTable = ({ data = {} }) => {
|
|
|
226
447
|
PreupgradeReportsTable.propTypes = {
|
|
227
448
|
data: PropTypes.shape({
|
|
228
449
|
id: PropTypes.number,
|
|
450
|
+
// eslint-disable-next-line camelcase
|
|
229
451
|
template_name: PropTypes.string,
|
|
452
|
+
// eslint-disable-next-line camelcase
|
|
453
|
+
status_label: PropTypes.string,
|
|
454
|
+
targeting: PropTypes.shape({
|
|
455
|
+
host_id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
456
|
+
}),
|
|
230
457
|
}),
|
|
231
458
|
};
|
|
232
459
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_leapp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Foreman Leapp team
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-06-23 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: foreman_remote_execution
|
|
@@ -37,20 +37,6 @@ dependencies:
|
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '5.0'
|
|
40
|
-
- !ruby/object:Gem::Dependency
|
|
41
|
-
name: rdoc
|
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
|
43
|
-
requirements:
|
|
44
|
-
- - "~>"
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '6.2'
|
|
47
|
-
type: :development
|
|
48
|
-
prerelease: false
|
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
-
requirements:
|
|
51
|
-
- - "~>"
|
|
52
|
-
- !ruby/object:Gem::Version
|
|
53
|
-
version: '6.2'
|
|
54
40
|
description: A Foreman plugin to support inplace RHEL upgrades with Leapp utility.
|
|
55
41
|
email:
|
|
56
42
|
- foreman-dev@googlegroups.com
|
|
@@ -140,7 +126,6 @@ files:
|
|
|
140
126
|
- webpack/components/PreupgradeReports/__tests__/PreupgradeReportsHelpers.test.js
|
|
141
127
|
- webpack/components/PreupgradeReports/__tests__/PreupgradeReportsReducer.test.js
|
|
142
128
|
- webpack/components/PreupgradeReports/__tests__/PreupgradeReportsSelectors.test.js
|
|
143
|
-
- webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReports.test.js.snap
|
|
144
129
|
- webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReportsHelpers.test.js.snap
|
|
145
130
|
- webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReportsReducer.test.js.snap
|
|
146
131
|
- webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReportsSelectors.test.js.snap
|
|
@@ -214,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
214
199
|
- !ruby/object:Gem::Version
|
|
215
200
|
version: '0'
|
|
216
201
|
requirements: []
|
|
217
|
-
rubygems_version: 4.0.
|
|
202
|
+
rubygems_version: 4.0.10
|
|
218
203
|
specification_version: 4
|
|
219
204
|
summary: A Foreman plugin for Leapp utility.
|
|
220
205
|
test_files:
|
data/webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReports.test.js.snap
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`PreupgradeReports should render error 1`] = `
|
|
4
|
-
<MessageBox
|
|
5
|
-
icontype="error-circle-o"
|
|
6
|
-
key="preupgrade-reports-error"
|
|
7
|
-
msg="Could not retrieve data: Internal server error - Well, this is embarassing"
|
|
8
|
-
/>
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
exports[`PreupgradeReports should render when loaded with reports 1`] = `
|
|
12
|
-
<LoadingState
|
|
13
|
-
additionalClasses=""
|
|
14
|
-
loading={false}
|
|
15
|
-
loadingText="Loading"
|
|
16
|
-
size="lg"
|
|
17
|
-
timeout={300}
|
|
18
|
-
>
|
|
19
|
-
<PreupgradeReports
|
|
20
|
-
csrfToken="xyz"
|
|
21
|
-
error={Object {}}
|
|
22
|
-
getPreupgradeReports={[Function]}
|
|
23
|
-
loading={false}
|
|
24
|
-
newJobInvocationUrl="/job_invocations/new"
|
|
25
|
-
preupgradeReports={
|
|
26
|
-
Array [
|
|
27
|
-
Object {
|
|
28
|
-
"entries": Array [
|
|
29
|
-
Object {
|
|
30
|
-
"flags": Array [],
|
|
31
|
-
"hostname": "host.example.com",
|
|
32
|
-
"id": 42,
|
|
33
|
-
"severity": "info",
|
|
34
|
-
"title": "Fix me!",
|
|
35
|
-
},
|
|
36
|
-
Object {
|
|
37
|
-
"flags": Array [],
|
|
38
|
-
"hostname": "host.example.com",
|
|
39
|
-
"id": 43,
|
|
40
|
-
"severity": "medium",
|
|
41
|
-
"title": "I am broken too",
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
"hostId": 5,
|
|
45
|
-
},
|
|
46
|
-
Object {
|
|
47
|
-
"entries": Array [
|
|
48
|
-
Object {
|
|
49
|
-
"flags": Array [
|
|
50
|
-
"inhibitor",
|
|
51
|
-
],
|
|
52
|
-
"hostname": "foo.example.com",
|
|
53
|
-
"id": 44,
|
|
54
|
-
"severity": "high",
|
|
55
|
-
"title": "Octocat is not happy",
|
|
56
|
-
},
|
|
57
|
-
Object {
|
|
58
|
-
"flags": Array [],
|
|
59
|
-
"hostname": "foo.example.com",
|
|
60
|
-
"id": 45,
|
|
61
|
-
"severity": "low",
|
|
62
|
-
"title": "Not enough credits",
|
|
63
|
-
},
|
|
64
|
-
Object {
|
|
65
|
-
"flags": Array [],
|
|
66
|
-
"hostname": "foo.example.com",
|
|
67
|
-
"id": 46,
|
|
68
|
-
"severity": "medium",
|
|
69
|
-
"title": "SELinux is turned off",
|
|
70
|
-
},
|
|
71
|
-
Object {
|
|
72
|
-
"flags": Array [],
|
|
73
|
-
"hostname": "foo.example.com",
|
|
74
|
-
"id": 47,
|
|
75
|
-
"severity": "medium",
|
|
76
|
-
"title": "Root password is too short",
|
|
77
|
-
},
|
|
78
|
-
Object {
|
|
79
|
-
"flags": Array [],
|
|
80
|
-
"hostname": "foo.example.com",
|
|
81
|
-
"id": 49,
|
|
82
|
-
"severity": "high",
|
|
83
|
-
"title": "No chocolate chip cookies in cookie jar",
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
"hostId": 6,
|
|
87
|
-
},
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
reportsExpected={true}
|
|
91
|
-
/>
|
|
92
|
-
</LoadingState>
|
|
93
|
-
`;
|
|
94
|
-
|
|
95
|
-
exports[`PreupgradeReports should render when loaded without reports 1`] = `
|
|
96
|
-
<LoadingState
|
|
97
|
-
additionalClasses=""
|
|
98
|
-
loading={false}
|
|
99
|
-
loadingText="Loading"
|
|
100
|
-
size="lg"
|
|
101
|
-
timeout={300}
|
|
102
|
-
>
|
|
103
|
-
<NoReports
|
|
104
|
-
reportsExpected={true}
|
|
105
|
-
/>
|
|
106
|
-
</LoadingState>
|
|
107
|
-
`;
|
|
108
|
-
|
|
109
|
-
exports[`PreupgradeReports should render when loading 1`] = `
|
|
110
|
-
<LoadingState
|
|
111
|
-
additionalClasses=""
|
|
112
|
-
loading={true}
|
|
113
|
-
loadingText="Loading"
|
|
114
|
-
size="lg"
|
|
115
|
-
timeout={300}
|
|
116
|
-
>
|
|
117
|
-
<NoReports
|
|
118
|
-
reportsExpected={false}
|
|
119
|
-
/>
|
|
120
|
-
</LoadingState>
|
|
121
|
-
`;
|