@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
@@ -1 +1 @@
1
- {"version":3,"file":"RouteConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteConstNTypes.ts"],"names":[],"mappings":"AAAA,M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var AppRouteSections;
8
8
  AppRouteSections["MANAGEMENT"] = "management";
9
9
  AppRouteSections["REVIEW"] = "review";
10
10
  AppRouteSections["SUBMIT_CASE"] = "submit-case";
11
+ AppRouteSections["BREAK"] = "break";
11
12
  })(AppRouteSections || (AppRouteSections = {}));
13
+ // start of wizard steps sequences
14
+ // - Note: use AppRouteSections.BREAK whenever you want partially show steps
15
+ // first and then reveal the rest at a certain point
16
+ export const openCaseNonTechnicalSequence = [
17
+ AppRouteSections.GET_SUPPORT,
18
+ AppRouteSections.SUMMARIZE,
19
+ AppRouteSections.DESCRIBE_IDEA,
20
+ ];
21
+ export const troubleshootNonTechnicalSequence = [
22
+ AppRouteSections.SUMMARIZE,
23
+ AppRouteSections.TROUBLESHOOT,
24
+ AppRouteSections.GET_SUPPORT,
25
+ AppRouteSections.DESCRIBE_IDEA,
26
+ ];
27
+ export const troubleshootRouteSectionsSequence = [
28
+ AppRouteSections.SUMMARIZE,
29
+ AppRouteSections.TROUBLESHOOT,
30
+ AppRouteSections.BREAK,
31
+ AppRouteSections.GET_SUPPORT,
32
+ AppRouteSections.DESCRIBE_MORE,
33
+ AppRouteSections.MANAGEMENT,
34
+ AppRouteSections.REVIEW,
35
+ ];
36
+ export const searchIntentRouteSectionSequence = [
37
+ AppRouteSections.GET_SUPPORT,
38
+ AppRouteSections.SUMMARIZE,
39
+ AppRouteSections.BREAK,
40
+ AppRouteSections.TROUBLESHOOT,
41
+ AppRouteSections.DESCRIBE_MORE,
42
+ AppRouteSections.MANAGEMENT,
43
+ AppRouteSections.REVIEW,
44
+ ];
45
+ export const openCaseRouteSectionSequence = [
46
+ AppRouteSections.GET_SUPPORT,
47
+ AppRouteSections.SUMMARIZE,
48
+ AppRouteSections.BREAK,
49
+ AppRouteSections.TROUBLESHOOT,
50
+ AppRouteSections.DESCRIBE_MORE,
51
+ AppRouteSections.MANAGEMENT,
52
+ AppRouteSections.REVIEW,
53
+ ];
54
+ // end of wizard steps sequences
12
55
  export const sessionRestoreCardSections = [AppRouteSections.GET_SUPPORT];
