@rh-support/troubleshoot 2.3.0-alpha.0 → 2.4.5-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +1 -1
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +20 -16
- 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 +86 -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 +42 -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/OpenCase/OpenCase.d.ts +3 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +8 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +3 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +29 -21
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +2 -2
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts +4 -2
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +12 -7
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +2 -2
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +5 -6
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +54 -15
- 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/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +14 -7
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +11 -9
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +28 -22
- package/lib/esm/css/results.css +6 -0
- 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 +133 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +11 -3
- 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 +4 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +3 -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/RouteConstNTypes.d.ts +0 -1
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +0 -1
- 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 +15 -122
- 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`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBAoKhD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Popover, TextArea } from '@patternfly/react-core';
|
|
2
|
+
import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon';
|
|
3
3
|
// import ArrowRightIcon from '@patternfly/react-icons/dist/js/icons/arrow-right-icon'; This will be used for the Learn More button
|
|
4
|
-
import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
|
|
5
4
|
import { InlineEdit, useBreakpoint } from '@rh-support/components';
|
|
6
5
|
import isEmpty from 'lodash/isEmpty';
|
|
7
6
|
import isEqual from 'lodash/isEqual';
|
|
@@ -57,22 +56,27 @@ export default function Description(props) {
|
|
|
57
56
|
};
|
|
58
57
|
const isKT1Required = true;
|
|
59
58
|
const headerPopoverContent = (React.createElement("div", null,
|
|
60
|
-
React.createElement(
|
|
61
|
-
|
|
62
|
-
React.createElement(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
" ",
|
|
66
|
-
React.createElement(
|
|
67
|
-
|
|
68
|
-
React.createElement("
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
React.createElement(Trans, null, "Tips for describing your problem")));
|
|
60
|
+
const PopoverContent = (React.createElement("div", { className: "popover-body-info-description" },
|
|
61
|
+
React.createElement(Trans, null, "Example:"),
|
|
62
|
+
React.createElement("p", { className: "pf-v5-u-color-200" },
|
|
63
|
+
React.createElement(Trans, null,
|
|
64
|
+
"I'm unable to start the SSHD service receiving the error message",
|
|
65
|
+
React.createElement("br", null),
|
|
66
|
+
"\"Bad yes/no argument for ShowPatchLevel parameter\"")),
|
|
67
|
+
React.createElement(Trans, null, "To expedite your case, include these details:"),
|
|
68
|
+
React.createElement("p", { className: "pf-v5-u-color-200" },
|
|
69
|
+
React.createElement(Trans, null,
|
|
70
|
+
"Problem",
|
|
71
|
+
React.createElement("br", null),
|
|
72
|
+
"Steps you've taken",
|
|
73
|
+
React.createElement("br", null),
|
|
74
|
+
"Error Messages"))));
|
|
71
75
|
return (React.createElement(InlineEdit, { labelContent: React.createElement(React.Fragment, null, props.customTitle ? (props.customTitle) : (React.createElement(React.Fragment, null,
|
|
72
76
|
React.createElement(Trans, null, "Describe your problem. Include specific actions and error messages."),
|
|
73
77
|
isKT1Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
74
|
-
React.createElement(Popover, {
|
|
75
|
-
React.createElement(
|
|
78
|
+
React.createElement(Popover, { isVisible: isOpen, shouldClose: handleClose, headerContent: headerPopoverContent, bodyContent: PopoverContent },
|
|
79
|
+
React.createElement(OutlinedQuestionCircleIcon, { className: "pf-v5-u-ml-xs icon-size", onClick: handleToggle }))))), labelProps: { htmlFor: 'get-support-ktQ1-issue' }, content: issue, allowInlineEdit: !!props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: isEmpty(issue), usePreformattedTag: true, saveOnBlur: true },
|
|
76
80
|
React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: `description-textarea ${(isEmpty(summary) || isEmpty(version)) && isEmpty(issue) ? 'kt1-disabled' : ''}`, "aria-invalid": (issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DETAILS_ISSUE_LIMIT ? 'true' : 'false', "aria-required": isKT1Required, isRequired: isKT1Required, value: issue, disabled: (isEmpty(summary) || isEmpty(version)) && isEmpty(issue), onChange: (e, value) => onKTQ1IssueChange(value, e), "data-tracking-id": "get-support-ktQ1-issue", placeholder: t(`The more detail that you include, the easier it is for us to help you. \nExample: \nI'm unable to start the SSHD service and am receiving the error message "Bad yes/no \nargument for ShowPatchLevel parameter"`), resizeOrientation: "vertical", validated: props.isSummarizeInvalid ? 'error' : 'default', rows: isLgScreenHeight ? 10 : 4, ref: textAreaRef, onClick: handleTextAreaClick }),
|
|
77
81
|
React.createElement("p", { className: "form-instructions pf-v5-u-danger-color-100", "data-tracking-id": "large-20k-warning-ktQ1-environment" }, `${(issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DETAILS_ISSUE_LIMIT
|
|
78
82
|
? `This description exceeds ${CASE_DETAILS_ISSUE_LIMIT} characters. Try shortening it.`
|
|
@@ -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":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,UAAU,KAAK;IACX,GAAG,EAAE,0BAA0B,CAAC;CACnC;AAID,eAAO,MAAM,OAAO,UAAW,KAAK,sBA2InC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 isEqual from 'lodash/isEqual';
|
|
9
|
+
import map from 'lodash/map';
|
|
10
|
+
import slice from 'lodash/slice';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { Trans } from 'react-i18next';
|
|
13
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
14
|
+
const sanitize = (html) => ({ __html: DOMPurify.sanitize(html) });
|
|
15
|
+
export const CveItem = (props) => {
|
|
16
|
+
const { cve } = props;
|
|
17
|
+
const { isCveModalOpened } = useCaseSelector((state) => ({
|
|
18
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
19
|
+
}), isEqual);
|
|
20
|
+
const renderDate = () => (React.createElement("div", { className: "pf-v5-u-disabled-color-100" },
|
|
21
|
+
React.createElement(Trans, null, "Public on"),
|
|
22
|
+
" - ",
|
|
23
|
+
format(cve === null || cve === void 0 ? void 0 : cve.publicDate, 'MMM dd, yyyy')));
|
|
24
|
+
const renderLabels = () => (React.createElement(LabelGroup, { defaultIsOpen: true, numLabels: 10 },
|
|
25
|
+
React.createElement(Label, { color: "green", isCompact: true, icon: React.createElement(StarIcon, null) },
|
|
26
|
+
React.createElement(Trans, null, "Exact match")),
|
|
27
|
+
React.createElement(Label, { color: cve.severity === 'Critical'
|
|
28
|
+
? 'red'
|
|
29
|
+
: cve.severity === 'Important'
|
|
30
|
+
? 'orange'
|
|
31
|
+
: cve.severity === 'Moderate'
|
|
32
|
+
? 'gold'
|
|
33
|
+
: undefined, isCompact: true }, cve.severity),
|
|
34
|
+
!isEmpty(cve.errataData) && (React.createElement(Label, { color: "blue", isCompact: true },
|
|
35
|
+
React.createElement(Trans, null, "Fixed"))),
|
|
36
|
+
!isEmpty(cve.mitigation) && (React.createElement(Label, { isCompact: true },
|
|
37
|
+
React.createElement(Trans, null, "Mitigation available")))));
|
|
38
|
+
const displayErrataTable = () => {
|
|
39
|
+
if (isEmpty(cve === null || cve === void 0 ? void 0 : cve.errataData)) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return (React.createElement(Table, { "aria-label": "Errata table", variant: 'compact' },
|
|
43
|
+
React.createElement(Thead, null,
|
|
44
|
+
React.createElement(Tr, null,
|
|
45
|
+
React.createElement(Th, null,
|
|
46
|
+
React.createElement(Trans, null, "Errata link")),
|
|
47
|
+
React.createElement(Th, { width: 30 },
|
|
48
|
+
React.createElement(Trans, null, "Component")),
|
|
49
|
+
React.createElement(Th, null,
|
|
50
|
+
React.createElement(Trans, null, "Status")))),
|
|
51
|
+
React.createElement(Tbody, null, map(slice(cve.errataData, 0, isCveModalOpened ? 3 : 2), (errata, index) => {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
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 })),
|
|
54
|
+
React.createElement(Td, null,
|
|
55
|
+
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 :
|
|
56
|
+
_c.name,
|
|
57
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" }))),
|
|
58
|
+
React.createElement(Td, { modifier: "truncate" }, errata === null || errata === void 0 ? void 0 : errata.package),
|
|
59
|
+
React.createElement(Td, null,
|
|
60
|
+
React.createElement(Trans, null, errata === null || errata === void 0 ? void 0 : errata.state))));
|
|
61
|
+
}))));
|
|
62
|
+
};
|
|
63
|
+
const displayDescription = () => {
|
|
64
|
+
var _a;
|
|
65
|
+
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) {
|
|
66
|
+
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."));
|
|
67
|
+
}
|
|
68
|
+
const MAX_DESCRIPTION_LENGTH = isCveModalOpened ? 300 : 120;
|
|
69
|
+
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;
|
|
70
|
+
if (!description)
|
|
71
|
+
return '';
|
|
72
|
+
const trimmedDescription = description.length <= MAX_DESCRIPTION_LENGTH
|
|
73
|
+
? description
|
|
74
|
+
: description.slice(0, MAX_DESCRIPTION_LENGTH).trim() + '...';
|
|
75
|
+
return React.createElement("p", { className: "pf-v5-u-mt-md", dangerouslySetInnerHTML: sanitize(trimmedDescription) });
|
|
76
|
+
};
|
|
77
|
+
return (React.createElement("p", null,
|
|
78
|
+
React.createElement(Flex, null,
|
|
79
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerXs' } }, renderLabels()),
|
|
80
|
+
React.createElement(FlexItem, null, renderDate())),
|
|
81
|
+
displayErrataTable(),
|
|
82
|
+
displayDescription(),
|
|
83
|
+
(cve === null || cve === void 0 ? void 0 : cve.cveLink) && (React.createElement(Button, { variant: "primary", className: isCveModalOpened ? 'pf-v5-u-my-md' : '', "data-tracking-id": "go-to-CVE-button", component: "a", href: cve.cveLink, target: "_blank", rel: "noopener noreferrer" },
|
|
84
|
+
React.createElement(Trans, null, "Go to CVE"),
|
|
85
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })))));
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAQ1C,eAAO,MAAM,QAAQ,yBA2DpB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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, { useContext } from 'react';
|
|
9
|
+
import { Trans } from 'react-i18next';
|
|
10
|
+
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
12
|
+
import { setCaseState } from '../../reducers/CaseReducer';
|
|
13
|
+
import { CvePanel } from './CvePanel';
|
|
14
|
+
export const CveModal = () => {
|
|
15
|
+
const caseDispatch = useCaseDispatch();
|
|
16
|
+
const { cveWorkflowRecommendation, isCveModalOpened } = useCaseSelector((state) => ({
|
|
17
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
18
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
19
|
+
}), isEqual);
|
|
20
|
+
const { sessionRestore: { activeSessionId }, } = useContext(SessionRestoreStateContext);
|
|
21
|
+
const handleModalToggle = () => {
|
|
22
|
+
setCaseState(caseDispatch, { isCveModalOpened: !isCveModalOpened });
|
|
23
|
+
};
|
|
24
|
+
const handleEscapePress = (event) => {
|
|
25
|
+
// prevent the default escape key behavior
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
};
|
|
28
|
+
const generateCveCheckerUrl = () => {
|
|
29
|
+
const cveTitles = join(map(cveWorkflowRecommendation, 'title'), ',');
|
|
30
|
+
return `https://${getAccessHostname()}/labs/cvechecker/?source=pcm&session=${activeSessionId}&id=${cveTitles}`;
|
|
31
|
+
};
|
|
32
|
+
return (React.createElement(Modal, { variant: ModalVariant.medium, title: React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' } },
|
|
33
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerSm' } },
|
|
34
|
+
React.createElement(Trans, null, "Handpicked for this CVEs")),
|
|
35
|
+
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))), isOpen: isCveModalOpened, onClose: handleModalToggle, titleIconVariant: "info", disableFocusTrap: true, onEscapePress: handleEscapePress, actions: [
|
|
36
|
+
React.createElement(Button, { key: "cve-checker-link", "data-tracking-id": "cve-checker-link", target: "_blank", variant: "secondary", isInline: true, component: "a", href: generateCveCheckerUrl() },
|
|
37
|
+
React.createElement(Trans, null, "Red Hat CVE Checker"),
|
|
38
|
+
" ",
|
|
39
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })),
|
|
40
|
+
] },
|
|
41
|
+
React.createElement(CvePanel, null)));
|
|
42
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -3,6 +3,9 @@ import { RouteComponentProps } from 'react-router-dom';
|
|
|
3
3
|
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
4
4
|
export interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
|
+
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
|
+
userClickedNextonRecommendations: boolean;
|
|
8
|
+
resultsRowRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
6
9
|
}
|
|
7
10
|
export default function OpenCase(props: IProps): React.JSX.Element;
|
|
8
11
|
//# sourceMappingURL=OpenCase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenCase.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/OpenCase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenCase.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/OpenCase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,MAAM,WAAW,MAAM;IACnB,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,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAqC7C"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
3
5
|
import { AccountSelector } from '../AccountInfo/AccountSelector';
|
|
4
6
|
import { OwnerSelector } from '../AccountInfo/OwnerSelector';
|
|
7
|
+
import ProductSelector from '../ProductSelector/ProductSelector';
|
|
5
8
|
import SupportTypeSelectorPage from './SupportTypeSelectorPage';
|
|
6
9
|
export default function OpenCase(props) {
|
|
7
10
|
const canChangeAccountInfo = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ACCOUNT_AND_OWNER);
|
|
11
|
+
const { enableGetSupportProductVersion } = useCaseSelector((state) => ({
|
|
12
|
+
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
13
|
+
}), isEqual);
|
|
8
14
|
return (React.createElement("form", null,
|
|
9
15
|
canChangeAccountInfo && (React.createElement(React.Fragment, null,
|
|
10
16
|
React.createElement(AccountSelector, { "data-tracking-id": "get-support-account-selector" }),
|
|
11
17
|
React.createElement(OwnerSelector, { "data-tracking-id": "get-support-owner-selector" }))),
|
|
18
|
+
enableGetSupportProductVersion && (React.createElement("div", { className: "form-group" },
|
|
19
|
+
React.createElement(ProductSelector, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendations: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef, isOnGetSupportPage: true }))),
|
|
12
20
|
React.createElement(SupportTypeSelectorPage, null)));
|
|
13
21
|
}
|
|
@@ -8,6 +8,9 @@ interface IProps {
|
|
|
8
8
|
showTCAfterButtonClicked?: boolean;
|
|
9
9
|
checkEntitledProduct?: boolean;
|
|
10
10
|
isOnSummaryPage?: boolean;
|
|
11
|
+
isOnGetSupportPage?: boolean;
|
|
12
|
+
isOnReviewPage?: boolean;
|
|
13
|
+
caseCreateExperience?: boolean;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Renders a dropdown list to select all products.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EA0JvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -8,8 +8,10 @@ import isEqual from 'lodash/isEqual';
|
|
|
8
8
|
import React, { forwardRef, useContext, useEffect, useState } from 'react';
|
|
9
9
|
import { Trans, useTranslation } from 'react-i18next';
|
|
10
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
11
12
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
12
13
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
14
|
+
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
13
15
|
import RouteUtils from '../../utils/routeUtils';
|
|
14
16
|
import OpenCaseIssue from '../CaseInformation/OpenCaseIssue';
|
|
15
17
|
import Suggestions from '../Suggestions/Suggestions';
|
|
@@ -76,28 +78,34 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
76
78
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
77
79
|
}
|
|
78
80
|
const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
82
|
+
if ((activeSection === AppRouteSections.SUMMARIZE && !props.caseCreateExperience) ||
|
|
83
|
+
activeSection === AppRouteSections.GET_SUPPORT) {
|
|
84
|
+
return (React.createElement("div", { className: "form-group product-selector-wrapper" },
|
|
81
85
|
React.createElement("div", { className: "all-product-selector-dropdown" },
|
|
82
|
-
React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching })))
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
React.createElement("
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching }))));
|
|
87
|
+
// } else if (activeSection === AppRouteSections.SUMMARIZE && props.caseCreateExperience)
|
|
88
|
+
}
|
|
89
|
+
else
|
|
90
|
+
return (React.createElement(React.Fragment, null,
|
|
91
|
+
React.createElement("div", { className: "case-details-summary" },
|
|
92
|
+
React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage })),
|
|
93
|
+
React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
|
|
94
|
+
? 'You are'
|
|
95
|
+
: 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
|
|
96
|
+
showModalButton &&
|
|
97
|
+
!isEmpty(product) &&
|
|
98
|
+
!isEmpty(version) &&
|
|
99
|
+
!topContent.isFetching &&
|
|
100
|
+
topContent.data.length !== 0 && (React.createElement("button", { className: "btn btn-bordered-blue btn-slim pull-top-narrow push-bottom-narrow", "data-tracking-id": "suggested-fixes-trigger", onClick: toggleTCModal, type: "button" },
|
|
101
|
+
React.createElement(Trans, null, "Suggested fixes"))),
|
|
102
|
+
props.loadTCOnChange && !topContent.isFetching && topContent.data.length !== 0 && (React.createElement(Modal, { className: "feedback-modal", title: t('Suggested fixes'), description: t('There are new updates to suggested fixes after changing your product.'), "aria-describedby": "Feedback Form", isOpen: isModalOpen, variant: ModalVariant.large, onClose: toggleTCModal, actions: [
|
|
103
|
+
React.createElement("button", { key: "cancel", onClick: toggleTCModal, className: "btn btn-app btn-primary", type: "button" },
|
|
104
|
+
React.createElement(Trans, null, "Cancel")),
|
|
105
|
+
] },
|
|
106
|
+
React.createElement("span", null,
|
|
107
|
+
React.createElement(Trans, null, "Here are some common suggestions:")),
|
|
108
|
+
React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
|
|
101
109
|
});
|
|
102
110
|
AllProductsSelector.defaultProps = defaultProps;
|
|
103
111
|
export { AllProductsSelector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAOD,eAAO,MAAM,0BAA0B,UAAW,MAAM,sBAyHvD,CAAC"}
|
|
@@ -73,8 +73,8 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
73
73
|
setIsSelectedProductSupportedForCustomer(isProductSupportedForCustomer(product, allProducts.data.productsResult));
|
|
74
74
|
}, [allProducts.data.productsResult, product, props.isOnSummaryPage]);
|
|
75
75
|
return (React.createElement("div", null,
|
|
76
|
-
React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Search for or select a product'), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Search for or select a product'), "aria-labelledby": t('Product-selector'), onFilter: onFilter, selections: product, validated: isEmpty(product) && showValidationLocal ? 'error' : 'default', "data-tracking-id": "get-support-product-dropdown-selector" }, getOptions()),
|
|
77
|
-
!isSelectedProductSupportedForCustomer && (React.createElement("div", { className: "pf-v5-u-ml-xs pf-v5-u-mt-sm form-instructions" },
|
|
76
|
+
React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Search for or select a product'), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Search for or select a product'), "aria-labelledby": t('Product-selector'), onFilter: onFilter, selections: product, validated: isEmpty(product) && showValidationLocal ? 'error' : 'default', "data-tracking-id": "get-support-product-dropdown-selector", isDisabled: props.isLoading }, getOptions()),
|
|
77
|
+
!props.isLoading && !isSelectedProductSupportedForCustomer && (React.createElement("div", { className: "pf-v5-u-ml-xs pf-v5-u-mt-sm form-instructions" },
|
|
78
78
|
React.createElement(Trans, null, "Red Hat must confirm your subscription status before providing support."),
|
|
79
79
|
React.createElement("br", null),
|
|
80
80
|
React.createElement(Trans, null, "We'll contact you if we have any questions.")))));
|
|
@@ -91,5 +91,5 @@ export const NewProductVersionSelector = (props) => {
|
|
|
91
91
|
setIsOpen(false);
|
|
92
92
|
};
|
|
93
93
|
const titleId = 'version-selector';
|
|
94
|
-
return (React.createElement(Select, Object.assign({ variant: SelectVariant.single, onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Select a version'), toggleAriaLabel: t('Select a version'), "aria-labelledby": titleId, selections: version, validated: isEmpty(version) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(product), "data-tracking-id": "get-support-version-dropdown-selector" }, (isSEProductApiIsDown && versionsDetails.isFetching && { loadingVariant: 'spinner' })), selectVersionOptions.map((version, index) => (React.createElement(SelectOption, { key: index, value: version })))));
|
|
94
|
+
return (React.createElement(Select, Object.assign({ variant: SelectVariant.single, onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Select a version'), toggleAriaLabel: t('Select a version'), "aria-labelledby": titleId, selections: version, validated: isEmpty(version) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(product) || allProducts.isFetching, "data-tracking-id": "get-support-version-dropdown-selector" }, (isSEProductApiIsDown && versionsDetails.isFetching && { loadingVariant: 'spinner' })), selectVersionOptions.map((version, index) => (React.createElement(SelectOption, { key: index, value: version })))));
|
|
95
95
|
};
|
|
@@ -4,8 +4,10 @@ import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
6
|
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
|
-
userClickedNextonRecommendations
|
|
8
|
-
resultsRowRef
|
|
7
|
+
userClickedNextonRecommendations?: boolean;
|
|
8
|
+
resultsRowRef?: React.MutableRefObject<HTMLDivElement | null>;
|
|
9
|
+
isOnGetSupportPage?: boolean;
|
|
10
|
+
caseCreateExperience?: boolean;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Responsible for:
|
|
@@ -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,CAAC,EAAE,OAAO,CAAC;IAC3C,aAAa,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAqGpD"}
|
|
@@ -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,11 +22,13 @@ 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
|
-
const { product, version } = useCaseSelector((state) => ({
|
|
28
|
+
const { product, version, enableGetSupportProductVersion } = useCaseSelector((state) => ({
|
|
26
29
|
product: state.caseDetails.product,
|
|
27
30
|
version: state.caseDetails.version,
|
|
31
|
+
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
28
32
|
}), isEqual);
|
|
29
33
|
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
30
34
|
/**
|
|
@@ -34,11 +38,12 @@ export default function ProductSelector(props) {
|
|
|
34
38
|
*/
|
|
35
39
|
const productSelectorRef = useRef(null);
|
|
36
40
|
return (React.createElement(React.Fragment, null,
|
|
37
|
-
allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
|
|
41
|
+
!enableGetSupportProductVersion && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
|
|
38
42
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
39
|
-
|
|
43
|
+
allProducts.isFetching ? (React.createElement(ProductSelectorLoader, null)) : (!allProducts.isError && (React.createElement(React.Fragment, null,
|
|
40
44
|
React.createElement("form", null,
|
|
41
|
-
|
|
45
|
+
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
|
|
46
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage, caseCreateExperience: props.caseCreateExperience }),
|
|
42
47
|
product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
|
|
43
48
|
' ',
|
|
44
49
|
"If you're having a subscription issue that doesn't relate to",
|
|
@@ -49,8 +54,8 @@ export default function ProductSelector(props) {
|
|
|
49
54
|
React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
|
|
50
55
|
' ',
|
|
51
56
|
"for help.") })),
|
|
52
|
-
React.createElement(EARuleWidget, null)),
|
|
53
|
-
React.createElement("div", { className: "suggestions-result-section" },
|
|
57
|
+
!enableGetSupportProductVersion && React.createElement(EARuleWidget, null)),
|
|
58
|
+
!(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
|
|
54
59
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
|
|
55
|
-
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))));
|
|
60
|
+
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))))));
|
|
56
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAOtD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAOtD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,wEAwClC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -16,7 +16,7 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
|
16
16
|
React.createElement(Trans, null, "Product"),
|
|
17
17
|
' ',
|
|
18
18
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
19
|
-
React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage })),
|
|
19
|
+
React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage, isLoading: props.isLoading })),
|
|
20
20
|
React.createElement("div", { className: "version-selector-wrapper" },
|
|
21
21
|
React.createElement("label", { htmlFor: "version-selector-dropdown-toggle" },
|
|
22
22
|
React.createElement(Trans, null, "Version"),
|
|
@@ -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"}
|
|
@@ -122,14 +122,14 @@ export function AsideResults(props) {
|
|
|
122
122
|
useEffect(() => {
|
|
123
123
|
if (isSelectedAccounntSecureSupport)
|
|
124
124
|
return;
|
|
125
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), JSON.stringify(payload));
|
|
125
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), typeof payload === 'string' ? payload : JSON.stringify(payload));
|
|
126
126
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
127
127
|
}, [recommendationState.sideRecommendation, activeSessionId, activeSection]);
|
|
128
128
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
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;
|