@rh-support/troubleshoot 2.4.5-beta.11 → 2.4.5-beta.12
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.
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +2 -3
- package/lib/esm/components/Cve/CveItem.d.ts +2 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveItem.js +49 -6
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveModal.js +4 -1
- package/lib/esm/components/Cve/CvePanel.js +1 -1
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +4 -3
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +38 -29
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +28 -20
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +6 -1
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +26 -21
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +4 -2
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +4 -2
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +52 -14
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +9 -4
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +19 -3
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +23 -7
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
- package/lib/esm/hooks/useFetchCVEData.js +10 -6
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +23 -5
- package/lib/esm/models/caseCreationWorkflows.d.ts +2 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +2 -0
- package/lib/esm/reducers/CaseReducer.d.ts +1 -0
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -0
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +7 -4
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +25 -12
- package/lib/esm/scss/_main.scss +49 -0
- package/lib/esm/utils/caseUtils.d.ts +1 -1
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +2 -2
- package/package.json +8 -8
|
@@ -16,6 +16,7 @@ import findIndex from 'lodash/findIndex';
|
|
|
16
16
|
import forEach from 'lodash/forEach';
|
|
17
17
|
import isEmpty from 'lodash/isEmpty';
|
|
18
18
|
import map from 'lodash/map';
|
|
19
|
+
import slice from 'lodash/slice';
|
|
19
20
|
import uniqBy from 'lodash/uniqBy';
|
|
20
21
|
import { CaseReducerConstants } from './CaseConstNTypes';
|
|
21
22
|
const { getSessions, patchSession, createNewSession, createSessionResources, updateSessionResources, createSessionCepDetails, SessionResourceVisibility, } = pcm.preCase.session;
|
|
@@ -289,33 +290,33 @@ export function markAllSessionsUnresolved(dispatch, sessionData, userAgent) {
|
|
|
289
290
|
}
|
|
290
291
|
// Create or Update Session Resource Helper
|
|
291
292
|
export function createOrUpdateSessionResources(dispatch_1, activeSessionId_1, currentSessionResourceTracking_1, source_1) {
|
|
292
|
-
return __awaiter(this, arguments, void 0, function* (dispatch, activeSessionId, currentSessionResourceTracking, source, resources = [], payload = JSON.stringify({})) {
|
|
293
|
+
return __awaiter(this, arguments, void 0, function* (dispatch, activeSessionId, currentSessionResourceTracking, source, resources = [], payload = JSON.stringify({}), workflowSource = undefined) {
|
|
293
294
|
if (isEmpty(payload) || isEmpty(activeSessionId) || isEmpty(source) || isEmpty(resources))
|
|
294
295
|
return;
|
|
295
|
-
const resourceTracking = currentSessionResourceTracking[source];
|
|
296
|
+
const resourceTracking = currentSessionResourceTracking[workflowSource || source];
|
|
296
297
|
if (isEmpty(resourceTracking) || (resourceTracking === null || resourceTracking === void 0 ? void 0 : resourceTracking.payload) !== payload) {
|
|
297
298
|
// adding presented resources or when we already have record but payload is changed
|
|
298
|
-
yield createSessionResourcesLocal(dispatch, activeSessionId, currentSessionResourceTracking, source, payload, resources);
|
|
299
|
+
yield createSessionResourcesLocal(dispatch, activeSessionId, currentSessionResourceTracking, source, payload, resources, workflowSource);
|
|
299
300
|
}
|
|
300
301
|
else {
|
|
301
302
|
// updating resource tracking by adding visites resources
|
|
302
|
-
yield updateSessionResourcesLocal(dispatch, activeSessionId, currentSessionResourceTracking, source, resources);
|
|
303
|
+
yield updateSessionResourcesLocal(dispatch, activeSessionId, currentSessionResourceTracking, source, resources, workflowSource);
|
|
303
304
|
}
|
|
304
305
|
});
|
|
305
306
|
}
|
|
306
307
|
// Create Session Resource Helper
|
|
307
308
|
export function createSessionResourcesLocal(dispatch_1, activeSessionId_1, currentSessionResourceTracking_1, source_1, payload_1) {
|
|
308
|
-
return __awaiter(this, arguments, void 0, function* (dispatch, activeSessionId, currentSessionResourceTracking, source, payload, resources = []) {
|
|
309
|
+
return __awaiter(this, arguments, void 0, function* (dispatch, activeSessionId, currentSessionResourceTracking, source, payload, resources = [], workflowSource = undefined) {
|
|
309
310
|
if (isEmpty(payload) || isEmpty(activeSessionId) || isEmpty(source))
|
|
310
311
|
return;
|
|
311
|
-
const resourceTracking = currentSessionResourceTracking[source];
|
|
312
|
+
const resourceTracking = currentSessionResourceTracking[workflowSource || source];
|
|
312
313
|
if ((resourceTracking === null || resourceTracking === void 0 ? void 0 : resourceTracking.payload) === payload)
|
|
313
314
|
return; //no need of new resourceOrigin for the same payload
|
|
314
315
|
try {
|
|
315
316
|
dispatch({
|
|
316
317
|
type: SessionRestoreConstants.updateSessionResourceTracking,
|
|
317
318
|
payload: {
|
|
318
|
-
resourceSource: source,
|
|
319
|
+
resourceSource: workflowSource || source,
|
|
319
320
|
resourceOriginId: '',
|
|
320
321
|
payload,
|
|
321
322
|
visitedResources: filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.VISITED),
|
|
@@ -327,7 +328,7 @@ export function createSessionResourcesLocal(dispatch_1, activeSessionId_1, curre
|
|
|
327
328
|
dispatch({
|
|
328
329
|
type: SessionRestoreConstants.updateSessionResourceTracking,
|
|
329
330
|
payload: {
|
|
330
|
-
resourceSource: source,
|
|
331
|
+
resourceSource: workflowSource || source,
|
|
331
332
|
resourceOriginId: response.resourceOrigin.id,
|
|
332
333
|
},
|
|
333
334
|
});
|
|
@@ -336,12 +337,12 @@ export function createSessionResourcesLocal(dispatch_1, activeSessionId_1, curre
|
|
|
336
337
|
});
|
|
337
338
|
}
|
|
338
339
|
// Update Session Resource Helper
|
|
339
|
-
export function updateSessionResourcesLocal(
|
|
340
|
-
return __awaiter(this,
|
|
340
|
+
export function updateSessionResourcesLocal(dispatch_1, activeSessionId_1, currentSessionResourceTracking_1, source_1, resources_1) {
|
|
341
|
+
return __awaiter(this, arguments, void 0, function* (dispatch, activeSessionId, currentSessionResourceTracking, source, resources, workflowSource = undefined) {
|
|
341
342
|
var _a, _b, _c;
|
|
342
343
|
if (isEmpty(activeSessionId) || isEmpty(source) || isEmpty(resources))
|
|
343
344
|
return;
|
|
344
|
-
const resourceTracking = currentSessionResourceTracking[source];
|
|
345
|
+
const resourceTracking = currentSessionResourceTracking[workflowSource || source];
|
|
345
346
|
if (isEmpty(resourceTracking === null || resourceTracking === void 0 ? void 0 : resourceTracking.resourceOriginId))
|
|
346
347
|
return;
|
|
347
348
|
const newlyVisitedResources = filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.VISITED);
|
|
@@ -364,7 +365,7 @@ export function updateSessionResourcesLocal(dispatch, activeSessionId, currentSe
|
|
|
364
365
|
...nonPreviouslyPresentedTabResources,
|
|
365
366
|
]);
|
|
366
367
|
const payloadToDispatch = {
|
|
367
|
-
resourceSource: source,
|
|
368
|
+
resourceSource: workflowSource || source,
|
|
368
369
|
sessionResourceTracking: {},
|
|
369
370
|
visitedResources: previouslyVisitedResources.concat(nonPreviouslyVisitedResources),
|
|
370
371
|
presentedResources: previouslyPresentedResources.concat(nonPreviouslyPresentedResources),
|
|
@@ -392,6 +393,18 @@ export function getSessResFromRecs(recs, visibilityStatus, pageSize = 1, current
|
|
|
392
393
|
// Recommendations Helper Function
|
|
393
394
|
export const getSessResFromRec = (rec, visibilityStatus, rank = 1) => (Object.assign(Object.assign({ visibilityStatus }, (rec.id && { resourceEntityId: rec.id })), { type: getResTypeFromUrl(rec.view_uri), url: rec.view_uri, rank, reRankScore: rec.rerank_score }));
|
|
394
395
|
export const getSessResFromRules = (url, visibilityStatus, rank = 1, resourceEntityId) => (Object.assign(Object.assign({ visibilityStatus }, (resourceEntityId && { resourceEntityId })), { type: getResTypeFromUrl(url), url: url, rank }));
|
|
396
|
+
export const getSessResFromErrata = (errata, visibilityStatus, rank = 1, resourceComponent = undefined) => {
|
|
397
|
+
var _a, _b, _c, _d;
|
|
398
|
+
return (Object.assign(Object.assign(Object.assign({ visibilityStatus }, (((_a = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _a === void 0 ? void 0 : _a.name) && { resourceEntityId: (_b = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _b === void 0 ? void 0 : _b.name })), { type: ((_c = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _c === void 0 ? void 0 : _c.type) || 'errata', url: (_d = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _d === void 0 ? void 0 : _d.url, rank }), (resourceComponent && { resourceComponent })));
|
|
399
|
+
};
|
|
400
|
+
export const getSessResFromCve = (cve, visibilityStatus, rank = 1, resourceComponent = undefined, isCveOnly = false, maxErrata = 3) => {
|
|
401
|
+
const toReturn = [
|
|
402
|
+
Object.assign(Object.assign(Object.assign({ visibilityStatus }, ((cve === null || cve === void 0 ? void 0 : cve.nid) && { resourceEntityId: cve.nid })), { type: (cve === null || cve === void 0 ? void 0 : cve.type) || 'cve', url: cve === null || cve === void 0 ? void 0 : cve.cveLink, rank }), (resourceComponent && { resourceComponent })),
|
|
403
|
+
];
|
|
404
|
+
!isCveOnly &&
|
|
405
|
+
forEach(slice((cve === null || cve === void 0 ? void 0 : cve.errataData) || [], 0, maxErrata), (err, i) => toReturn.push(getSessResFromErrata(err, visibilityStatus, i + 1, resourceComponent)));
|
|
406
|
+
return toReturn;
|
|
407
|
+
};
|
|
395
408
|
export const getRulesToSave = (visiterUrl, visitedRec, allPresentedRec) => {
|
|
396
409
|
return map(allPresentedRec, (rec, i) => {
|
|
397
410
|
let visStatus, url;
|
package/lib/esm/scss/_main.scss
CHANGED
|
@@ -1063,6 +1063,9 @@ svg.pf-v5-u-ml-xs.icon-size {
|
|
|
1063
1063
|
|
|
1064
1064
|
#DeepPurpleColorAILabel {
|
|
1065
1065
|
background-color: #6600cc !important; //deep purple override because not available in PF yet
|
|
1066
|
+
position: relative;
|
|
1067
|
+
display: inline-block;
|
|
1068
|
+
z-index: 1;
|
|
1066
1069
|
}
|
|
1067
1070
|
#DeepPurpleColorAILabel .pf-v5-c-label__content {
|
|
1068
1071
|
color: #ffffff !important;
|
|
@@ -1079,3 +1082,49 @@ svg.pf-v5-u-ml-xs.icon-size {
|
|
|
1079
1082
|
#DeepPurpleColorAILabel svg.pf-v5-c-spinner {
|
|
1080
1083
|
margin: 0 10px 0 5px;
|
|
1081
1084
|
}
|
|
1085
|
+
|
|
1086
|
+
.label-container-icon {
|
|
1087
|
+
position: relative;
|
|
1088
|
+
display: inline-block;
|
|
1089
|
+
overflow: hidden;
|
|
1090
|
+
padding: 1px;
|
|
1091
|
+
border-radius: 20px;
|
|
1092
|
+
height: 32px;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.gradient.label-container-icon::before {
|
|
1096
|
+
content: '';
|
|
1097
|
+
display: block;
|
|
1098
|
+
background: linear-gradient(
|
|
1099
|
+
90deg,
|
|
1100
|
+
rgba(255, 255, 255, 0) 0%,
|
|
1101
|
+
rgba(102, 102, 102, 0.75) 50%,
|
|
1102
|
+
rgba(255, 255, 255, 0) 100%
|
|
1103
|
+
);
|
|
1104
|
+
height: 300px;
|
|
1105
|
+
width: 20px;
|
|
1106
|
+
position: absolute;
|
|
1107
|
+
animation: rotate 5s linear infinite forwards;
|
|
1108
|
+
top: 50%;
|
|
1109
|
+
right: 45%;
|
|
1110
|
+
transform-origin: top center;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
#DeepPurpleColorAILabel {
|
|
1114
|
+
background-color: #6600cc !important;
|
|
1115
|
+
position: relative;
|
|
1116
|
+
display: inline-block;
|
|
1117
|
+
z-index: 1;
|
|
1118
|
+
margin: 1px;
|
|
1119
|
+
line-height: normal;
|
|
1120
|
+
font-size: 14px;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
@keyframes rotate {
|
|
1124
|
+
from {
|
|
1125
|
+
transform: rotate(0deg);
|
|
1126
|
+
}
|
|
1127
|
+
to {
|
|
1128
|
+
transform: rotate(360deg);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
@@ -16,5 +16,5 @@ export declare const normalizeCVE: (input: string) => string;
|
|
|
16
16
|
* @param {string} text - The input text to search for CVE identifiers.
|
|
17
17
|
* @returns {string[]} An array of CVE identifiers found in the text, or an empty array if none are found.
|
|
18
18
|
*/
|
|
19
|
-
export declare const findCVEsInString: (text
|
|
19
|
+
export declare const findCVEsInString: (text?: string) => string[];
|
|
20
20
|
//# sourceMappingURL=caseUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseUtils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iCAAiC,2BAa7C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM,WAazC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"caseUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseUtils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iCAAiC,2BAa7C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM,WAazC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAU,MAAM,KAAQ,MAAM,EAgB1D,CAAC"}
|
|
@@ -43,12 +43,12 @@ export const normalizeCVE = (input) => {
|
|
|
43
43
|
* @param {string} text - The input text to search for CVE identifiers.
|
|
44
44
|
* @returns {string[]} An array of CVE identifiers found in the text, or an empty array if none are found.
|
|
45
45
|
*/
|
|
46
|
-
export const findCVEsInString = (text) => {
|
|
46
|
+
export const findCVEsInString = (text = '') => {
|
|
47
47
|
// Regular expression to match CVE identifiers
|
|
48
48
|
// CVE 2021-44228 , CVE2022-1234 and CVE-2022-1234
|
|
49
49
|
const cveRegex = /\b(CVE[-\s]?\d{4}-\d{4,7})\b/gim;
|
|
50
50
|
// Find all matches in the text
|
|
51
|
-
const matches = text.match(cveRegex);
|
|
51
|
+
const matches = text === null || text === void 0 ? void 0 : text.match(cveRegex);
|
|
52
52
|
// Normalizes CVE
|
|
53
53
|
const normalizedCVEs = matches === null || matches === void 0 ? void 0 : matches.map((cve) => normalizeCVE(cve));
|
|
54
54
|
// Deduplicate the matches
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.4.5-beta.
|
|
3
|
+
"version": "2.4.5-beta.12",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lib/**/*"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@cee-eng/hydrajs": "4.17.
|
|
28
|
+
"@cee-eng/hydrajs": "4.17.34",
|
|
29
29
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
30
30
|
"@patternfly/patternfly": "5.4.0",
|
|
31
31
|
"@patternfly/react-core": "5.4.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-virtualized": "^9.22.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@cee-eng/hydrajs": "4.17.
|
|
54
|
+
"@cee-eng/hydrajs": "4.17.34",
|
|
55
55
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
56
56
|
"@patternfly/patternfly": "5.4.0",
|
|
57
57
|
"@patternfly/react-core": "5.4.0",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"@progress/kendo-licensing": "1.3.5",
|
|
61
61
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
62
62
|
"@redux-devtools/extension": "^3.3.0",
|
|
63
|
-
"@rh-support/components": "2.4.
|
|
64
|
-
"@rh-support/react-context": "2.4.
|
|
63
|
+
"@rh-support/components": "2.4.3-beta.1",
|
|
64
|
+
"@rh-support/react-context": "2.4.3-beta.1",
|
|
65
65
|
"@rh-support/types": "2.0.5",
|
|
66
|
-
"@rh-support/user-permissions": "2.4.
|
|
67
|
-
"@rh-support/utils": "2.4.
|
|
66
|
+
"@rh-support/user-permissions": "2.4.3-beta.1",
|
|
67
|
+
"@rh-support/utils": "2.4.3-beta.1",
|
|
68
68
|
"@types/react-redux": "^7.1.33",
|
|
69
69
|
"@types/redux": "^3.6.0",
|
|
70
70
|
"date-fns": "3.6.0",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"defaults and supports es6-module",
|
|
135
135
|
"maintained node versions"
|
|
136
136
|
],
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "b4ff244fac3c90b5b89db59aa7a41f3b06a4bf5b"
|
|
138
138
|
}
|