@rh-support/troubleshoot 2.2.95 → 2.2.97

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.
@@ -280,7 +280,7 @@ export default function UpdateSeverityModal(props) {
280
280
  setUpdatedCaseDetails((pre) => (Object.assign(Object.assign({}, pre), { severity: option.value.name, fts: true })));
281
281
  }
282
282
  else {
283
- setUpdatedCaseDetails({ severity: option.value.name });
283
+ setUpdatedCaseDetails({ severity: option.value.name, fts: isSev1(option.value.name) });
284
284
  }
285
285
  setCurrentSeverity(option.value.name);
286
286
  updateState(option.value.name);
@@ -8,6 +8,8 @@ interface IProps {
8
8
  description?: string | JSX.Element | JSX.Element[];
9
9
  descriptionClassName?: string;
10
10
  className?: string;
11
+ stepNumber?: number;
12
+ totalSteps?: number;
11
13
  }
12
14
  declare const MainSection: {
13
15
  (props: any): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"MainSection.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/MainSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,UAAU,MAAM;IACZ,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5C,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD,QAAA,MAAM,WAAW;;;CA8BhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"MainSection.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/MainSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,UAAU,MAAM;IACZ,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5C,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD,QAAA,MAAM,WAAW;;;CAwChB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -5,11 +5,12 @@ const defaultProps = {
5
5
  };
6
6
  const MainSection = (props) => {
7
7
  return (React.createElement(ErrorBoundary, { isPageLevelError: true },
8
- React.createElement("section", { id: `${props.section}-section`, tabIndex: -1, "aria-labelledby": `${props.section}-heading`, "aria-describedby": `${props.section}-description`, className: `${props.className ? props.className : ''}` },
8
+ React.createElement("section", { id: `${props.section}-section`, tabIndex: -1, "aria-labelledby": `${props.section}-heading`, "aria-describedby": `${props.section}-description`, className: `main-step-content ${props.className ? props.className : ''}` },
9
9
  React.createElement(LoadingIndicator, { show: props.isLoading, size: "lg" }),
10
10
  !props.isLoading && (React.createElement(React.Fragment, null,
11
11
  React.createElement("header", { className: "pf-v5-u-display-none-on-sm" },
12
- props.title && React.createElement("h2", { id: `${props.section}-heading` }, props.title),
12
+ props.title && (React.createElement("h2", { "aria-label": props.stepNumber &&
13
+ `Step ${props.stepNumber} of ${props.totalSteps}: ${props.section}`, id: `${props.section}-heading` }, props.title)),
13
14
  props.description && (React.createElement("p", { id: `${props.section}-description`, className: `${props.descriptionClassName ? props.descriptionClassName : ''}` }, props.description))),
14
15
  props.children)))));
15
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,2BAA2B,EAAE,OAAO,EAAE,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;CAClH;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAmGhC;AACD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,2BAA2B,EAAE,OAAO,EAAE,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;CAClH;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBA+GhC;AACD,eAAe,UAAU,CAAC"}
@@ -24,6 +24,12 @@ function WizardMain(props) {
24
24
  const renderSubmitCasePage = () => (React.createElement(MainSection, { section: AppRouteSections.SUBMIT_CASE, title: t('Case has been submitted'), isLoading: isCreatingCase, description: t("We'll be in contact with you shortly. Look for updates on this case."), className: "case-submit-page" },
25
25
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
26
26
  React.createElement(SubmitCase, { routeProps: props.routeProps }))));
27
+ const focusWizardMainPanel = () => {
28
+ setTimeout(() => {
29
+ var _a;
30
+ (_a = document.querySelector('.main-step-content')) === null || _a === void 0 ? void 0 : _a.focus();
31
+ }, 250);
32
+ };
27
33
  const onNext = (step) => {
28
34
  RouteUtils.navigateToSection(props.routeProps, `${props.routeProps.location.pathname}/${step.id}`, false);
29
35
  };
@@ -42,7 +48,13 @@ function WizardMain(props) {
42
48
  };
43
49
  const CustomFooter = (React.createElement(WizardFooter, null,
44
50
  React.createElement(WizardContextConsumer, null, ({ activeStep, onNext, onBack }) => {
45
- return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: onNext, onBack: onBack, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag) }));
51
+ return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: () => {
52
+ onNext();
53
+ focusWizardMainPanel();
54
+ }, onBack: () => {
55
+ onBack();
56
+ focusWizardMainPanel();
57
+ }, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag) }));
46
58
  })));
