@rh-support/troubleshoot 2.6.21 → 2.6.23

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 (73) hide show
  1. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts +1 -0
  2. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +31 -5
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +33 -34
  6. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +2 -1
  8. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  9. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +1 -0
  10. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +16 -22
  12. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +52 -95
  14. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +15 -19
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
  17. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +0 -8
  18. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  19. package/lib/esm/components/CaseInformation/Fts.js +6 -2
  20. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  21. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -8
  22. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  23. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +7 -7
  24. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  25. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +1 -1
  26. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +7 -0
  27. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -0
  28. package/lib/esm/components/TroubleshootSection/AskRedHat.js +73 -0
  29. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +5 -0
  30. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  31. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +86 -13
  32. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts +9 -0
  33. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts.map +1 -0
  34. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.js +9 -0
  35. package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts +9 -0
  36. package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts.map +1 -0
  37. package/lib/esm/components/TroubleshootSection/icons/StarIcon.js +17 -0
  38. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +0 -1
  39. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
  40. package/lib/esm/components/shared/input/ContactSelectorInternal.js +1 -6
  41. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  42. package/lib/esm/components/wizardLayout/WizardLayout.js +5 -4
  43. package/lib/esm/components/wizardLayout/WizardMain.d.ts +3 -1
  44. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  45. package/lib/esm/components/wizardLayout/WizardMain.js +116 -9
  46. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +2 -0
  47. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  48. package/lib/esm/components/wizardLayout/WizardNavigation.js +4 -3
  49. package/lib/esm/components/wizardLayout/index.d.ts +1 -0
  50. package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
  51. package/lib/esm/components/wizardLayout/index.js +1 -0
  52. package/lib/esm/context/AIResponseContext.d.ts +10 -0
  53. package/lib/esm/context/AIResponseContext.d.ts.map +1 -0
  54. package/lib/esm/context/AIResponseContext.js +26 -0
  55. package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
  56. package/lib/esm/context/RootTroubleshootProvider.js +8 -6
  57. package/lib/esm/css/AskRedHat.css +333 -0
  58. package/lib/esm/css/case.css +0 -12
  59. package/lib/esm/hooks/useWizard.d.ts +4 -0
  60. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  61. package/lib/esm/hooks/useWizard.js +1 -1
  62. package/lib/esm/reducers/AIResponseConstNTypes.d.ts +48 -0
  63. package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -0
  64. package/lib/esm/reducers/AIResponseConstNTypes.js +16 -0
  65. package/lib/esm/reducers/AIResponseReducer.d.ts +9 -0
  66. package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -0
  67. package/lib/esm/reducers/AIResponseReducer.js +43 -0
  68. package/lib/esm/reducers/CaseConstNTypes.d.ts +2 -0
  69. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  70. package/lib/esm/reducers/CaseConstNTypes.js +2 -0
  71. package/lib/esm/scss/_main.scss +0 -13
  72. package/lib/esm/scss/_pf-overrides.scss +0 -5
  73. package/package.json +7 -6
@@ -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,20 @@ var __rest = (this && this.__rest) || function (s, e) {
9
18
  }
10
19
  return t;
11
20
  };
21
+ import { askRHDirectAIResponse, getRHDirectStatusCheck, } from '@ifd-ui/ask-redhat-core';
12
22
  import { useWizardContext, Wizard, WizardNav, WizardNavItem, WizardStep } from '@patternfly/react-core';
13
23
  import { LoadingIndicator } from '@rh-support/components';
14
24
  import isEqual from 'lodash/isEqual';
15
25
  import React, { Suspense, useContext, useEffect, useRef, useState } from 'react';
16
26
  import { useTranslation } from 'react-i18next';
17
27
  import { Route } from 'react-router-dom';
28
+ import { useAIResponseDispatch } from '../../context/AIResponseContext';
18
29
  import { useCaseSelector } from '../../context/CaseContext';
19
30
  import { RecommendationDispatchContext } from '../../context/RecommendationContext';
20
31
  import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
21
32
  import { useWizard } from '../../hooks/useWizard';
