@rh-support/troubleshoot 2.3.0-alpha.0 → 2.4.5-beta.2
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/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +1 -1
- package/lib/esm/components/Cve/CveItem.d.ts +8 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveItem.js +81 -0
- package/lib/esm/components/Cve/CveModal.d.ts +3 -0
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveModal.js +40 -0
- package/lib/esm/components/Cve/CvePanel.d.ts +7 -0
- package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -0
- package/lib/esm/components/Cve/CvePanel.js +23 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts +3 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveSidebar.js +24 -0
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +4 -0
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +1 -1
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +20 -11
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts +3 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.js +11 -0
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +5 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +28 -22
- package/lib/esm/hooks/useFetchCVEData.d.ts +5 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -0
- package/lib/esm/hooks/useFetchCVEData.js +101 -0
- package/lib/esm/hooks/useWizard.js +1 -1
- package/lib/esm/models/caseCreationWorkflows.d.ts +25 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -0
- package/lib/esm/models/caseCreationWorkflows.js +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -0
- 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 -1
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +13 -9
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +14 -121
- package/lib/esm/scss/_main.scss +19 -0
- package/lib/esm/utils/caseUtils.d.ts +6 -0
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +15 -0
- package/package.json +9 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAgPnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -105,7 +105,7 @@ function OwnerSelector(props) {
|
|
|
105
105
|
firstName: newOwner.firstName,
|
|
106
106
|
lastName: newOwner.lastName,
|
|
107
107
|
fullNameCustom: newOwner.fullNameCustom,
|
|
108
|
-
}, '', abortSignal);
|
|
108
|
+
}, '', abortSignal, abortSignal, false, '', true, true, caseNumber);
|
|
109
109
|
setLocalOwnerChange(true);
|
|
110
110
|
updateNotifyUsersList(newOwner);
|
|
111
111
|
ToastNotification.addSuccessMessage(t(`Owner has been successfully updated`));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICVEWorkflowRecommendation } from '../../models/caseCreationWorkflows';
|
|
3
|
+
interface IProp {
|
|
4
|
+
cve: ICVEWorkflowRecommendation;
|
|
5
|
+
}
|
|
6
|
+
export declare const CveItem: (props: IProp) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=CveItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveItem.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,UAAU,KAAK;IACX,GAAG,EAAE,0BAA0B,CAAC;CACnC;AAID,eAAO,MAAM,OAAO,UAAW,KAAK,sBAqInC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Button, Flex, FlexItem, Label, LabelGroup, Text, TextVariants } from '@patternfly/react-core';
|
|
2
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
3
|
+
import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon';
|
|
4
|
+
import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
|
|
5
|
+
import { format } from 'date-fns';
|
|
6
|
+
import DOMPurify from 'dompurify';
|
|
7
|
+
import isEmpty from 'lodash/isEmpty';
|
|
8
|
+
import map from 'lodash/map';
|
|
9
|
+
import slice from 'lodash/slice';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Trans } from 'react-i18next';
|
|
12
|
+
const sanitize = (html) => ({ __html: DOMPurify.sanitize(html) });
|
|
13
|
+
export const CveItem = (props) => {
|
|
14
|
+
const { cve } = props;
|
|
15
|
+
const renderDate = () => (React.createElement("div", { className: "pf-v5-u-disabled-color-100" },
|
|
16
|
+
React.createElement(Trans, null, "Public on"),
|
|
17
|
+
" - ",
|
|
18
|
+
format(cve === null || cve === void 0 ? void 0 : cve.publicDate, 'MMM dd, yyyy')));
|
|
19
|
+
const renderLabels = () => (React.createElement(LabelGroup, { defaultIsOpen: true, numLabels: 10 },
|
|
20
|
+
React.createElement(Label, { color: "green", isCompact: true, icon: React.createElement(StarIcon, null) },
|
|
21
|
+
React.createElement(Trans, null, "Exact match")),
|
|
22
|
+
React.createElement(Label, { color: cve.severity === 'Critical'
|
|
23
|
+
? 'red'
|
|
24
|
+
: cve.severity === 'Important'
|
|
25
|
+
? 'orange'
|
|
26
|
+
: cve.severity === 'Moderate'
|
|
27
|
+
? 'gold'
|
|
28
|
+
: undefined, isCompact: true }, cve.severity),
|
|
29
|
+
!isEmpty(cve.errataData) && (React.createElement(Label, { color: "blue", isCompact: true },
|
|
30
|
+
React.createElement(Trans, null, "Fixed"))),
|
|
31
|
+
!isEmpty(cve.mitigation) && (React.createElement(Label, { isCompact: true },
|
|
32
|
+
React.createElement(Trans, null, "Mitigation available")))));
|
|
33
|
+
const displayErrataTable = () => {
|
|
34
|
+
if (isEmpty(cve === null || cve === void 0 ? void 0 : cve.errataData)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return (React.createElement(Table, { "aria-label": "Errata table", variant: 'compact' },
|
|
38
|
+
React.createElement(Thead, null,
|
|
39
|
+
React.createElement(Tr, null,
|
|
40
|
+
React.createElement(Th, { width: 30 },
|
|
41
|
+
React.createElement(Trans, null, "Errata link")),
|
|
42
|
+
React.createElement(Th, null,
|
|
43
|
+
React.createElement(Trans, null, "Component")),
|
|
44
|
+
React.createElement(Th, { width: 30 },
|
|
45
|
+
React.createElement(Trans, null, "Status")))),
|
|
46
|
+
React.createElement(Tbody, null, map(slice(cve.errataData, 0, 3), (errata, index) => {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
return (React.createElement(Tr, Object.assign({ key: (_a = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _a === void 0 ? void 0 : _a.name }, (index % 2 === 0 && { isStriped: true })),
|
|
49
|
+
React.createElement(Td, null,
|
|
50
|
+
React.createElement(Text, { component: TextVariants.a, href: (_b = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _b === void 0 ? void 0 : _b.url, target: "_blank", ouiaSafe: true, "data-tracking-id": "errata-link" }, (_c = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _c === void 0 ? void 0 :
|
|
51
|
+
_c.name,
|
|
52
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" }))),
|
|
53
|
+
React.createElement(Td, null, errata === null || errata === void 0 ? void 0 : errata.package),
|
|
54
|
+
React.createElement(Td, null,
|
|
55
|
+
React.createElement(Trans, null, errata === null || errata === void 0 ? void 0 : errata.state))));
|
|
56
|
+
}))));
|
|
57
|
+
};
|
|
58
|
+
const displayDescription = () => {
|
|
59
|
+
var _a;
|
|
60
|
+
if (isEmpty(cve === null || cve === void 0 ? void 0 : cve.mitigation) && ((_a = cve === null || cve === void 0 ? void 0 : cve.errataData) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
61
|
+
return (React.createElement("p", { className: "pf-v5-u-mt-md" }, "for this CVE mitigation and fix is not available, for more details, go to CVE page."));
|
|
62
|
+
}
|
|
63
|
+
const MAX_DESCRIPTION_LENGTH = 300;
|
|
64
|
+
const description = !isEmpty(cve === null || cve === void 0 ? void 0 : cve.mitigation) ? cve === null || cve === void 0 ? void 0 : cve.mitigation : cve === null || cve === void 0 ? void 0 : cve.details;
|
|
65
|
+
if (!description)
|
|
66
|
+
return '';
|
|
67
|
+
const trimmedDescription = description.length <= MAX_DESCRIPTION_LENGTH
|
|
68
|
+
? description
|
|
69
|
+
: description.slice(0, MAX_DESCRIPTION_LENGTH).trim() + '...';
|
|
70
|
+
return React.createElement("p", { className: "pf-v5-u-mt-md", dangerouslySetInnerHTML: sanitize(trimmedDescription) });
|
|
71
|
+
};
|
|
72
|
+
return (React.createElement("p", null,
|
|
73
|
+
React.createElement(Flex, null,
|
|
74
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerXs' } }, renderLabels()),
|
|
75
|
+
React.createElement(FlexItem, null, renderDate())),
|
|
76
|
+
displayErrataTable(),
|
|
77
|
+
displayDescription(),
|
|
78
|
+
(cve === null || cve === void 0 ? void 0 : cve.cveLink) && (React.createElement(Button, { variant: "primary", className: "pf-v5-u-my-md", "data-tracking-id": "go-to-CVE-button", component: "a", href: cve.cveLink, target: "_blank", rel: "noopener noreferrer" },
|
|
79
|
+
React.createElement(Trans, null, "Go to CVE"),
|
|
80
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })))));
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,QAAQ,yBAuDpB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Badge, Button, Flex, FlexItem, Modal, ModalVariant } from '@patternfly/react-core';
|
|
2
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
3
|
+
import { getAccessHostname } from '@rh-support/utils';
|
|
4
|
+
import isEqual from 'lodash/isEqual';
|
|
5
|
+
import join from 'lodash/join';
|
|
6
|
+
import map from 'lodash/map';
|
|
7
|
+
import size from 'lodash/size';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Trans } from 'react-i18next';
|
|
10
|
+
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { setCaseState } from '../../reducers/CaseReducer';
|
|
12
|
+
import { CvePanel } from './CvePanel';
|
|
13
|
+
export const CveModal = () => {
|
|
14
|
+
const caseDispatch = useCaseDispatch();
|
|
15
|
+
const { cveWorkflowRecommendation, isCveModalOpened } = useCaseSelector((state) => ({
|
|
16
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
17
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
18
|
+
}), isEqual);
|
|
19
|
+
const handleModalToggle = () => {
|
|
20
|
+
setCaseState(caseDispatch, { isCveModalOpened: !isCveModalOpened });
|
|
21
|
+
};
|
|
22
|
+
const handleEscapePress = (event) => {
|
|
23
|
+
// prevent the default escape key behavior
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
};
|
|
26
|
+
const generateCveCheckerUrl = () => {
|
|
27
|
+
const cveTitles = join(map(cveWorkflowRecommendation, 'title'), ',');
|
|
28
|
+
return `https://${getAccessHostname()}/labs/cvechecker/?id=${cveTitles}`;
|
|
29
|
+
};
|
|
30
|
+
return (React.createElement(Modal, { variant: ModalVariant.medium, title: React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' } },
|
|
31
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerSm' } },
|
|
32
|
+
React.createElement(Trans, null, "Handpicked for this CVEs")),
|
|
33
|
+
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))), isOpen: isCveModalOpened, onClose: handleModalToggle, titleIconVariant: "info", disableFocusTrap: true, onEscapePress: handleEscapePress, actions: [
|
|
34
|
+
React.createElement(Button, { key: "cve-checker-link", "data-tracking-id": "cve-checker-link", target: "_blank", variant: "secondary", isInline: true, component: "a", href: generateCveCheckerUrl() },
|
|
35
|
+
React.createElement(Trans, null, "Red Hat CVE Checker"),
|
|
36
|
+
" ",
|
|
37
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })),
|
|
38
|
+
] },
|
|
39
|
+
React.createElement(CvePanel, null)));
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CvePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CvePanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,UAAW,MAAM,sBAyCrC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionToggle } from '@patternfly/react-core';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
3
|
+
import map from 'lodash/map';
|
|
4
|
+
import slice from 'lodash/slice';
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
7
|
+
import { CveItem } from './CveItem';
|
|
8
|
+
export const CvePanel = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { cveWorkflowRecommendation } = useCaseSelector((state) => ({
|
|
11
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
12
|
+
}), isEqual);
|
|
13
|
+
const [expanded, setExpanded] = useState(((_a = cveWorkflowRecommendation === null || cveWorkflowRecommendation === void 0 ? void 0 : cveWorkflowRecommendation[0]) === null || _a === void 0 ? void 0 : _a.title) || '');
|
|
14
|
+
const handleToggle = (id) => setExpanded(id === expanded ? '' : id);
|
|
15
|
+
const renderAccordionItem = (cve, index) => {
|
|
16
|
+
const isExpanded = expanded === (cve === null || cve === void 0 ? void 0 : cve.title);
|
|
17
|
+
return (React.createElement(AccordionItem, { key: `cve-item-${index}` },
|
|
18
|
+
React.createElement(AccordionToggle, { onClick: () => handleToggle(cve.title), isExpanded: isExpanded, id: `cve-toggle-${index}`, "data-tracking-id": "cve-accordion-toggle" }, cve.title),
|
|
19
|
+
React.createElement(AccordionContent, { id: `cve-content-${index}`, isHidden: !isExpanded },
|
|
20
|
+
React.createElement(CveItem, { cve: cve }))));
|
|
21
|
+
};
|
|
22
|
+
return (React.createElement(Accordion, { isBordered: true, displaySize: 'default', asDefinitionList: false, className: `${props.className ? props.className : ''}` }, map(slice(cveWorkflowRecommendation, 0, 4), renderAccordionItem)));
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveSidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveSidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,UAAU,yBAyBtB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Badge } from '@patternfly/react-core';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
4
|
+
import size from 'lodash/size';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Trans } from 'react-i18next';
|
|
7
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
8
|
+
import { CvePanel } from './CvePanel';
|
|
9
|
+
export const CveSidebar = () => {
|
|
10
|
+
const { cveWorkflowRecommendation } = useCaseSelector((state) => ({
|
|
11
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
12
|
+
}), isEqual);
|
|
13
|
+
if (isEmpty(cveWorkflowRecommendation)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (React.createElement(React.Fragment, null,
|
|
17
|
+
React.createElement("div", { className: "card card-white card-support file-diag pf-v5-u-mb-md" },
|
|
18
|
+
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" },
|
|
19
|
+
React.createElement("span", { className: "pf-v5-u-mr-sm" },
|
|
20
|
+
React.createElement(Trans, null, "Handpicked for this CVEs")),
|
|
21
|
+
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))),
|
|
22
|
+
React.createElement("div", { className: "card-body" },
|
|
23
|
+
React.createElement(CvePanel, null)))));
|
|
24
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOlE,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,gCAAgC,EAAE,OAAO,CAAC;IAC1C,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAChE;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAwFpD"}
|
|
@@ -7,6 +7,8 @@ import React, { useContext, useRef } from 'react';
|
|
|
7
7
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
8
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
9
9
|
import { RouteContext } from '../../context/RouteContext';
|
|
10
|
+
import { useFetchCVEData } from '../../hooks/useFetchCVEData';
|
|
11
|
+
import { CveModal } from '../Cve/CveModal';
|
|
10
12
|
import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
|
|
11
13
|
import Recommendations from '../Recommendations/Recommendations';
|
|
12
14
|
import { AllProductsSelector } from './AllProductsSelector';
|
|
@@ -20,6 +22,7 @@ import { ProductSelectorLoader } from './ProductSelectorLoader';
|
|
|
20
22
|
* @param props
|
|
21
23
|
*/
|
|
22
24
|
export default function ProductSelector(props) {
|
|
25
|
+
const { cveRecommendation } = useFetchCVEData();
|
|
23
26
|
const { t } = useTranslation();
|
|
24
27
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
25
28
|
const { product, version } = useCaseSelector((state) => ({
|
|
@@ -38,6 +41,7 @@ export default function ProductSelector(props) {
|
|
|
38
41
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
39
42
|
!allProducts.isFetching && !allProducts.isError && (React.createElement(React.Fragment, null,
|
|
40
43
|
React.createElement("form", null,
|
|
44
|
+
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
|
|
41
45
|
React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true }),
|
|
42
46
|
product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
|
|
43
47
|
' ',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AASvD,OAAO,EAAE,eAAe,EAAsC,MAAM,iCAAiC,CAAC;AAUtG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AASvD,OAAO,EAAE,eAAe,EAAsC,MAAM,iCAAiC,CAAC;AAUtG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBAyLzC"}
|
|
@@ -129,7 +129,7 @@ export function AsideResults(props) {
|
|
|
129
129
|
if (!canShowSideRecommendations())
|
|
130
130
|
return React.createElement(React.Fragment, null);
|
|
131
131
|
return (React.createElement("div", { className: `card card-white card-support top-recommendations ${props.className ? props.className : ''}` },
|
|
132
|
-
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" }, isIdea ?
|
|
132
|
+
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" }, isIdea ? React.createElement(Trans, null, "Search recommendations") : React.createElement(Trans, null, "Articles recommended by OpenShift AI")),
|
|
133
133
|
React.createElement("div", { className: "card-body" },
|
|
134
134
|
React.createElement("ul", { className: "list-flat" }, recommendationState.sideRecommendation.map((doc, index) => {
|
|
135
135
|
var _a, _b;
|
|
@@ -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":"AAmBA,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,qBAoSpD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
|
-
import { Label, Pagination, PaginationVariant } from '@patternfly/react-core';
|
|
3
|
-
import
|
|
2
|
+
import { Label, Pagination, PaginationVariant, Spinner } from '@patternfly/react-core';
|
|
3
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
4
|
+
import { useDebounce, usePrevious } from '@rh-support/components';
|
|
4
5
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
5
6
|
import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, } from '@rh-support/utils';
|
|
6
7
|
import differenceBy from 'lodash/differenceBy';
|
|
@@ -20,6 +21,7 @@ import { fetchRecommendations, fetchWatsonXRecommendations, RecommendationsConst
|
|
|
20
21
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
21
22
|
import { createOrUpdateSessionResources, getSessResFromRec, getSessResFromRecs, } from '../../reducers/SessionRestoreReducer';
|
|
22
23
|
import RouteUtils from '../../utils/routeUtils';
|
|
24
|
+
import { RecommendationsLoader } from './RecommendationsLoader';
|
|
23
25
|
import { WatsonxAiIcon } from './WatsonxAiIcon';
|
|
24
26
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
25
27
|
export default function Recommendations(props) {
|
|
@@ -85,7 +87,7 @@ export default function Recommendations(props) {
|
|
|
85
87
|
// recreate a new AbortController for each call
|
|
86
88
|
let controller = new AbortController();
|
|
87
89
|
abortControllerRef.current = controller;
|
|
88
|
-
if (!isEmpty(issue)) {
|
|
90
|
+
if (!isEmpty(issue) || !isEmpty(summary)) {
|
|
89
91
|
!loggedInUsersAccount.data.secureSupport
|
|
90
92
|
? fetchWatsonXRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, queryFilters, controller.signal)
|
|
91
93
|
: fetchRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, caseNumber, isSecureSupportAccount, queryFilters, controller.signal);
|
|
@@ -106,9 +108,9 @@ export default function Recommendations(props) {
|
|
|
106
108
|
recommendationState.insightsKcsIds,
|
|
107
109
|
], 1000);
|
|
108
110
|
useEffect(() => {
|
|
109
|
-
props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations);
|
|
111
|
+
props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations); //reset userSeenRecommendations when recommendationState changes
|
|
110
112
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
-
}, [recommendationState]);
|
|
113
|
+
}, [recommendationState.numFound]);
|
|
112
114
|
useEffect(() => {
|
|
113
115
|
if (recommendationState.isLoadingRecommendations)
|
|
114
116
|
return;
|
|
@@ -151,12 +153,19 @@ export default function Recommendations(props) {
|
|
|
151
153
|
dtmTrackEventCaseStartStopped('recommendation click', caseNumber, `${product}|${version}`);
|
|
152
154
|
};
|
|
153
155
|
return (React.createElement(React.Fragment, null,
|
|
154
|
-
React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) }),
|
|
155
156
|
React.createElement("div", { className: "recommendation-list pf-v5-u-pt-md", ref: props.resultsRowRef },
|
|
156
|
-
recommendationState.visibleDocs.length !== 0 && (React.createElement(Label, {
|
|
157
|
-
React.createElement(
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
(recommendationState.visibleDocs.length !== 0 || recommendationState.isLoadingRecommendations) && (React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" },
|
|
158
|
+
recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
|
|
159
|
+
React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
|
|
160
|
+
' ',
|
|
161
|
+
React.createElement(Trans, null, "Recommending articles using OpenShift AI"))) : (React.createElement(React.Fragment, null,
|
|
162
|
+
React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
|
|
163
|
+
' ',
|
|
164
|
+
React.createElement(Trans, null, "Articles recommended by OpenShift AI"))),
|
|
165
|
+
' ',
|
|
166
|
+
React.createElement(InfoCircleIcon, { color: "white" }))),
|
|
167
|
+
recommendationState.isLoadingRecommendations ? ( // as much as it pains me to add these <br /> the pf docs has it this way
|
|
168
|
+
React.createElement(RecommendationsLoader, null)) : (React.createElement("ul", { className: "list-flat" }, map(recommendationState.visibleDocs, (doc, i) => {
|
|
160
169
|
var _a, _b;
|
|
161
170
|
return (React.createElement("li", { className: "result", key: doc.id },
|
|
162
171
|
React.createElement("header", { className: "result-header" },
|
|
@@ -169,7 +178,7 @@ export default function Recommendations(props) {
|
|
|
169
178
|
React.createElement("span", { className: "list-separator" }, "\u2013"),
|
|
170
179
|
React.createElement("time", { className: "moment_date meta", title: doc.lastModifiedDate.toString() }, formatDate(doc.lastModifiedDate)))),
|
|
171
180
|
React.createElement("p", { className: "result-body", dangerouslySetInnerHTML: computeRecommendationAbstract(doc, 300) })));
|
|
172
|
-
})),
|
|
181
|
+
}))),
|
|
173
182
|
recommendationState.numFound !== 0 && recommendationState.numFound > DEFAULTPAGESIZE && (React.createElement("div", { className: "pagination-footer" },
|
|
174
183
|
React.createElement(Pagination, { className: "push-top", itemCount: (_c = (_b = recommendationState.allDocs) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0, perPage: recPageSize, page: recommendationState.currentPage, variant: PaginationVariant.bottom, onSetPage: pageChanged, dropDirection: "up", onPerPageSelect: onPageSizeChanged })))),
|
|
175
184
|
recommendationState.visibleDocs.length === 0 &&
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecommendationsLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationsLoader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,qBAAqB,yBAejC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Skeleton } from '@patternfly/react-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export const RecommendationsLoader = () => {
|
|
4
|
+
return (React.createElement("div", { className: "pf-v5-u-mt-md" }, [...Array(5)].map((_, i) => (React.createElement(React.Fragment, { key: `recommendation-loading-${i}` },
|
|
5
|
+
React.createElement(Skeleton, { height: "20px", width: "100%" }),
|
|
6
|
+
React.createElement("br", null),
|
|
7
|
+
React.createElement(Skeleton, { height: "45px", width: "100%" }),
|
|
8
|
+
React.createElement("br", null),
|
|
9
|
+
React.createElement("br", null),
|
|
10
|
+
React.createElement("br", null))))));
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAGH,eAAe,EAKlB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAGH,eAAe,EAKlB,MAAM,iCAAiC,CAAC;AAUzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;CACxC;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,qBAyDjC;kBAzDQ,WAAW;;;AA2DpB,eAAe,WAAW,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { useCaseSelector } from '../../context/CaseContext';
|
|
|
7
7
|
import { RouteContext } from '../../context/RouteContext';
|
|
8
8
|
import { AppRouteSections, hideFileUploadSidebarWidgetSections, showRecommendationTipsSections, showSideBarClusterIdRuleWidgetSections, showSideBarEARuleWidgetSections, showSideBarFileRecommendationSections, } from '../../reducers/RouteConstNTypes';
|
|
9
9
|
import { FileDiag } from '../CaseInformation/FileDiag';
|
|
10
|
+
import { CveSidebar } from '../Cve/CveSidebar';
|
|
10
11
|
import { AsideResults } from '../Recommendations/AsideResults';
|
|
11
12
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
12
13
|
import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
|
|
@@ -17,9 +18,10 @@ const defaultProps = {};
|
|
|
17
18
|
function WizardAside(props) {
|
|
18
19
|
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
19
20
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
20
|
-
const { isCreatingCase, caseType } = useCaseSelector((state) => ({
|
|
21
|
+
const { isCreatingCase, caseType, isCveModalOpened } = useCaseSelector((state) => ({
|
|
21
22
|
isCreatingCase: state.isCreatingCase,
|
|
22
23
|
caseType: state.caseDetails.caseType,
|
|
24
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
23
25
|
}), isEqual);
|
|
24
26
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
25
27
|
const canUseSessionManagement = ability.can(resourceActions.CREATE, resources.SESSION_TRACKING);
|
|
@@ -35,6 +37,8 @@ function WizardAside(props) {
|
|
|
35
37
|
React.createElement("section", { className: "grid-aside-content" },
|
|
36
38
|
canShowFileUploadWidget() && React.createElement(InsightsResults, null),
|
|
37
39
|
canShowFileUploadWidget() && React.createElement(FileDiag, { className: "pf-v5-u-mb-md" }),
|
|
40
|
+
activeSection === AppRouteSections.SUMMARIZE && !isCveModalOpened && React.createElement(CveSidebar, null),
|
|
41
|
+
activeSection === AppRouteSections.TROUBLESHOOT && React.createElement(CveSidebar, null),
|
|
38
42
|
canshowEARuleWidget && activeSection !== AppRouteSections.GET_SUPPORT && React.createElement(EARuleWidget, null),
|
|
39
43
|
!(isIdea && activeSection === 'submit-case') && (React.createElement(AsideResults, { routeProps: props.routeProps, className: "pf-v5-u-mb-md pf-v5-u-mt-0" })),
|
|
40
44
|
canShowFileRecommendationSectionsWidget && React.createElement(InsightsResults, { isDisplayOnMain: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAK3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAK3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA4PtC;kBA5PQ,gBAAgB;;;AA8PzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -70,16 +70,30 @@ function WizardNavigation(props) {
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
const observer = new IntersectionObserver(([entry]) => {
|
|
73
|
-
if
|
|
74
|
-
|
|
73
|
+
// future debugging needs if resolution issue occurs
|
|
74
|
+
// console.log('Intersection status:', entry.isIntersecting);
|
|
75
|
+
// console.log('Intersection ratio:', entry.intersectionRatio);
|
|
76
|
+
// console.log({ hasUserScrolled });
|
|
77
|
+
const boundingRect = entry.boundingClientRect;
|
|
78
|
+
const isScrollingUp = boundingRect.top > 0;
|
|
79
|
+
const isAboveThreshold = entry.intersectionRatio >= 0.3;
|
|
80
|
+
isAboveThreshold && props.setUserCanNavigateToTroubleshoot(true);
|
|
81
|
+
isAboveThreshold && props.setUserSeenRecommendations(true);
|
|
82
|
+
// If scrolling up, always use the threshold check
|
|
83
|
+
if (isScrollingUp) {
|
|
84
|
+
setHasUserScrolled(isAboveThreshold);
|
|
85
|
+
props.setUserScrolledLabel(isAboveThreshold);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// If scrolling down and we hit the threshold, set to true
|
|
89
|
+
if (isAboveThreshold) {
|
|
75
90
|
props.setUserScrolledLabel(true);
|
|
76
|
-
|
|
77
|
-
props.userClickedNextonRecommendationsFn(true);
|
|
78
|
-
}
|
|
91
|
+
props.userClickedNextonRecommendationsFn && props.userClickedNextonRecommendationsFn(true);
|
|
79
92
|
}
|
|
80
93
|
}, {
|
|
81
94
|
root: null,
|
|
82
|
-
threshold: 0.
|
|
95
|
+
threshold: [0, 0.3], // Changing threshold value to have its effect on pagination when page size is more than 10.
|
|
96
|
+
rootMargin: '0px',
|
|
83
97
|
});
|
|
84
98
|
const resultsRowElement = props.resultsRowRef.current;
|
|
85
99
|
if (resultsRowElement) {
|
|
@@ -90,30 +104,22 @@ function WizardNavigation(props) {
|
|
|
90
104
|
observer.unobserve(resultsRowElement);
|
|
91
105
|
}
|
|
92
106
|
};
|
|
93
|
-
}, [recommendationState.numFound,
|
|
107
|
+
}, [recommendationState.numFound, hasUserScrolled, props]);
|
|
94
108
|
const onNext = () => {
|
|
95
109
|
var _a;
|
|
96
110
|
updateisNextBtnClickedToShowValidationError(dispatchToRouteReducer, true);
|
|
97
111
|
//handle the new changes for 13406:
|
|
98
112
|
if (props.activeStep.id === AppRouteSections.SUMMARIZE && recommendationState.numFound > 2) {
|
|
99
|
-
if (!
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
107
|
-
}
|
|
113
|
+
if (!hasUserScrolled) {
|
|
114
|
+
scrollIntoView(props.resultsRowRef, {
|
|
115
|
+
navBarRef,
|
|
116
|
+
timeout: 0,
|
|
117
|
+
onlyIfNotInViewport: true,
|
|
118
|
+
offset: 120,
|
|
119
|
+
});
|
|
108
120
|
props.userClickedNextonRecommendationsFn && props.userClickedNextonRecommendationsFn(true);
|
|
109
121
|
return;
|
|
110
122
|
}
|
|
111
|
-
else {
|
|
112
|
-
props.setUserCanNavigateToTroubleshoot(true);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
props.setUserCanNavigateToTroubleshoot(true);
|
|
117
123
|
}
|
|
118
124
|
const userCanNotOpenCase = props.activeStep.id === AppRouteSections.TROUBLESHOOT && canCreateCase.alert();
|
|
119
125
|
if (userCanNotOpenCase || !isSectionValidFn(props.activeStep.id))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchCVEData.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchCVEData.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,0BAA0B,EAAkB,MAAM,iCAAiC,CAAC;AAI7F,wBAAgB,eAAe;;EAkG9B"}
|