47
59
  // To add a new step to wizard first need to add the component to appRouteConfugurations
48
60
  // in useWizard file then add it to step squences in RouteConstNTypes
@@ -1 +1 @@
1
- {"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AA+BA,wBAAgB,SAAS,CAAC,UAAU,KAAA;iCAyNG,OAAO;EAwC7C"}
1
+ {"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AA+BA,wBAAgB,SAAS,CAAC,UAAU,KAAA;iCAsPG,OAAO;EAwC7C"}
@@ -38,44 +38,53 @@ export function useWizard(routeProps) {
38
38
  enableNext: false,
39
39
  nextButtonLabel: 'Continue',
40
40
  };
41
+ const focusWizardMainPanel = () => {
42
+ setTimeout(() => {
43
+ var _a;
44
+ (_a = document.querySelector('.main-step-content')) === null || _a === void 0 ? void 0 : _a.focus();
45
+ }, 250);
46
+ };
41
47
  const alertMessage = () => {
42
48
  // alert title and variant based on multiple conditions for two different sections
43
49
  const isLoading = topContent.isFetching || (isLoadingRecommendations && summary);
44
50
  const title = isLoading
45
51
  ? t('Please wait while recommendations are loading')
46
52
  : t('Please address the errors to proceed');
53
+ if (isNextBtnClickedToShowValidationError) {
54
+ focusWizardMainPanel();
55
+ }
47
56
  return (React.createElement(AlertMessage, { show: isNextBtnClickedToShowValidationError && !isActiveSectionValid, variant: (isLoadingRecommendations && summary) || topContent.isFetching ? AlertType.INFO : AlertType.DANGER, isInline: true, title: title, className: "pf-v5-u-mb-lg", "data-tracking-id": isLoading ? 'wait-recommendations-loading' : 'proceed-address-errors' }));
48
57
  };
49
58
  // components that are used in wizard steps
50
59
  const appRouteConfugurations = {
51
- [AppRouteSections.GET_SUPPORT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.GET_SUPPORT, name: t('Get support'), component: (React.createElement(MainSection, { section: AppRouteSections.GET_SUPPORT, title: t('Why are you opening a case?'), description: t('Select the best category for your issue.') },
60
+ [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.') },
52
61
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
53
62
  alertMessage(),
54
63
  React.createElement(OpenCase, { routeProps: routeProps })))), canJumpTo: isSectionValidFn(AppRouteSections.GET_SUPPORT) || activeSection === AppRouteSections.GET_SUPPORT }),
