@rh-support/troubleshoot 2.6.55 → 2.6.57

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.
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  interface IProps {
3
3
  onChatWithAIClick?: () => void;
4
4
  }
5
- export declare const AskRedHat: React.FC<IProps>;
5
+ export declare const AskRedHat: ({ onChatWithAIClick }: IProps) => React.JSX.Element;
6
6
  export {};
7
7
  //# sourceMappingURL=AskRedHat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAe5D,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAsVtC,CAAC"}
1
+ {"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAgC5D,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,0BAA2B,MAAM,sBAuZtD,CAAC"}
@@ -7,24 +7,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { Env } from '@cee-eng/hydrajs';
10
+ import { Env, pcm } from '@cee-eng/hydrajs';
11
11
  import { sendRHDirectMessageFeedback } from '@ifd-ui/ask-redhat-core';
12
12
  import { Button, Card, CardBody, CardHeader, Content, ContentVariants, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateVariant, Icon, Modal, ModalVariant, Skeleton, Spinner, } from '@patternfly/react-core';
13
13
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
14
+ import { useFetch } from '@rh-support/components';
14
15
  import isEqual from 'lodash/isEqual';
15
16
  import React, { useContext, useRef, useState } from 'react';
16
17
  import { MODAL_MESSAGES, QUICK_RESPONSES, TOOLTIP_MESSAGES } from '../../constants/askRedHatMessages';
17
18
  import { useAIResponseState } from '../../context/AIResponseContext';
18
19
  import { useCaseSelector } from '../../context/CaseContext';
19
20
  import { RouteContext } from '../../context/RouteContext';
21
+ import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
20
22
  import { useARHResponse } from '../../hooks/useARHResponse';
21
23
  import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
22
24
  import { appSourceId_ARH } from '../../reducers/CaseConstNTypes';
25
+ import { createOrUpdateSessionResources } from '../../reducers/SessionRestoreReducer';
23
26
  import { CollapseIcon } from './icons/CollapseIcon';
24
27
  import { StarIcon } from './icons/StarIcon';
25
28
  import ResponseActions from './ResponseActions';
26
29
  import UserFeedback from './UserFeedback';
27
30
  import UserFeedbackComplete from './UserFeedbackComplete';
31
+ const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
32
+ const getSessResFromARHSource = (source, visibilityStatus, rank = 1) => ({
33
+ visibilityStatus,
34
+ resourceEntityId: source.id,
35
+ url: source.link || source.url,
36
+ rank,
37
+ });
38
+ const getSessResFromAISources = (sources, visibilityStatus) => {
39
+ if (!sources || sources.length === 0)
40
+ return [];
41
+ return sources.map((source, index) => getSessResFromARHSource(source, visibilityStatus, index + 1));
42
+ };
28
43
  export const AskRedHat = ({ onChatWithAIClick }) => {
29
44
  var _a, _b, _c;
30
45
  const [isExpanded, setIsExpanded] = useState(false);
@@ -36,6 +51,8 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
36
51
  const aiResponseState = useAIResponseState();
37
52
  const contentRef = useRef(null);
38
53
  const { routeState: { isCaseCreate, activeSection }, } = useContext(RouteContext);
54
+ const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
55
+ const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
39
56
  const { product, version, summary, issue, caseType } = useCaseSelector((state) => ({
40
57
  product: state.caseDetails.product,
41
58
  version: state.caseDetails.version,
@@ -43,6 +60,7 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
43
60
  issue: state.caseDetails.issue,
44
61
  caseType: state.caseDetails.caseType,
45
62
  }), isEqual);
63
+ const { request: updateSessionOrigin } = useFetch(pcm.preCase.session.updateSessionOrigin);
46
64
  const config = {
47
65
  appSourceId: appSourceId_ARH,
48
66
  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 : '',
@@ -62,9 +80,40 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
62
80
  if (isExpanded && contentRef.current) {
63
81
  contentRef.current.scrollTop = 0;
64
82
  }
83
+ if (!isExpanded) {
84
+ const payload = JSON.stringify({
85
+ product,
86
+ version,
87
+ summary,
88
+ issue,
89
+ });
90
+ const sessionResources = getSessResFromAISources(sources || [], SessionResourceVisibility.PRESENTED);
91
+ createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.ASK_RED_HAT, sessionResources, payload);
92
+ }
65
93
  setIsExpanded((prev) => !prev);
66
94
  };
