@rh-support/troubleshoot 2.0.6 → 2.0.8

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 (107) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +44 -5
  3. package/lib/esm/components/AccountInfo/OwnerSelector.js +2 -2
  4. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +5 -3
  6. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseOverview/index.js +1 -1
  8. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +1 -1
  9. package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.js +6 -1
  11. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +1 -2
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +1 -1
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +1 -1
  15. package/lib/esm/components/CaseInformation/CaseGroup.js +2 -2
  16. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  17. package/lib/esm/components/CaseInformation/CaseInformation.js +1 -8
  18. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  19. package/lib/esm/components/CaseInformation/Description.js +4 -2
  20. package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
  21. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  22. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  23. package/lib/esm/components/CaseManagement/CaseManagement.js +2 -9
  24. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts +5 -1
  25. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  26. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -7
  27. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  28. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +4 -1
  29. package/lib/esm/components/IdeaInformation/IdeaInformtion.d.ts.map +1 -1
  30. package/lib/esm/components/IdeaInformation/IdeaInformtion.js +1 -8
  31. package/lib/esm/components/ImproveCase/KtQuestions.js +2 -2
  32. package/lib/esm/components/Issue/Issue.d.ts.map +1 -1
  33. package/lib/esm/components/Issue/Issue.js +1 -2
  34. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  35. package/lib/esm/components/OpenCase/OpenCase.js +2 -9
  36. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -2
  37. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  38. package/lib/esm/components/ProductSelector/AllProductsSelector.js +1 -1
  39. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -1
  40. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  41. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +3 -3
  42. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts +1 -1
  43. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  44. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +3 -3
  45. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -2
  46. package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts +1 -2
  47. package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts.map +1 -1
  48. package/lib/esm/components/ProductSelector/ProductSelectorLoader.js +12 -19
  49. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +3 -3
  50. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  51. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +2 -1
  52. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
  53. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +1 -1
  54. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  55. package/lib/esm/components/SessionRestore/SessionRestore.js +4 -9
  56. package/lib/esm/components/SubmitCase/ResubmitToast.js +1 -1
  57. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  58. package/lib/esm/components/Suggestions/TopContent.js +1 -1
  59. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  60. package/lib/esm/components/shared/useIsSectionValid.d.ts +1 -1
  61. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  62. package/lib/esm/components/shared/useIsSectionValid.js +5 -24
  63. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  64. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +40 -80
  65. package/lib/esm/components/wizardLayout/MainSection.d.ts +5 -3
  66. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  67. package/lib/esm/components/wizardLayout/MainSection.js +4 -4
  68. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  69. package/lib/esm/components/wizardLayout/WizardAside.js +3 -10
  70. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  71. package/lib/esm/components/wizardLayout/WizardLayout.js +31 -42
  72. package/lib/esm/components/wizardLayout/WizardMain.d.ts +2 -3
  73. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  74. package/lib/esm/components/wizardLayout/WizardMain.js +43 -163
  75. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +7 -3
  76. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  77. package/lib/esm/components/wizardLayout/WizardNavigation.js +46 -90
  78. package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
  79. package/lib/esm/components/wizardLayout/index.js +2 -10
  80. package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
  81. package/lib/esm/context/RootTroubleshootProvider.js +7 -9
  82. package/lib/esm/css/app.css +0 -450
  83. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  84. package/lib/esm/hooks/useResetCaseCreate.js +0 -4
  85. package/lib/esm/hooks/useWizard.d.ts +4 -0
  86. package/lib/esm/hooks/useWizard.d.ts.map +1 -0
  87. package/lib/esm/hooks/useWizard.js +128 -0
  88. package/lib/esm/reducers/RouteConstNTypes.d.ts +21 -1
  89. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  90. package/lib/esm/reducers/RouteConstNTypes.js +43 -0
  91. package/lib/esm/reducers/RouteReducer.d.ts +13 -47
  92. package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
  93. package/lib/esm/reducers/RouteReducer.js +36 -165
  94. package/lib/esm/scss/_main.scss +67 -786
  95. package/lib/esm/utils/routeUtils.d.ts +3 -9
  96. package/lib/esm/utils/routeUtils.d.ts.map +1 -1
  97. package/lib/esm/utils/routeUtils.js +14 -41
  98. package/package.json +14 -25
  99. package/lib/esm/components/wizardLayout/WizardProgress.d.ts +0 -13
  100. package/lib/esm/components/wizardLayout/WizardProgress.d.ts.map +0 -1
  101. package/lib/esm/components/wizardLayout/WizardProgress.js +0 -108
  102. package/lib/esm/context/AppMetadataContext.d.ts +0 -11
  103. package/lib/esm/context/AppMetadataContext.d.ts.map +0 -1
  104. package/lib/esm/context/AppMetadataContext.js +0 -13
  105. package/lib/esm/reducers/AppMetadataReducer.d.ts +0 -28
  106. package/lib/esm/reducers/AppMetadataReducer.d.ts.map +0 -1
  107. package/lib/esm/reducers/AppMetadataReducer.js +0 -28
