@rh-support/troubleshoot 2.6.47 → 2.6.49
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/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +2 -2
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +7 -0
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/AskRedHat.js +184 -0
- package/lib/esm/components/TroubleshootSection/CloseButton.d.ts +9 -0
- package/lib/esm/components/TroubleshootSection/CloseButton.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/CloseButton.js +5 -0
- package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts +15 -0
- package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/QuickResponse.js +26 -0
- package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts +18 -0
- package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/ResponseActionButton.js +28 -0
- package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts +20 -0
- package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/ResponseActions.js +52 -0
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +7 -0
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +99 -13
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts +13 -0
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/UserFeedback.js +44 -0
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts +10 -0
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +46 -0
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts +9 -0
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.js +9 -0
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts +9 -0
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts.map +1 -0
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.js +17 -0
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +9 -6
- package/lib/esm/components/wizardLayout/WizardMain.d.ts +7 -1
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +210 -11
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +2 -0
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +4 -3
- package/lib/esm/components/wizardLayout/index.d.ts +1 -0
- package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/index.js +1 -0
- package/lib/esm/constants/askRedHatMessages.d.ts +35 -0
- package/lib/esm/constants/askRedHatMessages.d.ts.map +1 -0
- package/lib/esm/constants/askRedHatMessages.js +36 -0
- package/lib/esm/context/AIResponseContext.d.ts +10 -0
- package/lib/esm/context/AIResponseContext.d.ts.map +1 -0
- package/lib/esm/context/AIResponseContext.js +26 -0
- package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
- package/lib/esm/context/RootTroubleshootProvider.js +8 -6
- package/lib/esm/css/AskRedHat.css +392 -0
- package/lib/esm/hooks/useWizard.d.ts +6 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +1 -1
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts +48 -0
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -0
- package/lib/esm/reducers/AIResponseConstNTypes.js +18 -0
- package/lib/esm/reducers/AIResponseReducer.d.ts +9 -0
- package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -0
- package/lib/esm/reducers/AIResponseReducer.js +42 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +2 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +2 -0
- package/lib/esm/scss/_main.scss +15 -14
- package/package.json +3 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CardProps, OUIAProps } from '@patternfly/react-core';
|
|
2
|
+
import { type FunctionComponent } from 'react';
|
|
3
|
+
import QuickResponse from './QuickResponse';
|
|
4
|
+
export interface UserFeedbackProps extends Omit<CardProps, 'onSubmit'>, OUIAProps {
|
|
5
|
+
quickResponses?: QuickResponse[];
|
|
6
|
+
hasTextArea?: boolean;
|
|
7
|
+
onSubmit: (selectedResponse?: string, additionalFeedback?: string) => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
isSubmitting?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const UserFeedback: FunctionComponent<UserFeedbackProps>;
|
|
12
|
+
export default UserFeedback;
|
|
13
|
+
//# sourceMappingURL=UserFeedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserFeedback.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAET,SAAS,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAGhE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS;IAC7E,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA4EtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { ActionGroup, Button, Card, CardBody, CardHeader, Form, TextArea, } from '@patternfly/react-core';
|
|
13
|
+
import React, { useState } from 'react';
|
|
14
|
+
import CloseButton from './CloseButton';
|
|
15
|
+
import QuickResponse from './QuickResponse';
|
|
16
|
+
const UserFeedback = (_a) => {
|
|
17
|
+
var { title = 'Why did you choose this rating?', hasTextArea, quickResponses, onSubmit, onClose, isCompact, isSubmitting = false } = _a, props = __rest(_a, ["title", "hasTextArea", "quickResponses", "onSubmit", "onClose", "isCompact", "isSubmitting"]);
|
|
18
|
+
const [selectedResponse, setSelectedResponse] = useState();
|
|
19
|
+
const [value, setValue] = useState('');
|
|
20
|
+
return (React.createElement(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__feedback-card" }, props),
|
|
21
|
+
React.createElement(CardHeader, { actions: {
|
|
22
|
+
actions: React.createElement(CloseButton, { onClose: onClose }),
|
|
23
|
+
} },
|
|
24
|
+
React.createElement("h1", { className: "pf-chatbot__feedback-card-title" }, title)),
|
|
25
|
+
React.createElement(CardBody, null,
|
|
26
|
+
React.createElement(Form, { className: `pf-chatbot__feedback-card-form ${isCompact ? 'pf-m-compact' : ''}` },
|
|
27
|
+
quickResponses && (React.createElement(QuickResponse, { quickResponses: quickResponses, onSelect: (id) => {
|
|
28
|
+
const selectedQuickResponse = quickResponses.find((response) => response.id === id);
|
|
29
|
+
setSelectedResponse(selectedQuickResponse === null || selectedQuickResponse === void 0 ? void 0 : selectedQuickResponse.content);
|
|
30
|
+
}, isCompact: isCompact })),
|
|
31
|
+
hasTextArea && (React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement(TextArea, { value: value, onChange: (_event, value) => {
|
|
33
|
+
setValue(value);
|
|
34
|
+
}, placeholder: "Provide optional additional feedback", "aria-label": "Provide optional additional feedback", resizeOrientation: "vertical" }),
|
|
35
|
+
React.createElement("div", { className: "privacy-notice-container" },
|
|
36
|
+
React.createElement("p", null,
|
|
37
|
+
"Do not share any personal or other sensitive information in your feedback. Feedback may be used to improve Red Hat's products or services. For more information about Red Hat's privacy practices, please refer to the",
|
|
38
|
+
' ',
|
|
39
|
+
React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" }, "Red Hat Privacy Statement"),
|
|
40
|
+
".")))),
|
|
41
|
+
React.createElement(ActionGroup, null,
|
|
42
|
+
React.createElement(Button, { onClick: () => onSubmit(selectedResponse, value), isDisabled: isSubmitting, isLoading: isSubmitting }, "Send Feedback"))))));
|
|
43
|
+
};
|
|
44
|
+
export default UserFeedback;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CardProps, OUIAProps } from '@patternfly/react-core';
|
|
2
|
+
import React, { type FunctionComponent } from 'react';
|
|
3
|
+
export interface UserFeedbackCompleteProps extends Omit<CardProps, 'ref'>, OUIAProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string | React.ReactNode;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const UserFeedbackComplete: FunctionComponent<UserFeedbackCompleteProps>;
|
|
9
|
+
export default UserFeedbackComplete;
|
|
10
|
+
//# sourceMappingURL=UserFeedbackComplete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserFeedbackComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedbackComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAa,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAItD,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CAyEtE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import CloseButton from './CloseButton';
|
|
15
|
+
const UserFeedbackComplete = (_a) => {
|
|
16
|
+
var { title = 'Feedback submitted', body = "We've received your response. Thank you for sharing your feedback!", onClose, isCompact } = _a, props = __rest(_a, ["title", "body", "onClose", "isCompact"]);
|
|
17
|
+
return (React.createElement(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__feedback-card pf-chatbot__feedback-card-complete" }, props),
|
|
18
|
+
React.createElement(CardHeader, { className: onClose
|
|
19
|
+
? 'pf-chatbot__feedback-card-complete-header'
|
|
20
|
+
: 'pf-chatbot__feedback-card-complete-empty-header', actions: onClose
|
|
21
|
+
? {
|
|
22
|
+
actions: React.createElement(CloseButton, { onClose: onClose }),
|
|
23
|
+
}
|
|
24
|
+
: undefined }),
|
|
25
|
+
React.createElement("div", { className: "pf-chatbot__feedback-complete-body" },
|
|
26
|
+
React.createElement("div", { className: "pf-chatbot__feedback-complete-image" },
|
|
27
|
+
React.createElement("svg", { width: "60", height: "64", viewBox: "0 0 60 64", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
|
+
React.createElement("path", { d: "M53.0555 21.5975H6.94323C3.57013 21.5975 0.835693 24.3319 0.835693 27.705V57.8925C0.835693 61.2656 3.57013 64 6.94323 64H53.0555C56.4286 64 59.1631 61.2656 59.1631 57.8925V27.705C59.1631 24.3319 56.4286 21.5975 53.0555 21.5975Z", fill: "#F8AE54" }),
|
|
29
|
+
React.createElement("path", { d: "M55.8973 19.8247C52.5894 15.7926 29.9992 0 29.9992 0C29.9992 0 7.40996 15.7926 4.10102 19.8247C0.79312 23.8568 0.835476 25.7184 0.835476 27.8899H59.1629C59.1629 25.7184 59.2052 23.8578 55.8973 19.8257V19.8247Z", fill: "#FFCC17" }),
|
|
30
|
+
React.createElement("g", null,
|
|
31
|
+
React.createElement("path", { d: "M53.0567 8.48981H6.94336V61.8388H53.0567V8.48981Z", fill: "#F2F2F2" })),
|
|
32
|
+
React.createElement("path", { d: "M51.6589 7.49908H8.34204V60.8481H51.6589V7.49908Z", fill: "white" }),
|
|
33
|
+
React.createElement("path", { d: "M0.835693 29.1296V57.8925C0.835693 59.2375 1.27165 60.4803 2.00823 61.4896L23.0303 43.5462L0.835693 29.1296Z", fill: "#FFCC17" }),
|
|
34
|
+
React.createElement("path", { d: "M36.9695 43.5472L57.9905 61.4907C58.7271 60.4813 59.1631 59.2386 59.1631 57.8935V29.1306L36.9685 43.5472H36.9695Z", fill: "#FFF4CC" }),
|
|
35
|
+
React.createElement("path", { d: "M0.835693 57.8925V57.8067L22.4146 42.7992L29.9994 37.5244L37.5842 42.7992L59.1641 57.8067V57.8925C59.1641 61.2665 56.4296 64 53.0566 64H6.94323C3.57024 64 0.835693 61.2665 0.835693 57.8925Z", fill: "#FFE072" }),
|
|
36
|
+
React.createElement("g", null,
|
|
37
|
+
React.createElement("path", { d: "M22.1563 42.978L0.835693 57.8067V56.6993L22.1563 42.978Z", fill: "#FEF07C" })),
|
|
38
|
+
React.createElement("g", null,
|
|
39
|
+
React.createElement("path", { d: "M37.8425 42.978L59.1631 57.8067V56.6993L37.8425 42.978Z", fill: "#FEF07C" })),
|
|
40
|
+
React.createElement("path", { d: "M37.8037 32.2373C42.1136 27.9273 42.1136 20.9395 37.8037 16.6295C33.4937 12.3196 26.5059 12.3196 22.196 16.6295C17.886 20.9395 17.886 27.9273 22.196 32.2373C26.5059 36.5472 33.4937 36.5472 37.8037 32.2373Z", fill: "#0066CC" }),
|
|
41
|
+
React.createElement("path", { d: "M27.7803 30.1276C27.6098 30.1276 27.4497 30.0614 27.3298 29.9406L22.9465 25.5562C22.8267 25.4364 22.7595 25.2762 22.7595 25.1068C22.7595 24.9374 22.8256 24.7762 22.9465 24.6554L24.2379 23.364C24.3577 23.2442 24.5178 23.177 24.6883 23.177C24.8587 23.177 25.0168 23.2431 25.1377 23.363L27.7803 26.0056L34.861 18.9259C34.9808 18.8061 35.1409 18.7389 35.3103 18.7389C35.4798 18.7389 35.6389 18.8051 35.7597 18.9239L37.0531 20.2173C37.173 20.3361 37.2401 20.4962 37.2401 20.6677C37.2401 20.8392 37.174 20.9983 37.0531 21.1181L28.2317 29.9406C28.1119 30.0604 27.9518 30.1265 27.7823 30.1265L27.7803 30.1276Z", fill: "white" }))),
|
|
42
|
+
React.createElement("div", { className: "pf-chatbot__feedback-complete-text" },
|
|
43
|
+
React.createElement(CardTitle, { className: "pf-chatbot__feedback-complete-title" }, title),
|
|
44
|
+
React.createElement(CardBody, { className: `pf-chatbot__feedback-complete-card-body` }, body)))));
|
|
45
|
+
};
|
|
46
|
+
export default UserFeedbackComplete;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapseIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/TroubleshootSection/icons/CollapseIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,SAAS;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,UAAW,SAAS,sBAiB5C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const CollapseIcon = (props) => {
|
|
3
|
+
const { width = 18.118, height = 12 } = props;
|
|
4
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 19 11", fill: "none", style: {
|
|
5
|
+
flexShrink: 0,
|
|
6
|
+
} },
|
|
7
|
+
React.createElement("path", { d: "M9.05895 0L16.9042 7.07143H1.21367L9.05895 0Z", fill: "#9F549C" }),
|
|
8
|
+
React.createElement("path", { d: "M9.05895 1.57129L16.9042 8.64272H1.21367L9.05895 1.57129Z", fill: "white" })));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StarIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/TroubleshootSection/icons/StarIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,SAAS;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,UAAW,SAAS,sBAgDxC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const StarIcon = (props) => {
|
|
3
|
+
const { width = 16, height = 15.273 } = props;
|
|
4
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 16 15.273", fill: "none", style: {
|
|
5
|
+
flexShrink: 0,
|
|
6
|
+
aspectRatio: '16.00/15.27',
|
|
7
|
+
} },
|
|
8
|
+
React.createElement("path", { d: "M16.197 9.21581L11.3573 8.18825L10.3297 3.34854C10.2937 3.16868 10.1345 3.04541 9.95463 3.04541C9.77478 3.04541 9.61558 3.17385 9.57958 3.34854L8.55202 8.18825L3.71231 9.21581C3.53245 9.25181 3.40918 9.41101 3.40918 9.59087C3.40918 9.77072 3.53762 9.92992 3.71231 9.96592L8.55202 10.9935L9.57958 15.8332C9.61558 16.013 9.77478 16.1363 9.95463 16.1363C10.1345 16.1363 10.2937 16.0079 10.3297 15.8332L11.3573 10.9935L16.197 9.96592C16.3768 9.92992 16.5001 9.77072 16.5001 9.59087C16.5001 9.41101 16.3717 9.25181 16.197 9.21581Z", fill: "url(#paint0_linear_5146_16767)" }),
|
|
9
|
+
React.createElement("path", { d: "M3.40909 6.68195C3.58647 6.68195 3.74356 6.55526 3.77905 6.38297L4.16931 4.53308L6.0192 4.14282C6.19658 4.10733 6.31818 3.95024 6.31818 3.77286C6.31818 3.59548 6.19149 3.43839 6.0192 3.4029L4.16931 3.01264L3.77905 1.16275C3.74356 0.98537 3.58647 0.86377 3.40909 0.86377C3.23171 0.86377 3.07462 0.990461 3.03913 1.16275L2.64887 3.01264L0.798982 3.4029C0.6216 3.43839 0.5 3.59548 0.5 3.77286C0.5 3.95024 0.626691 4.10733 0.798982 4.14282L2.64887 4.53308L3.03913 6.38297C3.07462 6.56035 3.23171 6.68195 3.40909 6.68195Z", fill: "url(#paint1_linear_5146_16767)" }),
|
|
10
|
+
React.createElement("defs", null,
|
|
11
|
+
React.createElement("linearGradient", { id: "paint0_linear_5146_16767", x1: "9.95463", y1: "3.04541", x2: "9.95463", y2: "16.1363", gradientUnits: "userSpaceOnUse" },
|
|
12
|
+
React.createElement("stop", { stopColor: "#F56E6E" }),
|
|
13
|
+
React.createElement("stop", { offset: "1", stopColor: "#5E40BE" })),
|
|
14
|
+
React.createElement("linearGradient", { id: "paint1_linear_5146_16767", x1: "3.40909", y1: "0.86377", x2: "3.40909", y2: "6.68195", gradientUnits: "userSpaceOnUse" },
|
|
15
|
+
React.createElement("stop", { stopColor: "#F56E6E" }),
|
|
16
|
+
React.createElement("stop", { offset: "1", stopColor: "#5E40BE" })))));
|
|
17
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBA+NzC"}
|
|
@@ -33,20 +33,23 @@ import { GlobalTroubleshootEffects } from './GlobalTroubleshootEffects';
|
|
|
33
33
|
import WizardAside from './WizardAside';
|
|
34
34
|
import WizardMain from './WizardMain';
|
|
35
35
|
export function WizardLayout(props) {
|
|
36
|
+
var _a, _b, _c, _d;
|
|
36
37
|
const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
|
|
37
38
|
const { getMetadata } = useMetadata();
|
|
38
|
-
const
|
|
39
|
+
const [isAIChatMode, setIsAIChatMode] = useState(false);
|
|
40
|
+
const { caseCreationError, contactSSOName, caseType, product, caseState, ABTestVariation, hasInvalidEntitlements } = useCaseSelector((state) => ({
|
|
39
41
|
caseState: state,
|
|
40
42
|
caseCreationError: state.caseCreationError,
|
|
41
43
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
42
44
|
caseType: state.caseDetails.caseType,
|
|
43
45
|
product: state.caseDetails.product,
|
|
44
46
|
ABTestVariation: state.ABTestVariation,
|
|
47
|
+
hasInvalidEntitlements: state.hasInvalidEntitlements,
|
|
45
48
|
}), isEqual);
|
|
46
49
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
47
50
|
const caseDispatch = useCaseDispatch();
|
|
48
51
|
const { sessionRestore: { activeSessionId, previousSessions }, } = useContext(SessionRestoreStateContext);
|
|
49
|
-
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
52
|
+
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount, loggedInUserRights, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
50
53
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
51
54
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
52
55
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
@@ -152,9 +155,9 @@ export function WizardLayout(props) {
|
|
|
152
155
|
React.createElement(GlobalTroubleshootEffects, { routeProps: props.routeProps }),
|
|
153
156
|
activeSection !== AppRouteSections.DESCRIBE_IDEA && (React.createElement(PreCaseConfirmationModals, { onModalClose: onModalClose, confirmationModalType: confirmationModalType, onConfirm: () => submitCaseAndNavigate(caseCreationError) })),
|
|
154
157
|
React.createElement(Grid, { style: { height: '100%' } },
|
|
155
|
-
React.createElement(GridItem, { sm: 12, md: 12, lg: 8, xl2: 8 },
|
|
156
|
-
React.createElement(WizardMain, { routeProps: props.routeProps, submitCaseAndNavigate: submitCaseAndNavigate, confirmSupportModal: confirmSupportModal })),
|
|
157
|
-
React.createElement(GridItem, { span: 4, className: "grid-wizard-aside-content" },
|
|
158
|
-
React.createElement(WizardAside, { isAttachmentUploadModalOpen: confirmationModalType === PreCaseConfirmationModalsEnum.NO_ATTACHMENT_MODAL, routeProps: props.routeProps }))),
|
|
158
|
+
React.createElement(GridItem, { sm: 12, md: 12, lg: isAIChatMode ? 12 : 8, xl2: isAIChatMode ? 12 : 8 },
|
|
159
|
+
React.createElement(WizardMain, { routeProps: props.routeProps, submitCaseAndNavigate: submitCaseAndNavigate, confirmSupportModal: confirmSupportModal, isAIChatMode: isAIChatMode, setIsAIChatMode: setIsAIChatMode, isSecureSupport: (_a = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.secureSupport, hasConfirmedStatesideSupport: (_b = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.hasConfirmedStatesideSupport, isUserExternal: (_d = (_c = loggedInUserRights === null || loggedInUserRights === void 0 ? void 0 : loggedInUserRights.data) === null || _c === void 0 ? void 0 : _c.isExternal()) !== null && _d !== void 0 ? _d : false, hasInvalidEntitlements: hasInvalidEntitlements })),
|
|
160
|
+
!isAIChatMode && (React.createElement(GridItem, { span: 4, className: "grid-wizard-aside-content" },
|
|
161
|
+
React.createElement(WizardAside, { isAttachmentUploadModalOpen: confirmationModalType === PreCaseConfirmationModalsEnum.NO_ATTACHMENT_MODAL, routeProps: props.routeProps })))),
|
|
159
162
|
React.createElement(AlertToastWrapper, { submitCaseAndNavigate: submitCaseAndNavigate, routeProps: props.routeProps })));
|
|
160
163
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { RouteComponentProps } from 'react-router-dom';
|
|
3
3
|
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
6
|
submitCaseAndNavigate: (isReSubmitting: boolean) => void;
|
|
7
7
|
confirmSupportModal: (hasPreferredSecureSupportAccount: boolean) => void;
|
|
8
|
+
isAIChatMode: boolean;
|
|
9
|
+
setIsAIChatMode: Dispatch<SetStateAction<boolean>>;
|
|
10
|
+
isSecureSupport?: boolean;
|
|
11
|
+
hasConfirmedStatesideSupport?: boolean;
|
|
12
|
+
isUserExternal?: boolean;
|
|
13
|
+
hasInvalidEntitlements?: boolean;
|
|
8
14
|
}
|
|
9
15
|
declare function WizardMain(props: IProps): React.JSX.Element;
|
|
10
16
|
export default WizardMain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAqD,MAAM,OAAO,CAAC;AAE3G,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAe9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AA0FpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBA2XhC;AACD,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
11
|
var t = {};
|
|
3
12
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -9,16 +18,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
18
|
}
|
|
10
19
|
return t;
|
|
11
20
|
};
|
|
21
|
+
import { Env } from '@cee-eng/hydrajs';
|
|
22
|
+
import { askRHDirectAIResponse, getRHDirectStatusCheck, } from '@ifd-ui/ask-redhat-core';
|
|
12
23
|
import { Wizard, WizardNav, WizardNavItem, WizardStep, } from '@patternfly/react-core';
|
|
13
24
|
import { LoadingIndicator } from '@rh-support/components';
|
|
25
|
+
import i18n from 'i18next';
|
|
14
26
|
import isEqual from 'lodash/isEqual';
|
|
15
27
|
import React, { Suspense, useContext, useEffect, useRef, useState } from 'react';
|
|
16
28
|
import { useTranslation } from 'react-i18next';
|
|
17
29
|
import { Route } from 'react-router-dom';
|
|
30
|
+
import { useAIResponseDispatch, useAIResponseState } from '../../context/AIResponseContext';
|
|
18
31
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
19
32
|
import { RecommendationDispatchContext } from '../../context/RecommendationContext';
|
|
20
33
|
import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
|
|
21
34
|
import { useWizard } from '../../hooks/useWizard';
|
|
35
|
+
import { streamingChunkReceived, streamingCompleted, streamingError, streamingStarted, } from '../../reducers/AIResponseReducer';
|
|
36
|
+
import { appSourceId_ARH, excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
|
|
22
37
|
import { RecommendationsConstants } from '../../reducers/RecommendationsReducer';
|
|
23
38
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
24
39
|
import { setActiveSectionChanged, updateisNextBtnClickedToShowValidationError } from '../../reducers/RouteReducer';
|
|
@@ -27,22 +42,84 @@ import SubmitCase from '../SubmitCase/SubmitCase';
|
|
|
27
42
|
import MainSection from './MainSection';
|
|
28
43
|
import NewFeatureModal from './NewFeatureModal';
|
|
29
44
|
import WizardNavigation from './WizardNavigation';
|
|
45
|
+
// Mapping for case type display text in AI questions
|
|
46
|
+
const CASE_TYPE_AI_TEXT_MAP = {
|
|
47
|
+
Other: 'Something',
|
|
48
|
+
};
|
|
49
|
+
const getCaseTypeAIText = (caseType) => {
|
|
50
|
+
return CASE_TYPE_AI_TEXT_MAP[caseType] || caseType;
|
|
51
|
+
};
|
|
52
|
+
const generateCaseTypePrefix = (activeSection, caseType, lang) => {
|
|
53
|
+
if (activeSection === AppRouteSections.TROUBLESHOOT) {
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
const helpWith = getCaseTypeAIText(caseType);
|
|
57
|
+
const helpWithMap = {
|
|
58
|
+
en: `I want help with ${helpWith}.`,
|
|
59
|
+
de: `Ich benoetige Hilfe bei ${helpWith}.`,
|
|
60
|
+
zh: `我需要 ${helpWith} 方面的帮助。`,
|
|
61
|
+
pt: `Eu quero ajuda com ${helpWith}.`,
|
|
62
|
+
fr: `Je souhaite obtenir de l'aide pour ${helpWith}.`,
|
|
63
|
+
ko: `${helpWith}에 대한 도움이 필요합니다.`,
|
|
64
|
+
it: `Vorrei aiuto con un ${helpWith}.`,
|
|
65
|
+
ja: `${helpWith}のサポートを希望します。`,
|
|
66
|
+
ru: `Я хочу помощь с ${helpWith}.`,
|
|
67
|
+
es: `Quiero ayuda con ${helpWith}.`,
|
|
68
|
+
};
|
|
69
|
+
return helpWithMap[lang] || helpWithMap.en;
|
|
70
|
+
};
|
|
71
|
+
// Generate AI question based on case details
|
|
72
|
+
const generateAIQuestion = (activeSection, product, version, summary, issue, caseType, lang) => {
|
|
73
|
+
const baseMessageMap = {
|
|
74
|
+
en: `My issue is primarily related to ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}. I would title my problem: ${summary !== null && summary !== void 0 ? summary : ''}. More details are as follows: ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
75
|
+
de: `Mein Problem hängt hauptsächlich mit ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''} zusammen. Ich würde mein Problem so betiteln: ${summary !== null && summary !== void 0 ? summary : ''}. Weitere Details sind wie folgt: ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
76
|
+
zh: `我的问题主要与${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}有关。我会将我的问题命名为:${summary !== null && summary !== void 0 ? summary : ''}。更多细节如下:${issue !== null && issue !== void 0 ? issue : ''}。`,
|
|
77
|
+
pt: `Meu problema está principalmente relacionado a ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}. Eu daria ao meu problema o título: ${summary !== null && summary !== void 0 ? summary : ''}. Mais detalhes são os seguintes: ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
78
|
+
fr: `Mon problème est principalement lié à ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}. Je donnerais à mon problème le titre : ${summary !== null && summary !== void 0 ? summary : ''}. Plus de détails sont les suivants : ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
79
|
+
ko: `내 문제는 주로 ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}과(와) 관련이 있습니다. 내 문제의 제목은 ${summary !== null && summary !== void 0 ? summary : ''}입니다. 자세한 내용은 다음과 같습니다: ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
80
|
+
it: `Il mio problema è principalmente legato a ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}. Intitolerei il mio problema: ${summary !== null && summary !== void 0 ? summary : ''}. Ulteriori dettagli sono i seguenti: ${issue !== null && issue !== void 0 ? issue : ''}`,
|
|
81
|
+
ja: `私の問題は主に${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}に関係しています。問題のタイトルは: ${summary !== null && summary !== void 0 ? summary : ''}です。詳細は次のとおりです: ${issue !== null && issue !== void 0 ? issue : ''}。`,
|
|
82
|
+
ru: `Моя проблема в основном связана с ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}. Я бы назвал свою проблему: ${summary !== null && summary !== void 0 ? summary : ''}. Дополнительные подробности следующие: ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
83
|
+
es: `Mi problema está principalmente relacionado con ${product !== null && product !== void 0 ? product : ''} ${version !== null && version !== void 0 ? version : ''}. Titularía mi problema: ${summary !== null && summary !== void 0 ? summary : ''}. Más detalles son los siguientes: ${issue !== null && issue !== void 0 ? issue : ''}.`,
|
|
84
|
+
};
|
|
85
|
+
const prefix = generateCaseTypePrefix(activeSection, caseType, lang);
|
|
86
|
+
return `${prefix} ${baseMessageMap[lang] || baseMessageMap.en}`;
|
|
87
|
+
};
|
|
30
88
|
function WizardMain(props) {
|
|
89
|
+
var _a, _b, _c;
|
|
31
90
|
const [showRestFlag, setShowRestFlag] = useState(false);
|
|
91
|
+
const [aiServicesAvailable, setAIServicesAvailable] = useState(false); // default to false until services are confirmed available
|
|
32
92
|
const recommendationDispatch = useContext(RecommendationDispatchContext);
|
|
33
|
-
const { isCreatingCase } = useCaseSelector((state) => ({
|
|
93
|
+
const { isCreatingCase, product, version, summary, issue, caseType } = useCaseSelector((state) => ({
|
|
34
94
|
isCreatingCase: state.isCreatingCase,
|
|
95
|
+
product: state.caseDetails.product,
|
|
96
|
+
version: state.caseDetails.version,
|
|
97
|
+
summary: state.caseDetails.summary,
|
|
98
|
+
issue: state.caseDetails.issue,
|
|
99
|
+
caseType: state.caseDetails.caseType,
|
|
35
100
|
}), isEqual);
|
|
36
|
-
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
101
|
+
const { routeState: { isCaseCreate, activeSection }, } = useContext(RouteContext);
|
|
102
|
+
const aiResponseDispatch = useAIResponseDispatch();
|
|
103
|
+
const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
|
|
104
|
+
const isResourcesSection = activeSection === AppRouteSections.RESOURCES;
|
|
105
|
+
const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
|
|
37
106
|
const [userSeenRecommendations, setUserSeenRecommendations] = useState(false);
|
|
38
107
|
const [userClickedNextonRecommendations, setUserClickedNextonRecommendations] = useState(false);
|
|
39
108
|
const [userScrolledLabel, setUserScrolledLabel] = useState(false);
|
|
40
109
|
const [userCanNavigateToTroubleshoot, setUserCanNavigateToTroubleshoot] = useState(false);
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
110
|
const [isNextButtonClicked, setIsNextButtonClicked] = useState(false);
|
|
43
111
|
const isNextButtonClickedRef = useRef(false);
|
|
44
112
|
const isBackButtonClickedRef = useRef(false);
|
|
45
113
|
const resultsRowRef = useRef(null);
|
|
114
|
+
const previousARHFieldsRef = useRef({
|
|
115
|
+
product: product,
|
|
116
|
+
version: version,
|
|
117
|
+
summary: summary,
|
|
118
|
+
issue: issue,
|
|
119
|
+
});
|
|
120
|
+
const handleChatWithAIClick = () => {
|
|
121
|
+
props.setIsAIChatMode(true);
|
|
122
|
+
};
|
|
46
123
|
const { getStepsSequece } = useWizard(props.routeProps, {
|
|
47
124
|
userSeenRecommendationsfn: setUserSeenRecommendations,
|
|
48
125
|
userSeenRecommendationsValue: userSeenRecommendations,
|
|
@@ -50,12 +127,91 @@ function WizardMain(props) {
|
|
|
50
127
|
userClickedNextonRecommendationsValue: userClickedNextonRecommendations,
|
|
51
128
|
resultsRowRef: resultsRowRef,
|
|
52
129
|
userScrolledLabel: userScrolledLabel,
|
|
130
|
+
isAIChatMode: props.isAIChatMode,
|
|
131
|
+
setIsAIChatMode: props.setIsAIChatMode,
|
|
132
|
+
onChatWithAIClick: handleChatWithAIClick,
|
|
133
|
+
aiServicesAvailable: aiServicesAvailable,
|
|
134
|
+
isSecureSupport: props.isSecureSupport,
|
|
135
|
+
hasConfirmedStatesideSupport: props.hasConfirmedStatesideSupport,
|
|
53
136
|
});
|
|
54
137
|
const dispatchToRouteReducer = useContext(RouteDispatchContext);
|
|
55
138
|
const { t } = useTranslation();
|
|
56
139
|
useEffect(() => {
|
|
57
140
|
setActiveSectionChanged(dispatchToRouteReducer, isCaseCreate ? AppRouteSections.GET_SUPPORT : AppRouteSections.TROUBLESHOOT, '');
|
|
58
141
|
}, [isCaseCreate, dispatchToRouteReducer]);
|
|
142
|
+
const shouldEnableARHServices = () => {
|
|
143
|
+
// Check if the current section is relevant for AI services
|
|
144
|
+
const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
|
|
145
|
+
// Check if the case type is allowed (not in the excluded list)
|
|
146
|
+
const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseType || '');
|
|
147
|
+
// Check if user is not a secure support or confirmed stateside support user
|
|
148
|
+
const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
|
|
149
|
+
// Check if the ARH fields have changed
|
|
150
|
+
const isARHFieldsChanged = haveARHFieldsChanged();
|
|
151
|
+
// Check if user is external and has invalid entitlements
|
|
152
|
+
const isNotUnentitledExternalUser = !(props.isUserExternal && props.hasInvalidEntitlements);
|
|
153
|
+
return (isRelevantSection &&
|
|
154
|
+
isCaseTypeAllowed &&
|
|
155
|
+
isNotSecureOrStatesideUser &&
|
|
156
|
+
isARHFieldsChanged &&
|
|
157
|
+
isNotUnentitledExternalUser);
|
|
158
|
+
};
|
|
159
|
+
// Check if any of the ARH-relevant fields have changed
|
|
160
|
+
const haveARHFieldsChanged = () => {
|
|
161
|
+
const hasChanged = previousARHFieldsRef.current.product !== product ||
|
|
162
|
+
previousARHFieldsRef.current.version !== version ||
|
|
163
|
+
previousARHFieldsRef.current.summary !== summary ||
|
|
164
|
+
previousARHFieldsRef.current.issue !== issue;
|
|
165
|
+
if (hasChanged) {
|
|
166
|
+
previousARHFieldsRef.current = {
|
|
167
|
+
product,
|
|
168
|
+
version,
|
|
169
|
+
summary,
|
|
170
|
+
issue,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return hasChanged;
|
|
174
|
+
};
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
if (!activeSection) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
//todo - need to revisit this logic
|
|
180
|
+
// if (!shouldEnableARHServices()) {
|
|
181
|
+
// if (aiServicesAvailable) {
|
|
182
|
+
// setAIServicesAvailable(false);
|
|
183
|
+
// }
|
|
184
|
+
// return;
|
|
185
|
+
// }
|
|
186
|
+
// check if ARH services are available
|
|
187
|
+
if (!aiServicesAvailable) {
|
|
188
|
+
const checkAIServices = () => __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
var _a, _b, _c;
|
|
190
|
+
const config = {
|
|
191
|
+
appSourceId: appSourceId_ARH,
|
|
192
|
+
authToken: (_b = (_a = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _a === void 0 ? void 0 : _a.getEncodedToken()) !== null && _b !== void 0 ? _b : '',
|
|
193
|
+
packageVersion: (_c = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _c === void 0 ? void 0 : _c.packageVersion,
|
|
194
|
+
appEnv: Env.getEnvName(),
|
|
195
|
+
};
|
|
196
|
+
try {
|
|
197
|
+
yield getRHDirectStatusCheck(config);
|
|
198
|
+
setAIServicesAvailable(true);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
setAIServicesAvailable(false);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
checkAIServices();
|
|
205
|
+
}
|
|
206
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
207
|
+
}, [
|
|
208
|
+
activeSection,
|
|
209
|
+
caseType,
|
|
210
|
+
isCaseCreate,
|
|
211
|
+
aiServicesAvailable,
|
|
212
|
+
props.isSecureSupport,
|
|
213
|
+
props.hasConfirmedStatesideSupport,
|
|
214
|
+
]);
|
|
59
215
|
const renderSubmitCasePage = () => (React.createElement(MainSection, { section: AppRouteSections.SUBMIT_CASE, title: t('Case has been submitted'), isLoading: isCreatingCase, description: t("We'll be in contact with you shortly. Look for updates on this case."), className: "case-submit-page" },
|
|
60
216
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
61
217
|
React.createElement(SubmitCase, { routeProps: props.routeProps }))));
|
|
@@ -100,9 +256,46 @@ function WizardMain(props) {
|
|
|
100
256
|
isBackButtonClickedRef.current = false;
|
|
101
257
|
setIsNextButtonClicked(false);
|
|
102
258
|
};
|
|
259
|
+
const handleReturnToCaseCreation = () => {
|
|
260
|
+
props.setIsAIChatMode(false);
|
|
261
|
+
};
|
|
103
262
|
const customNav = (isExpanded, steps, activeStep, goToStepByIndex) => (React.createElement(WizardNav, { isExpanded: isExpanded }, steps.map((step) => {
|
|
104
263
|
return (React.createElement(WizardNavItem, { key: step.id, id: step.id, content: step.name, isCurrent: activeStep.id === step.id, isDisabled: !step.canJumpTo, stepIndex: step.index, onClick: () => goToStepByIndex(step.index) }));
|
|
105
264
|
})));
|
|
265
|
+
const aiResponseState = useAIResponseState();
|
|
266
|
+
const config = {
|
|
267
|
+
appSourceId: appSourceId_ARH,
|
|
268
|
+
authToken: (_b = (_a = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _a === void 0 ? void 0 : _a.getEncodedToken()) !== null && _b !== void 0 ? _b : '',
|
|
269
|
+
packageVersion: (_c = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _c === void 0 ? void 0 : _c.packageVersion,
|
|
270
|
+
appEnv: Env.getEnvName(),
|
|
271
|
+
};
|
|
272
|
+
const fetchARHResponse = () => __awaiter(this, void 0, void 0, function* () {
|
|
273
|
+
var _a;
|
|
274
|
+
const detailedQuestion = generateAIQuestion(activeSection || '', product, version, summary, issue, caseType || '', i18n.language || 'en');
|
|
275
|
+
//streaming callbacks
|
|
276
|
+
const streamingCallbacks = {
|
|
277
|
+
onChunk: (chunk, accumulatedResponse) => {
|
|
278
|
+
aiResponseDispatch(streamingChunkReceived(chunk, accumulatedResponse));
|
|
279
|
+
},
|
|
280
|
+
onComplete: (finalResponse) => {
|
|
281
|
+
aiResponseDispatch(streamingCompleted(finalResponse));
|
|
282
|
+
},
|
|
283
|
+
onError: (error) => {
|
|
284
|
+
aiResponseDispatch(streamingError(error));
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
aiResponseDispatch(streamingStarted());
|
|
288
|
+
try {
|
|
289
|
+
// Get existing conversation ID from state if available (need to map it with session data)
|
|
290
|
+
const existingConversationId = (_a = aiResponseState === null || aiResponseState === void 0 ? void 0 : aiResponseState.aiResponse) === null || _a === void 0 ? void 0 : _a.conversationId;
|
|
291
|
+
yield askRHDirectAIResponse(detailedQuestion, config, true, // response to be streamed or not
|
|
292
|
+
existingConversationId, streamingCallbacks);
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
const errorMessage = error instanceof Error ? error.message : 'Failed to get AI response';
|
|
296
|
+
aiResponseDispatch(streamingError(errorMessage));
|
|
297
|
+
}
|
|
298
|
+
});
|
|
106
299
|
const CustomFooter = (activeStep, goToNextStep, goToPrevStep) => {
|
|
107
300
|
useEffect(() => {
|
|
108
301
|
if (steps.length > 2 && (activeStep === null || activeStep === void 0 ? void 0 : activeStep.index) === 2 && isNextButtonClicked) {
|
|
@@ -110,16 +303,22 @@ function WizardMain(props) {
|
|
|
110
303
|
}
|
|
111
304
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
112
305
|
}, [activeStep, steps.length, isNextButtonClicked, goToNextStep]);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
306
|
+
const handleContinueClick = () => __awaiter(this, void 0, void 0, function* () {
|
|
307
|
+
// Navigate to next step first
|
|
308
|
+
isNextButtonClickedRef.current = true;
|
|
309
|
+
setIsNextButtonClicked(true);
|
|
310
|
+
goToNextStep({});
|
|
311
|
+
focusWizardMainPanel();
|
|
312
|
+
// Fetch ARH response if conditions are met
|
|
313
|
+
if (shouldEnableARHServices() && aiServicesAvailable) {
|
|
314
|
+
yield fetchARHResponse();
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: handleContinueClick, onBack: () => {
|
|
119
318
|
isBackButtonClickedRef.current = true;
|
|
120
|
-
goToPrevStep(
|
|
319
|
+
goToPrevStep({});
|
|
121
320
|
focusWizardMainPanel();
|
|
122
|
-
}, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, setUserCanNavigateToTroubleshoot: setUserCanNavigateToTroubleshoot, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel }));
|
|
321
|
+
}, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, setUserCanNavigateToTroubleshoot: setUserCanNavigateToTroubleshoot, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel, isAIChatMode: props.isAIChatMode, onReturnToCaseCreation: handleReturnToCaseCreation }));
|
|
123
322
|
};
|
|
124
323
|
const steps = getStepsSequece(showRestFlag);
|
|
125
324
|
const wizardSteps = steps.map((step) => {
|
|
@@ -16,6 +16,8 @@ interface IProps {
|
|
|
16
16
|
setUserCanNavigateToTroubleshoot: (value: React.SetStateAction<boolean>) => void;
|
|
17
17
|
resultsRowRef?: any;
|
|
18
18
|
setUserScrolledLabel: (value: React.SetStateAction<boolean>) => void;
|
|
19
|
+
isAIChatMode?: boolean;
|
|
20
|
+
onReturnToCaseCreation?: () => void;
|
|
19
21
|
}
|
|
20
22
|
declare function WizardNavigation(props: IProps): React.JSX.Element;
|
|
21
23
|
declare namespace WizardNavigation {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAsVtC;kBAtVQ,gBAAgB;;;AAwVzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -253,9 +253,10 @@ function WizardNavigation(props) {
|
|
|
253
253
|
// To handle entitled products
|
|
254
254
|
return (React.createElement(React.Fragment, null,
|
|
255
255
|
React.createElement(WizardFooterWrapper, null,
|
|
256
|
-
props.
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (React.createElement(Button, { onClick: props.onReturnToCaseCreation, variant: "link", className: "return-to-case-btn" }, isCaseCreate ? t('Return to case creation') : t('Return to resources'))) : (React.createElement(React.Fragment, null,
|
|
257
|
+
props.activeStep.order !== 0 && (React.createElement("button", { onClick: () => onBack({}), className: "btn btn-app btn-open-white main-nav-button", "data-tracking-id": `prev-of-${activeSection}`, type: "button", disabled: isDisabledGoBack() }, t('Go back'))),
|
|
258
|
+
React.createElement("button", { disabled: nextButtonDisabledLogic(), onClick: onNext, className: "btn btn-app btn-primary main-nav-button", "data-tracking-id": `next-of-${activeSection}`, type: "button" }, t(props.activeStep.nextButtonLabel)),
|
|
259
|
+
activeSection === AppRouteSections.RESOURCES && isFileRecommendationsTriggered && (React.createElement(Button, { onClick: handleFileRecsSelfSolved, variant: ButtonVariant.secondary, className: "issue-solved-button solved-issue-button", "data-tracking-id": "troubleshoot-self-solved-issue" }, t('I solved my issue'))))),
|
|
259
260
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
260
261
|
activeSectionError ? (React.createElement("small", { className: "pf-v6-u-align-self-center pf-v6-u-ml-md text-red" }, activeSectionError)) : null)));
|
|
261
262
|
}
|
|
@@ -2,6 +2,7 @@ import 'react-bootstrap-typeahead/css/Typeahead.css';
|
|
|
2
2
|
import '../../css/app.css';
|
|
3
3
|
import '../../css/pagination.css';
|
|
4
4
|
import '../../css/productSelector.css';
|
|
5
|
+
import '../../css/AskRedHat.css';
|
|
5
6
|
import '../../css/results.css';
|
|
6
7
|
import '../shared/fileUpload/css/fileSelector.css';
|
|
7
8
|
import React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AACrD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2CAA2C,CAAC;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,sBAYzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AACrD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,2CAA2C,CAAC;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AAED,eAAO,MAAM,YAAY,UAAW,MAAM,sBAYzC,CAAC"}
|