67
- const handleChatWithAIClick = () => onChatWithAIClick === null || onChatWithAIClick === void 0 ? void 0 : onChatWithAIClick();
95
+ const handleChatWithAIClick = () => __awaiter(void 0, void 0, void 0, function* () {
96
+ var _a;
97
+ onChatWithAIClick === null || onChatWithAIClick === void 0 ? void 0 : onChatWithAIClick();
98
+ if (updateSessionOrigin) {
99
+ yield updateSessionOrigin(activeSessionId, {
100
+ id: (_a = sessionResourceTracking[SessionResourceSource.ASK_RED_HAT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId,
101
+ aiChatStarted: true,
102
+ });
103
+ }
104
+ });
105
+ const handleSourceClick = (source, index) => () => {
106
+ if (!source || !activeSessionId)
107
+ return;
108
+ const payload = JSON.stringify({
109
+ product,
110
+ version,
111
+ summary,
112
+ issue,
113
+ });
114
+ const sessionResource = getSessResFromARHSource(source, SessionResourceVisibility.VISITED, index + 1);
115
+ createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.ASK_RED_HAT, [sessionResource], payload);
116
+ };
68
117
  const aiResponse = aiResponseState.aiResponse;
69
118
  const messageId = aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.messageId;
70
119
  const conversationId = aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.conversationId;
@@ -72,7 +121,7 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
72
121
  const answer = aiResponseState.isStreaming && aiResponseState.accumulatedResponse
73
122
  ? aiResponseState.accumulatedResponse
74
123
  : (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content) || 'No AI response available yet.';
75
- const sources = (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [];
124
+ const sources = React.useMemo(() => (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [], [aiResponse]);
76
125
  const sourcesCount = sources.length || 0;
77
126
  // Show loading only when streaming has started but no content received yet
78
127
  const isLoading = aiResponseState.isStreaming && aiResponseState.accumulatedResponse === '';
@@ -174,7 +223,7 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
174
223
  React.createElement("div", { className: "ask-redhat-cards" }, sources.map((source, index) => (React.createElement(Card, { className: "ask-redhat-card", key: index },
175
224
  React.createElement(CardHeader, null,
176
225
  React.createElement("h3", { className: "ask-redhat-card-title" },
177
- React.createElement("a", { href: source.link, target: "_blank", rel: "noopener noreferrer" }, source.title))),
226
+ React.createElement("a", { href: source.link, target: "_blank", rel: "noopener noreferrer", onClick: handleSourceClick(source, index) }, source.title))),
178
227
  React.createElement(CardBody, null,
179
228
  React.createElement("p", null, source.snippet)))))))),
