@rh-support/troubleshoot 2.4.5-beta.11 → 2.4.5-beta.14

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.
Files changed (52) hide show
  1. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  2. package/lib/esm/components/CaseInformation/Description.js +2 -3
  3. package/lib/esm/components/Cve/CveItem.d.ts +2 -0
  4. package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
  5. package/lib/esm/components/Cve/CveItem.js +49 -6
  6. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
  7. package/lib/esm/components/Cve/CveModal.js +4 -1
  8. package/lib/esm/components/Cve/CvePanel.js +1 -1
  9. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  10. package/lib/esm/components/OpenCase/OpenCase.js +4 -3
  11. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  12. package/lib/esm/components/ProductSelector/AllProductsSelector.js +37 -32
  13. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  14. package/lib/esm/components/ProductSelector/ProductSelector.js +31 -21
  15. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  16. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +6 -1
  17. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  18. package/lib/esm/components/Recommendations/Recommendations.js +26 -21
  19. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  20. package/lib/esm/components/Review/Review.js +4 -2
  21. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  22. package/lib/esm/components/SessionRestore/SessionRestore.js +4 -2
  23. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  24. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +6 -10
  25. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  26. package/lib/esm/components/shared/useIsSectionValid.js +63 -14
  27. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  28. package/lib/esm/components/wizardLayout/WizardAside.js +9 -4
  29. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  30. package/lib/esm/components/wizardLayout/WizardLayout.js +18 -3
  31. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  32. package/lib/esm/components/wizardLayout/WizardNavigation.js +23 -7
  33. package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
  34. package/lib/esm/hooks/useFetchCVEData.js +10 -6
  35. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  36. package/lib/esm/hooks/useWizard.js +23 -5
  37. package/lib/esm/models/caseCreationWorkflows.d.ts +2 -0
  38. package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -1
  39. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -1
  40. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  41. package/lib/esm/reducers/CaseConstNTypes.js +2 -0
  42. package/lib/esm/reducers/CaseReducer.d.ts +1 -0
  43. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  44. package/lib/esm/reducers/CaseReducer.js +9 -0
  45. package/lib/esm/reducers/SessionRestoreReducer.d.ts +7 -4
  46. package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
  47. package/lib/esm/reducers/SessionRestoreReducer.js +25 -12
  48. package/lib/esm/scss/_main.scss +49 -0
  49. package/lib/esm/utils/caseUtils.d.ts +1 -1
  50. package/lib/esm/utils/caseUtils.d.ts.map +1 -1
  51. package/lib/esm/utils/caseUtils.js +2 -2
  52. 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,qBAoKhD"}
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, summary, version } = useCaseSelector((state) => ({
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 ${(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 }),
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":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,UAAU,KAAK;IACX,GAAG,EAAE,0BAA0B,CAAC;CACnC;AAaD,eAAO,MAAM,OAAO,UAAW,KAAK,sBAqJnC,CAAC"}
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
- const { cve } = props;
26
- const { isCveModalOpened } = useCaseSelector((state) => ({
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
- return (React.createElement("p", null,
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;AAQ1C,eAAO,MAAM,QAAQ,yBA+DpB,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,qBAqC7C"}
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 { enableGetSupportProductVersion } = useCaseSelector((state) => ({
12
- enableGetSupportProductVersion: state.enableGetSupportProductVersion,
11
+ const { ABTestVarioation } = useCaseSelector((state) => ({
12
+ ABTestVarioation: state.ABTestVarioation,
13
13
  }), isEqual);
14
+ const isATestvariation = ABTestVarioation === 'A';
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
- enableGetSupportProductVersion && (React.createElement("div", { className: "form-group" },
19
+ isATestvariation && (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,4EA4JvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,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,4EAsKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -10,12 +10,10 @@ import { Trans, useTranslation } from 'react-i18next';
10
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
11
11
  import { RouteContext } from '../../context/RouteContext';
12
12
  import { TCStateContext } from '../../context/TopContentContext';
13
- import { useFetchCVEData } from '../../hooks/useFetchCVEData';
14
13
  import { setCaseDetails } from '../../reducers/CaseReducer';
15
14
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
16
15
  import RouteUtils from '../../utils/routeUtils';
17
16
  import OpenCaseIssue from '../CaseInformation/OpenCaseIssue';
18
- import { CveModal } from '../Cve/CveModal';
19
17
  import Suggestions from '../Suggestions/Suggestions';
20
18
  import { ProductVersionDropdownSelector } from './ProductVersionDropdownSelector';
21
19
  const defaultProps = {
@@ -35,13 +33,14 @@ const AllProductsSelector = forwardRef((props, ref) => {
35
33
  var _a, _b;
36
34
  const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
37
35
  const caseDispatch = useCaseDispatch();
38
- const { product, version, contactSSOName } = useCaseSelector((state) => ({
36
+ const { product, version, contactSSOName, ABTestVarioation } = useCaseSelector((state) => ({
39
37
  product: state.caseDetails.product,
40
38
  version: state.caseDetails.version,
41
39
  contactSSOName: state.caseDetails.contactSSOName,
40
+ ABTestVarioation: state.ABTestVarioation,
42
41
  }), isEqual);
43
- const { cveRecommendation } = useFetchCVEData();
44
42
  const { topContentState: { topContent }, } = useContext(TCStateContext);
43
+ const { routeState: { activeSection }, } = useContext(RouteContext);
45
44
  const [isModalOpen, setIsModalOpen] = useState(false);
46
45
  const [showModal, setShowModal] = useState(false);
47
46
  const [showModalButton, setShowModalButton] = useState(false);
@@ -81,35 +80,41 @@ const AllProductsSelector = forwardRef((props, ref) => {
81
80
  RouteUtils.updateQueryParams(props.routeProps, newParams);
82
81
  }
83
82
  const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
84
- const { routeState: { activeSection }, } = useContext(RouteContext);
85
- if ((activeSection === AppRouteSections.SUMMARIZE && !props.caseCreateExperience) ||
86
- activeSection === AppRouteSections.GET_SUPPORT) {
87
- return (React.createElement("div", { className: "form-group product-selector-wrapper" },
83
+ const isATestvariation = ABTestVarioation === 'A';
84
+ const isBTestvariation = ABTestVarioation === 'B';
85
+ // Determine whether to render the ProductVersionDropdownSelector
86
+ const renderProductVersionDropdownSelector = (activeSection === AppRouteSections.SUMMARIZE && !props.caseCreateExperience) ||
87
+ activeSection === AppRouteSections.GET_SUPPORT ||
88
+ isBTestvariation ||
89
+ (isATestvariation && (props.isOnGetSupportPage || props.isOnReviewPage));
90
+ // Determine whether to render the OpenCaseIssue component
91
+ const renderOpenCaseIssue = (isBTestvariation &&
92
+ (activeSection === AppRouteSections.SUMMARIZE || activeSection === AppRouteSections.REVIEW)) ||
93
+ (isATestvariation &&
94
+ (activeSection === AppRouteSections.SUMMARIZE || activeSection === AppRouteSections.REVIEW)) ||
95
+ (!props.caseCreateExperience && activeSection === AppRouteSections.SUMMARIZE);
96
+ return (React.createElement(React.Fragment, null,
97
+ renderProductVersionDropdownSelector && (React.createElement("div", { className: "form-group product-selector-wrapper" },
88
98
  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
- // } else if (activeSection === AppRouteSections.SUMMARIZE && props.caseCreateExperience)
91
- }
92
- else
93
- return (React.createElement(React.Fragment, null,
94
- React.createElement("div", { className: "case-details-summary" },
95
- React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage })),
96
- (cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
97
- React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
98
- ? 'You are'
99
- : 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
100
- showModalButton &&
101
- !isEmpty(product) &&
102
- !isEmpty(version) &&
103
- !topContent.isFetching &&
104
- 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" },
105
- React.createElement(Trans, null, "Suggested fixes"))),
106
- 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: [
107
- React.createElement("button", { key: "cancel", onClick: toggleTCModal, className: "btn btn-app btn-primary", type: "button" },
108
- React.createElement(Trans, null, "Cancel")),
109
- ] },
110
- React.createElement("span", null,
111
- React.createElement(Trans, null, "Here are some common suggestions:")),
112
- React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
99
+ 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 })))),
100
+ renderOpenCaseIssue && (React.createElement("div", { className: "case-details-summary" },
101
+ React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage }))),
102
+ React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
103
+ ? 'You are'
104
+ : 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
105
+ showModalButton &&
106
+ !isEmpty(product) &&
107
+ !isEmpty(version) &&
108
+ !topContent.isFetching &&
109
+ 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" },
110
+ React.createElement(Trans, null, "Suggested fixes"))),
111
+ 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: [
112
+ React.createElement("button", { key: "cancel", onClick: toggleTCModal, className: "btn btn-app btn-primary", type: "button" },
113
+ React.createElement(Trans, null, "Cancel")),
114
+ ] },
115
+ React.createElement("span", null,
116
+ React.createElement(Trans, null, "Here are some common suggestions:")),
117
+ React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
113
118
  });
114
119
  AllProductsSelector.defaultProps = defaultProps;
115
120
  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;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,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,qBAmGpD"}
1
+ {"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAMA,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,qBAgGpD"}
@@ -1,12 +1,15 @@
1
1
  import { Alert, AlertVariant } from '@patternfly/react-core';
2
2
  import { AlertMessage, AlertType, ErrorBoundary } from '@rh-support/components';
3
3
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
+ import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
4
5
  import isEmpty from 'lodash/isEmpty';
5
6
  import isEqual from 'lodash/isEqual';
6
7
  import React, { useContext, useRef } from 'react';
7
8
  import { Trans, useTranslation } from 'react-i18next';
8
9
  import { useCaseSelector } from '../../context/CaseContext';
9
10
  import { RouteContext } from '../../context/RouteContext';
11
+ import { useFetchCVEData } from '../../hooks/useFetchCVEData';
12
+ import { CveModal } from '../Cve/CveModal';
10
13
  import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
11
14
  import Recommendations from '../Recommendations/Recommendations';
12
15
  import { AllProductsSelector } from './AllProductsSelector';
@@ -20,38 +23,45 @@ import { ProductSelectorLoader } from './ProductSelectorLoader';
20
23
  * @param props
21
24
  */
22
25
  export default function ProductSelector(props) {
26
+ const { cveRecommendation } = useFetchCVEData();
23
27
  const { t } = useTranslation();
24
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
25
- const { product, version, enableGetSupportProductVersion } = useCaseSelector((state) => ({
28
+ const { globalMetadataState: { allProducts, pcmConfig }, } = useContext(GlobalMetadataStateContext);
29
+ const { product, version, ABTestVarioation } = useCaseSelector((state) => ({
26
30
  product: state.caseDetails.product,
27
31
  version: state.caseDetails.version,
28
- enableGetSupportProductVersion: state.enableGetSupportProductVersion,
32
+ ABTestVarioation: state.ABTestVarioation,
29
33
  }), isEqual);
30
34
  const { routeState: { isCaseCreate }, } = useContext(RouteContext);
35
+ const isCVEModalEnabled = getConfigField(pcmConfig.data, 'isCVEModalEnabled', PCM_CONFIG_FIELD_TYPE.STRING);
36
+ const isATestvariation = ABTestVarioation === 'A';
37
+ const isBTestvariation = ABTestVarioation === 'B';
31
38
  /**
32
39
  * The all product selector and top product selector should always be "selected" because
33
40
  * the all product selector needs to show the selection from the top products selector and the top product selector
34
41
  * doesn't matter becasue it will be hidden whenever a product is selected.
35
42
  */
36
43
  const productSelectorRef = useRef(null);
44
+ const rederProductSelect = (React.createElement("form", null,
45
+ (cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && isCVEModalEnabled === '1' && 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 })));
37
47
  return (React.createElement(React.Fragment, null,
38
- !enableGetSupportProductVersion && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
48
+ isBTestvariation && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
39
49
  React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
40
- allProducts.isFetching ? (React.createElement(ProductSelectorLoader, null)) : (!allProducts.isError && (React.createElement(React.Fragment, null,
41
- React.createElement("form", null,
42
- 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 }),
43
- product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
44
- ' ',
45
- "If you're having a subscription issue that doesn't relate to",
46
- ' ',
47
- React.createElement("a", { href: "/products/subscription-central", rel: "noopener noreferrer", target: "_blank" }, "Subscription Watch"),
48
- "product, then please contact",
49
- ' ',
50
- React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
51
- ' ',
52
- "for help.") })),
53
- !enableGetSupportProductVersion && React.createElement(EARuleWidget, null)),
54
- !(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
55
- React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
56
- React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))))));
50
+ isBTestvariation
51
+ ? !allProducts.isFetching && !allProducts.isError && rederProductSelect
52
+ : isATestvariation && rederProductSelect,
53
+ product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
54
+ ' ',
55
+ "If you're having a subscription issue that doesn't relate to",
56
+ ' ',
57
+ React.createElement("a", { href: "/products/subscription-central", rel: "noopener noreferrer", target: "_blank" }, "Subscription Watch"),
58
+ "product, then please contact",
59
+ ' ',
60
+ React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
61
+ ' ',
62
+ "for help.") })),
63
+ isBTestvariation && React.createElement(EARuleWidget, null),
64
+ !(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
65
+ React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
66
+ React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef }))))))));
57
67
  }