13
56
  export const hideFileUploadSidebarWidgetSections = [
14
57
  AppRouteSections.GET_SUPPORT,
@@ -1,34 +1,17 @@
1
1
  import { IAction } from '@rh-support/types/shared';
2
2
  import { AppRouteSections } from './RouteConstNTypes';
3
- export interface ISectionConfiguration {
4
- title: string;
5
- stepName: string;
6
- futureSections: AppRouteSections[];
7
- previousSection: AppRouteSections | null;
8
- nextSection?: AppRouteSections | null;
9
- showBackToSection: boolean;
10
- backToSection: AppRouteSections;
11
- backToSectionLabel: string;
12
- nextButtonLabel: string;
13
- previousButtonLabel: string;
14
- showOpenCaseButton: boolean;
15
- openCaseButtonLabel: string;
16
- showNewIssueButton: boolean;
17
- newIssueButtonLabel: string;
18
- disableOtherSections: boolean;
19
- hideAside: boolean;
20
- }
21
- export interface ISectionConfigurations {
22
- [key: string]: ISectionConfiguration;
23
- }
24
3
  export interface IRouteState {
25
- completedSections: AppRouteSections[];
26
- visitedSections: AppRouteSections[];
27
- activeSection: AppRouteSections;
28
- sectionsToHide: AppRouteSections[];
4
+ activeSection: AppRouteSections | undefined;
29
5
  isCaseCreate: boolean;
30
6
  isSearchIntent: boolean;
31
- showValidationErrorAlert: boolean;
7
+ isNextBtnClickedToShowValidationError: boolean;
8
+ noValidEntitlement: boolean;
9
+ }
10
+ export declare enum RouteReducerConstants {
11
+ activeSectionChanged = "activeSectionChanged",
12
+ setRouteFlags = "setRouteFlags",
13
+ setisNextBtnClickedToShowValidationError = "setisNextBtnClickedToShowValidationError",
14
+ setNoValidEntitlement = "setNoValidEntitlement"
32
15
  }
33
16
  export interface IRoutePayloadType extends IRouteState {
34
17
  isIdea: boolean;
@@ -36,29 +19,12 @@ export interface IRoutePayloadType extends IRouteState {
36
19
  }
37
20
  declare type IActionType = IAction<RouteReducerConstants, IRoutePayloadType>;
38
21
  export declare type RouteReducerDispatchType = (value: IActionType) => void;
39
- export declare enum RouteReducerConstants {
40
- activeSectionChanged = "activeSectionChanged",
41
- updateSectionsToHide = "updateSectionsToHide",
42
- setIsCaseCreate = "setIsCaseCreate",
43
- setIsSearchIntent = "setIsSearchIntent",
44
- updateAppRouteSectionSequence = "updateAppRouteSectionSequence",
45
- updateVisitedSections = "updateVisitedSections",
46
- setShowValidationErrorAlert = "setShowValidationErrorAlert",
47
- resetRouteState = "resetRouteState"
48
- }
49
- export declare const troubleshootingSections: AppRouteSections[];
50
- export declare const troubleshootRouteSectionsSequence: AppRouteSections[];
51
- export declare const openCaseRouteSectionSequence: AppRouteSections[];
52
- export declare const searchIntentRouteSectionSequence: AppRouteSections[];
53
- export declare const openCaseNonTechnicalSequence: AppRouteSections[];
54
- export declare const troubleshootNonTechnicalSequence: AppRouteSections[];
55
- export declare function getAppRouteSectionsSequence(sectionsToHide: AppRouteSections[], isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean): AppRouteSections[];
56
22
  export declare function isSearchIntent(isCaseCreate: boolean, summary: string): boolean;
57
- export declare function isNextSectionCaseCreation(activeSection: AppRouteSections, nextSection: AppRouteSections): boolean;
58
- export declare function getDefaultSection(isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean): AppRouteSections;
59
- export declare function getRouteSequence(isCaseCreate: boolean, isSearchIntent: boolean, isIdea: boolean): AppRouteSections[];
60
- export declare function getAppRouteConfugurations(isCaseCreate: boolean, isIdea: boolean, product?: string): ISectionConfigurations;
61
23
  export declare const initialRouteReducerState: IRouteState;
62
24
  export declare const routeReducer: (pState: IRouteState, action: IActionType) => IRouteState;
25
+ export declare const setNoValidEntitlement: (dispatch: RouteReducerDispatchType, noValidEntitlement: boolean) => void;
26
+ export declare const setRouteFlags: (dispatch: RouteReducerDispatchType, isCaseCreate: boolean, isSearchIntent: boolean) => void;
27
+ export declare const setActiveSectionChanged: (dispatch: RouteReducerDispatchType, activeSection: AppRouteSections) => void;
28
+ export declare const updateisNextBtnClickedToShowValidationError: (dispatch: RouteReducerDispatchType, isNextBtnClickedToShowValidationError: boolean) => void;
63
29
  export {};
64
30
  //# sourceMappingURL=RouteReducer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouteReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAOnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IAElC,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,gBAAgB,EAAE,CAAC;IAEnC,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,gBAAgB,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAE5B,oBAAoB,EAAE,OAAO,CAAC;IAE9B,SAAS,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,WAAW,sBAAsB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACxC;AACD,MAAM,WAAW,WAAW;IACxB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,eAAe,EAAE,gBAAgB,EAAE,CAAC;IACpC,aAAa,EAAE,gBAAgB,CAAC;IAChC,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,wBAAwB,EAAE,OAAO,CAAC;CACrC;AACD,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IAClD,MAAM,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,0BAAwB,WA4BvE,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAAc,wBAAwB,sBAAsB,OAAO,SAEpG,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,wBAAwB,gBAAgB,OAAO,kBAAkB,OAAO,SAK/G,CAAC;AAEF,eAAO,MAAM,uBAAuB,aAAc,wBAAwB,iBAAiB,gBAAgB,SAK1G,CAAC;AAEF,eAAO,MAAM,2CAA2C,aAC1C,wBAAwB,yCACK,OAAO,SAMjD,CAAC"}
@@ -1,190 +1,61 @@
1
- import { isEmpty } from 'lodash';
2
- import difference from 'lodash/difference';
3
- import forEach from 'lodash/forEach';
4
- import uniq from 'lodash/uniq';
5
- import RouteUtils from '../utils/routeUtils';
6
- import { AppRouteSections } from './RouteConstNTypes';
1
+ import isEmpty from 'lodash/isEmpty';
7
2
  // Constants
8
3
  export var RouteReducerConstants;
9
4
  (function (RouteReducerConstants) {
10
5
  RouteReducerConstants["activeSectionChanged"] = "activeSectionChanged";
11
- RouteReducerConstants["updateSectionsToHide"] = "updateSectionsToHide";
12
- RouteReducerConstants["setIsCaseCreate"] = "setIsCaseCreate";
13
- RouteReducerConstants["setIsSearchIntent"] = "setIsSearchIntent";
14
- RouteReducerConstants["updateAppRouteSectionSequence"] = "updateAppRouteSectionSequence";
15
- RouteReducerConstants["updateVisitedSections"] = "updateVisitedSections";
16
- RouteReducerConstants["setShowValidationErrorAlert"] = "setShowValidationErrorAlert";
17
- RouteReducerConstants["resetRouteState"] = "resetRouteState";
6
+ RouteReducerConstants["setRouteFlags"] = "setRouteFlags";
7
+ RouteReducerConstants["setisNextBtnClickedToShowValidationError"] = "setisNextBtnClickedToShowValidationError";
8
+ RouteReducerConstants["setNoValidEntitlement"] = "setNoValidEntitlement";
18
9
  })(RouteReducerConstants || (RouteReducerConstants = {}));
19
- export const troubleshootingSections = [AppRouteSections.SUMMARIZE, AppRouteSections.TROUBLESHOOT];
20
- export const troubleshootRouteSectionsSequence = [
21
- AppRouteSections.SUMMARIZE,
22
- AppRouteSections.TROUBLESHOOT,
23
- AppRouteSections.GET_SUPPORT,
24
- AppRouteSections.DESCRIBE_MORE,
25
- AppRouteSections.MANAGEMENT,
26
- AppRouteSections.REVIEW,
27
- AppRouteSections.SUBMIT_CASE,
28
- ];
29
- export const openCaseRouteSectionSequence = [
30
- AppRouteSections.GET_SUPPORT,
31
- AppRouteSections.SUMMARIZE,
32
- AppRouteSections.TROUBLESHOOT,
33
- AppRouteSections.DESCRIBE_MORE,
34
- AppRouteSections.MANAGEMENT,
35
- AppRouteSections.REVIEW,
36
- AppRouteSections.SUBMIT_CASE,
37
- ];
38
- export const searchIntentRouteSectionSequence = [
39
- AppRouteSections.GET_SUPPORT,
40
- AppRouteSections.SUMMARIZE,
41
- AppRouteSections.TROUBLESHOOT,
42
- AppRouteSections.DESCRIBE_MORE,
43
- AppRouteSections.MANAGEMENT,
44
- AppRouteSections.REVIEW,
45
- AppRouteSections.SUBMIT_CASE,
46
- ];
47
- export const openCaseNonTechnicalSequence = [
48
- AppRouteSections.GET_SUPPORT,
49
- AppRouteSections.SUMMARIZE,
50
- AppRouteSections.DESCRIBE_IDEA,
51
- AppRouteSections.SUBMIT_CASE,
52
- ];
53
- export const troubleshootNonTechnicalSequence = [
54
- AppRouteSections.SUMMARIZE,
55
- AppRouteSections.TROUBLESHOOT,
56
- AppRouteSections.GET_SUPPORT,
57
- AppRouteSections.DESCRIBE_IDEA,
58
- AppRouteSections.SUBMIT_CASE,
59
- ];
60
- const defaultRouteConfiguration = {
61
- title: '',
62
- stepName: '',
63
- previousSection: null,
64
- nextSection: null,
65
- futureSections: [],
66
- disableOtherSections: false,
67
- showBackToSection: false,
68
- backToSection: AppRouteSections.GET_SUPPORT,
69
- backToSectionLabel: 'Back to open case',
70
- nextButtonLabel: 'Continue',
71
- previousButtonLabel: 'Go back',
72
- showOpenCaseButton: false,
73
- openCaseButtonLabel: 'View this case',
74
- showNewIssueButton: false,
75
- newIssueButtonLabel: 'Troubleshoot a new issue',
76
- hideAside: false,
77
- };
78
- export function getAppRouteSectionsSequence(sectionsToHide, isCaseCreate, isSearchIntent, isIdea) {
79
- const routeSequence = getRouteSequence(isCaseCreate, isSearchIntent, isIdea);
80
- return difference(routeSequence, sectionsToHide);
81
- }
82
10
  export function isSearchIntent(isCaseCreate, summary) {
83
11
  return !isCaseCreate && !isEmpty(summary);
84
12
  }
85
- export function isNextSectionCaseCreation(activeSection, nextSection) {
86
- return troubleshootingSections.includes(activeSection) && !troubleshootingSections.includes(nextSection);
87
- }
88
- export function getDefaultSection(isCaseCreate, isSearchIntent, isIdea) {
89
- return getRouteSequence(isCaseCreate, isSearchIntent, isIdea)[0];
90
- }
91
- export function getRouteSequence(isCaseCreate, isSearchIntent, isIdea) {
92
- let routeSequence = isSearchIntent
93
- ? searchIntentRouteSectionSequence
94
- : isCaseCreate
95
- ? openCaseRouteSectionSequence
96
- : troubleshootRouteSectionsSequence;
97
- if (isIdea) {
98
- if (isCaseCreate) {
99
- routeSequence = openCaseNonTechnicalSequence;
100
- }
101
- else {
102
- routeSequence = troubleshootNonTechnicalSequence;
103
- }
104
- }
105
- return routeSequence || troubleshootRouteSectionsSequence;
106
- }
107
- export function getAppRouteConfugurations(isCaseCreate, isIdea, product) {
108
- const appRouteConfugurations = {
109
- [AppRouteSections.GET_SUPPORT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Why are you opening a case?', stepName: 'Get support', previousSection: isCaseCreate ? null : AppRouteSections.TROUBLESHOOT, nextSection: isCaseCreate
110
- ? AppRouteSections.SUMMARIZE
111
- : isIdea
112
- ? AppRouteSections.DESCRIBE_IDEA
113
- : AppRouteSections.DESCRIBE_MORE, futureSections: isCaseCreate && isIdea
114
- ? [AppRouteSections.SUMMARIZE, AppRouteSections.DESCRIBE_IDEA]
115
- : isCaseCreate && !isIdea
116
- ? [AppRouteSections.SUMMARIZE]
117
- : isIdea
118
- ? [AppRouteSections.DESCRIBE_IDEA]
119
- : [AppRouteSections.DESCRIBE_MORE, AppRouteSections.MANAGEMENT, AppRouteSections.REVIEW] }),
120
- [AppRouteSections.SUMMARIZE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'What are you having an issue with?', stepName: 'Summarize', previousSection: isCaseCreate ? AppRouteSections.GET_SUPPORT : null, nextSection: isCaseCreate && isIdea ? AppRouteSections.DESCRIBE_IDEA : AppRouteSections.TROUBLESHOOT, futureSections: isCaseCreate && isIdea
121
- ? [AppRouteSections.DESCRIBE_IDEA]
122
- : isCaseCreate && !isIdea
123
- ? []
124
- : [AppRouteSections.TROUBLESHOOT] }),
125
- [AppRouteSections.TROUBLESHOOT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Recommendations', stepName: 'Troubleshoot', nextButtonLabel: isCaseCreate ? 'Continue' : 'Get support', previousSection: AppRouteSections.SUMMARIZE, nextSection: isCaseCreate ? AppRouteSections.DESCRIBE_MORE : AppRouteSections.GET_SUPPORT, futureSections: isCaseCreate
126
- ? [AppRouteSections.DESCRIBE_MORE, AppRouteSections.MANAGEMENT, AppRouteSections.REVIEW]
127
- : [] }),
128
- [AppRouteSections.DESCRIBE_MORE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Case information', stepName: 'Describe more', previousSection: isCaseCreate ? AppRouteSections.TROUBLESHOOT : AppRouteSections.GET_SUPPORT, nextSection: AppRouteSections.MANAGEMENT, futureSections: [AppRouteSections.MANAGEMENT, AppRouteSections.REVIEW] }),
129
- [AppRouteSections.DESCRIBE_IDEA]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Idea information', stepName: 'Describe more', nextButtonLabel: 'Submit', disableOtherSections: false, previousSection: isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.GET_SUPPORT, nextSection: AppRouteSections.SUBMIT_CASE, futureSections: [], hideAside: false }),
130
- [AppRouteSections.MANAGEMENT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Case management', stepName: 'Management', previousSection: AppRouteSections.DESCRIBE_MORE, nextSection: AppRouteSections.REVIEW, futureSections: [AppRouteSections.REVIEW] }),
131
- [AppRouteSections.REVIEW]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Preview case', stepName: 'Review', nextButtonLabel: 'Submit', previousSection: AppRouteSections.MANAGEMENT, nextSection: AppRouteSections.SUBMIT_CASE, futureSections: [] }),
132
- [AppRouteSections.SUBMIT_CASE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { title: 'Case has been submitted', stepName: 'Submit', disableOtherSections: true, hideAside: false, previousSection: null, showOpenCaseButton: false, showNewIssueButton: false, showBackToSection: true, backToSection: AppRouteSections.SUMMARIZE, backToSectionLabel: 'Back to open case', nextSection: null, futureSections: [] }),
133
- };
134
- return appRouteConfugurations;
135
- }
136
13
  // Reducer
137
14
  export const initialRouteReducerState = {
138
- activeSection: troubleshootRouteSectionsSequence[0],
139
- completedSections: [],
140
- visitedSections: [],
141
- sectionsToHide: [],
15
+ activeSection: undefined,
142
16
  isCaseCreate: false,
143
17
  isSearchIntent: false,
144
- showValidationErrorAlert: false,
18
+ isNextBtnClickedToShowValidationError: false,
19
+ noValidEntitlement: false,
145
20
  };
146
21
  export const routeReducer = (pState, action) => {
147
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
22
+ var _a, _b, _c, _d, _e;
148
23
  switch (action.type) {
149
24
  case RouteReducerConstants.activeSectionChanged: {
150
- const activeSection = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.activeSection;
151
- const completedSections = RouteUtils.getCompletedSectionsForActiveSection(activeSection, getAppRouteSectionsSequence((_b = action.payload) === null || _b === void 0 ? void 0 : _b.sectionsToHide, (_c = action.payload) === null || _c === void 0 ? void 0 : _c.isCaseCreate, (_d = action.payload) === null || _d === void 0 ? void 0 : _d.isSearchIntent, (_e = action.payload) === null || _e === void 0 ? void 0 : _e.isIdea), (_f = action.payload) === null || _f === void 0 ? void 0 : _f.isCaseCreate, (_g = action.payload) === null || _g === void 0 ? void 0 : _g.isSearchIntent, (_h = action.payload) === null || _h === void 0 ? void 0 : _h.isIdea);
152
- const visitedSections = !((_j = action.payload) === null || _j === void 0 ? void 0 : _j.visitedSections.includes(activeSection))
153
- ? [...(_k = action.payload) === null || _k === void 0 ? void 0 : _k.visitedSections, activeSection]
154
- : (_l = action.payload) === null || _l === void 0 ? void 0 : _l.visitedSections;
155
- return Object.assign(Object.assign({}, pState), { completedSections, activeSection, visitedSections });
25
+ return Object.assign(Object.assign({}, pState), { activeSection: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.activeSection });
156
26
  }
157
- case RouteReducerConstants.setIsCaseCreate: {
158
- return Object.assign(Object.assign({}, pState), { isCaseCreate: (_m = action.payload) === null || _m === void 0 ? void 0 : _m.isCaseCreate });
27
+ case RouteReducerConstants.setRouteFlags: {
28
+ return Object.assign(Object.assign({}, pState), { isCaseCreate: (_b = action.payload) === null || _b === void 0 ? void 0 : _b.isCaseCreate, isSearchIntent: (_c = action.payload) === null || _c === void 0 ? void 0 : _c.isSearchIntent });
159
29
  }
160
- case RouteReducerConstants.setIsSearchIntent: {
161
- return Object.assign(Object.assign({}, pState), { isSearchIntent: (_o = action.payload) === null || _o === void 0 ? void 0 : _o.isSearchIntent });
30
+ case RouteReducerConstants.setisNextBtnClickedToShowValidationError: {
31
+ return Object.assign(Object.assign({}, pState), { isNextBtnClickedToShowValidationError: (_d = action.payload) === null || _d === void 0 ? void 0 : _d.isNextBtnClickedToShowValidationError });
162
32
  }
163
- case RouteReducerConstants.updateAppRouteSectionSequence: {
164
- const appRouteSectionsSequence = getAppRouteSectionsSequence((_p = action.payload) === null || _p === void 0 ? void 0 : _p.sectionsToHide, (_q = action.payload) === null || _q === void 0 ? void 0 : _q.isCaseCreate, (_r = action.payload) === null || _r === void 0 ? void 0 : _r.isSearchIntent, ((_s = action.payload) === null || _s === void 0 ? void 0 : _s.isIdea) || false);
165
- const completedSections = RouteUtils.getCompletedSectionsForActiveSection(action.payload.activeSection, appRouteSectionsSequence, (_t = action.payload) === null || _t === void 0 ? void 0 : _t.isCaseCreate, (_u = action.payload) === null || _u === void 0 ? void 0 : _u.isSearchIntent, ((_v = action.payload) === null || _v === void 0 ? void 0 : _v.isIdea) || false);
166
- return Object.assign(Object.assign({}, pState), { completedSections, activeSection: action.payload.activeSection });
167
- }
168
- case RouteReducerConstants.updateSectionsToHide: {
169
- const updatedSectionsToHide = uniq(action.payload.sectionsToHide);
170
- const appRouteConfugurations = getAppRouteConfugurations((_w = action.payload) === null || _w === void 0 ? void 0 : _w.isCaseCreate, (_x = action.payload) === null || _x === void 0 ? void 0 : _x.isIdea, (_y = action.payload) === null || _y === void 0 ? void 0 : _y.product);
171
- forEach(updatedSectionsToHide, (hiddenSection) => {
172
- var _a, _b, _c;
173
- appRouteConfugurations[hiddenSection] = getAppRouteConfugurations((_a = action.payload) === null || _a === void 0 ? void 0 : _a.isCaseCreate, (_b = action.payload) === null || _b === void 0 ? void 0 : _b.isIdea, (_c = action.payload) === null || _c === void 0 ? void 0 : _c.product)[hiddenSection];
174
- });
175
- return Object.assign(Object.assign({}, pState), { sectionsToHide: updatedSectionsToHide });
176
- }
177
- case RouteReducerConstants.updateVisitedSections: {
178
- return Object.assign(Object.assign({}, pState), { visitedSections: action.payload.visitedSections });
179
- }
180
- case RouteReducerConstants.resetRouteState: {
181
- return Object.assign(Object.assign({}, pState), { sectionsToHide: [], visitedSections: [] });
182
- }
183
- case RouteReducerConstants.setShowValidationErrorAlert: {
184
- return Object.assign(Object.assign({}, pState), { showValidationErrorAlert: action.payload.showValidationErrorAlert });
33
+ case RouteReducerConstants.setNoValidEntitlement: {
34
+ return Object.assign(Object.assign({}, pState), { noValidEntitlement: (_e = action.payload) === null || _e === void 0 ? void 0 : _e.noValidEntitlement });
185
35
  }
186
36
  default: {
187
37
  return pState;
188
38
  }
189
39
  }
190
40
  };
41
+ export const setNoValidEntitlement = (dispatch, noValidEntitlement) => {
42
+ dispatch({ type: RouteReducerConstants.setNoValidEntitlement, payload: { noValidEntitlement } });
43
+ };
44
+ export const setRouteFlags = (dispatch, isCaseCreate, isSearchIntent) => {
45
+ dispatch({
46
+ type: RouteReducerConstants.setRouteFlags,
47
+ payload: { isCaseCreate: isCaseCreate, isSearchIntent: isSearchIntent },
48
+ });
49
+ };
50
+ export const setActiveSectionChanged = (dispatch, activeSection) => {
51
+ dispatch({
52
+ type: RouteReducerConstants.activeSectionChanged,
53
+ payload: { activeSection },
54
+ });
55
+ };
56
+ export const updateisNextBtnClickedToShowValidationError = (dispatch, isNextBtnClickedToShowValidationError) => {
57
+ dispatch({
58
+ type: RouteReducerConstants.setisNextBtnClickedToShowValidationError,
59
+ payload: { isNextBtnClickedToShowValidationError },
60
+ });
61
+ };