33
+ import { receivedAIResponse, receivedAIResponseError, requestAIResponse } from '../../reducers/AIResponseReducer';
34
+ import { appSourceId_ARH, excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
22
35
  import { RecommendationsConstants } from '../../reducers/RecommendationsReducer';
23
36
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
24
37
  import { setActiveSectionChanged, updateisNextBtnClickedToShowValidationError } from '../../reducers/RouteReducer';
@@ -27,13 +40,43 @@ import SubmitCase from '../SubmitCase/SubmitCase';
27
40
  import MainSection from './MainSection';
28
41
  import NewFeatureModal from './NewFeatureModal';
29
42
  import WizardNavigation from './WizardNavigation';
43
+ // Mapping for case type display text in AI questions
44
+ const CASE_TYPE_AI_TEXT_MAP = {
45
+ Other: 'Something',
46
+ };
47
+ const getCaseTypeAIText = (caseType) => {
48
+ return CASE_TYPE_AI_TEXT_MAP[caseType] || caseType;
49
+ };
50
+ const generateCaseTypePrefix = (activeSection, caseType) => {
51
+ if (activeSection === AppRouteSections.TROUBLESHOOT) {
52
+ return '';
53
+ }
54
+ const helpWith = getCaseTypeAIText(caseType);
55
+ return `I want help with ${helpWith}. `;
56
+ };
57
+ //generate AI question based on case details
58
+ const generateAIQuestion = (activeSection, product, version, summary, issue, caseType) => {
59
+ const baseMessage = `My issue is primarily related to ${product} ${version}. I would title my problem: ${summary}. More details are as follows: ${issue}.`;
60
+ const prefix = generateCaseTypePrefix(activeSection, caseType);
61
+ return `${prefix}${baseMessage}`;
62
+ };
30
63
  function WizardMain(props) {
31
64
  const [showRestFlag, setShowRestFlag] = useState(false);
65
+ const [aiServicesAvailable, setAIServicesAvailable] = useState(false); // default to false until services are confirmed available
32
66
  const recommendationDispatch = useContext(RecommendationDispatchContext);
33
- const { isCreatingCase } = useCaseSelector((state) => ({
67
+ const { isCreatingCase, product, version, summary, issue, caseType } = useCaseSelector((state) => ({
34
68
  isCreatingCase: state.isCreatingCase,
69
+ product: state.caseDetails.product,
70
+ version: state.caseDetails.version,
71
+ summary: state.caseDetails.summary,
72
+ issue: state.caseDetails.issue,
73
+ caseType: state.caseDetails.caseType,
35
74
  }), isEqual);
36
- const { routeState: { isCaseCreate }, } = useContext(RouteContext);
75
+ const { routeState: { isCaseCreate, activeSection }, } = useContext(RouteContext);
76
+ const aiResponseDispatch = useAIResponseDispatch();
77
+ const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
78
+ const isResourcesSection = activeSection === AppRouteSections.RESOURCES;
79
+ const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
37
80
  const [userSeenRecommendations, setUserSeenRecommendations] = useState(false);
38
81
  const [userClickedNextonRecommendations, setUserClickedNextonRecommendations] = useState(false);
39
82
  const [userScrolledLabel, setUserScrolledLabel] = useState(false);
@@ -42,6 +85,9 @@ function WizardMain(props) {
42
85
  const isNextButtonClickedRef = useRef(false);
43
86
  const isBackButtonClickedRef = useRef(false);
44
87
  const resultsRowRef = useRef(null);
88
+ const handleChatWithAIClick = () => {
89
+ props.setIsAIChatMode(true);
90
+ };
45
91
  const { getStepsSequece } = useWizard(props.routeProps, {
46
92
  userSeenRecommendationsfn: setUserSeenRecommendations,
47
93
  userSeenRecommendationsValue: userSeenRecommendations,
@@ -49,12 +95,48 @@ function WizardMain(props) {
49
95
  userClickedNextonRecommendationsValue: userClickedNextonRecommendations,
50
96
  resultsRowRef: resultsRowRef,
51
97
  userScrolledLabel: userScrolledLabel,
98
+ isAIChatMode: props.isAIChatMode,
99
+ setIsAIChatMode: props.setIsAIChatMode,
100
+ onChatWithAIClick: handleChatWithAIClick,
101
+ aiServicesAvailable: aiServicesAvailable,
52
102
  });
53
103
  const dispatchToRouteReducer = useContext(RouteDispatchContext);
54
104
  const { t } = useTranslation();
55
105
  useEffect(() => {
56
106
  setActiveSectionChanged(dispatchToRouteReducer, isCaseCreate ? AppRouteSections.GET_SUPPORT : AppRouteSections.TROUBLESHOOT, '');
57
107
  }, [isCaseCreate, dispatchToRouteReducer]);
108
+ useEffect(() => {
109
+ if (!activeSection) {
110
+ return;
111
+ }
112
+ const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
113
+ const isAllowedCaseType = !excludedCaseTypesforARH.includes(caseType || '');
114
+ if (!isRelevantSection || !isAllowedCaseType) {
115
+ if (aiServicesAvailable) {
116
+ setAIServicesAvailable(false);
117
+ }
118
+ return;
119
+ }
120
+ // check if ARH services are available
121
+ if (!aiServicesAvailable) {
122
+ const checkAIServices = () => __awaiter(this, void 0, void 0, function* () {
123
+ var _a, _b;
124
+ const config = {
125
+ appSourceId: appSourceId_ARH,
126
+ 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 : '',
127
+ };
128
+ try {
129
+ yield getRHDirectStatusCheck(config);
130
+ setAIServicesAvailable(true);
131
+ }
132
+ catch (error) {
133
+ setAIServicesAvailable(false);
134
+ }
135
+ });
136
+ checkAIServices();
137
+ }
138
+ // eslint-disable-next-line react-hooks/exhaustive-deps
139
+ }, [activeSection, caseType, isCaseCreate, aiServicesAvailable]);
58
140
  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" },
59
141
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
60
142
  React.createElement(SubmitCase, { routeProps: props.routeProps }))));
@@ -99,26 +181,51 @@ function WizardMain(props) {
99
181
  isBackButtonClickedRef.current = false;
100
182
  setIsNextButtonClicked(false);
101
183
  };
184
+ const handleReturnToCaseCreation = () => {
185
+ props.setIsAIChatMode(false);
186
+ };
102
187
  const customNav = (isExpanded, steps, activeStep, goToStepByIndex) => (React.createElement(WizardNav, { isExpanded: isExpanded }, steps.map((step) => {
103
188
  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) }));
104
189
  })));