@@ -12,16 +12,10 @@ export default class RouteUtils {
12
12
  * is empty by lodash isEmpty standards it will be removed from the returned query object.
13
13
  */
14
14
  static getQueryParams(routeProps: RouteComponentProps<IRouteUrlParams>, replacementQueries?: IRouteQueryParams): IRouteQueryParams;
15
- static getActiveSection(routeProps: RouteComponentProps<IRouteUrlParams>, appRouteSectionsSequence: AppRouteSections[], isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean): AppRouteSections;
16
15
  static getQueryString(routeProps: RouteComponentProps<IRouteUrlParams>, resetSearchParams?: boolean, newQueries?: IRouteUrlParams): string;
17
- static navigateToSectionWithProductVersion(routeProps: RouteComponentProps<IRouteUrlParams>, newSection: AppRouteSections, appRouteSectionsSequence: AppRouteSections[], product: string, version: string, isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean, resetOldParams: boolean): void;
18
- static navigateToSection(routeProps: RouteComponentProps<IRouteUrlParams>, newSection: AppRouteSections, appRouteSectionsSequence: AppRouteSections[], isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean, resetSearchParams: boolean, newQueryParams?: IRouteQueryParams): void;
19
- static getNavigateToSectionLink(routeProps: RouteComponentProps<IRouteUrlParams>, newSection: AppRouteSections, appRouteSectionsSequence: AppRouteSections[], isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean, resetSearchParams?: boolean): {
20
- pathname: string;
21
- search: string;
22
- };
23
- static getCompletedSectionsForActiveSection(activeSection: AppRouteSections, appRouteSectionsSequence: AppRouteSections[], isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean): AppRouteSections[];
24
- static getRoutePathForActiveSection(activeSection: AppRouteSections, appRouteSectionsSequence: AppRouteSections[], isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean): string;
16
+ static getDefaultSection(isCaseCreate: boolean, isSearchIntent: boolean): AppRouteSections;
17
+ static navigateToDefaltSection(routeProps: RouteComponentProps<IRouteUrlParams>, isCaseCreate: boolean, isSearchIntent: boolean, resetSearchParams: boolean, newQueryParams?: IRouteQueryParams): void;
18
+ static navigateToSection(routeProps: RouteComponentProps<IRouteUrlParams>, newSection: string, resetSearchParams: boolean, newQueryParams?: IRouteQueryParams): void;
25
19
  static updateQueryParams(routeProps: RouteComponentProps<IRouteUrlParams>, newParams: IRouteQueryParams, resetOldParams?: boolean): void;
26
20
  static getSEResourceQueryParams(seSessionId: string, seResourceOriginID: string, seSource: SessionResourceSource, band?: string): string;
27
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"routeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/routeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAI5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpG,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,UAAU,SAAM;IAEvB;;;;;;;OAOG;IACH,MAAM,CAAC,cAAc,CACjB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,kBAAkB,GAAE,iBAAsB;IAe9C,MAAM,CAAC,gBAAgB,CACnB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,wBAAwB,EAAE,gBAAgB,EAAE,EAC5C,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,GAChB,gBAAgB;IAenB,MAAM,CAAC,cAAc,CACjB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,iBAAiB,UAAQ,EACzB,UAAU,GAAE,eAAoB,GACjC,MAAM;IAKT,MAAM,CAAC,mCAAmC,CACtC,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,UAAU,EAAE,gBAAgB,EAC5B,wBAAwB,EAAE,gBAAgB,EAAE,EAC5C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,EACf,cAAc,EAAE,OAAO;IAe3B,MAAM,CAAC,iBAAiB,CACpB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,UAAU,EAAE,gBAAgB,EAC5B,wBAAwB,EAAE,gBAAgB,EAAE,EAC5C,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,OAAO,EAC1B,cAAc,GAAE,iBAAsB;IAe1C,MAAM,CAAC,wBAAwB,CAC3B,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,UAAU,EAAE,gBAAgB,EAC5B,wBAAwB,EAAE,gBAAgB,EAAE,EAC5C,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,EACf,iBAAiB,UAAQ;;;;IAc7B,MAAM,CAAC,oCAAoC,CACvC,aAAa,EAAE,gBAAgB,EAC/B,wBAAwB,EAAE,gBAAgB,EAAE,EAC5C,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,GAChB,gBAAgB,EAAE;IAarB,MAAM,CAAC,4BAA4B,CAC/B,aAAa,EAAE,gBAAgB,EAC/B,wBAAwB,EAAE,gBAAgB,EAAE,EAC5C,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,GAChB,MAAM;IAgBT,MAAM,CAAC,iBAAiB,CACpB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,SAAS,EAAE,iBAAiB,EAC5B,cAAc,UAAQ;IAY1B,MAAM,CAAC,wBAAwB,CAC3B,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,SAAO;CAMlB"}
1
+ {"version":3,"file":"routeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/routeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAG5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpG,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,UAAU,SAAM;IAEvB;;;;;;;OAOG;IACH,MAAM,CAAC,cAAc,CACjB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,kBAAkB,GAAE,iBAAsB;IAe9C,MAAM,CAAC,cAAc,CACjB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,iBAAiB,UAAQ,EACzB,UAAU,GAAE,eAAoB,GACjC,MAAM;IAKT,MAAM,CAAC,iBAAiB,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,GAAG,gBAAgB;IAU1F,MAAM,CAAC,uBAAuB,CAC1B,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,iBAAiB,EAAE,OAAO,EAC1B,cAAc,GAAE,iBAAsB;IAS1C,MAAM,CAAC,iBAAiB,CACpB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,OAAO,EAC1B,cAAc,GAAE,iBAAsB;IAS1C,MAAM,CAAC,iBAAiB,CACpB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAChD,SAAS,EAAE,iBAAiB,EAC5B,cAAc,UAAQ;IAY1B,MAAM,CAAC,wBAAwB,CAC3B,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,SAAO;CAMlB"}
@@ -1,8 +1,6 @@
1
1
  import { getStringifiedParams, getUrlParsedParams } from '@rh-support/utils';
