@rh-support/troubleshoot 2.6.252 → 2.6.258

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.
@@ -171,7 +171,7 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
171
171
  : (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content);
172
172
  const sources = React.useMemo(() => (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [], [aiResponse]);
173
173
  const sourcesCount = sources.length || 0;
174
- // Show loading only when streaming has started but no content received yet
174
+ // Show loading only when streaming has started but no content received yet.
175
175
  const isLoading = aiResponseState.isStreaming && aiResponseState.accumulatedResponse === '';
176
176
  const isStreaming = aiResponseState.isStreaming;
177
177
  const { parseMarkdown } = useParseRuleMarkdown();
@@ -354,7 +354,7 @@ function TroubleshootSection(props) {
354
354
  React.createElement("button", { onClick: props.onSeeMoreResources, className: "btn btn-app btn-primary main-nav-button", type: "button", disabled: isFunctionalCookieAccepted() &&
355
355
  props.aiServicesAvailable &&
356
356
  !aiResponseState.hasChunkReceived &&
357
- !aiResponseState.error }, t('See more resources')))) : isCaseCreate ? (React.createElement("span", null,
357
+ !aiResponseState.error }, isFunctionalCookieAccepted() ? t('See more resources') : t('Continue')))) : isCaseCreate ? (React.createElement("span", null,
358
358
  React.createElement(Trans, { i18nKey: "<span>Return to</span> <button>case creation</button>", components: {
359
359
  span: React.createElement("span", { className: "return-to-case-text" }),
360
360
  button: (React.createElement(Button, { className: "return-to-case-btn", variant: "link", component: "a", onClick: () => props.setIsAIChatMode(false) })),
@@ -286,7 +286,7 @@ function WizardNavigation(props) {
286
286
  React.createElement("button", { onClick: props.onSeeMoreResources, className: "btn btn-app btn-primary main-nav-button", type: "button", disabled: isFunctionalCookieAccepted() &&
287
287
  props.aiServicesAvailable &&
288
288
  !aiResponseState.hasChunkReceived &&
289
- !aiResponseState.error }, t('Continue')))) : props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (isCaseCreate ? (React.createElement("span", null,
289
+ !aiResponseState.error }, isFunctionalCookieAccepted() ? t('See more resources') : t('Continue')))) : props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (isCaseCreate ? (React.createElement("span", null,
290
290
  React.createElement(Trans, { i18nKey: "<span>Return to</span> <button>case creation</button>", components: {
291
291
  span: React.createElement("span", { className: "return-to-case-text" }),
292
292
  button: (React.createElement(Button, { className: "return-to-case-btn", variant: "link", component: "a", onClick: props.onReturnToCaseCreation })),
@@ -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,CAAC;IAC/C,aAAa,EAAE,GAAG,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,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;IACvC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC1D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2BAA2B,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9D,0BAA0B,CAAC,EAAE,KAAK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;IACvC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,wBAAgB,SAAS,CAAC,UAAU,KAAA,EAAE,KAAK,CAAC,EAAE,MAAM;iCAgUb,OAAO;EAwC7C"}
@@ -1,6 +1,6 @@
1
1
  import { Alert } from '@patternfly/react-core';
2
2
  import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
3
- import { PreviousCaseTypes } from '@rh-support/utils';
3
+ import { isFunctionalCookieAccepted, PreviousCaseTypes } from '@rh-support/utils';
4
4
  import isEmpty from 'lodash/isEmpty';
5
5
  import isEqual from 'lodash/isEqual';
6
6
  import React, { Suspense, useContext } from 'react';
@@ -57,6 +57,13 @@ export function useWizard(routeProps, props) {
57
57
  let summarizeNextButtonLabelLogic = () => {
58
58
  return props.userScrolledLabel;
59
59
  };
60
+ const getResourcesNextButtonLabel = () => {
61
+ const hasNoResults = numFound === 0 && isFunctionalCookieAccepted();
62
+ const hasUserInteracted = ((summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
63
+ !isEmpty(issue)) ||
64
+ hasNoResults;
65
+ return hasUserInteracted ? (isCaseCreate ? t('Continue') : t('Convert to case')) : t('See more options');
66
+ };
60
67
  // components that are used in wizard steps
61
68
  const appRouteConfugurations = {
62
69
  [AppRouteSections.GET_SUPPORT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.GET_SUPPORT, name: t('Get support'), component: (React.createElement(MainSection, { stepNumber: 1, totalSteps: 6, section: AppRouteSections.GET_SUPPORT, title: t('Why are you opening a case?'), description: t('Select the best category for your issue.') },
@@ -84,13 +91,7 @@ export function useWizard(routeProps, props) {
84
91
  React.createElement(TroubleshootSection, { isAIChatMode: props.isAIChatMode, setIsAIChatMode: props.setIsAIChatMode, onChatWithAIClick: props.onChatWithAIClick, aiServicesAvailable: props.aiServicesAvailable, isSecureSupport: props.isSecureSupport, hasConfirmedStatesideSupport: props.hasConfirmedStatesideSupport, onBack: props.onBack, onSeeMoreResources: props.onSeeMoreResources, routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef, haveARHFieldsChanged: props.haveARHFieldsChanged, haveARHFieldsChangedForBRef: props.haveARHFieldsChangedForBRef, haveNewARHFieldsChangedRef: props.haveNewARHFieldsChangedRef, resetARHFieldsChanged: props.resetARHFieldsChanged, resetARHFieldsChangedForB: props.resetARHFieldsChangedForB })))), canJumpTo: isSectionValidFn(AppRouteSections.RESOURCES || activeSection === AppRouteSections.RESOURCES) &&
85
92
  (props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) &&
86
93
  (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
- ? isCaseCreate
91
- ? t('Continue')
92
- : t('Convert to case')
93
- : t('See more options')
94
+ ? getResourcesNextButtonLabel()
94
95
  : isCaseCreate
95
96
  ? t('Continue')
96
97
  : t('Convert to case') }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.6.252",
3
+ "version": "2.6.258",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -129,5 +129,5 @@
129
129
  "defaults and supports es6-module",
130
130
  "maintained node versions"
131
131
  ],
132
- "gitHead": "5d4a3e312d21059bec48c39b35c637bd43989a06"
132
+ "gitHead": "412d1ff1f89542a109560c563c5f281ee51b88eb"
133
133
  }