@rh-support/troubleshoot 2.4.5-beta.11 → 2.4.5-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +2 -3
- package/lib/esm/components/Cve/CveItem.d.ts +2 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveItem.js +49 -6
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveModal.js +4 -1
- package/lib/esm/components/Cve/CvePanel.js +1 -1
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +4 -3
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +38 -29
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +28 -20
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +6 -1
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +26 -21
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +4 -2
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +4 -2
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +52 -14
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +9 -4
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +19 -3
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +23 -7
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
- package/lib/esm/hooks/useFetchCVEData.js +10 -6
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +23 -5
- package/lib/esm/models/caseCreationWorkflows.d.ts +2 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +2 -0
- package/lib/esm/reducers/CaseReducer.d.ts +1 -0
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -0
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +7 -4
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +25 -12
- package/lib/esm/scss/_main.scss +49 -0
- package/lib/esm/utils/caseUtils.d.ts +1 -1
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +2 -2
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qBAgKhD"}
|
|
@@ -12,8 +12,7 @@ import { getUpdatedDescription } from '../../reducers/CaseHelpers';
|
|
|
12
12
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
13
13
|
export default function Description(props) {
|
|
14
14
|
const { t } = useTranslation();
|
|
15
|
-
const { issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName,
|
|
16
|
-
summary: state.caseDetails.summary,
|
|
15
|
+
const { issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName, version } = useCaseSelector((state) => ({
|
|
17
16
|
description: state.caseDetails.description,
|
|
18
17
|
issue: state.caseDetails.issue,
|
|
19
18
|
environment: state.caseDetails.environment,
|
|
@@ -77,7 +76,7 @@ export default function Description(props) {
|
|
|
77
76
|
isKT1Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
78
77
|
React.createElement(Popover, { isVisible: isOpen, shouldClose: handleClose, headerContent: headerPopoverContent, bodyContent: PopoverContent },
|
|
79
78
|
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 },
|
|
80
|
-
React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: `description-textarea ${
|
|
79
|
+
React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: `description-textarea ${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(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 }),
|
|
81
80
|
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
|
|
82
81
|
? `This description exceeds ${CASE_DETAILS_ISSUE_LIMIT} characters. Try shortening it.`
|
|
83
82
|
: ''}`)));
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { ICVEWorkflowRecommendation } from '../../models/caseCreationWorkflows';
|
|
3
3
|
interface IProp {
|
|
4
4
|
cve: ICVEWorkflowRecommendation;
|
|
5
|
+
isExpanded: boolean;
|
|
6
|
+
index: number;
|
|
5
7
|
}
|
|
6
8
|
export declare const CveItem: (props: IProp) => React.JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CveItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CveItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveItem.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAKrD,OAAO,EAAE,0BAA0B,EAAkB,MAAM,oCAAoC,CAAC;AAShG,UAAU,KAAK;IACX,GAAG,EAAE,0BAA0B,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACjB;AAaD,eAAO,MAAM,OAAO,UAAW,KAAK,sBA2NnC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pcm } from '@cee-eng/hydrajs';
|
|
1
2
|
import { Button, Flex, FlexItem, Label, LabelGroup, Text, TextVariants } from '@patternfly/react-core';
|
|
2
3
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
3
4
|
import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon';
|
|
@@ -8,9 +9,13 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
8
9
|
import isEqual from 'lodash/isEqual';
|
|
9
10
|
import map from 'lodash/map';
|
|
10
11
|
import slice from 'lodash/slice';
|
|
11
|
-
import React from 'react';
|
|
12
|
+
import React, { useContext, useEffect } from 'react';
|
|
12
13
|
import { Trans } from 'react-i18next';
|
|
13
14
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
15
|
+
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
16
|
+
import { createOrUpdateSessionResources, getSessResFromCve, getSessResFromErrata, } from '../../reducers/SessionRestoreReducer';
|
|
17
|
+
import RouteUtils from '../../utils/routeUtils';
|
|
18
|
+
const { SessionResourceVisibility, SessionResourceWorkflowComponent, SessionResourceSource } = pcm.preCase.session;
|
|
14
19
|
const sanitize = (html) => ({ __html: DOMPurify.sanitize(html) });
|
|
15
20
|
function formatDate(dateString) {
|
|
16
21
|
const date = parseISO(dateString);
|
|
@@ -22,10 +27,45 @@ function formatDate(dateString) {
|
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
export const CveItem = (props) => {
|
|
25
|
-
|
|
26
|
-
const {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const { cve, isExpanded, index } = props;
|
|
32
|
+
const { product, version, summary, issue, isCveModalOpened } = useCaseSelector((state) => ({
|
|
33
|
+
product: state.caseDetails.product,
|
|
34
|
+
version: state.caseDetails.version,
|
|
35
|
+
summary: state.caseDetails.summary,
|
|
36
|
+
issue: state.caseDetails.issue,
|
|
27
37
|
isCveModalOpened: state.isCveModalOpened,
|
|
28
38
|
}), isEqual);
|
|
39
|
+
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
40
|
+
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
41
|
+
const workflowSource = `${cve.title}-${isCveModalOpened ? 'model' : 'aside'}`;
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (isExpanded) {
|
|
44
|
+
onPresentOrVisitedCveErrataData();
|
|
45
|
+
}
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
+
}, [isExpanded]);
|
|
48
|
+
const updateSessionDb = (resources) => {
|
|
49
|
+
const payload = {
|
|
50
|
+
product: product,
|
|
51
|
+
version: version,
|
|
52
|
+
summary: summary,
|
|
53
|
+
description: issue,
|
|
54
|
+
};
|
|
55
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.DRUPAL, resources, JSON.stringify(payload), workflowSource);
|
|
56
|
+
};
|
|
57
|
+
const onClickErrataLink = (errataDetails, index = 0) => {
|
|
58
|
+
updateSessionDb([
|
|
59
|
+
getSessResFromErrata(errataDetails, SessionResourceVisibility.VISITED, index + 1, isCveModalOpened
|
|
60
|
+
? SessionResourceWorkflowComponent.CVE_MODEl
|
|
61
|
+
: SessionResourceWorkflowComponent.CVE_ASIDE),
|
|
62
|
+
]);
|
|
63
|
+
};
|
|
64
|
+
const onPresentOrVisitedCveErrataData = (isVisited = false) => {
|
|
65
|
+
updateSessionDb(getSessResFromCve(cve, isVisited ? SessionResourceVisibility.VISITED : SessionResourceVisibility.PRESENTED, index + 1, isCveModalOpened
|
|
66
|
+
? SessionResourceWorkflowComponent.CVE_MODEl
|
|
67
|
+
: SessionResourceWorkflowComponent.CVE_ASIDE, isVisited ? true : false, isCveModalOpened ? 3 : 2));
|
|
68
|
+
};
|
|
29
69
|
const renderDate = () => (cve === null || cve === void 0 ? void 0 : cve.publicDate) && (React.createElement("div", { className: "pf-v5-u-disabled-color-100" },
|
|
30
70
|
React.createElement(Trans, null, "Public on"),
|
|
31
71
|
" - ",
|
|
@@ -61,7 +101,7 @@ export const CveItem = (props) => {
|
|
|
61
101
|
var _a, _b, _c;
|
|
62
102
|
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 })),
|
|
63
103
|
React.createElement(Td, null,
|
|
64
|
-
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 :
|
|
104
|
+
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", onClick: () => onClickErrataLink(errata, index) }, (_c = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _c === void 0 ? void 0 :
|
|
65
105
|
_c.name,
|
|
66
106
|
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" }))),
|
|
67
107
|
React.createElement(Td, { modifier: "truncate" }, errata === null || errata === void 0 ? void 0 : errata.package),
|
|
@@ -84,13 +124,16 @@ export const CveItem = (props) => {
|
|
|
84
124
|
: description.slice(0, MAX_DESCRIPTION_LENGTH).trim() + '...';
|
|
85
125
|
return React.createElement("p", { className: "pf-v5-u-mt-md pf-v5-u-color-300", dangerouslySetInnerHTML: sanitize(trimmedDescription) });
|
|
86
126
|
};
|
|
87
|
-
|
|
127
|
+
const onClickGoToCveButtonPage = () => {
|
|
128
|
+
onPresentOrVisitedCveErrataData(true);
|
|
129
|
+
};
|
|
130
|
+
return (React.createElement("div", null,
|
|
88
131
|
React.createElement(Flex, null,
|
|
89
132
|
React.createElement(FlexItem, { spacer: { default: 'spacerXs' } }, renderLabels()),
|
|
90
133
|
React.createElement(FlexItem, null, renderDate())),
|
|
91
134
|
displayErrataTable(),
|
|
92
135
|
displayDescription(),
|
|
93
|
-
(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" },
|
|
136
|
+
(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}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[workflowSource]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.DRUPAL)}`, target: "_blank", rel: "noopener noreferrer", onClick: onClickGoToCveButtonPage },
|
|
94
137
|
React.createElement(Trans, null, "Go to CVE"),
|
|
95
138
|
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })))));
|
|
96
139
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CveModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
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,yBAmEpB,CAAC"}
|
|
@@ -8,8 +8,10 @@ import size from 'lodash/size';
|
|
|
8
8
|
import React, { useContext } from 'react';
|
|
9
9
|
import { Trans } from 'react-i18next';
|
|
10
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
11
12
|
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
12
13
|
import { setCaseState } from '../../reducers/CaseReducer';
|
|
14
|
+
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
13
15
|
import { CvePanel } from './CvePanel';
|
|
14
16
|
export const CveModal = () => {
|
|
15
17
|
const caseDispatch = useCaseDispatch();
|
|
@@ -18,6 +20,7 @@ export const CveModal = () => {
|
|
|
18
20
|
isCveModalOpened: state.isCveModalOpened,
|
|
19
21
|
}), isEqual);
|
|
20
22
|
const { sessionRestore: { activeSessionId }, } = useContext(SessionRestoreStateContext);
|
|
23
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
21
24
|
const handleModalToggle = () => {
|
|
22
25
|
setCaseState(caseDispatch, { isCveModalOpened: !isCveModalOpened });
|
|
23
26
|
};
|
|
@@ -31,7 +34,7 @@ export const CveModal = () => {
|
|
|
31
34
|
};
|
|
32
35
|
return (React.createElement(Modal, { variant: ModalVariant.medium, title: React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' } },
|
|
33
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"))),
|
|
34
|
-
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))), isOpen: isCveModalOpened, 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, onEscapePress: handleEscapePress, actions: [
|
|
35
38
|
React.createElement(Button, { key: "cve-checker-link", "data-tracking-id": "cve-checker-link", target: "_blank", variant: "secondary", isInline: true, component: "a", href: generateCveCheckerUrl() },
|
|
36
39
|
React.createElement(Trans, null, "Red Hat CVE Checker"),
|
|
37
40
|
" ",
|
|
@@ -17,7 +17,7 @@ export const CvePanel = (props) => {
|
|
|
17
17
|
return (React.createElement(AccordionItem, { key: `cve-item-${index}` },
|
|
18
18
|
React.createElement(AccordionToggle, { onClick: () => handleToggle(cve.title), isExpanded: isExpanded, id: `cve-toggle-${index}`, "data-tracking-id": "cve-accordion-toggle" }, cve.title),
|
|
19
19
|
React.createElement(AccordionContent, { id: `cve-content-${index}`, isHidden: !isExpanded },
|
|
20
|
-
React.createElement(CveItem, { cve: cve }))));
|
|
20
|
+
React.createElement(CveItem, { cve: cve, isExpanded: isExpanded, index: index }))));
|
|
21
21
|
};
|
|
22
22
|
return (React.createElement(Accordion, { isBordered: true, displaySize: 'default', asDefinitionList: false, className: `${props.className ? props.className : ''}` }, map(slice(cveWorkflowRecommendation, 0, 4), renderAccordionItem)));
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qBAuC7C"}
|
|
@@ -8,14 +8,15 @@ import ProductSelector from '../ProductSelector/ProductSelector';
|
|
|
8
8
|
import SupportTypeSelectorPage from './SupportTypeSelectorPage';
|
|
9
9
|
export default function OpenCase(props) {
|
|
10
10
|
const canChangeAccountInfo = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ACCOUNT_AND_OWNER);
|
|
11
|
-
const {
|
|
12
|
-
|
|
11
|
+
const { ABTestVarioation } = useCaseSelector((state) => ({
|
|
12
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
13
13
|
}), isEqual);
|
|
14
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
14
15
|
return (React.createElement("form", null,
|
|
15
16
|
canChangeAccountInfo && (React.createElement(React.Fragment, null,
|
|
16
17
|
React.createElement(AccountSelector, { "data-tracking-id": "get-support-account-selector" }),
|
|
17
18
|
React.createElement(OwnerSelector, { "data-tracking-id": "get-support-owner-selector" }))),
|
|
18
|
-
|
|
19
|
+
isBTestvariation && (React.createElement("div", { className: "form-group" },
|
|
19
20
|
React.createElement(ProductSelector, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendations: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef, isOnGetSupportPage: true }))),
|
|
20
21
|
React.createElement(SupportTypeSelectorPage, null)));
|
|
21
22
|
}
|
|
@@ -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;AAOvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvG,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,
|
|
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;AAOvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvG,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,4EAwKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -35,13 +35,15 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
35
35
|
var _a, _b;
|
|
36
36
|
const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
37
37
|
const caseDispatch = useCaseDispatch();
|
|
38
|
-
const { product, version, contactSSOName } = useCaseSelector((state) => ({
|
|
38
|
+
const { product, version, contactSSOName, ABTestVarioation } = useCaseSelector((state) => ({
|
|
39
39
|
product: state.caseDetails.product,
|
|
40
40
|
version: state.caseDetails.version,
|
|
41
41
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
42
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
42
43
|
}), isEqual);
|
|
43
44
|
const { cveRecommendation } = useFetchCVEData();
|
|
44
45
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
46
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
45
47
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
46
48
|
const [showModal, setShowModal] = useState(false);
|
|
47
49
|
const [showModalButton, setShowModalButton] = useState(false);
|
|
@@ -81,35 +83,42 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
81
83
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
82
84
|
}
|
|
83
85
|
const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
87
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
88
|
+
// Determine whether to render the ProductVersionDropdownSelector
|
|
89
|
+
const renderProductVersionDropdownSelector = (activeSection === AppRouteSections.SUMMARIZE && !props.caseCreateExperience) ||
|
|
90
|
+
activeSection === AppRouteSections.GET_SUPPORT ||
|
|
91
|
+
isATestvariation ||
|
|
92
|
+
(isBTestvariation && (props.isOnGetSupportPage || props.isOnReviewPage));
|
|
93
|
+
// Determine whether to render the OpenCaseIssue component
|
|
94
|
+
const renderOpenCaseIssue = (isATestvariation &&
|
|
95
|
+
(activeSection === AppRouteSections.SUMMARIZE || activeSection === AppRouteSections.REVIEW)) ||
|
|
96
|
+
(isBTestvariation &&
|
|
97
|
+
(activeSection === AppRouteSections.SUMMARIZE || activeSection === AppRouteSections.REVIEW)) ||
|
|
98
|
+
(!props.caseCreateExperience && activeSection === AppRouteSections.SUMMARIZE);
|
|
99
|
+
return (React.createElement(React.Fragment, null,
|
|
100
|
+
renderProductVersionDropdownSelector && (React.createElement("div", { className: "form-group product-selector-wrapper" },
|
|
88
101
|
React.createElement("div", { className: "all-product-selector-dropdown" },
|
|
89
|
-
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 }))))
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
] },
|
|
110
|
-
React.createElement("span", null,
|
|
111
|
-
React.createElement(Trans, null, "Here are some common suggestions:")),
|
|
112
|
-
React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
|
|
102
|
+
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 })))),
|
|
103
|
+
renderOpenCaseIssue && (React.createElement("div", { className: "case-details-summary" },
|
|
104
|
+
React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage }))),
|
|
105
|
+
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
|
|
106
|
+
React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
|
|
107
|
+
? 'You are'
|
|
108
|
+
: 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
|
|
109
|
+
showModalButton &&
|
|
110
|
+
!isEmpty(product) &&
|
|
111
|
+
!isEmpty(version) &&
|
|
112
|
+
!topContent.isFetching &&
|
|
113
|
+
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" },
|
|
114
|
+
React.createElement(Trans, null, "Suggested fixes"))),
|
|
115
|
+
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: [
|
|
116
|
+
React.createElement("button", { key: "cancel", onClick: toggleTCModal, className: "btn btn-app btn-primary", type: "button" },
|
|
117
|
+
React.createElement(Trans, null, "Cancel")),
|
|
118
|
+
] },
|
|
119
|
+
React.createElement("span", null,
|
|
120
|
+
React.createElement(Trans, null, "Here are some common suggestions:")),
|
|
121
|
+
React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
|
|
113
122
|
});
|
|
114
123
|
AllProductsSelector.defaultProps = defaultProps;
|
|
115
124
|
export { AllProductsSelector };
|
|
@@ -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,qBA8FpD"}
|
|
@@ -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,38 +22,44 @@ 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,
|
|
28
|
+
const { product, version, ABTestVarioation } = useCaseSelector((state) => ({
|
|
26
29
|
product: state.caseDetails.product,
|
|
27
30
|
version: state.caseDetails.version,
|
|
28
|
-
|
|
31
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
29
32
|
}), isEqual);
|
|
30
33
|
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
34
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
35
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
31
36
|
/**
|
|
32
37
|
* The all product selector and top product selector should always be "selected" because
|
|
33
38
|
* the all product selector needs to show the selection from the top products selector and the top product selector
|
|
34
39
|
* doesn't matter becasue it will be hidden whenever a product is selected.
|
|
35
40
|
*/
|
|
36
41
|
const productSelectorRef = useRef(null);
|
|
42
|
+
const rederProductSelect = (React.createElement("form", null,
|
|
43
|
+
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
|
|
44
|
+
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 })));
|
|
37
45
|
return (React.createElement(React.Fragment, null,
|
|
38
|
-
|
|
46
|
+
isATestvariation && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
|
|
39
47
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
isATestvariation
|
|
49
|
+
? !allProducts.isFetching && !allProducts.isError && rederProductSelect
|
|
50
|
+
: isBTestvariation && rederProductSelect,
|
|
51
|
+
product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
|
|
52
|
+
' ',
|
|
53
|
+
"If you're having a subscription issue that doesn't relate to",
|
|
54
|
+
' ',
|
|
55
|
+
React.createElement("a", { href: "/products/subscription-central", rel: "noopener noreferrer", target: "_blank" }, "Subscription Watch"),
|
|
56
|
+
"product, then please contact",
|
|
57
|
+
' ',
|
|
58
|
+
React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
|
|
59
|
+
' ',
|
|
60
|
+
"for help.") })),
|
|
61
|
+
isATestvariation && React.createElement(EARuleWidget, null),
|
|
62
|
+
!(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
|
|
63
|
+
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
|
|
64
|
+
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef }))))))));
|
|
57
65
|
}
|
|
@@ -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,wEAuDlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -16,7 +16,12 @@ 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(
|
|
19
|
+
React.createElement("div", { className: "pf-v5-u-display-flex pf-v5-u-align-items-center" },
|
|
20
|
+
React.createElement("div", { className: "pf-v5-u-flex-1" },
|
|
21
|
+
React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage, isLoading: props.isLoading })),
|
|
22
|
+
props.isLoading && (React.createElement("div", { className: "pf-v5-u-flex-basis-auto" },
|
|
23
|
+
React.createElement(LoadingIndicator, { className: "pf-v5-u-ml-sm", isInline: true, show: props.isLoading, size: "sm" })))),
|
|
24
|
+
React.createElement(React.Fragment, null)),
|
|
20
25
|
React.createElement("div", { className: "version-selector-wrapper" },
|
|
21
26
|
React.createElement("label", { htmlFor: "version-selector-dropdown-toggle" },
|
|
22
27
|
React.createElement(Trans, null, "Version"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAoBA,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,
|
|
1
|
+
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAoBA,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,qBAgXpD"}
|
|
@@ -27,14 +27,14 @@ import { WatsonxAiIcon } from './WatsonxAiIcon';
|
|
|
27
27
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
28
28
|
export default function Recommendations(props) {
|
|
29
29
|
var _a, _b, _c;
|
|
30
|
-
const { product, version, environment, summary, caseResourceLinks, issue,
|
|
30
|
+
const { product, version, environment, summary, caseResourceLinks, issue, ABTestVarioation } = useCaseSelector((state) => ({
|
|
31
31
|
product: state.caseDetails.product,
|
|
32
32
|
version: state.caseDetails.version,
|
|
33
33
|
environment: state.caseDetails.environment,
|
|
34
34
|
summary: state.caseDetails.summary,
|
|
35
35
|
issue: state.caseDetails.issue,
|
|
36
36
|
caseResourceLinks: state.caseDetails.caseResourceLinks,
|
|
37
|
-
|
|
37
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
38
38
|
}), isEqual);
|
|
39
39
|
const caseDispatch = useCaseDispatch();
|
|
40
40
|
// Use Case Number
|
|
@@ -58,6 +58,8 @@ export default function Recommendations(props) {
|
|
|
58
58
|
summary: summary,
|
|
59
59
|
description: issue, // we don't need to truncate to 20k as Watsonx max recs is 4000 done for us already
|
|
60
60
|
};
|
|
61
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
62
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
61
63
|
const isRecSearchPayloadSame = isEqual(payload, recommendationState.prevRecommendationsBody);
|
|
62
64
|
useEffect(() => {
|
|
63
65
|
// currently due to the debounce we use after the page load leads to some delay in the disbaling of next button
|
|
@@ -78,7 +80,7 @@ export default function Recommendations(props) {
|
|
|
78
80
|
* Also, log the newly presented resources on the session
|
|
79
81
|
*/
|
|
80
82
|
useDebounce(() => {
|
|
81
|
-
if (activeSection !== AppRouteSections.SUMMARIZE ||
|
|
83
|
+
if (activeSection !== AppRouteSections.SUMMARIZE || isRecSearchPayloadSame) {
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
86
|
setCurrentPage(recommendationDispatch, 1);
|
|
@@ -166,8 +168,8 @@ export default function Recommendations(props) {
|
|
|
166
168
|
function getRankPercentage(decimal) {
|
|
167
169
|
return Math.round(decimal * 100);
|
|
168
170
|
}
|
|
169
|
-
const computeLabel = (
|
|
170
|
-
const percentage = getRankPercentage(
|
|
171
|
+
const computeLabel = (rerankScore) => {
|
|
172
|
+
const percentage = getRankPercentage(rerankScore);
|
|
171
173
|
return (React.createElement(React.Fragment, null,
|
|
172
174
|
percentage > 80 && (React.createElement(Label, { color: "green", className: "match-label", icon: React.createElement(StarIcon, null) }, "Best Match")),
|
|
173
175
|
React.createElement(Label, { className: "match-label", color: "purple" },
|
|
@@ -175,32 +177,35 @@ export default function Recommendations(props) {
|
|
|
175
177
|
"% Match")));
|
|
176
178
|
};
|
|
177
179
|
return (React.createElement(React.Fragment, null,
|
|
178
|
-
|
|
179
|
-
React.createElement("div", { className: "recommendation-list", ref: props.resultsRowRef },
|
|
180
|
-
|
|
180
|
+
isATestvariation && (React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) })),
|
|
181
|
+
React.createElement("div", { className: "recommendation-list pf-v5-u-pt-md", ref: props.resultsRowRef },
|
|
182
|
+
isBTestvariation
|
|
181
183
|
? (recommendationState.visibleDocs.length !== 0 ||
|
|
182
|
-
recommendationState.isLoadingRecommendations) && (React.createElement(
|
|
183
|
-
React.createElement(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
184
|
+
recommendationState.isLoadingRecommendations) && (React.createElement("div", { className: `${recommendationState.isLoadingRecommendations ? 'gradient' : ''} label-container-icon` },
|
|
185
|
+
React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" },
|
|
186
|
+
recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
|
|
187
|
+
React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
|
|
188
|
+
' ',
|
|
189
|
+
React.createElement(Trans, null, "Recommending articles using OpenShift AI"),
|
|
190
|
+
' ',
|
|
191
|
+
React.createElement(InfoCircleIcon, { color: "white" }))) : (React.createElement(React.Fragment, null,
|
|
192
|
+
React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
|
|
193
|
+
' ',
|
|
194
|
+
React.createElement(Trans, null, "Articles recommended by OpenShift AI"),
|
|
195
|
+
" ",
|
|
196
|
+
infoPopover)),
|
|
197
|
+
' ')))
|
|
193
198
|
: recommendationState.visibleDocs.length !== 0 && (React.createElement(Label, { color: "purple", className: "pf-v5-u-mb-md" },
|
|
194
199
|
React.createElement(WatsonxAiIcon, { fillColor: "#6753ac", className: "pf-v5-u-mr-xs" }),
|
|
195
200
|
React.createElement(Trans, null, "Live search results powered by OpenShift AI"))),
|
|
196
|
-
|
|
201
|
+
isBTestvariation && recommendationState.isLoadingRecommendations ? ( // as much as it pains me to add these <br /> the pf docs has it this way
|
|
197
202
|
React.createElement(RecommendationsLoader, null)) : (React.createElement("ul", { className: "list-flat" }, map(recommendationState.visibleDocs, (doc, i) => {
|
|
198
203
|
var _a, _b;
|
|
199
204
|
return (React.createElement("li", { className: "result", key: doc.id },
|
|
200
205
|
React.createElement("header", { className: "result-header" },
|
|
201
206
|
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) }),
|
|
202
207
|
React.createElement("div", { className: "header-meta" },
|
|
203
|
-
|
|
208
|
+
isBTestvariation && doc.rerank_score && computeLabel(doc.rerank_score),
|
|
204
209
|
doc.kcsState === 'verified' && (React.createElement(React.Fragment, null,
|
|
205
210
|
React.createElement("span", { className: "status-verified pf-v5-u-font-weight-bold pf-v5-u-success-color-100" }, "verified"),
|
|
206
211
|
React.createElement("span", { className: "list-separator" }, "\u2013"))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,qBAiF3C"}
|
|
@@ -30,9 +30,10 @@ import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
|
|
|
30
30
|
export default function Review(props) {
|
|
31
31
|
var _a;
|
|
32
32
|
const caseDispatch = useCaseDispatch();
|
|
33
|
-
const { contactInfo24x7, product } = useCaseSelector((state) => ({
|
|
33
|
+
const { contactInfo24x7, product, ABTestVarioation } = useCaseSelector((state) => ({
|
|
34
34
|
contactInfo24x7: state.caseDetails.contactInfo24x7,
|
|
35
35
|
product: state.caseDetails.product,
|
|
36
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
36
37
|
}), isEqual);
|
|
37
38
|
const ability = useContext(AbilityContext);
|
|
38
39
|
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
@@ -41,10 +42,11 @@ export default function Review(props) {
|
|
|
41
42
|
const onSeverityChange = (payload) => {
|
|
42
43
|
setCaseDetails(caseDispatch, payload);
|
|
43
44
|
};
|
|
45
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
44
46
|
// To check if the user is ESS Customer and Product has ESS Support
|
|
45
47
|
const isESSCustomer = isSpecialSupportOfferingEnabled((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, selectedProduct);
|
|
46
48
|
return (React.createElement(React.Fragment, null,
|
|
47
|
-
React.createElement(EARuleWidget, null),
|
|
49
|
+
isATestvariation && React.createElement(EARuleWidget, null),
|
|
48
50
|
React.createElement("form", { className: "review-form card card-light push-bottom" },
|
|
49
51
|
React.createElement(AccountSelector, null),
|
|
50
52
|
React.createElement(OwnerSelector, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA2V3C"}
|
|
@@ -35,12 +35,13 @@ export function SessionRestore(props) {
|
|
|
35
35
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
36
36
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
37
37
|
const { sessionRestore } = useContext(SessionRestoreStateContext);
|
|
38
|
-
const { selectedNotificationContacts, cepDetails, caseDetails, caseCreation500ErrorStatus } = useCaseSelector((state) => ({
|
|
38
|
+
const { selectedNotificationContacts, cepDetails, caseDetails, caseCreation500ErrorStatus, ABTestVarioation } = useCaseSelector((state) => ({
|
|
39
39
|
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
40
40
|
cepDetails: state.cepDetails,
|
|
41
41
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
42
42
|
caseDetails: state.caseDetails,
|
|
43
43
|
caseCreation500ErrorStatus: state.caseCreation500ErrorStatus,
|
|
44
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
44
45
|
}), isEqual);
|
|
45
46
|
const caseDispatch = useCaseDispatch();
|
|
46
47
|
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, referrerUrl }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -90,8 +91,9 @@ export function SessionRestore(props) {
|
|
|
90
91
|
const needsNewSessionId = hasProductVersionOrSummary && isEmpty(relevantSession);
|
|
91
92
|
if (needsNewSessionId) {
|
|
92
93
|
const userAgent = getUserAgentForCaseMode(isCaseCreate);
|
|
94
|
+
const userAgentAB = userAgent + (ABTestVarioation ? '-A-1' : '-B-1');
|
|
93
95
|
let session = {
|
|
94
|
-
userAgent,
|
|
96
|
+
userAgent: userAgentAB,
|
|
95
97
|
originatingSystem: userAgent,
|
|
96
98
|
referrerUrl: referrerUrl.substring(0, SESSION_REFERRER_URL_LIMIT),
|
|
97
99
|
isInternal: loggedInUserRights.data.isInternal(),
|