@@ -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,wEAwClC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
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(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage, isLoading: props.isLoading })),
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,qBA0WpD"}
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, enableGetSupportProductVersion } = useCaseSelector((state) => ({
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
- enableGetSupportProductVersion: state.enableGetSupportProductVersion,
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 || !summary || isRecSearchPayloadSame) {
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 = (doc) => {
170
- const percentage = getRankPercentage(doc.rerank_score);
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
- !enableGetSupportProductVersion && (React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) })),
179
- React.createElement("div", { className: "recommendation-list", ref: props.resultsRowRef },
180
- enableGetSupportProductVersion
180
+ isBTestvariation && (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
+ isATestvariation
181
183
  ? (recommendationState.visibleDocs.length !== 0 ||
182
- recommendationState.isLoadingRecommendations) && (React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" }, recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
183
- React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
184
- ' ',
185
- React.createElement(Trans, null, "Recommending articles using OpenShift AI"),
186
- ' ',
187
- React.createElement(InfoCircleIcon, { color: "white" }))) : (React.createElement(React.Fragment, null,
188
- React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
189
- ' ',
190
- React.createElement(Trans, null, "Articles recommended by OpenShift AI"),
191
- " ",
192
- infoPopover))))
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
- enableGetSupportProductVersion && recommendationState.isLoadingRecommendations ? ( // as much as it pains me to add these <br /> the pf docs has it this way
201
+ isATestvariation && 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
- enableGetSupportProductVersion && computeLabel(doc),
208
+ isATestvariation && 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,qBA8E3C"}
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 isBTestvariation = ABTestVarioation === 'B';
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
+ isBTestvariation && 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,qBAwV3C"}
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"}