@rh-support/troubleshoot 2.6.118 → 2.6.120

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 (91) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.js +1 -1
  2. package/lib/esm/components/AccountInfo/css/accountSelector.css +3 -2
  3. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/Case.js +1 -1
  5. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
  7. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +2 -4
  9. package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
  10. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
  11. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +4 -2
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +2 -1
  15. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +2 -3
  17. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +13 -33
  18. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +3 -3
  19. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +1 -1
  20. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +1 -1
  21. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  22. package/lib/esm/components/CaseInformation/CaseGroup.js +11 -1
  23. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  24. package/lib/esm/components/CaseInformation/CaseInformation.js +4 -4
  25. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  26. package/lib/esm/components/CaseInformation/Description.js +1 -3
  27. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  28. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  29. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  30. package/lib/esm/components/CaseInformation/SupportLevel.js +1 -1
  31. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  32. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +12 -6
  33. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  34. package/lib/esm/components/IdeaInformation/IdeaInformation.js +4 -4
  35. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  36. package/lib/esm/components/OpenCase/OpenCase.js +8 -2
  37. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  38. package/lib/esm/components/ProductSelector/AllProductsSelector.js +18 -6
  39. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  40. package/lib/esm/components/ProductSelector/ProductSelector.js +12 -5
  41. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts +2 -0
  42. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
  43. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +16 -13
  44. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  45. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  46. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  47. package/lib/esm/components/Recommendations/Recommendations.js +38 -38
  48. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  49. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  50. package/lib/esm/components/Review/Review.js +5 -1
  51. package/lib/esm/components/TroubleshootSection/AskRedHat.js +1 -1
  52. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +0 -9
  53. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  54. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +44 -150
  55. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  56. package/lib/esm/components/shared/useIsSectionValid.js +71 -32
  57. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  58. package/lib/esm/components/wizardLayout/WizardAside.js +9 -18
  59. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  60. package/lib/esm/components/wizardLayout/WizardMain.js +64 -110
  61. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  62. package/lib/esm/components/wizardLayout/WizardNavigation.js +53 -59
  63. package/lib/esm/css/AskRedHat.css +2 -9
  64. package/lib/esm/css/app.css +1 -1
  65. package/lib/esm/hooks/useWizard.d.ts +0 -4
  66. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  67. package/lib/esm/hooks/useWizard.js +6 -20
  68. package/lib/esm/reducers/AIResponseConstNTypes.d.ts +2 -17
  69. package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -1
  70. package/lib/esm/reducers/AIResponseConstNTypes.js +0 -3
  71. package/lib/esm/reducers/AIResponseReducer.d.ts +0 -2
  72. package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -1
  73. package/lib/esm/reducers/AIResponseReducer.js +0 -17
  74. package/lib/esm/reducers/CaseConstNTypes.js +3 -3
  75. package/lib/esm/reducers/CaseDiscussionTabReducer.js +1 -1
  76. package/lib/esm/reducers/CaseHelpers.d.ts +8 -6
  77. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  78. package/lib/esm/reducers/CaseHelpers.js +20 -10
  79. package/lib/esm/reducers/CaseReducer.d.ts +1 -0
  80. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  81. package/lib/esm/reducers/CaseReducer.js +37 -2
  82. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  83. package/lib/esm/reducers/RouteConstNTypes.js +1 -0
  84. package/lib/esm/scss/_pf-overrides.scss +23 -2
  85. package/package.json +7 -9
  86. package/lib/esm/components/Suggestions/TopContentSidebar.d.ts +0 -3
  87. package/lib/esm/components/Suggestions/TopContentSidebar.d.ts.map +0 -1
  88. package/lib/esm/components/Suggestions/TopContentSidebar.js +0 -26
  89. package/lib/esm/hooks/useAB.d.ts +0 -22
  90. package/lib/esm/hooks/useAB.d.ts.map +0 -1
  91. package/lib/esm/hooks/useAB.js +0 -37
@@ -22,10 +22,9 @@ import { Env } from '@cee-eng/hydrajs';
22
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
- import isEmpty from 'lodash/isEmpty';
26
25
  import isEqual from 'lodash/isEqual';
27
26
  import trim from 'lodash/trim';
28
- import React, { Suspense, useCallback, useContext, useEffect, useRef, useState } from 'react';
27
+ import React, { Suspense, useContext, useEffect, useRef, useState } from 'react';
29
28
  import { useTranslation } from 'react-i18next';
30
29
  import { Route } from 'react-router-dom';
31
30
  import { useAIResponseState } from '../../context/AIResponseContext';
@@ -33,7 +32,6 @@ import { useCaseSelector } from '../../context/CaseContext';
33
32
  import { RecommendationDispatchContext } from '../../context/RecommendationContext';
34
33
  import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
35
34
  import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
36
- import { useAB } from '../../hooks/useAB';
37
35
  import { useARHResponse } from '../../hooks/useARHResponse';
