@rh-support/troubleshoot 2.2.161-beta.4 → 2.2.161-beta.6

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.
@@ -108,7 +108,7 @@ export default function Recommendations(props) {
108
108
  useEffect(() => {
109
109
  props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations);
110
110
  // eslint-disable-next-line react-hooks/exhaustive-deps
111
- }, [recommendationState.isLoadingRecommendations]);
111
+ }, [recommendationState]);
112
112
  useEffect(() => {
113
113
  if (recommendationState.isLoadingRecommendations)
114
114
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQpF,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;CAC5E;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAkIhC;AACD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQpF,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;CAC5E;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAmIhC;AACD,eAAe,UAAU,CAAC"}
@@ -66,7 +66,7 @@ function WizardMain(props) {
66
66
  }, onBack: () => {
67
67
  onBack();
68
68
  focusWizardMainPanel();
69
- }, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel }));
69
+ }, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel }));
70
70
  })));
71
71
  // To add a new step to wizard first need to add the component to appRouteConfugurations
72
72
  // in useWizard file then add it to step squences in RouteConstNTypes
@@ -10,6 +10,7 @@ interface IProps {
10
10
  confirmSupportModal: (hasPreferredSecureSupportAccount: boolean) => void;
11
11
  onShowRestUpdate: (flag: boolean) => void;
12
12
  userSeenRecommendations?: boolean;
13
+ setUserSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
13
14
  userClickedNextonRecommendationsFn?: (value: React.SetStateAction<boolean>) => void;
14
15
  userClickedNextonRecommendationsValue?: boolean;
15
16
  resultsRowRef?: any;
@@ -1 +1 @@
1
- {"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAOnD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAK3G,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,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAqNtC;kBArNQ,gBAAgB;;;AAuNzB,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAOnD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAK3G,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,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA4NtC;kBA5NQ,gBAAgB;;;AA8NzB,eAAe,gBAAgB,CAAC"}
@@ -48,6 +48,13 @@ function WizardNavigation(props) {
48
48
  isFileRecommendationsTriggered: state.isFileRecommendationsTriggered,
49
49
  }), isEqual);
50
50
  const caseDispatch = useCaseDispatch();
51
+ useEffect(() => {
52
+ // we need this because when the user hits the troubleshoot tab, we only refresh the children but the state is managed in the parent
53
+ props.setUserSeenRecommendations(false);
54
+ props.userClickedNextonRecommendationsFn(false);
55
+ props.setUserScrolledLabel(false);
56
+ // eslint-disable-next-line react-hooks/exhaustive-deps
57
+ }, []);
51
58
  useEffect(() => {
52
59
  if (props.activeStep.id === AppRouteSections.TROUBLESHOOT) {
53
60
  window.scrollTo({
@@ -65,6 +72,7 @@ function WizardNavigation(props) {
65
72
  if (resultsRowElement && isElementInViewport(resultsRowElement)) {
66
73
  setHasUserScrolled(true);
67
74
  props.setUserScrolledLabel(true);
75
+ props.userClickedNextonRecommendationsFn && props.userClickedNextonRecommendationsFn(true);
68
76
  }
69
77
  }
70
78
  };
@@ -73,7 +81,7 @@ function WizardNavigation(props) {
73
81
  window.removeEventListener('scroll', handleScroll);
74
82
  };
75
83
  // eslint-disable-next-line react-hooks/exhaustive-deps
76
- }, [props.activeStep.id, recommendationState.numFound]);
84
+ }, [props.activeStep.id, recommendationState.numFound, caseState.caseDetails.issue]);
77
85
  const isElementInViewport = (el) => {
78
86
  if (!el)
79
87
  return false;
@@ -89,9 +97,7 @@ function WizardNavigation(props) {
89
97
  //handle the new changes for 13406:
90
98
  if (props.activeStep.id === AppRouteSections.SUMMARIZE && recommendationState.numFound > 2) {
91
99
  if (!props.userClickedNextonRecommendationsValue) {
92
- const resultsRowElement = props.resultsRowRef.current;
93
- const isResultsRowInViewport = isElementInViewport(resultsRowElement);
94
- if (!isResultsRowInViewport && !hasUserScrolled) {
100
+ if (!hasUserScrolled) {
95
101
  scrollIntoView(props.resultsRowRef, {
96
102
  navBarRef,
97
103
  timeout: 0,
@@ -61,7 +61,7 @@ export function useWizard(routeProps, props) {
61
61
  [AppRouteSections.SUMMARIZE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.SUMMARIZE, name: t('Summarize'), component: (React.createElement(MainSection, { stepNumber: 2, totalSteps: 6, section: AppRouteSections.SUMMARIZE, title: t('What are you having an issue with?') },
62
62
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
63
63
  alertMessage(),
64
- React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel: (summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 2)) &&
64
+ React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel: (summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
65
65
  !isEmpty(issue) // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
66
66
  ? t('Continue')
67
67
  : t('See more options') }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.161-beta.4",
3
+ "version": "2.2.161-beta.6",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -131,5 +131,5 @@
131
131
  "defaults and supports es6-module",
132
132
  "maintained node versions"
133
133
  ],
134
- "gitHead": "6b408e64401582f6345d14bf1bfe5d59b8bcff86"
134
+ "gitHead": "f0b76556801ad24b5e3c503804820ba87707088e"
135
135
  }