55
- [AppRouteSections.SUMMARIZE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.SUMMARIZE, name: t('Summarize'), component: (React.createElement(MainSection, { section: AppRouteSections.SUMMARIZE, title: t('What are you having an issue with?') },
64
+ [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?') },
56
65
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
57
66
  alertMessage(),
58
67
  React.createElement(ProductSelector, { routeProps: routeProps })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel: t('See more options') }),
59
- [AppRouteSections.TROUBLESHOOT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.TROUBLESHOOT, name: t('Troubleshoot'), component: (React.createElement(MainSection, { section: AppRouteSections.TROUBLESHOOT, title: t('Recommendations') },
68
+ [AppRouteSections.TROUBLESHOOT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.TROUBLESHOOT, name: t('Troubleshoot'), component: (React.createElement(MainSection, { stepNumber: 3, totalSteps: 6, section: AppRouteSections.TROUBLESHOOT, title: t('Recommendations') },
60
69
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
61
70
  alertMessage(),
62
71
  React.createElement(TroubleshootSection, null)))), canJumpTo: isSectionValidFn(AppRouteSections.TROUBLESHOOT) || activeSection === AppRouteSections.TROUBLESHOOT, nextButtonLabel: isCaseCreate ? t('Continue') : t('Convert to Case') }),
63
- [AppRouteSections.DESCRIBE_MORE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_MORE, name: t('Describe more'), component: (React.createElement(MainSection, { section: AppRouteSections.DESCRIBE_MORE, title: React.createElement(React.Fragment, null,
72
+ [AppRouteSections.DESCRIBE_MORE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_MORE, name: t('Describe more'), component: (React.createElement(MainSection, { stepNumber: 4, totalSteps: 6, section: AppRouteSections.DESCRIBE_MORE, title: React.createElement(React.Fragment, null,
64
73
  t('Case information'),
65
74
  isEmpty(RouteUtils.seBasePath) && isSelectedAccounntSecureSupport && (React.createElement("span", { className: "secured-support" },
66
75
  React.createElement(Trans, null, "Secured Support")))), description: t('Provide the details of your issue.') },
67
76
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
68
77
  alertMessage(),
69
78
  React.createElement(CaseInformation, { routeProps: routeProps })))), canJumpTo: isSectionValidFn(AppRouteSections.DESCRIBE_MORE) || activeSection === AppRouteSections.DESCRIBE_MORE }),
70
- [AppRouteSections.DESCRIBE_IDEA]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_IDEA, name: t('Describe more'), component: (React.createElement(MainSection, { section: AppRouteSections.DESCRIBE_IDEA, title: t('Idea information'), description: t("We'll be in contact with you shortly. Look for updates on this case.") },
79
+ [AppRouteSections.DESCRIBE_IDEA]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_IDEA, name: t('Describe more'), component: (React.createElement(MainSection, { stepNumber: 4, totalSteps: 6, section: AppRouteSections.DESCRIBE_IDEA, title: t('Idea information'), description: t("We'll be in contact with you shortly. Look for updates on this case.") },
71
80
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
72
81
  alertMessage(),
73
82
  React.createElement(IdeaInformation, null)))), canJumpTo: isSectionValidFn(AppRouteSections.DESCRIBE_IDEA) || activeSection === AppRouteSections.DESCRIBE_IDEA, nextButtonLabel: 'Submit', disableOtherSections: false }),
74
- [AppRouteSections.MANAGEMENT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.MANAGEMENT, name: t('Management'), component: (React.createElement(MainSection, { section: AppRouteSections.MANAGEMENT, title: t('Case management'), descriptionClassName: "text-medium-grey" },
83
+ [AppRouteSections.MANAGEMENT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.MANAGEMENT, name: t('Management'), component: (React.createElement(MainSection, { stepNumber: 5, totalSteps: 6, section: AppRouteSections.MANAGEMENT, title: t('Case management'), descriptionClassName: "text-medium-grey" },
75
84
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
76
85
  alertMessage(),
77
86
  React.createElement(CaseManagement, null)))), canJumpTo: isSectionValidFn(AppRouteSections.MANAGEMENT) || activeSection === AppRouteSections.MANAGEMENT }),
78
- [AppRouteSections.REVIEW]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.REVIEW, name: t('Review'), component: (React.createElement(MainSection, { section: AppRouteSections.REVIEW, title: t('Preview case'), description: t('Before submitting, review the information you entered.') },
87
+ [AppRouteSections.REVIEW]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.REVIEW, name: t('Review'), component: (React.createElement(MainSection, { stepNumber: 6, totalSteps: 6, section: AppRouteSections.REVIEW, title: t('Preview case'), description: t('Before submitting, review the information you entered.') },
79
88
  React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
80
89
  alertMessage(),
81
90
  React.createElement(Review, { routeProps: routeProps })))), canJumpTo: isSectionValidFn(AppRouteSections.REVIEW) || activeSection === AppRouteSections.REVIEW, nextButtonLabel: t('Submit') }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.95",
3
+ "version": "2.2.97",
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": "9428a86e921565225fd6ab7ee4ad358e29de43b3"
134
+ "gitHead": "0fa0968e831c199572669184c466e9fecd781d12"
135
135
  }