38
36
  import { useWizard } from '../../hooks/useWizard';
39
37
  import { appSourceId_ARH, excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
@@ -90,8 +88,7 @@ export const generateAIQuestion = (activeSection, product, version, summary, iss
90
88
  return `${prefix} ${baseMessageMap[lang] || baseMessageMap.en}`;
91
89
  };
92
90
  function WizardMain(props) {
93
- var _a, _b, _c, _d;
94
- const { isVariationA } = useAB();
91
+ var _a, _b, _c;
95
92
  const [showRestFlag, setShowRestFlag] = useState(false);
96
93
  const [aiServicesAvailable, setAIServicesAvailable] = useState(false); // default to false until services are confirmed available
97
94
  const recommendationDispatch = useContext(RecommendationDispatchContext);
@@ -104,6 +101,24 @@ function WizardMain(props) {
104
101
  }), isEqual);
105
102
  const { routeState: { isCaseCreate, activeSection }, } = useContext(RouteContext);
106
103
  const aiResponseState = useAIResponseState();
104
+ const config = {
105
+ appSourceId: appSourceId_ARH,
106
+ 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 : '',
107
+ packageVersion: (_c = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _c === void 0 ? void 0 : _c.packageVersion,
108
+ appEnv: Env.getEnvName(),
109
+ };
110
+ const { fetchARHResponse } = useARHResponse({
111
+ activeSection,
112
+ product: caseDetails.product,
113
+ version: caseDetails.version,
114
+ summary: caseDetails.summary,
115
+ issue: caseDetails.issue,
116
+ caseType: caseDetails.caseType,
117
+ config,
118
+ });
119
+ const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
120
+ const isResourcesSection = activeSection === AppRouteSections.RESOURCES;
121
+ const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
107
122
  const [userSeenRecommendations, setUserSeenRecommendations] = useState(false);
108
123
  const [userClickedNextonRecommendations, setUserClickedNextonRecommendations] = useState(false);
109
124
  const [userScrolledLabel, setUserScrolledLabel] = useState(false);
@@ -112,68 +127,17 @@ function WizardMain(props) {
112
127
  const isNextButtonClickedRef = useRef(false);
113
128
  const isBackButtonClickedRef = useRef(false);
114
129
  const resultsRowRef = useRef(null);
115
- const goToPrevStepRef = useRef(null);
116
- //to track the previous ARH fields
117
130
  const previousARHFieldsRef = useRef({
118
- product: '',
119
- version: '',
120
- summary: '',
121
- issue: '',
122
- caseType: '',
131
+ product: caseDetails.product,
132
+ version: caseDetails.version,
133
+ summary: caseDetails.summary,
134
+ issue: caseDetails.issue,
135
+ caseType: caseDetails.caseType,
123
136
  });
124
137
  const haveARHFieldsChangedRef = useRef(false);
125
138
  const handleChatWithAIClick = () => {
126
139
  props.setIsAIChatMode(true);
127
140
  };
128
- const handleOnBackForExpandedARH = (e) => {
129
- if (goToPrevStepRef.current) {
130
- isBackButtonClickedRef.current = true;
131
- goToPrevStepRef.current(e);
132
- focusWizardMainPanel();
133
- }
134
- };
135
- // Callback for TroubleshootSection to reset the flag on unmount
136
- const resetARHFieldsChanged = useCallback(() => {
137
- haveARHFieldsChangedRef.current = false;
138
- }, []);
139
- // Check if any of the ARH-related fields have changed
140
- useEffect(() => {
141
- var _a;
142
- const prev = previousARHFieldsRef.current;
143
- const curr = {
144
- product: caseDetails.product,
145
- version: caseDetails.version,
146
- summary: trim(caseDetails.summary),
147
- issue: trim(caseDetails.issue),
148
- caseType: caseDetails.caseType,
149
- };
150
- const hasChanged = prev.product !== curr.product ||
151
- prev.version !== curr.version ||
152
- prev.summary !== curr.summary ||
153
- prev.issue !== curr.issue ||
154
- prev.caseType !== curr.caseType;
155
- if (hasChanged) {
156
- const previousHadValues = !isEmpty(prev.product) || !isEmpty(prev.version) || !isEmpty(prev.summary) || !isEmpty(prev.issue);
157
- const hasExistingConversation = !isEmpty((_a = aiResponseState.aiResponse) === null || _a === void 0 ? void 0 : _a.conversationId);
158
- if (previousHadValues && hasExistingConversation) {
159
- haveARHFieldsChangedRef.current = true;
160
- }
161
- previousARHFieldsRef.current = {
162
- product: curr.product,
163
- version: curr.version,
164
- summary: curr.summary,
165
- issue: curr.issue,
166
- caseType: curr.caseType,
167
- };
168
- }
169
- }, [
170
- caseDetails.product,
171
- caseDetails.version,
172
- caseDetails.summary,
173
- caseDetails.issue,
174
- caseDetails.caseType,
175
- (_a = aiResponseState.aiResponse) === null || _a === void 0 ? void 0 : _a.conversationId,
176
- ]);
177
141
  const { getStepsSequece } = useWizard(props.routeProps, {
178
142
  userSeenRecommendationsfn: setUserSeenRecommendations,
179
143
  userSeenRecommendationsValue: userSeenRecommendations,
@@ -187,15 +151,47 @@ function WizardMain(props) {
187
151
  aiServicesAvailable: aiServicesAvailable,
188
152
  isSecureSupport: props.isSecureSupport,
189
153
  hasConfirmedStatesideSupport: props.hasConfirmedStatesideSupport,
190
- onBack: handleOnBackForExpandedARH,
191
- haveARHFieldsChanged: haveARHFieldsChangedRef.current,
192
- resetARHFieldsChanged,
193
154
  });
194
155
  const dispatchToRouteReducer = useContext(RouteDispatchContext);
195
156
  const { t } = useTranslation();
196
157
  useEffect(() => {
197
158
  setActiveSectionChanged(dispatchToRouteReducer, isCaseCreate ? AppRouteSections.GET_SUPPORT : AppRouteSections.TROUBLESHOOT, '');
198
159
  }, [isCaseCreate, dispatchToRouteReducer]);
160
+ const shouldEnableARHServices = () => {
161
+ // Check if the current section is relevant for AI services
162
+ const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
163
+ // Check if the case type is allowed (not in the excluded list)
164
+ const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseDetails.caseType || '');
165
+ // Check if user is not a secure support or confirmed stateside support user
166
+ const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
167
+ // Check if the ARH fields have changed
168
+ const isARHFieldsChanged = haveARHFieldsChangedRef.current;
169
+ // Check if user is external and has invalid entitlements
170
+ const isNotUnentitledExternalUser = !(props.isUserExternal && props.hasInvalidEntitlements);
171
+ return (isRelevantSection &&
172
+ isCaseTypeAllowed &&
173
+ isNotSecureOrStatesideUser &&
174
+ isARHFieldsChanged &&
175
+ isNotUnentitledExternalUser);
176
+ };
177
+ // Check if any of the ARH-related fields have changed
178
+ useEffect(() => {
179
+ const hasChanged = previousARHFieldsRef.current.product !== caseDetails.product ||
180
+ previousARHFieldsRef.current.version !== caseDetails.version ||
181
+ previousARHFieldsRef.current.summary !== trim(caseDetails.summary) ||
182
+ previousARHFieldsRef.current.issue !== trim(caseDetails.issue) ||
183
+ previousARHFieldsRef.current.caseType !== caseDetails.caseType;
184
+ if (hasChanged) {
185
+ previousARHFieldsRef.current = {
186
+ product: caseDetails.product,
187
+ version: caseDetails.version,
188
+ summary: caseDetails.summary,
189
+ issue: caseDetails.issue,
190
+ caseType: caseDetails.caseType,
191
+ };
192
+ haveARHFieldsChangedRef.current = true;
193
+ }
194
+ }, [caseDetails.product, caseDetails.version, caseDetails.summary, caseDetails.issue, caseDetails.caseType]);
199
195
  useEffect(() => {
200
196
  if (!activeSection) {
201
197
  return;
@@ -251,10 +247,10 @@ function WizardMain(props) {
251
247
  RouteUtils.navigateToSection(props.routeProps, `${props.routeProps.location.pathname}/${step.id}`, false);
252
248
  };
253
249
  const onBack = (step, prevStep) => {
254
- // isLoadingRecommendations needs to be set to false when going back TO the summary step
255
- // because it can cause the next button to be permanently disabled if the debounce is not called
250
+ // isLoadingRecommendations needs to be set to false on back when the previous step is the summary
251
+ // step because it can cause the next button to be permanently disabled if the debounce is not called
256
252
  // before going back a step. This can be caused if navigating quickly to then away from the recommendations page.
257
- if (step.id === AppRouteSections.SUMMARIZE) {
253
+ if (prevStep.id === AppRouteSections.SUMMARIZE) {
258
254
  recommendationDispatch({
259
255
  type: RecommendationsConstants.setIsLoadingRecommendations,
260
256
  payload: { isLoadingRecommendations: false },
@@ -268,47 +264,6 @@ function WizardMain(props) {
268
264
  props.submitCaseAndNavigate(false);
269
265
  return;
270
266
  };
271
- const config = {
272
- appSourceId: appSourceId_ARH,
273
- authToken: (_c = (_b = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _b === void 0 ? void 0 : _b.getEncodedToken()) !== null && _c !== void 0 ? _c : '',
274
- packageVersion: (_d = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _d === void 0 ? void 0 : _d.packageVersion,
275
- appEnv: Env.getEnvName(),
276
- };
277
- const { fetchARHResponse } = useARHResponse({
278
- activeSection,
279
- product: caseDetails.product,
280
- version: caseDetails.version,
281
- summary: caseDetails.summary,
282
- issue: caseDetails.issue,
283
- caseType: caseDetails.caseType,
284
- config,
285
- });
286
- const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
287
- const isResourcesSection = activeSection === AppRouteSections.RESOURCES;
288
- const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
289
- const shouldEnableARHServices = () => {
290
- // Check if the current section is relevant for AI services
291
- const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
292
- // Check if the case type is allowed (not in the excluded list)
293
- const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseDetails.caseType || '');
294
- // Check if user is not a secure support or confirmed stateside support user
295
- const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
296
- // Check if the ARH fields have changed
297
- const isARHFieldsChanged = haveARHFieldsChangedRef.current;
298
- // Check if user is external and has invalid entitlements
299
- const isNotUnentitledExternalUser = !(props.isUserExternal && props.hasInvalidEntitlements);
300
- // For variation B, check if we have valid fields to make the API call (even if fields haven't changed)
301
- const hasValidFieldsForVariationB = !isVariationA &&
302
- !isEmpty(caseDetails.product) &&
303
- !isEmpty(caseDetails.version) &&
304
- !isEmpty(trim(caseDetails.summary)) &&
305
- !isEmpty(trim(caseDetails.issue));
306
- return (isRelevantSection &&
307
- isCaseTypeAllowed &&
308
- isNotSecureOrStatesideUser &&
309
- (isARHFieldsChanged || hasValidFieldsForVariationB) &&
310
- isNotUnentitledExternalUser);
311
- };
312
267
  const onCurrentStepChanged = (event, currentStep, prevStep, scope) => {
313
268
  if (isNextButtonClickedRef.current) {
314
269
  onNext(currentStep);
@@ -337,7 +292,6 @@ function WizardMain(props) {
337
292
  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) }));
338
293
  })));
339
294
  const CustomFooter = (activeStep, goToNextStep, goToPrevStep) => {
340
- goToPrevStepRef.current = goToPrevStep;
341
295
  useEffect(() => {
342
296
  if (steps.length > 2 && (activeStep === null || activeStep === void 0 ? void 0 : activeStep.index) === 2 && isNextButtonClicked) {
343
297
  goToNextStep({});
@@ -351,7 +305,7 @@ function WizardMain(props) {
351
305
  goToNextStep({});
352
306
  focusWizardMainPanel();
353
307
  // Fetch ARH response if conditions are met
354
- if (shouldEnableARHServices() && aiServicesAvailable && !isVariationA) {
308
+ if (shouldEnableARHServices() && aiServicesAvailable) {
355
309
  yield fetchARHResponse();
356
310
  haveARHFieldsChangedRef.current = false;
357
311
  }
@@ -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;AAUvD,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,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Empty';
17
17
  import isEqual from 'lodash/isEqual';
18
18
  import React, { useContext, useEffect, useRef, useState } from 'react';
19
19
  import { Trans, useTranslation } from 'react-i18next';
20
- import { useAIResponseState } from '../../context/AIResponseContext';
21
20
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
22
21
  import { RecommendationStateContext } from '../../context/RecommendationContext';
23
22
  import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
24
23
  import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
25
- import { useAB } from '../../hooks/useAB';
26
24
  import { excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
27
25
  import { setCaseState } from '../../reducers/CaseReducer';
28
26
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
@@ -34,21 +32,22 @@ const defaultProps = {};
34
32
  function WizardNavigation(props) {
35
33
  var _a, _b;
36
34
  const { t } = useTranslation();
37
- const { isVariationA } = useAB();
38
35
  const canCreateCase = useCanCreateCase();
39
36
  const { recommendationState } = useContext(RecommendationStateContext);
40
- const aiResponseState = useAIResponseState();
41
37
  const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent, isCaseCreate, }, } = useContext(RouteContext);
42
38
  const { globalMetadataState: { loggedInUsersAccount, allProducts, navBarRef }, } = useContext(GlobalMetadataStateContext);
43
- const { caseState, issue, summary, product, version, caseType } = useCaseSelector((state) => ({
39
+ const { caseState, ABTestVariation, issue, summary, product, version, caseType, manageSupportCases } = useCaseSelector((state) => ({
44
40
  caseState: state,
45
41
  issue: state.caseDetails.issue,
46
42
  summary: state.caseDetails.summary,
43
+ ABTestVariation: state.ABTestVariation,
47
44
  product: state.caseDetails.product,
48
45
  version: state.caseDetails.version,
49
46
  caseType: state.caseDetails.caseType,
50
47
  manageSupportCases: state.selectedOwner.data.manageSupportCases,
51
48
  }), isEqual);
49
+ const isATestvariation = ABTestVariation === 'A';
50
+ const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
52
51
  // To check if the user is entitled or not
53
52
  const isEntitledProduct = (_b = find((_a = allProducts === null || allProducts === void 0 ? void 0 : allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, (p) => p.product === caseState.caseDetails.product)) === null || _b === void 0 ? void 0 : _b.isEntitledProduct;
54
53
  const dispatchToRouteReducer = useContext(RouteDispatchContext);
@@ -79,37 +78,18 @@ function WizardNavigation(props) {
79
78
  behavior: 'instant',
80
79
  });
81
80
  }
82
- // Reset scroll state when navigating based on isVariationA
83
- const resetScrollSection = isVariationA
84
- ? AppRouteSections.RESOURCES
85
- : isCaseCreate
86
- ? AppRouteSections.SUMMARIZE
87
- : AppRouteSections.TROUBLESHOOT;
88
- if (props.activeStep.id === resetScrollSection) {
89
- setHasUserScrolled(false);
90
- }
91
81
  // eslint-disable-next-line react-hooks/exhaustive-deps
92
82
  }, [previousStep === null || previousStep === void 0 ? void 0 : previousStep.id, props.activeStep.id]);
93
83
  const [hasUserScrolled, setHasUserScrolled] = useState(false);
94
- const [shouldOpenChatbot, setShouldOpenChatbot] = useState(false);
95
84
  useEffect(() => {
96
- var _a, _b;
85
+ var _a;
97
86
  if (activeSection !== AppRouteSections.RESOURCES && props.isAIChatMode) {
98
87
  (_a = props.setIsAIChatMode) === null || _a === void 0 ? void 0 : _a.call(props, false);
99
88
  }
100
- if (activeSection === AppRouteSections.RESOURCES && shouldOpenChatbot) {
101
- (_b = props.setIsAIChatMode) === null || _b === void 0 ? void 0 : _b.call(props, true);
102
- setShouldOpenChatbot(false);
103
- }
104
89
  // eslint-disable-next-line react-hooks/exhaustive-deps
105
- }, [activeSection, shouldOpenChatbot]);
90
+ }, [activeSection]);
106
91
  useEffect(() => {
107
- const validSteps = isVariationA
108
- ? [AppRouteSections.RESOURCES]
109
- : isCaseCreate
110
- ? [AppRouteSections.SUMMARIZE]
111
- : [AppRouteSections.TROUBLESHOOT];
112
- if (!validSteps.includes(props.activeStep.id)) {
92
+ if (props.activeStep.id !== (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) {
113
93
  return;
114
94
  }
115
95
  const observer = new IntersectionObserver(([entry]) => {
@@ -167,21 +147,13 @@ function WizardNavigation(props) {
167
147
  observer.unobserve(resultsRowElement);
168
148
  }
169
149
  };
170
- }, [recommendationState.numFound, hasUserScrolled, props, isCaseCreate, isVariationA]);
150
+ }, [recommendationState.numFound, hasUserScrolled, props, isCaseCreate]);
171
151
  const onNext = (e) => {
172
152
  var _a;
173
153
  updateisNextBtnClickedToShowValidationError(dispatchToRouteReducer, true);
174
- if (isVariationA &&
175
- activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) {
176
- setShouldOpenChatbot(true);
177
- }
178
- // Handle scroll behavior based on isVariationA
179
- const scrollSection = isVariationA
180
- ? AppRouteSections.RESOURCES
181
- : isCaseCreate
182
- ? AppRouteSections.SUMMARIZE
183
- : AppRouteSections.TROUBLESHOOT;
184
- if (props.activeStep.id === scrollSection && recommendationState.numFound > 2) {
154
+ //handle the new changes for 13406:
155
+ if (props.activeStep.id === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) &&
156
+ recommendationState.numFound > 2) {
185
157
  if (!hasUserScrolled) {
186
158
  scrollIntoView(props.resultsRowRef, {
187
159
  navBarRef,
@@ -251,38 +223,60 @@ function WizardNavigation(props) {
251
223
  const isLoadingARH = props.isLoadingARH &&
252
224
  props.activeStep.id === AppRouteSections.RESOURCES &&
253
225
  !excludedCaseTypesforARH.includes(caseType || '');
254
- const shouldCheckRecommendationsLoading = !isVariationA && recommendationState.isLoadingRecommendations;
255
- let value = isLoadingARH ||
256
- ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
257
- props.activeStep.id === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
258
- (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
259
- props.activeStep.nextButtonLabel === 'Troubleshoot' ||
260
- (isSectionValidFn && !isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
261
- noValidEntitlement ||
262
- shouldCheckRecommendationsLoading;
263
- return value;
226
+ if (isBTestvariation) {
227
+ let value = isLoadingARH ||
228
+ ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
229
+ props.activeStep.id ===
230
+ (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
231
+ (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
232
+ props.activeStep.nextButtonLabel === 'Troubleshoot' ||
233
+ (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
234
+ (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
235
+ (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
236
+ recommendationState.isLoadingRecommendations;
237
+ return value;
238
+ }
239
+ else if (isATestvariation) {
240
+ let value = isLoadingARH ||
241
+ ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
242
+ props.activeStep.id ===
243
+ (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
244
+ (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
245
+ props.activeStep.nextButtonLabel === 'Troubleshoot' ||
246
+ (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
247
+ (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
248
+ (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
249
+ recommendationState.isLoadingRecommendations;
250
+ return value;
251
+ }
252
+ else if (isATestvariation && !isCaseCreate) {
253
+ let value = isLoadingARH ||
254
+ isEmpty(summary) ||
255
+ isEmpty(issue) ||
256
+ (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
257
+ (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
258
+ (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
259
+ (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
260
+ recommendationState.isLoadingRecommendations;
261
+ return value;
262
+ }
264
263
  };
265
264
  const isDisabledGoBack = () => {
266
- if (props.activeStep.id === 'get-support') {
265
+ if (isBTestvariation || isEmpty(ABTestVariation))
266
+ return false;
267
+ if (isATestvariation && props.activeStep.id === 'get-support') {
267
268
  return isEmpty(product) || isEmpty(version);
268
269
  }
269
- return false;
270
270
  };
271
- const shouldShowNewARHFlowFooterButtons = isVariationA && props.isAIChatMode && activeSection === AppRouteSections.RESOURCES;
272
- const shouldShowBackToAIButton = isVariationA && !props.isAIChatMode && activeSection === AppRouteSections.RESOURCES;
273
271
  // To handle entitled products
274
272
  return (React.createElement(React.Fragment, null,
275
273
  React.createElement(WizardFooterWrapper, null,
276
- shouldShowNewARHFlowFooterButtons ? (React.createElement(React.Fragment, null,
277
- 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" }, t('Go back'))),
278
- React.createElement("button", { onClick: () => { var _a; return (_a = props.setIsAIChatMode) === null || _a === void 0 ? void 0 : _a.call(props, false); }, className: "btn btn-app btn-primary main-nav-button", type: "button", disabled: !aiResponseState.hasChunkReceived }, t('See more resources')))) : props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (isCaseCreate ? (React.createElement("span", null,
274
+ props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (isCaseCreate ? (React.createElement("span", null,
279
275
  React.createElement(Trans, { i18nKey: "<span>Return to</span> <button>case creation</button>", components: {
280
276
  span: React.createElement("span", { className: "return-to-case-text" }),
281
277
  button: (React.createElement(Button, { className: "return-to-case-btn", variant: "link", component: "a", onClick: props.onReturnToCaseCreation })),
282
278
  } }))) : (React.createElement(Button, { onClick: props.onReturnToCaseCreation, variant: "link", className: "return-to-resources-btn" }, t('Back to resources')))) : (React.createElement(React.Fragment, null,
283
- props.activeStep.order !== 0 && (React.createElement("button", { onClick: shouldShowBackToAIButton
284
- ? () => { var _a; return (_a = props.setIsAIChatMode) === null || _a === void 0 ? void 0 : _a.call(props, true); }
285
- : () => onBack({}), className: "btn btn-app btn-open-white main-nav-button", "data-tracking-id": `prev-of-${activeSection}`, type: "button", disabled: !shouldShowBackToAIButton && isDisabledGoBack() }, shouldShowBackToAIButton ? t('Back to AI') : t('Go back'))),
279
+ 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'))),
286
280
  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)),
287
281
  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'))))),
288
282
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
@@ -331,7 +331,7 @@
331
331
  }
332
332
 
333
333
  .pf-chatbot--fullscreen .pf-chatbot-container {
334
- height: calc(100vh - 277px) !important;
334
+ height: calc(100vh - 255px) !important;
335
335
  }
336
336
 
337
337
  .fullscreen-chat-footer {
@@ -339,7 +339,7 @@
339
339
  bottom: 0 !important;
340
340
  left: 0 !important;
341
341
  right: 0 !important;
342
- height: 57px !important;
342
+ height: 42px !important;
343
343
  background: #f6f6f6 !important;
344
344
  border-top: 1px solid #d1d1d1 !important;
345
345
  align-items: center !important;
@@ -354,13 +354,6 @@ body:has(.pf-chatbot--fullscreen) .pf-v6-c-wizard__footer {
354
354
 
355
355
  body:has(.pf-chatbot--fullscreen) .fullscreen-chat-footer {
356
356
  display: flex !important;
357
- gap: 10px;
358
- }
359
-
360
- .fullscreen-chat-footer .btn.btn-app {
361
- padding: 0.375rem 1rem;
362
- border-radius: var(--global-border-radius-pill, 999px);
363
- border: var(--global-border-width-regular, 1px) solid var(--global-border-color-brand-default, #06c);
364
357
  }
365
358
 
366
359
  body:has(.pf-chatbot--fullscreen) .main-section {
@@ -449,7 +449,7 @@ input[type='checkbox'] {
449
449
  .comment-plaintext.reset-pre-text {
450
450
  font-family: 'Red Hat Display', 'RedHatDisplay', 'Helvetica Neue', 'Arial', 'sans-serif';
451
451
  text-rendering: auto;
452
- font-weight: 500;
452
+ font-weight: 300;
453
453
  font-size: 1.12rem;
454
454
  line-height: 1.5em;
455
455
  }
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  interface IProps {
3
2
  userSeenRecommendationsfn?: any;
4
3
  userSeenRecommendationsValue: boolean;
@@ -12,9 +11,6 @@ interface IProps {
12
11
  aiServicesAvailable: boolean;
13
12
  isSecureSupport?: boolean;
14
13
  hasConfirmedStatesideSupport?: boolean;
15
- onBack?: (e: React.MouseEvent<HTMLButtonElement>) => void;
16
- haveARHFieldsChanged?: boolean;
17
- resetARHFieldsChanged?: () => void;
18
14
  }
19
15
  export declare function useWizard(routeProps: any, props?: IProps): {
20
16
  getStepsSequece: (showRest?: boolean) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA4BpD,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,GAAG,CAAC;IAChC,4BAA4B,EAAE,OAAO,CAAC;IACtC,6BAA6B,EAAE,OAAO,CAAC;IACvC,qCAAqC,EAAE,OAAO,CA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O;EAwC7C"}
@@ -20,9 +20,7 @@ import { RouteContext } from '../context/RouteContext';
20
20
  import { TCStateContext } from '../context/TopContentContext';
21
21
  import { AppRouteSections, openCaseNonTechnicalSequence, openCaseRouteSectionSequence, searchIntentRouteSectionSequence, troubleshootNonTechnicalSequence, troubleshootRouteSectionsSequence, } from '../reducers/RouteConstNTypes';
22
22
  import RouteUtils from '../utils/routeUtils';
23
- import { useAB } from './useAB';
24
23
  export function useWizard(routeProps, props) {
25
- const { isVariationA } = useAB();
26
24
  const { routeState: { activeSection, isSearchIntent, isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
27
25
  // state value was available later - reading dirctly from url
28
26
  const isCaseCreate = RouteUtils.getQueryParams(routeProps).caseCreate === 'true';
@@ -71,29 +69,17 @@ export function useWizard(routeProps, props) {
71
69
  alertMessage(),
72
70
  !props.isSecureSupport && !props.hasConfirmedStatesideSupport && aiInformationAlert(),
73
71
  React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef, isOnGetSupportPage: false, caseCreateExperience: isCaseCreate })))), canJumpTo: isSectionValidFn(isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) ||
74
- activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT), nextButtonLabel: isVariationA
72
+ activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT), nextButtonLabel: ((summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
73
+ !isEmpty(issue)) ||
74
+ numFound === 0 // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
75
75
  ? t('Continue')
76
- : ((summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
77
- !isEmpty(issue)) ||
78
- numFound === 0
79
- ? t('Continue')
80
- : t('See more options') }),
76
+ : t('See more options') }),
81
77
  [AppRouteSections.RESOURCES]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.RESOURCES, name: isCaseCreate ? t('Resources') : t('Resources'), component: (React.createElement(MainSection, { stepNumber: 3, totalSteps: 6, section: AppRouteSections.RESOURCES, title: t('Recommendations') },
82
78
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
83
79
  alertMessage(),
84
- React.createElement(TroubleshootSection, { isAIChatMode: props.isAIChatMode, setIsAIChatMode: props.setIsAIChatMode, onChatWithAIClick: props.onChatWithAIClick, aiServicesAvailable: props.aiServicesAvailable, isSecureSupport: props.isSecureSupport, hasConfirmedStatesideSupport: props.hasConfirmedStatesideSupport, onBack: props.onBack, routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef, haveARHFieldsChanged: props.haveARHFieldsChanged, resetARHFieldsChanged: props.resetARHFieldsChanged })))), canJumpTo: isSectionValidFn(AppRouteSections.RESOURCES || activeSection === AppRouteSections.RESOURCES) &&
80
+ React.createElement(TroubleshootSection, { isAIChatMode: props.isAIChatMode, setIsAIChatMode: props.setIsAIChatMode, onChatWithAIClick: props.onChatWithAIClick, aiServicesAvailable: props.aiServicesAvailable, isSecureSupport: props.isSecureSupport, hasConfirmedStatesideSupport: props.hasConfirmedStatesideSupport })))), canJumpTo: isSectionValidFn(AppRouteSections.RESOURCES || activeSection === AppRouteSections.RESOURCES) &&
85
81
  (props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) &&
86
- (props === null || props === void 0 ? void 0 : props.userCanNavigateToTroubleshoot), nextButtonLabel: isVariationA
87
- ? ((summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
88
- !isEmpty(issue)) ||
89
- numFound === 0
90
- ? t('Continue')
91
- : isCaseCreate
92
- ? t('See more options')
93
- : t('Convert to case')
94
- : isCaseCreate
95
- ? t('Continue')
96
- : t('Convert to case') }),
82
+ (props === null || props === void 0 ? void 0 : props.userCanNavigateToTroubleshoot), nextButtonLabel: isCaseCreate ? t('Continue') : t('Convert to case') }),
97
83
  [AppRouteSections.ADDITIONAL_INFORMATION]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.ADDITIONAL_INFORMATION, name: t('Additional information'), component: (React.createElement(MainSection, { stepNumber: 4, totalSteps: 6, section: AppRouteSections.ADDITIONAL_INFORMATION, title: React.createElement(React.Fragment, null,
98
84
  t('Case information'),
99
85
  isEmpty(RouteUtils.seBasePath) && isSelectedAccounntSecureSupport && (React.createElement("span", { className: "secured-support" },
@@ -13,7 +13,6 @@ export interface IAIResponseState {
13
13
  submittedFeedbackTypes: string[];
14
14
  isRateLimited?: boolean;
15
15
  quotaLimit?: number;
16
- hasChunkReceived?: boolean;
17
16
  }
18
17
  export declare const initialAIResponseState: IAIResponseState;
19
18
  export declare enum AIResponseConstants {
@@ -24,9 +23,7 @@ export declare enum AIResponseConstants {
24
23
  streamingError = "streamingError",
25
24
  addSubmittedFeedbackType = "addSubmittedFeedbackType",
26
25
  clearSubmittedFeedbackTypes = "clearSubmittedFeedbackTypes",
27
- updateQuotaLimit = "updateQuotaLimit",
28
- updateConversationId = "updateConversationId",
29
- setHasChunkReceived = "setHasChunkReceived"
26
+ updateQuotaLimit = "updateQuotaLimit"
30
27
  }
31
28
  export interface IClearAIResponseAction extends IActionType {
32
29
  type: AIResponseConstants.clearAIResponse;
@@ -69,17 +66,5 @@ export interface IUpdateQuotaLimitAction extends IActionType {
69
66
  quotaLimit: number;
70
67
  };
71
68
  }
72
- export interface IUpdateConversationIdAction extends IActionType {
73
- type: AIResponseConstants.updateConversationId;
74
- payload: {
75
- conversationId: string;
76
- };
77
- }
78
- export interface ISetHasChunkReceivedAction extends IActionType {
79
- type: AIResponseConstants.setHasChunkReceived;
80
- payload: {
81
- hasChunkReceived: boolean;
82
- };
83
- }
84
- export type IAIResponseActionType = IClearAIResponseAction | IStreamingStartedAction | IStreamingChunkReceivedAction | IStreamingCompletedAction | IStreamingErrorAction | IAddSubmittedFeedbackTypeAction | IClearSubmittedFeedbackTypesAction | IUpdateQuotaLimitAction | IUpdateConversationIdAction | ISetHasChunkReceivedAction;
69
+ export type IAIResponseActionType = IClearAIResponseAction | IStreamingStartedAction | IStreamingChunkReceivedAction | IStreamingCompletedAction | IStreamingErrorAction | IAddSubmittedFeedbackTypeAction | IClearSubmittedFeedbackTypesAction | IUpdateQuotaLimitAction;
85
70
  //# sourceMappingURL=AIResponseConstNTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AIResponseConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/AIResponseConstNTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,GAAG,CAAC;CACjB;AAGD,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACzC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAGD,eAAO,MAAM,sBAAsB,EAAE,gBAWpC,CAAC;AAGF,oBAAY,mBAAmB;IAC3B,eAAe,oBAAoB;IACnC,gBAA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C,OAAO,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;CACL;AAED,MAAM,MAAM,qBAAqB,GAC3B,sBAAsB,GACtB,uBAAuB,GACvB,6BAA6B,GAC7B,yBAAyB,GACzB,qBAAqB,GACrB,+BAA+B,GAC/B,kCAAkC,GAClC,uBAAuB,CAAC"}
@@ -9,7 +9,6 @@ export const initialAIResponseState = {
9
9
  submittedFeedbackTypes: [],
10
10
  isRateLimited: false,
11
11
  quotaLimit: undefined,
12
- hasChunkReceived: false,
13
12
  };
14
13
  // Action Constants
15
14
  export var AIResponseConstants;
@@ -22,6 +21,4 @@ export var AIResponseConstants;
22
21
  AIResponseConstants["addSubmittedFeedbackType"] = "addSubmittedFeedbackType";
23
22
  AIResponseConstants["clearSubmittedFeedbackTypes"] = "clearSubmittedFeedbackTypes";
24
23
  AIResponseConstants["updateQuotaLimit"] = "updateQuotaLimit";
25
- AIResponseConstants["updateConversationId"] = "updateConversationId";
26
- AIResponseConstants["setHasChunkReceived"] = "setHasChunkReceived";
27
24
  })(AIResponseConstants || (AIResponseConstants = {}));