@rh-support/troubleshoot 2.4.5-beta.15 → 2.4.5-beta.16
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/CaseManagement/OpenShiftClusterId.js +2 -2
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveModal.js +1 -1
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +13 -8
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
- package/lib/esm/hooks/useFetchCVEData.js +10 -12
- package/lib/esm/scss/_main.scss +16 -0
- package/package.json +6 -6
|
@@ -86,16 +86,16 @@ export function OpenShiftClusterId(props) {
|
|
|
86
86
|
*/
|
|
87
87
|
useEffect(() => {
|
|
88
88
|
var _a;
|
|
89
|
-
if (isEmpty(product)
|
|
89
|
+
if (isEmpty(product))
|
|
90
90
|
return;
|
|
91
91
|
const isClusterVisible = () => __awaiter(this, void 0, void 0, function* () {
|
|
92
92
|
var _a, _b;
|
|
93
93
|
const hasCluster = yield isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
94
|
+
setShowClusterId(hasCluster);
|
|
94
95
|
if (!hasCluster) {
|
|
95
96
|
resetClusterData();
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
|
-
setShowClusterId(hasCluster);
|
|
99
99
|
// if clusterId is already populated it means it comes from session and
|
|
100
100
|
// we ignore url clusterId otherwise we get cluster id from url and validate it
|
|
101
101
|
const clusterIdFromUrl = queryParams === null || queryParams === void 0 ? void 0 : queryParams.clusterId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CveModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"CveModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,eAAO,MAAM,QAAQ,yBAoEpB,CAAC"}
|
|
@@ -34,7 +34,7 @@ export const CveModal = () => {
|
|
|
34
34
|
};
|
|
35
35
|
return (React.createElement(Modal, { variant: ModalVariant.medium, title: React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' } },
|
|
36
36
|
React.createElement(FlexItem, { spacer: { default: 'spacerSm' } }, cveWorkflowRecommendation.length > 1 ? (React.createElement(Trans, null, "Handpicked for these CVEs")) : (React.createElement(Trans, null, "Handpicked for this CVE"))),
|
|
37
|
-
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))), isOpen: isCveModalOpened && activeSection === AppRouteSections.SUMMARIZE, onClose: handleModalToggle, titleIconVariant: "info", disableFocusTrap: true, onEscapePress: handleEscapePress, actions: [
|
|
37
|
+
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))), isOpen: isCveModalOpened && activeSection === AppRouteSections.SUMMARIZE, onClose: handleModalToggle, titleIconVariant: "info", disableFocusTrap: true, className: "cve-modal-fade-in-effect", onEscapePress: handleEscapePress, actions: [
|
|
38
38
|
React.createElement(Button, { key: "cve-checker-link", "data-tracking-id": "cve-checker-link", target: "_blank", variant: "secondary", isInline: true, component: "a", href: generateCveCheckerUrl() },
|
|
39
39
|
React.createElement(Trans, null, "Red Hat CVE Checker"),
|
|
40
40
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAelE,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBA4WpD"}
|
|
@@ -3,8 +3,9 @@ import { Label, Pagination, PaginationVariant, Popover, Spinner } from '@pattern
|
|
|
3
3
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
4
4
|
import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
|
|
5
5
|
import { LoadingDots, useDebounce, usePrevious } from '@rh-support/components';
|
|
6
|
-
import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, } from '@rh-support/utils';
|
|
6
|
+
import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, getRecommendationTitle, } from '@rh-support/utils';
|
|
7
7
|
import differenceBy from 'lodash/differenceBy';
|
|
8
|
+
import find from 'lodash/find';
|
|
8
9
|
import isEmpty from 'lodash/isEmpty';
|
|
9
10
|
import isEqual from 'lodash/isEqual';
|
|
10
11
|
import map from 'lodash/map';
|
|
@@ -26,7 +27,7 @@ import { WatsonxAiIcon } from './WatsonxAiIcon';
|
|
|
26
27
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
27
28
|
export default function Recommendations(props) {
|
|
28
29
|
var _a, _b, _c;
|
|
29
|
-
const { product, version, environment, summary, caseResourceLinks, issue, ABTestVarioation } = useCaseSelector((state) => ({
|
|
30
|
+
const { product, version, environment, summary, caseResourceLinks, issue, ABTestVarioation, cveWorkflowRecommendation, } = useCaseSelector((state) => ({
|
|
30
31
|
product: state.caseDetails.product,
|
|
31
32
|
version: state.caseDetails.version,
|
|
32
33
|
environment: state.caseDetails.environment,
|
|
@@ -34,6 +35,7 @@ export default function Recommendations(props) {
|
|
|
34
35
|
issue: state.caseDetails.issue,
|
|
35
36
|
caseResourceLinks: state.caseDetails.caseResourceLinks,
|
|
36
37
|
ABTestVarioation: state.ABTestVarioation,
|
|
38
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
37
39
|
}), isEqual);
|
|
38
40
|
const caseDispatch = useCaseDispatch();
|
|
39
41
|
const { caseNumber } = useParams();
|
|
@@ -162,13 +164,16 @@ export default function Recommendations(props) {
|
|
|
162
164
|
function getRankPercentage(decimal) {
|
|
163
165
|
return Math.round(decimal * 100);
|
|
164
166
|
}
|
|
165
|
-
const computeLabel = (
|
|
166
|
-
const
|
|
167
|
+
const computeLabel = (recommendationDoc) => {
|
|
168
|
+
const { rerank_score } = recommendationDoc;
|
|
169
|
+
const title = getRecommendationTitle(recommendationDoc);
|
|
170
|
+
const isCveExist = !isEmpty(find(cveWorkflowRecommendation, (cveW) => (cveW === null || cveW === void 0 ? void 0 : cveW.title) === title));
|
|
171
|
+
const percentage = getRankPercentage(rerank_score);
|
|
167
172
|
return (React.createElement(React.Fragment, null,
|
|
168
|
-
percentage
|
|
169
|
-
React.createElement(Label, { className: "match-label", color: "purple" },
|
|
173
|
+
percentage >= 80 && (React.createElement(Label, { color: "green", className: "match-label", icon: React.createElement(StarIcon, null) }, isCveExist ? 'Exact match' : 'Best match')),
|
|
174
|
+
!isCveExist && (React.createElement(Label, { className: "match-label", color: "purple" },
|
|
170
175
|
percentage,
|
|
171
|
-
"% Match")));
|
|
176
|
+
"% Match"))));
|
|
172
177
|
};
|
|
173
178
|
return (React.createElement(React.Fragment, null,
|
|
174
179
|
isBTestvariation && (React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) })),
|
|
@@ -198,7 +203,7 @@ export default function Recommendations(props) {
|
|
|
198
203
|
React.createElement("header", { className: "result-header" },
|
|
199
204
|
React.createElement("a", { href: `${doc.view_uri}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[SessionResourceSource.RECOMMENDATIONS]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.RECOMMENDATIONS)}`, className: "se-recommended ts-result", "data-tracking-id": `se-recommended-main-recommendations-${i}`, rel: "noopener noreferrer", target: "_blank", onClick: onResourceClick(doc, i), dangerouslySetInnerHTML: computeRecommendationTitle(doc) }),
|
|
200
205
|
React.createElement("div", { className: "header-meta" },
|
|
201
|
-
isATestvariation && doc.rerank_score && computeLabel(doc
|
|
206
|
+
isATestvariation && doc.rerank_score && computeLabel(doc),
|
|
202
207
|
doc.kcsState === 'verified' && (React.createElement(React.Fragment, null,
|
|
203
208
|
React.createElement("span", { className: "status-verified pf-v5-u-font-weight-bold pf-v5-u-success-color-100" }, "verified"),
|
|
204
209
|
React.createElement("span", { className: "list-separator" }, "\u2013"))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAQ,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAQ1E,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAQ,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAQ1E,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,qBAwZ/C"}
|
|
@@ -233,5 +233,5 @@ export default function SubmitCase(props) {
|
|
|
233
233
|
React.createElement(InsightsResults, { isDisplayOnMain: true })),
|
|
234
234
|
React.createElement(ClusterRecommendations, { showClusterRecommendationsModal: false }))),
|
|
235
235
|
React.createElement("div", { className: "pf-v5-u-mt-lg" }, isIdea ? (React.createElement(AsideResults, { routeProps: props.routeProps })) : (!isEmpty(topContent.data) &&
|
|
236
|
-
isNotAnIdea &&
|
|
236
|
+
isNotAnIdea && React.createElement(Suggestions, { showTitleDescription: true, showMax: 6 }))))))));
|
|
237
237
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchCVEData.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchCVEData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFetchCVEData.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchCVEData.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,0BAA0B,EAAkB,MAAM,iCAAiC,CAAC;AAI7F,wBAAgB,eAAe;;EAwI9B"}
|
|
@@ -8,8 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { search } from '@cee-eng/hydrajs';
|
|
11
|
-
import { useLRUCache } from '@rh-support/components';
|
|
11
|
+
import { useDebounce, useLRUCache } from '@rh-support/components';
|
|
12
12
|
import filter from 'lodash/filter';
|
|
13
|
+
import includes from 'lodash/includes';
|
|
13
14
|
import isArray from 'lodash/isArray';
|
|
14
15
|
import isEmpty from 'lodash/isEmpty';
|
|
15
16
|
import isEqual from 'lodash/isEqual';
|
|
@@ -17,7 +18,7 @@ import map from 'lodash/map';
|
|
|
17
18
|
import slice from 'lodash/slice';
|
|
18
19
|
import sortBy from 'lodash/sortBy';
|
|
19
20
|
import uniqBy from 'lodash/uniqBy';
|
|
20
|
-
import {
|
|
21
|
+
import { useState } from 'react';
|
|
21
22
|
import { useCaseDispatch, useCaseSelector } from '../context/CaseContext';
|
|
22
23
|
import { setCaseState } from '../reducers/CaseReducer';
|
|
23
24
|
import { findCVEsInString } from '../utils/caseUtils';
|
|
@@ -43,13 +44,8 @@ export function useFetchCVEData() {
|
|
|
43
44
|
const filteredArray = releaseInfo.filter((obj) => {
|
|
44
45
|
var _a, _b;
|
|
45
46
|
const product = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.product) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.trim();
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
product === `${selectedProductLower} ${selectedVersionLower}` ||
|
|
49
|
-
product === `red hat ${selectedProductLower} ${selectedVersionLower}` ||
|
|
50
|
-
(majorVersion && product === `${selectedProductLower} ${majorVersion}`) ||
|
|
51
|
-
(majorVersion && product === `red hat ${selectedProductLower} ${majorVersion}`);
|
|
52
|
-
return productVersionMatchConditions && (obj === null || obj === void 0 ? void 0 : obj.state) === 'Fixed';
|
|
47
|
+
const productWithVersion = `${selectedProductLower} ${majorVersion}`;
|
|
48
|
+
return includes(product, productWithVersion) && (obj === null || obj === void 0 ? void 0 : obj.state) === 'Fixed';
|
|
53
49
|
});
|
|
54
50
|
const uniqFilteredArray = uniqBy(filteredArray, (fa) => { var _a; return (_a = fa === null || fa === void 0 ? void 0 : fa.advisory) === null || _a === void 0 ? void 0 : _a.name; });
|
|
55
51
|
const errataData = map(uniqFilteredArray, (i) => {
|
|
@@ -106,7 +102,10 @@ export function useFetchCVEData() {
|
|
|
106
102
|
return [];
|
|
107
103
|
}
|
|
108
104
|
});
|
|
109
|
-
|
|
105
|
+
useDebounce(() => {
|
|
106
|
+
if (isEmpty(summary) || isEmpty(description)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
110
109
|
const CVETextValue = `${summary || ''} ${description || ''}`;
|
|
111
110
|
const cveIds = findCVEsInString(CVETextValue);
|
|
112
111
|
fetchCVEData(cveIds)
|
|
@@ -134,7 +133,6 @@ export function useFetchCVEData() {
|
|
|
134
133
|
.catch((error) => {
|
|
135
134
|
console.error('Error processing CVE data:', error);
|
|
136
135
|
});
|
|
137
|
-
|
|
138
|
-
}, [summary, description, product, version]);
|
|
136
|
+
}, [summary, description, product, version], 1000);
|
|
139
137
|
return { cveRecommendation };
|
|
140
138
|
}
|
package/lib/esm/scss/_main.scss
CHANGED
|
@@ -1128,3 +1128,19 @@ svg.pf-v5-u-ml-xs.icon-size {
|
|
|
1128
1128
|
transform: rotate(360deg);
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
|
+
|
|
1132
|
+
.cve-modal-fade-in-effect {
|
|
1133
|
+
opacity: 0;
|
|
1134
|
+
animation: cveModalfadeIn 0.3s forwards;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
@keyframes cveModalfadeIn {
|
|
1138
|
+
from {
|
|
1139
|
+
opacity: 0;
|
|
1140
|
+
transform: scale(0.9);
|
|
1141
|
+
}
|
|
1142
|
+
to {
|
|
1143
|
+
opacity: 1;
|
|
1144
|
+
transform: scale(1);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
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.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -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.3-beta.
|
|
64
|
-
"@rh-support/react-context": "2.4.3-beta.
|
|
63
|
+
"@rh-support/components": "2.4.3-beta.4",
|
|
64
|
+
"@rh-support/react-context": "2.4.3-beta.4",
|
|
65
65
|
"@rh-support/types": "2.0.5",
|
|
66
|
-
"@rh-support/user-permissions": "2.4.3-beta.
|
|
67
|
-
"@rh-support/utils": "2.4.3-beta.
|
|
66
|
+
"@rh-support/user-permissions": "2.4.3-beta.4",
|
|
67
|
+
"@rh-support/utils": "2.4.3-beta.4",
|
|
68
68
|
"@types/react-redux": "^7.1.33",
|
|
69
69
|
"@types/redux": "^3.6.0",
|
|
70
70
|
"date-fns": "3.6.0",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"defaults and supports es6-module",
|
|
136
136
|
"maintained node versions"
|
|
137
137
|
],
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "a6b8a621dbb440a324ea93262d5d8b1e8e9498be"
|
|
139
139
|
}
|