2
- import difference from 'lodash/difference';
3
2
  import isEmpty from 'lodash/isEmpty';
4
3
  import { AppRouteSections } from '../reducers/RouteConstNTypes';
5
- import { getDefaultSection } from '../reducers/RouteReducer';
6
4
  export default class RouteUtils {
7
5
  /**
8
6
  * parses and makes/replaces the url query params into a js object.
@@ -23,56 +21,31 @@ export default class RouteUtils {
23
21
  return newQueryObject;
24
22
  }, {});
25
23
  }
26
- static getActiveSection(routeProps, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea) {
27
- if (routeProps.location.pathname === RouteUtils.seBasePath) {
28
- return getDefaultSection(isCaseCreate, isSearchIntent, isIdea);
29
- }
30
- const allSections = routeProps.location.pathname.split('/');
31
- const activeSectionFromURL = allSections[allSections.length - 1];
32
- return appRouteSectionsSequence.indexOf(activeSectionFromURL) > -1
33
- ? activeSectionFromURL
34
- : getDefaultSection(RouteUtils.getQueryParams(routeProps).caseCreate === 'true', !isEmpty(RouteUtils.getQueryParams(routeProps).summary), isIdea);
35
- }
36
24
  static getQueryString(routeProps, resetSearchParams = false, newQueries = {}) {
37
25
  const queryParams = RouteUtils.getQueryParams(routeProps, newQueries);
38
26
  return !resetSearchParams ? getStringifiedParams(queryParams) : getStringifiedParams(newQueries);
39
27
  }
40
- static navigateToSectionWithProductVersion(routeProps, newSection, appRouteSectionsSequence, product, version, isCaseCreate, isSearchIntent, isIdea, resetOldParams) {
41
- const newParams = { product, version };
42
- RouteUtils.navigateToSection(routeProps, newSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, resetOldParams, isIdea, newParams);
28
+ static getDefaultSection(isCaseCreate, isSearchIntent) {
29
+ let routeSequence = isSearchIntent
30
+ ? AppRouteSections.GET_SUPPORT
31
+ : isCaseCreate
32
+ ? AppRouteSections.GET_SUPPORT
33
+ : AppRouteSections.SUMMARIZE;
34
+ return routeSequence;
43
35
  }
44
- static navigateToSection(routeProps, newSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea, resetSearchParams, newQueryParams = {}) {
36
+ static navigateToDefaltSection(routeProps, isCaseCreate, isSearchIntent, resetSearchParams, newQueryParams = {}) {
45
37
  const navigationObj = {
46
- pathname: RouteUtils.getRoutePathForActiveSection(newSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea),
38
+ pathname: routeProps.location.pathname + '/' + this.getDefaultSection(isCaseCreate, isSearchIntent),
47
39
  search: RouteUtils.getQueryString(routeProps, resetSearchParams, newQueryParams),
48
40
  };
49
41
  routeProps.history.replace(navigationObj);
50
42
  }
51
- static getNavigateToSectionLink(routeProps, newSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea, resetSearchParams = false) {
52
- return {
53
- pathname: RouteUtils.getRoutePathForActiveSection(newSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea),
54
- search: RouteUtils.getQueryString(routeProps, resetSearchParams),
43
+ static navigateToSection(routeProps, newSection, resetSearchParams, newQueryParams = {}) {
44
+ const navigationObj = {
45
+ pathname: newSection,
46
+ search: RouteUtils.getQueryString(routeProps, resetSearchParams, newQueryParams),
55
47
  };
56
- }
57
- static getCompletedSectionsForActiveSection(activeSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea) {
58
- // Once Case is submitted, we dont want the previous section in main content but we want there disabled placeholders in progress bar
59
- if (activeSection === AppRouteSections.SUBMIT_CASE) {
60
- return difference(appRouteSectionsSequence, [AppRouteSections.SUBMIT_CASE]);
61
- }
62
- if (activeSection === getDefaultSection(isCaseCreate, isSearchIntent, isIdea)) {
63
- return [];
64
- }
65
- const activeSectionIndex = appRouteSectionsSequence.indexOf(activeSection);
66
- return appRouteSectionsSequence.slice(0, activeSectionIndex);
67
- }
68
- static getRoutePathForActiveSection(activeSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea) {
69
- if (activeSection === AppRouteSections.SUBMIT_CASE) {
70
- return `${RouteUtils.seBasePath}/${AppRouteSections.SUBMIT_CASE}`;
71
- }
72
- const completedSections = RouteUtils.getCompletedSectionsForActiveSection(activeSection, appRouteSectionsSequence, isCaseCreate, isSearchIntent, isIdea);
73
- return isEmpty(completedSections)
74
- ? `${RouteUtils.seBasePath}/${activeSection}`
75
- : `${RouteUtils.seBasePath}/${completedSections.join('/')}/${activeSection}`;
48
+ routeProps.history.replace(navigationObj);
76
49
  }
77
50
  static updateQueryParams(routeProps, newParams, resetOldParams = false) {
78
51
  const params = resetOldParams
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,27 +26,20 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.15.72",
29
+ "@cee-eng/hydrajs": "4.15.78",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
31
  "@patternfly/patternfly": "4.196.7",
32
32
  "@patternfly/pfe-accordion": "1.12.3",
33
33
  "@patternfly/pfe-collapse": "1.12.3",
34
- "@patternfly/pfe-cta": "1.12.3",
35
34
  "@patternfly/pfe-tabs": "1.12.3",
36
35
  "@patternfly/react-core": "4.264.0",
37
- "@rh-support/components": "^0.1.3",
38
- "@rh-support/react-context": "^0.1.3",
39
- "@rh-support/types": "^0.1.3",
40
- "@rh-support/user-permissions": "^0.1.3",
41
- "@rh-support/utils": "^0.1.3",
42
- "@webcomponents/webcomponentsjs": "^2.2.10",
43
36
  "dompurify": "^2.2.6",
44
37
  "downshift": "^6.0.5",
45
38
  "i18next": "^19.0.1",
46
39
  "js-markdown-extra": "^1.2.4",
47
40
  "js-worker-search": "^1.4.1",
48
41
  "lazysizes": "^5.3.2",
49
- "localforage": "^1.7.3",
42
+ "localforage": "^1.10.0",
50
43
  "lodash": "^4.17.21",
51
44
  "mark.js": "^8.11.1",
52
45
  "marked": "^1.2.4",
@@ -63,7 +56,7 @@
63
56
  "react-virtualized": "^9.21.2"
64
57
  },
65
58
  "dependencies": {
66
- "@cee-eng/hydrajs": "4.15.72",
59
+ "@cee-eng/hydrajs": "4.15.78",
67
60
  "@cee-eng/ui-toolkit": "1.1.6",
68
61
  "@patternfly/patternfly": "4.196.7",
69
62
  "@patternfly/pfe-accordion": "1.12.3",
@@ -73,21 +66,20 @@
73
66
  "@patternfly/react-core": "4.264.0",
74
67
  "@progress/kendo-drawing": "^1.6.0",
75
68
  "@progress/kendo-react-pdf": "^3.12.0",
76
- "@rh-support/components": "2.0.4",
77
- "@rh-support/react-context": "2.0.4",
69
+ "@rh-support/components": "2.0.5",
70
+ "@rh-support/react-context": "2.0.5",
78
71
  "@rh-support/types": "2.0.1",
79
- "@rh-support/user-permissions": "2.0.4",
80
- "@rh-support/utils": "2.0.4",
72
+ "@rh-support/user-permissions": "2.0.5",
73
+ "@rh-support/utils": "2.0.5",
81
74
  "@types/react-redux": "^7.1.12",
82
75
  "@types/redux": "^3.6.0",
83
- "@webcomponents/webcomponentsjs": "^2.2.10",
84
76
  "dompurify": "^2.4.1",
85
77
  "downshift": "^6.0.5",
86
78
  "i18next": "^19.0.1",
87
79
  "js-markdown-extra": "^1.2.4",
88
80
  "js-worker-search": "^1.4.1",
89
81
  "lazysizes": "^5.3.2",
90
- "localforage": "^1.7.3",
82
+ "localforage": "^1.10.0",
91
83
  "lodash": "^4.17.21",
92
84
  "mark.js": "^8.11.1",
93
85
  "marked": "^1.2.4",
@@ -103,7 +95,8 @@
103
95
  "react-test-renderer": "17.0.1",
104
96
  "react-virtualized": "^9.21.2",
105
97
  "redux": "^4.0.5",
106
- "redux-devtools-extension": "^2.13.8"
98
+ "redux-devtools-extension": "^2.13.8",
99
+ "timers": "^0.1.1"
107
100
  },
108
101
  "devDependencies": {
109
102
  "@testing-library/jest-dom": "^5.16.5",
@@ -118,11 +111,7 @@
118
111
  "@types/react-dom": "^17.0.9",
119
112
  "@types/react-i18next": "^8.1.0",
120
113
  "@types/react-router-dom": "^5.1.2",
121
- "faker": "^5.5.3",
122
- "node-sass": "^7.0.1"
123
- },
124
- "resolutions": {
125
- "**/node-gyp": "^9.3.1"
114
+ "faker": "^5.5.3"
126
115
  },