105
190
  const CustomFooter = () => {
191
+ var _a, _b;
106
192
  const { activeStep, goToNextStep, goToPrevStep, steps, goToStepByIndex } = useWizardContext(); // Correctly using the context
193
+ const config = {
194
+ appSourceId: appSourceId_ARH,
195
+ 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 : '',
196
+ };
107
197
  useEffect(() => {
108
198
  if (steps.length > 2 && activeStep.index === 2 && isNextButtonClicked) {
109
199
  goToStepByIndex(3);
110
200
  }
111
201
  }, [activeStep, steps.length, goToStepByIndex]);
112
- return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: () => {
113
- isNextButtonClickedRef.current = true;
114
- setIsNextButtonClicked(true);
115
- goToNextStep();
116
- focusWizardMainPanel();
117
- }, onBack: () => {
202
+ const handleContinueClick = () => __awaiter(this, void 0, void 0, function* () {
203
+ const shouldCallAPI = (isTroubleshootSection || isSummarizeSection) && !excludedCaseTypesforARH.includes(caseType || '');
204
+ // Navigate to next step first
205
+ isNextButtonClickedRef.current = true;
206
+ setIsNextButtonClicked(true);
207
+ goToNextStep();
208
+ focusWizardMainPanel();
209
+ if (shouldCallAPI) {
210
+ const detailedQuestion = generateAIQuestion(activeSection, product, version, summary, issue, caseType || '');
211
+ const useAIServices = aiServicesAvailable;
212
+ if (useAIServices) {
213
+ aiResponseDispatch(requestAIResponse(detailedQuestion));
214
+ try {
215
+ const response = yield askRHDirectAIResponse(detailedQuestion, config);
216
+ aiResponseDispatch(receivedAIResponse(response));
217
+ }
218
+ catch (error) {
219
+ aiResponseDispatch(receivedAIResponseError((error === null || error === void 0 ? void 0 : error.message) || 'Failed to get AI response'));
220
+ }
221
+ }
222
+ }
223
+ });
224
+ return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: handleContinueClick, onBack: () => {
118
225
  isBackButtonClickedRef.current = true;
119
226
  goToPrevStep();
120
227
  focusWizardMainPanel();
121
- }, 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 }));
228
+ }, 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 }));
122
229
  };