180
229
  React.createElement("div", { className: "response-actions-wrapper" },
@@ -1 +1 @@
1
- {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AAUrD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAUD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAgLzC;kBAhLQ,mBAAmB;;;AAmL5B,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AAUrD,OAAO,KAA6B,MAAM,OAAO,CAAC;AAclD,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAUD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAuLzC;kBAvLQ,mBAAmB;;;AA0L5B,eAAe,mBAAmB,CAAC"}
@@ -16,7 +16,7 @@ import { ErrorBoundary, LoadingDots } from '@rh-support/components';
16
16
  import { PreviousCaseTypes } from '@rh-support/utils';
17
17
  import isEmpty from 'lodash/isEmpty';
18
18
  import isEqual from 'lodash/isEqual';
19
- import React, { useContext } from 'react';
19
+ import React, { useContext, useRef } from 'react';
20
20
  import { Trans, useTranslation } from 'react-i18next';
21
21
  import { useAIResponseState } from '../../context/AIResponseContext';
22
22
  import { useCaseSelector } from '../../context/CaseContext';
@@ -40,6 +40,7 @@ function TroubleshootSection(props) {
40
40
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
41
41
  const { t } = useTranslation();
42
42
  const { aiServicesAvailable, isAIChatMode, setIsAIChatMode, onChatWithAIClick } = props;
43
+ const refetchControlReady = useRef(null);
43
44
  const { topContentState: { topContent }, } = useContext(TCStateContext);
44
45
  const { routeState: { isCaseCreate }, } = useContext(RouteContext);
45
46
  const aiResponseState = useAIResponseState();
@@ -58,7 +59,6 @@ function TroubleshootSection(props) {
58
59
  const isNotAnIdea = caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT;
59
60
  const shouldShowARHUI = () => {
60
61
  // Check if the case type is allowed (not in the excluded list)
61
- // test
62
62
  const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseType !== null && caseType !== void 0 ? caseType : '');
63
63
  // Check if user is not a secure support or confirmed stateside support user
64
64
  const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
@@ -67,8 +67,10 @@ function TroubleshootSection(props) {
67
67
  return isCaseTypeAllowed && isNotSecureOrStatesideUser && isAIServicesAvailable;
68
68
  };
69
69
  const handleInitialized = (success, error) => {
70
+ var _a;
70
71
  if (success) {
71
72
  console.log('Chat initialized successfully');
73
+ (_a = refetchControlReady.current) === null || _a === void 0 ? void 0 : _a.refetch();
72
74
  }
73
75
  else {
74
76
  console.error('Chat initialization failed:', error);
@@ -119,6 +121,13 @@ function TroubleshootSection(props) {
119
121
  },
120
122
  },
121
123
  onInitialized: handleInitialized,
124
+ onUnauthenticatedLogin: () => {
125
+ var _a, _b;
126
+ (_b = (_a = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _a === void 0 ? void 0 : _a.login) === null || _b === void 0 ? void 0 : _b.call(_a);
127
+ },
128
+ onRefetchControlReady: (refetchControl) => {
129
+ refetchControlReady.current = refetchControl;
130
+ },
122
131
  };
123
132
  const handleChatWithAIClick = () => {
124
133
  setIsAIChatMode(true);
@@ -1 +1 @@
1
- {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAqD,MAAM,OAAO,CAAC;AAE3G,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAS9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAapF,eAAO,MAAM,iBAAiB,aAAc,MAAM,KAAG,MAEpD,CAAC;AAEF,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,YAAY,MAAM,QAAQ,MAAM,KAAG,MAqB9F,CAAC;AAGF,eAAO,MAAM,kBAAk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YACf,MAAM,QACV,MAAM,KACb,MAwCF,CAAC;AACF,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,qBAmWhC;AACD,eAAe,UAAU,CAAC"}
@@ -19,7 +19,7 @@ var __rest = (this && this.__rest) || function (s, e) {
19
19
  return t;
20
20
  };
21
21
  import { Env } from '@cee-eng/hydrajs';
22
- import { getRHDirectStatusCheck } from '@ifd-ui/ask-redhat-core';
22
+ import { getRHDirectHealthCheck, getRHDirectStatusCheck, } from '@ifd-ui/ask-redhat-core';
23
23
  import { Wizard, WizardNav, WizardNavItem, WizardStep, } from '@patternfly/react-core';
24
24
  import { LoadingIndicator } from '@rh-support/components';
25
25
  import isEqual from 'lodash/isEqual';
@@ -29,12 +29,15 @@ import { Route } from 'react-router-dom';
29
29
  import { useCaseSelector } from '../../context/CaseContext';
30
30
  import { RecommendationDispatchContext } from '../../context/RecommendationContext';
31
31
  import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
32
+ import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
32
33
  import { useARHResponse } from '../../hooks/useARHResponse';
33
34
  import { useWizard } from '../../hooks/useWizard';
34
35
  import { appSourceId_ARH, excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
36
+ import { getSessionDetailsFromCase } from '../../reducers/CaseHelpers';
35
37
  import { RecommendationsConstants } from '../../reducers/RecommendationsReducer';
36
38
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
37
39
  import { setActiveSectionChanged, updateisNextBtnClickedToShowValidationError } from '../../reducers/RouteReducer';
40
+ import { updateSession } from '../../reducers/SessionRestoreReducer';
38
41
  import RouteUtils from '../../utils/routeUtils';
39
42
  import SubmitCase from '../SubmitCase/SubmitCase';
40
43
  import MainSection from './MainSection';
@@ -88,13 +91,12 @@ function WizardMain(props) {
88
91
  const [showRestFlag, setShowRestFlag] = useState(false);
89
92
  const [aiServicesAvailable, setAIServicesAvailable] = useState(false); // default to false until services are confirmed available
90
93
  const recommendationDispatch = useContext(RecommendationDispatchContext);
91
- const { isCreatingCase, product, version, summary, issue, caseType } = useCaseSelector((state) => ({
94
+ const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
95
+ const { sessionRestore } = useContext(SessionRestoreStateContext);
96
+ const { isCreatingCase, caseDetails, selectedNotificationContacts } = useCaseSelector((state) => ({
92
97
  isCreatingCase: state.isCreatingCase,
93
- product: state.caseDetails.product,
94
- version: state.caseDetails.version,
95
- summary: state.caseDetails.summary,
96
- issue: state.caseDetails.issue,
97
- caseType: state.caseDetails.caseType,
98
+ caseDetails: state.caseDetails,
99
+ selectedNotificationContacts: state.selectedNotificationContacts,
98
100
  }), isEqual);
99
101
  const { routeState: { isCaseCreate, activeSection }, } = useContext(RouteContext);
100
102
  const config = {
@@ -105,11 +107,11 @@ function WizardMain(props) {
105
107
  };
106
108
  const { fetchARHResponse } = useARHResponse({
107
109
  activeSection,
108
- product,
109
- version,
110
- summary,
111
- issue,
112
- caseType,
110
+ product: caseDetails.product,
111
+ version: caseDetails.version,
112
+ summary: caseDetails.summary,
113
+ issue: caseDetails.issue,
114
+ caseType: caseDetails.caseType,
113
115
  config,
114
116
  });
115
117
  const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
@@ -124,10 +126,10 @@ function WizardMain(props) {
124
126
  const isBackButtonClickedRef = useRef(false);
125
127
  const resultsRowRef = useRef(null);
126
128
  const previousARHFieldsRef = useRef({
127
- product: product,
128
- version: version,
129
- summary: summary,
130
- issue: issue,
129
+ product: caseDetails.product,
130
+ version: caseDetails.version,
131
+ summary: caseDetails.summary,
132
+ issue: caseDetails.issue,
131
133
  });
132
134
  const handleChatWithAIClick = () => {
133
135
  props.setIsAIChatMode(true);
@@ -155,7 +157,7 @@ function WizardMain(props) {
155
157
  // Check if the current section is relevant for AI services
156
158
  const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
157
159
  // Check if the case type is allowed (not in the excluded list)
158
- const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseType || '');
160
+ const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseDetails.caseType || '');
159
161
  // Check if user is not a secure support or confirmed stateside support user
160
162
  const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
161
163
  // Check if the ARH fields have changed
@@ -170,20 +172,20 @@ function WizardMain(props) {
170
172
  };
171
173
  // Check if any of the ARH-relevant fields have changed
172
174
  const haveARHFieldsChanged = React.useMemo(() => {
173
- const hasChanged = previousARHFieldsRef.current.product !== product ||
174
- previousARHFieldsRef.current.version !== version ||
175
- previousARHFieldsRef.current.summary !== summary ||
176
- previousARHFieldsRef.current.issue !== issue;
175
+ const hasChanged = previousARHFieldsRef.current.product !== caseDetails.product ||
176
+ previousARHFieldsRef.current.version !== caseDetails.version ||
177
+ previousARHFieldsRef.current.summary !== caseDetails.summary ||
178
+ previousARHFieldsRef.current.issue !== caseDetails.issue;
177
179
  if (hasChanged) {
178
180
  previousARHFieldsRef.current = {
179
- product,
180
- version,
181
- summary,
182
- issue,
181
+ product: caseDetails.product,
182
+ version: caseDetails.version,
183
+ summary: caseDetails.summary,
184
+ issue: caseDetails.issue,
183
185
  };
184
186
  }
185
187
  return hasChanged;
186
- }, [product, version, summary, issue]);
188
+ }, [caseDetails.product, caseDetails.version, caseDetails.summary, caseDetails.issue]);
187
189
  useEffect(() => {
188
190
  if (!activeSection) {
189
191
  return;
@@ -206,6 +208,7 @@ function WizardMain(props) {
206
208
  appEnv: Env.getEnvName(),
207
209
  };
208
210
  try {
211
+ yield getRHDirectHealthCheck(config);
209
212
  yield getRHDirectStatusCheck(config);
210
213
  setAIServicesAvailable(true);
211
214
  }
@@ -218,7 +221,7 @@ function WizardMain(props) {
218
221
  // eslint-disable-next-line react-hooks/exhaustive-deps
219
222
  }, [
220
223
  activeSection,
221
- caseType,
224
+ caseDetails.caseType,
222
225
  isCaseCreate,
223
226
  aiServicesAvailable,
224
227
  props.isSecureSupport,
@@ -268,9 +271,16 @@ function WizardMain(props) {
268
271
  isBackButtonClickedRef.current = false;
269
272
  setIsNextButtonClicked(false);
270
273
  };
271
- const handleReturnToCaseCreation = () => {
274
+ const handleReturnToCaseCreation = () => __awaiter(this, void 0, void 0, function* () {
272
275
  props.setIsAIChatMode(false);
273
- };
276
+ if (sessionRestore.activeSessionId) {
277
+ const sessionDetails = getSessionDetailsFromCase(caseDetails, selectedNotificationContacts);
278
+ const newSession = {
279
+ returnToCase: true,
280
+ };
281
+ yield updateSession(sessionRestoreDispatch, sessionRestore.activeSessionId, sessionDetails, newSession);
282
+ }
283
+ });
274
284
  const customNav = (isExpanded, steps, activeStep, goToStepByIndex) => (React.createElement(WizardNav, { isExpanded: isExpanded }, steps.map((step) => {
275
285
  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) }));
276
286
  })));
@@ -296,7 +306,7 @@ function WizardMain(props) {
296
306
  isBackButtonClickedRef.current = true;
297
307
  goToPrevStep({});
298
308
  focusWizardMainPanel();
299
- }, 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 }));
309
+ }, 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, setIsAIChatMode: props.setIsAIChatMode, onReturnToCaseCreation: handleReturnToCaseCreation }));
300
310
  };
301
311
  const steps = getStepsSequece(showRestFlag);
302
312
  const wizardSteps = steps.map((step) => {
@@ -17,6 +17,7 @@ interface IProps {
17
17
  resultsRowRef?: any;
18
18
  setUserScrolledLabel: (value: React.SetStateAction<boolean>) => void;
19
19
  isAIChatMode?: boolean;
20
+ setIsAIChatMode?: (value: boolean) => void;
20
21
  onReturnToCaseCreation?: () => void;
21
22
  }
22
23
  declare function WizardNavigation(props: IProps): React.JSX.Element;
@@ -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,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IAC3C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA6VtC;kBA7VQ,gBAAgB;;;AA+VzB,eAAe,gBAAgB,CAAC"}
@@ -78,6 +78,13 @@ function WizardNavigation(props) {
78
78
  // eslint-disable-next-line react-hooks/exhaustive-deps
79
79
  }, [previousStep === null || previousStep === void 0 ? void 0 : previousStep.id, props.activeStep.id]);
80
80
  const [hasUserScrolled, setHasUserScrolled] = useState(false);
81
+ useEffect(() => {
82
+ var _a;
83
+ if (activeSection !== AppRouteSections.RESOURCES && props.isAIChatMode) {
84
+ (_a = props.setIsAIChatMode) === null || _a === void 0 ? void 0 : _a.call(props, false);
85
+ }
86
+ // eslint-disable-next-line react-hooks/exhaustive-deps
87
+ }, [activeSection]);
81
88
  useEffect(() => {
82
89
  if (props.activeStep.id !== (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) ||
83
90
  recommendationState.numFound <= 2) {
@@ -253,7 +260,7 @@ function WizardNavigation(props) {
253
260
  // To handle entitled products
254
261
  return (React.createElement(React.Fragment, null,
255
262
  React.createElement(WizardFooterWrapper, null,
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,
263
+ 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('Back to resources'))) : (React.createElement(React.Fragment, null,
257
264
  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
265
  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
266
  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'))))),
@@ -375,6 +375,7 @@ body:has(.pf-chatbot--embedded) .pf-v6-c-wizard__main-body:last-child {
375
375
  .ask-redhat-core .pf-chatbot__beta-label .pf-v6-c-label__content {
376
376
  color: #707070 !important;
377
377
  line-height: var(--global-font-line-height-figma-only-body-small, 18px) !important;
378
+ font-weight: 500 !important;
378
379
  }
379
380
 
380
381
  .ask-redhat-core .pf-chatbot__header-container:after {
@@ -384,6 +385,13 @@ body:has(.pf-chatbot--embedded) .pf-v6-c-wizard__main-body:last-child {
384
385
  .ask-redhat-core .pf-chatbot__expand-collapse-button {
385
386
  color: #151515 !important;
386
387
  font-size: var(--global-font-size-body-sm, 12px) !important;
388
+ align-items: center !important;
389
+ }
390
+
391
+ .pf-chatbot__expand-collapse-button .pf-v6-svg {
392
+ width: 16px !important;
393
+ height: 16px !important;
394
+ color: black !important;
387
395
  }
388
396
 
389
397
  .pf-v6-c-button__icon.pf-m-end {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.6.55",
3
+ "version": "2.6.57",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -25,7 +25,7 @@
25
25
  "lib/**/*"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@cee-eng/hydrajs": "4.18.57",
28
+ "@cee-eng/hydrajs": "4.18.84",
29
29
  "@cee-eng/ui-toolkit": "1.1.8",
30
30
  "@patternfly/patternfly": "6.2.1",
31
31
  "@patternfly/react-core": "6.2.1",
@@ -49,9 +49,9 @@
49
49
  "react-virtualized": "^9.22.5"
50
50
  },
51
51
  "dependencies": {
52
- "@cee-eng/hydrajs": "4.18.57",
52
+ "@cee-eng/hydrajs": "4.18.84",
53
53
  "@cee-eng/ui-toolkit": "1.1.8",
54
- "@ifd-ui/ask-redhat-core": "^0.0.33",
54
+ "@ifd-ui/ask-redhat-core": "^0.0.34",
55
55
  "@patternfly/patternfly": "6.2.1",
56
56
  "@patternfly/react-core": "6.2.1",
57
57
  "@patternfly/react-table": "6.2.1",
@@ -59,11 +59,11 @@
59
59
  "@progress/kendo-licensing": "1.3.5",
60
60
  "@progress/kendo-react-pdf": "^5.16.0",
61
61
  "@redux-devtools/extension": "^3.3.0",
62
- "@rh-support/components": "2.5.45",
63
- "@rh-support/react-context": "2.5.60",
62
+ "@rh-support/components": "2.5.46",
63
+ "@rh-support/react-context": "2.5.61",
64
64
  "@rh-support/types": "2.0.5",
65
- "@rh-support/user-permissions": "2.5.20",
66
- "@rh-support/utils": "2.5.19",
65
+ "@rh-support/user-permissions": "2.5.21",
66
+ "@rh-support/utils": "2.5.20",
67
67
  "@types/react-redux": "^7.1.33",
68
68
  "@types/redux": "^3.6.0",
69
69
  "date-fns": "3.6.0",
@@ -135,5 +135,5 @@
135
135
  "defaults and supports es6-module",
136
136
  "maintained node versions"
137
137
  ],
138
- "gitHead": "496bf698365697ff751a8edf712284454440d6ea"
138
+ "gitHead": "6c4cd843a136a0df2fc9bb67dd13364a8660f6cf"
139
139
  }