127
116
  "scripts": {
128
117
  "build:watch": "../../node_modules/.bin/tsc -w -p config/tsconfig.json & npm run watch:css",
@@ -133,7 +122,7 @@
133
122
  "test:watch": "./../../node_modules/.bin/jest --watchAll -c ./../../configs/tests/jest.config.unit.js",
134
123
  "test:unit": "./../../node_modules/.bin/jest -c ./../../configs/tests/jest.config.unit.js",
135
124
  "test:snap": "./../../node_modules/.bin/jest -c ./../../configs/tests/jest.config.snapshot.js",
136
- "test:coverage": "./../../node_modules/.bin/jest -c ./../../configs/tests/jest.config.coverage.js",
125
+ "test:coverage": "./../../node_modules/.bin/jest --all -c ./../../configs/tests/jest.config.coverage.js",
137
126
  "test:changes": "./../../node_modules/.bin/jest --passWithNoTests -c ./../../configs/tests/jest-only-changed-from-upstream.js",
138
127
  "test": "npm run test:changes",
139
128
  "watch:css": "./../../node_modules/.bin/chokidar 'src/**/*.(css|scss)' -c '../../node_modules/.bin/copyfiles -V -u 1 -a {path} lib/esm'",
@@ -145,5 +134,5 @@
145
134
  "not ie <= 11",
146
135
  "not op_mini all"
147
136
  ],