123
230
  const steps = getStepsSequece(showRestFlag);
124
231
  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,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAA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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,qBAiVtC;kBAjVQ,gBAAgB;;;AAmVzB,eAAe,gBAAgB,CAAC"}
@@ -249,9 +249,10 @@ function WizardNavigation(props) {
249
249
  // To handle entitled products
250
250
  return (React.createElement(React.Fragment, null,
251
251
  React.createElement(WizardFooterWrapper, null,
252
- 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'))),
253
- 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)),
254
- 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'))),
252
+ props.isAIChatMode ? (React.createElement(Button, { onClick: props.onReturnToCaseCreation, variant: "link", className: "return-to-case-btn" }, t('Return to case creation'))) : (React.createElement(React.Fragment, null,
253
+ 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'))),
254
+ 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)),
255
+ 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'))))),
255
256
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
256
257
  activeSectionError ? (React.createElement("small", { className: "pf-v6-u-align-self-center pf-v6-u-ml-md text-red" }, activeSectionError)) : null)));
257
258
  }
@@ -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,O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;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"}
@@ -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 { useDocumentTitle } from '@rh-support/components';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IAIResponseActionType, IAIResponseState } from '../reducers/AIResponseConstNTypes';
3
+ export declare const AIResponseStateContext: React.Context<IAIResponseState>;
4
+ export declare const AIResponseDispatchContext: React.Context<React.Dispatch<IAIResponseActionType>>;
5
+ export declare function AIResponseContextProvider({ children }: {
6
+ children: React.ReactNode;
7
+ }): React.JSX.Element;
8
+ export declare const useAIResponseState: () => IAIResponseState;
9
+ export declare const useAIResponseDispatch: () => React.Dispatch<IAIResponseActionType>;
10
+ //# sourceMappingURL=AIResponseContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIResponseContext.d.ts","sourceRoot":"","sources":["../../../src/context/AIResponseContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAA0B,MAAM,mCAAmC,CAAC;AAKpH,eAAO,MAAM,sBAAsB,iCAAgE,CAAC;AACpG,eAAO,MAAM,yBAAyB,sDACgD,CAAC;AAEvF,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAUpF;AAGD,eAAO,MAAM,kBAAkB,wBAM9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,6CAMjC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import React, { useReducer } from 'react';
2
+ import { initialAIResponseState } from '../reducers/AIResponseConstNTypes';
3
+ import { aiResponseReducer } from '../reducers/AIResponseReducer';
4
+ const initialDispatchContext = () => { };
5
+ export const AIResponseStateContext = React.createContext(initialAIResponseState);
6
+ export const AIResponseDispatchContext = React.createContext(initialDispatchContext);
7
+ export function AIResponseContextProvider({ children }) {
8
+ const [aiResponseState, aiResponseDispatch] = useReducer(aiResponseReducer, initialAIResponseState);
9
+ return (React.createElement(AIResponseStateContext.Provider, { value: aiResponseState },
10
+ React.createElement(AIResponseDispatchContext.Provider, { value: aiResponseDispatch }, children)));
11
+ }
12
+ // Custom hooks for easy access
13
+ export const useAIResponseState = () => {
14
+ const context = React.useContext(AIResponseStateContext);
15
+ if (context === undefined) {
16
+ throw new Error('useAIResponseState must be used within a AIResponseContextProvider');
17
+ }
18
+ return context;
19
+ };
20
+ export const useAIResponseDispatch = () => {
21
+ const context = React.useContext(AIResponseDispatchContext);
22
+ if (context === undefined) {
23
+ throw new Error('useAIResponseDispatch must be used within a AIResponseContextProvider');
24
+ }
25
+ return context;
26
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"RootTroubleshootProvider.d.ts","sourceRoot":"","sources":["../../../src/context/RootTroubleshootProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,qBAkBrD"}
1
+ {"version":3,"file":"RootTroubleshootProvider.d.ts","sourceRoot":"","sources":["../../../src/context/RootTroubleshootProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,qBAoBrD"}
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AttachmentContextProvider } from '../components/shared/fileUpload/reducer/AttachmentReducerContext';
3
+ import { AIResponseContextProvider } from './AIResponseContext';
3
4
  import { CaseContextProvider } from './CaseContext';
4
5
  import { ClusterRecommendationsContextProvider } from './ClusterRecommendationsContext';
5
6
  import { RecommendationContextProvider } from './RecommendationContext';
@@ -10,10 +11,11 @@ import { TCContextProvider } from './TopContentContext';
10
11
  export function RootTroubleshootProvider(props) {
11
12
  return (React.createElement(RouteContextProvider, null,
12
13
  React.createElement(CaseContextProvider, null,
13
- React.createElement(RecommendationContextProvider, null,
14
- React.createElement(AttachmentContextProvider, null,
15
- React.createElement(RulesContextProvider, null,
16
- React.createElement(ClusterRecommendationsContextProvider, null,
17
- React.createElement(TCContextProvider, null,
18
- React.createElement(SessionRestoreContextProvider, null, props.children)))))))));
14
+ React.createElement(AIResponseContextProvider, null,
15
+ React.createElement(RecommendationContextProvider, null,
16
+ React.createElement(AttachmentContextProvider, null,
17
+ React.createElement(RulesContextProvider, null,
18
+ React.createElement(ClusterRecommendationsContextProvider, null,
19
+ React.createElement(TCContextProvider, null,
20
+ React.createElement(SessionRestoreContextProvider, null, props.children))))))))));
19
21
  }