148
- "gitHead": "dd2c04fd2f86fb8034a17ce8a9d0503a0ead36f3"
137
+ "gitHead": "184ccbf01006c0dc3732d8b8ad44656f4b5cad22"
149
138
  }
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { RouteComponentProps } from 'react-router';
3
- import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
4
- interface IProps {
5
- routeProps: RouteComponentProps<IRouteUrlParams>;
6
- onNext: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
7
- }
8
- declare function WizardProgress(props: IProps): JSX.Element;
9
- declare namespace WizardProgress {
10
- var defaultProps: Partial<IProps>;
11
- }
12
- export default WizardProgress;
13
- //# sourceMappingURL=WizardProgress.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WizardProgress.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardProgress.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAC5E;AAGD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,eA6MpC;kBA7MQ,cAAc;;;AA+MvB,eAAe,cAAc,CAAC"}
@@ -1,108 +0,0 @@
1
- import { Button } from '@patternfly/react-core';
2
- import ArrowLeftIcon from '@patternfly/react-icons/dist/js/icons/arrow-left-icon';
3
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
- import { getFieldInParts, PCM_CONFIG_FIELD_TYPE, PreviousCaseTypes } from '@rh-support/utils';
5
- import difference from 'lodash/difference';
6
- import map from 'lodash/map';
7
- import React, { useContext } from 'react';
8
- import { useTranslation } from 'react-i18next';
9
- import { useCaseSelector } from '../../context/CaseContext';
10
- import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
11
- import { AppRouteSections } from '../../reducers/RouteConstNTypes';
12
- import { getAppRouteConfugurations, getAppRouteSectionsSequence, RouteReducerConstants, troubleshootingSections, } from '../../reducers/RouteReducer';
13
- import RouteUtils from '../../utils/routeUtils';
14
- import { isUploadingAttachment } from '../shared/fileUpload/reducer/AttachmentHelper';
15
- import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
16
- import { useIsSectionValid } from '../shared/useIsSectionValid';
17
- const defaultProps = {};
18
- function WizardProgress(props) {
19
- var _a;
20
- const { globalMetadataState: { pcmConfig }, } = useContext(GlobalMetadataStateContext);
21
- const { routeState } = useContext(RouteContext);
22
- const { activeSection, isCaseCreate, isSearchIntent, sectionsToHide } = routeState;
23
- const { attachmentState } = useContext(AttachmentStateContext);
24
- const dispatchToRouteReducer = useContext(RouteDispatchContext);
25
- const { isCreatingCase, caseType, product } = useCaseSelector((state) => ({
26
- isCreatingCase: state.isCreatingCase,
27
- caseType: state.caseDetails.caseType,
28
- product: state.caseDetails.product,
29
- }));
30
- const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
31
- const appRouteConfugurations = getAppRouteConfugurations(isCaseCreate, isIdea, product);
32
- const isUploadingAnyFile = isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles);
33
- const { isSectionValidFn, isActiveSectionValid } = useIsSectionValid();
34
- // hasPreferredSecureSupportAccount show modal logic
35
- const { t } = useTranslation();
36
- const onJumpCompleted = (section) => () => {
37
- RouteUtils.navigateToSection(props.routeProps, section, getAppRouteSectionsSequence(sectionsToHide, isCaseCreate, isSearchIntent, isIdea), isCaseCreate, isSearchIntent, isIdea, false);
38
- };
39
- const onJumpFuture = (section) => () => {
40
- RouteUtils.navigateToSection(props.routeProps, section, getAppRouteSectionsSequence(sectionsToHide, isCaseCreate, isSearchIntent, isIdea), isCaseCreate, isSearchIntent, isIdea, false);
41
- };
42
- const onNext = (event) => {
43
- if (isActiveSectionValid) {
44
- dispatchToRouteReducer({
45
- type: RouteReducerConstants.setShowValidationErrorAlert,
46
- payload: {
47
- showValidationErrorAlert: false,
48
- },
49
- });
50
- }
51
- props.onNext && props.onNext(event);
52
- };
53
- const onCurrent = (event) => {
54
- RouteUtils.navigateToSection(props.routeProps, activeSection, getAppRouteSectionsSequence(sectionsToHide, isCaseCreate, isSearchIntent, isIdea), isCaseCreate, isSearchIntent, isIdea, false);
55
- };
56
- // Determines if a section should be enabled in progress bar or not
57
- const isSectionEnabled = (sectionName) => {
58
- const isSectionValid = isSectionValidFn(sectionName);
59
- // if it's a troubleshooting flow we only show the case creation section once user completes the troubleshooting flow
60
- // so we only execute the else logic when it's a case create flow
61
- if (!isCaseCreate || troubleshootingSections.includes(sectionName))
62
- return isSectionValid;
63
- // if user restores a session we don't want him to jump directly to review section. We want to make sure that
64
- // user visits the troubleshoot sections even if on session restore all the sections becomes valid
65
- const visibleTroubleshootingSections = difference(troubleshootingSections, sectionsToHide);
66
- return (isSectionValid &&
67
- visibleTroubleshootingSections.every((section) => routeState.visitedSections.includes(section)));
68
- };
69
- const backToApp = () => {
70
- window.location.href = document.referrer;
71
- };
72
- const appNames = (_a = getFieldInParts(pcmConfig.data, 'referrer_app_names', PCM_CONFIG_FIELD_TYPE.JSON_HASHMAP)) !== null && _a !== void 0 ? _a : {};
73
- return (React.createElement("div", { className: appRouteConfugurations[activeSection].disableOtherSections
74
- ? 'section-disabled grid-progress'
75
- : 'grid-progress' },
76
- React.createElement("nav", { className: "grid-progress-content" },
77
- appNames[document.referrer] && (React.createElement(Button, { className: "back-to-app", title: t(`Back to {{appReferrer}}`, { appReferrer: appNames[document.referrer] }), variant: "link", isInline: true, onClick: backToApp },
78
- React.createElement(ArrowLeftIcon, { className: "pf-u-mr-sm", "aria-hidden": true }),
79
- React.createElement("span", { className: "pf-u-screen-reader-on-md pf-u-screen-reader-on-lg pf-u-visible-on-xl" }, t(`Back to {{appReferrer}}`, { appReferrer: appNames[document.referrer] })))),
80
- React.createElement("ol", { className: "grid-progress-steps" },
81
- map(routeState.completedSections, (completedSection) => (React.createElement("li", { className: "completed", key: `completed-${completedSection}` },
82
- React.createElement("button", { className: "btn btn-app btn-link", disabled: appRouteConfugurations[activeSection].disableOtherSections, title: `${appRouteConfugurations[completedSection].stepName}`, onClick: onJumpCompleted(completedSection), "data-tracking-id": `progress-completed-${completedSection}` },
83
- React.createElement("span", { className: "pf-u-display-inline-on-xl" }, t(appRouteConfugurations[completedSection].stepName)))))),
84
- activeSection && (React.createElement("li", { className: `${activeSection === AppRouteSections.SUBMIT_CASE && !isUploadingAnyFile && !isCreatingCase
85
- ? 'completed'
86
- : 'on'}` },
87
- React.createElement("button", { className: "btn btn-app btn-link", onClick: onCurrent, title: `${appRouteConfugurations[activeSection].stepName}`, "data-tracking-id": `progress-current-${activeSection}` },
88
- React.createElement("span", { className: "pf-u-display-inline-on-xl" }, t(appRouteConfugurations[activeSection].stepName))))),
89
- appRouteConfugurations[activeSection].nextSection &&
90
- appRouteConfugurations[activeSection].futureSections.length !== 0 && (React.createElement("li", { className: isSectionEnabled(activeSection) ? 'completed' : 'next' },
91
- React.createElement("button", { className: "btn btn-app btn-link", disabled: appRouteConfugurations[activeSection].disableOtherSections ||
92
- !isActiveSectionValid, onClick: onNext, title: `${appRouteConfugurations[appRouteConfugurations[activeSection].nextSection]
93
- .stepName}`, "data-tracking-id": `progress-next-of-${activeSection}` },
94
- React.createElement("span", { className: "pf-u-display-inline-on-xl" }, t(appRouteConfugurations[appRouteConfugurations[activeSection].nextSection]
95
- .stepName))))),
96
- map(appRouteConfugurations[activeSection].futureSections, (futureSection, i) => {
97
- const nextSection = appRouteConfugurations[activeSection].nextSection;
98
- if (futureSection === nextSection)
99
- return React.createElement(React.Fragment, null);
100
- return (React.createElement("li", { className: isSectionEnabled(activeSection) ? 'completed' : 'future', key: `future-${futureSection}-${i}` },
101
- React.createElement("button", { className: "btn btn-app btn-link", disabled: appRouteConfugurations[activeSection].disableOtherSections ||
102
- !isActiveSectionValid ||
103
- !isSectionEnabled(futureSection), title: `${appRouteConfugurations[futureSection].stepName}`, "data-tracking-id": `progress-future-${futureSection}`, onClick: onJumpFuture(futureSection) },
104
- React.createElement("span", { className: "pf-u-display-inline-on-xl" }, t(appRouteConfugurations[futureSection].stepName)))));
105
- })))));
106
- }
107
- WizardProgress.defaultProps = defaultProps;
108
- export default WizardProgress;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { AppMetadataReducerDispatchType, IAppMetadataState } from '../reducers/AppMetadataReducer';
3
- export interface IAppMetadataStateContext {
4
- appMetadataState: IAppMetadataState;
5
- }
6
- export declare const AppMetadataStateContext: React.Context<IAppMetadataStateContext>;
7
- export declare const AppMetadataDispatchContext: React.Context<AppMetadataReducerDispatchType>;
8
- export declare function AppMetadataContextProvider({ children }: {
9
- children: any;
10
- }): JSX.Element;
11
- //# sourceMappingURL=AppMetadataContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AppMetadataContext.d.ts","sourceRoot":"","sources":["../../../src/context/AppMetadataContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAEH,8BAA8B,EAC9B,iBAAiB,EAEpB,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,wBAAwB;IACrC,gBAAgB,EAAE,iBAAiB,CAAC;CACvC;AAMD,eAAO,MAAM,uBAAuB,yCAA2C,CAAC;AAChF,eAAO,MAAM,0BAA0B,+CAA6C,CAAC;AAErF,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE;;CAAA,eAOtD"}
@@ -1,13 +0,0 @@
1
- import React, { useReducer } from 'react';
2
- import { appMetadataReducer, initialAppMetadataState, } from '../reducers/AppMetadataReducer';
3
- const initialStateContext = {
4
- appMetadataState: initialAppMetadataState,
5
- };
6
- const initalDispatchContext = null;
7
- export const AppMetadataStateContext = React.createContext(initialStateContext);
8
- export const AppMetadataDispatchContext = React.createContext(initalDispatchContext);
9
- export function AppMetadataContextProvider({ children }) {
10
- const [appMetadataState, dispatch] = useReducer(appMetadataReducer, initialAppMetadataState);
11
- return (React.createElement(AppMetadataStateContext.Provider, { value: { appMetadataState } },
12
- React.createElement(AppMetadataDispatchContext.Provider, { value: dispatch }, children)));
13
- }
@@ -1,28 +0,0 @@
1
- import { IAction } from '@rh-support/types/shared';
2
- import React from 'react';
3
- export interface IIntraction {
4
- time: Date;
5
- action: string;
6
- context: string[];
7
- }
8
- export interface IAppMetadataState {
9
- nextButtonRef: React.MutableRefObject<HTMLButtonElement>;
10
- }
11
- export interface IAppMetadataPayloadType extends IAppMetadataState {
12
- interaction: IIntraction;
13
- }
14
- declare type IActionType = IAction<AppMetadataReducerConstants, IAppMetadataPayloadType>;
15
- export declare type AppMetadataReducerDispatchType = (value: IActionType) => void;
16
- export declare enum AppMetadataReducerConstants {
17
- setRecommendationDocsTrack = "setRecommendationDocsTrack",
18
- setSearchTrackingData = "setSearchTrackingData",
19
- setGuid = "setGuid",
20
- receivedGuid = "receivedGuid",
21
- setTrackingProductFlag = "setTrackingProductFlag",
22
- setRef = "setRef"
23
- }
24
- export declare const initialAppMetadataState: IAppMetadataState;
25
- export declare const appMetadataReducer: (pState: IAppMetadataState, action: IActionType) => IAppMetadataState;
26
- export declare const setRef: (dispatch: AppMetadataReducerDispatchType, nextButtonRef: React.MutableRefObject<HTMLButtonElement>) => void;
27
- export {};
28
- //# sourceMappingURL=AppMetadataReducer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AppMetadataReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/AppMetadataReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAC9B,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAC9D,WAAW,EAAE,WAAW,CAAC;CAC5B;AACD,aAAK,WAAW,GAAG,OAAO,CAAC,2BAA2B,EAAE,uBAAuB,CAAC,CAAC;AACjF,oBAAY,8BAA8B,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAG1E,oBAAY,2BAA2B;IACnC,0BAA0B,+BAA+B;IACzD,qBAAqB,0BAA0B;IAC/C,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,sBAAsB,2BAA2B;IACjD,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,uBAAuB,EAAE,iBAErC,CAAC;AAGF,eAAO,MAAM,kBAAkB,WAAY,iBAAiB,0BAAwB,iBASnF,CAAC;AAGF,eAAO,MAAM,MAAM,aACL,8BAA8B,iBACzB,MAAM,gBAAgB,CAAC,iBAAiB,CAAC,SAG3D,CAAC"}
@@ -1,28 +0,0 @@
1
- // Constants
2
- export var AppMetadataReducerConstants;
3
- (function (AppMetadataReducerConstants) {
4
- AppMetadataReducerConstants["setRecommendationDocsTrack"] = "setRecommendationDocsTrack";
5
- AppMetadataReducerConstants["setSearchTrackingData"] = "setSearchTrackingData";
6
- AppMetadataReducerConstants["setGuid"] = "setGuid";
7
- AppMetadataReducerConstants["receivedGuid"] = "receivedGuid";
8
- AppMetadataReducerConstants["setTrackingProductFlag"] = "setTrackingProductFlag";
9
- AppMetadataReducerConstants["setRef"] = "setRef";
10
- })(AppMetadataReducerConstants || (AppMetadataReducerConstants = {}));
11
- export const initialAppMetadataState = {
12
- nextButtonRef: null,
13
- };
14
- // Resucers
15
- export const appMetadataReducer = (pState, action) => {
16
- switch (action.type) {
17
- case AppMetadataReducerConstants.setRef: {
18
- return Object.assign(Object.assign({}, pState), { nextButtonRef: action.payload.nextButtonRef });
19
- }
20
- default: {
21
- return pState;
22
- }
23
- }
24
- };
25
- // Actions
26
- export const setRef = (dispatch, nextButtonRef) => {
27
- nextButtonRef && dispatch({ type: AppMetadataReducerConstants.setRef, payload: { nextButtonRef } });
28
- };