@@ -0,0 +1,333 @@
1
+ .ask-redhat {
2
+ padding: 1rem 1rem 2rem;
3
+ }
4
+
5
+ .ask-redhat-title {
6
+ display: flex;
7
+ flex-direction: row;
8
+ width: 387.666px;
9
+ height: 24px;
10
+ flex-shrink: 0;
11
+ color: #000;
12
+ font-family: 'Red Hat Display';
13
+ font-size: 16px;
14
+ font-style: normal;
15
+ font-weight: 600;
16
+ line-height: normal;
17
+ align-items: center;
18
+ gap: 0.5rem;
19
+ }
20
+
21
+ .ask-redhat-content-wrapper {
22
+ position: relative;
23
+ }
24
+
25
+ .ask-redhat-content {
26
+ max-height: 120px;
27
+ color: #000;
28
+ font-family: 'Red Hat Text';
29
+ font-size: 16px;
30
+ font-style: normal;
31
+ font-weight: 400;
32
+ line-height: 24px;
33
+ overflow: hidden;
34
+ position: relative;
35
+ transition: max-height 0.8s ease;
36
+ }
37
+
38
+ .ask-redhat-content--expanded {
39
+ max-height: calc(100vh - 390px);
40
+ transition: max-height 0.8s ease !important;
41
+ }
42
+
43
+ .ask-redhat-content--expanded-scrollable {
44
+ max-height: calc(100vh - 500px);
45
+ overflow-y: auto;
46
+ }
47
+
48
+ .ask-redhat-list {
49
+ margin-left: 1.5rem;
50
+ }
51
+
52
+ .ask-redhat-cards {
53
+ display: flex;
54
+ gap: 1rem;
55
+ margin-top: 1rem;
56
+ }
57
+
58
+ .ask-redhat-card {
59
+ flex: 1;
60
+ }
61
+
62
+ .ask-redhat-card-title {
63
+ margin: 0;
64
+ }
65
+
66
+ .ask-redhat-footer-wrapper {
67
+ position: relative;
68
+ margin-top: 1rem;
69
+ padding-bottom: 3rem;
70
+ }
71
+
72
+ .ask-redhat-footer {
73
+ display: flex;
74
+ justify-content: space-between;
75
+ align-items: center;
76
+ margin: 1.5rem 0 2rem;
77
+ }
78
+
79
+ .ask-redhat-footer-text {
80
+ margin: 0;
81
+ }
82
+
83
+ :root {
84
+ --color-red: var(--Core-color-palette-Red-red-40, #f56e6e);
85
+ --color-purple: var(--Secondary-color-palette-Purple-purple-50, #5e40be);
86
+ --gradient-red-purple: linear-gradient(90deg, var(--color-red), var(--color-purple));
87
+ --gorgey: #f56e6e;
88
+ }
89
+
90
+ .ask-redhat-chat-button {
91
+ width: 129px;
92
+ height: 30px;
93
+ justify-content: center;
94
+ align-items: center !important;
95
+ gap: 8px;
96
+ flex-shrink: 0;
97
+ border-radius: 40px;
98
+ background: var(--gradient-red-purple) !important;
99
+ color: #000;
100
+ text-decoration: none;
101
+ transition: all 0.2s ease;
102
+ cursor: pointer;
103
+ position: relative;
104
+ display: flex;
105
+ padding: 1px;
106
+ }
107
+
108
+ .ask-redhat-chat-button svg {
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ margin: 0;
113
+ padding: 0;
114
+ vertical-align: middle;
115
+ }
116
+
117
+ .ask-redhat-chat-button .pf-v6-c-button__text {
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ line-height: 1;
122
+ color: #000;
123
+ margin: 0;
124
+ padding: 0;
125
+ height: 100%;
126
+ }
127
+
128
+ .ask-redhat-chat-button .pf-v6-c-button__icon {
129
+ display: flex;
130
+ align-items: center;
131
+ justify-content: center;
132
+ margin: 0;
133
+ padding: 0;
134
+ height: 100%;
135
+ }
136
+
137
+ .ask-redhat-chat-button::before {
138
+ content: '';
139
+ position: absolute;
140
+ top: 1px;
141
+ left: 1px;
142
+ right: 1px;
143
+ bottom: 1px;
144
+ background: #fff;
145
+ border-radius: 39px;
146
+ z-index: 1;
147
+ }
148
+
149
+ .ask-redhat-chat-button > * {
150
+ position: relative;
151
+ z-index: 2;
152
+ }
153
+
154
+ .ask-redhat-chat-button:focus {
155
+ outline: none;
156
+ box-shadow: 0 0 0 2px rgba(94, 64, 190, 0.2);
157
+ }
158
+
159
+ .ask-redhat-fade-overlay {
160
+ position: absolute;
161
+ bottom: 0;
162
+ left: 0;
163
+ width: 1002px;
164
+ height: 147px;
165
+ flex-shrink: 0;
166
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 80%, #fff 100%);
167
+ pointer-events: none;
168
+ z-index: 1;
169
+ }
170
+
171
+ .ask-redhat-toggle-button {
172
+ display: flex;
173
+ justify-content: center;
174
+ align-items: center;
175
+ gap: 8px;
176
+ flex-shrink: 0;
177
+ left: 50%;
178
+ width: 211.839px;
179
+ height: 40px;
180
+ transform: translateX(-50%);
181
+ background-color: #fff;
182
+ z-index: 3;
183
+ background: var(--gradient-red-purple) !important;
184
+ padding: 2px;
185
+ color: #000;
186
+ border-radius: 40px;
187
+ }
188
+
189
+ .ask-redhat-toggle-button .pf-v6-c-button__text {
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: center;
193
+ line-height: 1;
194
+ margin: 0;
195
+ padding: 0;
196
+ gap: 8px;
197
+ color: #000;
198
+ }
199
+
200
+ .ask-redhat-toggle-button svg {
201
+ display: flex;
202
+ align-items: center;
203
+ justify-content: center;
204
+ margin: 0;
205
+ padding: 0;
206
+ vertical-align: middle;
207
+ }
208
+
209
+ .ask-redhat-toggle-button::before {
210
+ content: '';
211
+ position: absolute;
212
+ top: 2px;
213
+ left: 2px;
214
+ right: 2px;
215
+ bottom: 2px;
216
+ background: #fff;
217
+ border-radius: 38px;
218
+ z-index: 1;
219
+ }
220
+
221
+ .ask-redhat-toggle-button > * {
222
+ position: relative;
223
+ z-index: 2;
224
+ }
225
+
226
+ .ask-redhat-toggle-button-collapsed {
227
+ display: flex;
228
+ width: 50px;
229
+ height: 24px;
230
+ padding: 6px 16px;
231
+ justify-content: center;
232
+ align-items: center;
233
+ gap: 8px;
234
+ flex-shrink: 0;
235
+ border-radius: 40px;
236
+ background: var(--gradient-red-purple) !important;
237
+ color: #000;
238
+ position: absolute;
239
+ left: 50%;
240
+ transform: translateX(-50%);
241
+ z-index: 3;
242
+ }
243
+
244
+ .ask-redhat-toggle-button-collapsed::before {
245
+ content: '';
246
+ position: absolute;
247
+ top: 1px;
248
+ left: 1px;
249
+ right: 1px;
250
+ bottom: 1px;
251
+ background: #fff;
252
+ border-radius: 39px;
253
+ z-index: 1;
254
+ }
255
+
256
+ .ask-redhat-toggle-button-collapsed > * {
257
+ position: relative;
258
+ z-index: 2;
259
+ }
260
+
261
+ .ask-redhat-toggle-button-collapsed svg {
262
+ display: flex;
263
+ align-items: center;
264
+ justify-content: center;
265
+ margin: 0;
266
+ padding: 0;
267
+ vertical-align: middle;
268
+ line-height: 1;
269
+ }
270
+
271
+ .ask-redhat-toggle-button-wrapper {
272
+ position: relative;
273
+ }
274
+
275
+ .ask-redhat-border-line {
276
+ position: absolute;
277
+ top: 50%;
278
+ left: 0;
279
+ right: 0;
280
+ height: 1px;
281
+ background: #d2d2d2;
282
+ z-index: 1;
283
+ }
284
+
285
+ .return-to-case-btn {
286
+ border: none;
287
+ background-color: transparent;
288
+ color: #0066cc;
289
+ padding: 0.5rem 1rem;
290
+ cursor: pointer;
291
+ font-size: 1rem;
292
+ }
293
+
294
+ .pf-chatbot--fullscreen {
295
+ position: absolute !important;
296
+ }
297
+
298
+ .pf-chatbot--embedded {
299
+ height: calc(100vh - 276px) !important;
300
+ }
301
+
302
+ .pf-chatbot--fullscreen .pf-chatbot-container {
303
+ height: calc(100vh - 255px) !important;
304
+ }
305
+
306
+ .fullscreen-chat-footer {
307
+ position: absolute !important;
308
+ bottom: 0 !important;
309
+ left: 0 !important;
310
+ right: 0 !important;
311
+ height: 42px !important;
312
+ background: #f6f6f6 !important;
313
+ border-top: 1px solid #d1d1d1 !important;
314
+ align-items: center !important;
315
+ z-index: 10001 !important;
316
+ padding-left: 25px;
317
+ }
318
+
319
+ body:has(.pf-chatbot--fullscreen) .pf-v6-c-wizard__footer {
320
+ z-index: 0 !important;
321
+ }
322
+
323
+ body:has(.pf-chatbot--fullscreen) .fullscreen-chat-footer {
324
+ display: flex !important;
325
+ }
326
+
327
+ body:has(.pf-chatbot--fullscreen) .main-section {
328
+ min-height: calc(100vh - 212px) !important;
329
+ }
330
+
331
+ body:has(.pf-chatbot--embedded) .pf-v6-c-wizard__main-body:last-child {
332
+ padding: 0 !important;
333
+ }