@rh-support/troubleshoot 2.6.119 → 2.6.121

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 (90) hide show
  1. package/lib/esm/components/AccountInfo/css/accountSelector.css +3 -2
  2. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  3. package/lib/esm/components/CaseEditView/Case.js +1 -1
  4. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
  6. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +2 -4
  8. package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
  9. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
  10. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +4 -2
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +2 -1
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +2 -3
  16. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +13 -33
  17. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +3 -3
  18. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +1 -1
  19. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +1 -1
  20. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  21. package/lib/esm/components/CaseInformation/CaseGroup.js +11 -1
  22. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  23. package/lib/esm/components/CaseInformation/CaseInformation.js +4 -4
  24. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  25. package/lib/esm/components/CaseInformation/Description.js +1 -3
  26. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  27. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  28. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  29. package/lib/esm/components/CaseInformation/SupportLevel.js +1 -1
  30. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  31. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +12 -6
  32. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  33. package/lib/esm/components/IdeaInformation/IdeaInformation.js +4 -4
  34. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  35. package/lib/esm/components/OpenCase/OpenCase.js +8 -2
  36. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  37. package/lib/esm/components/ProductSelector/AllProductsSelector.js +19 -6
  38. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  39. package/lib/esm/components/ProductSelector/ProductSelector.js +12 -5
  40. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts +2 -0
  41. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
  42. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +16 -13
  43. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  44. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  45. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  46. package/lib/esm/components/Recommendations/Recommendations.js +38 -38
  47. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  48. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  49. package/lib/esm/components/Review/Review.js +5 -1
  50. package/lib/esm/components/TroubleshootSection/AskRedHat.js +1 -1
  51. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +0 -9
  52. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  53. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +44 -150
  54. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  55. package/lib/esm/components/shared/useIsSectionValid.js +71 -32
  56. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  57. package/lib/esm/components/wizardLayout/WizardAside.js +9 -18
  58. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  59. package/lib/esm/components/wizardLayout/WizardMain.js +64 -110
  60. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  61. package/lib/esm/components/wizardLayout/WizardNavigation.js +53 -59
  62. package/lib/esm/css/AskRedHat.css +2 -9
  63. package/lib/esm/css/app.css +1 -1
  64. package/lib/esm/hooks/useWizard.d.ts +0 -4
  65. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  66. package/lib/esm/hooks/useWizard.js +6 -20
  67. package/lib/esm/reducers/AIResponseConstNTypes.d.ts +2 -17
  68. package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -1
  69. package/lib/esm/reducers/AIResponseConstNTypes.js +0 -3
  70. package/lib/esm/reducers/AIResponseReducer.d.ts +0 -2
  71. package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -1
  72. package/lib/esm/reducers/AIResponseReducer.js +0 -17
  73. package/lib/esm/reducers/CaseConstNTypes.js +3 -3
  74. package/lib/esm/reducers/CaseDiscussionTabReducer.js +1 -1
  75. package/lib/esm/reducers/CaseHelpers.d.ts +8 -6
  76. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  77. package/lib/esm/reducers/CaseHelpers.js +20 -10
  78. package/lib/esm/reducers/CaseReducer.d.ts +1 -0
  79. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  80. package/lib/esm/reducers/CaseReducer.js +37 -2
  81. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  82. package/lib/esm/reducers/RouteConstNTypes.js +1 -0
  83. package/lib/esm/scss/_pf-overrides.scss +23 -2
  84. package/package.json +9 -11
  85. package/lib/esm/components/Suggestions/TopContentSidebar.d.ts +0 -3
  86. package/lib/esm/components/Suggestions/TopContentSidebar.d.ts.map +0 -1
  87. package/lib/esm/components/Suggestions/TopContentSidebar.js +0 -26
  88. package/lib/esm/hooks/useAB.d.ts +0 -22
  89. package/lib/esm/hooks/useAB.d.ts.map +0 -1
  90. package/lib/esm/hooks/useAB.js +0 -37
@@ -9,6 +9,4 @@ export declare const streamingError: (error: string, isRateLimited?: boolean) =>
9
9
  export declare const addSubmittedFeedbackType: (feedbackType: string) => IAIResponseActionType;
10
10
  export declare const clearSubmittedFeedbackTypes: () => IAIResponseActionType;
11
11
  export declare const updateQuotaLimit: (quotaLimit: number) => IAIResponseActionType;
12
- export declare const updateConversationId: (conversationId: string) => IAIResponseActionType;
13
- export declare const setHasChunkReceived: (hasChunkReceived: boolean) => IAIResponseActionType;
14
12
  //# sourceMappingURL=AIResponseReducer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AIResponseReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/AIResponseReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAEH,qBAAqB,EACrB,gBAAgB,EAEnB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,iBAAiB,UACnB,gBAAgB,UACf,qBAAqB,KAC9B,gBAwFF,CAAC;AAGF,eAAO,MAAM,eAAe,QAAO,qBAGJ,CAAC;AAEhC,eAAO,MAAM,gBAAgB,QAAO,qBAGL,CAAC;AAEhC,eAAO,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gB,MAAM,KAAG,qBAIvB,CAAC"}
@@ -26,15 +26,6 @@ export const aiResponseReducer = (state = initialAIResponseState, action) => {
26
26
  case AIResponseConstants.updateQuotaLimit: {
27
27
  return Object.assign(Object.assign({}, state), { quotaLimit: action.payload.quotaLimit });
28
28
  }
29
- case AIResponseConstants.updateConversationId: {
30
- return Object.assign(Object.assign({}, state), { aiResponse: state.aiResponse
31
- ? Object.assign(Object.assign({}, state.aiResponse), { conversationId: action.payload.conversationId }) : {
32
- conversationId: action.payload.conversationId,
33
- } });
34
- }
35
- case AIResponseConstants.setHasChunkReceived: {
36
- return Object.assign(Object.assign({}, state), { hasChunkReceived: action.payload.hasChunkReceived });
37
- }
38
29
  default: {
39
30
  return state;
40
31
  }
@@ -70,11 +61,3 @@ export const updateQuotaLimit = (quotaLimit) => ({
70
61
  type: AIResponseConstants.updateQuotaLimit,
71
62
  payload: { quotaLimit },
72
63
  });
73
- export const updateConversationId = (conversationId) => ({
74
- type: AIResponseConstants.updateConversationId,
75
- payload: { conversationId },
76
- });
77
- export const setHasChunkReceived = (hasChunkReceived) => ({
78
- type: AIResponseConstants.setHasChunkReceived,
79
- payload: { hasChunkReceived },
80
- });
@@ -84,9 +84,9 @@ export const SeverityDescription = {
84
84
  };
85
85
  //updated description details
86
86
  export const SeverityDescriptionDetails = {
87
- ["1 (Urgent)" /* SeverityLevelsInternal.SEV_1 */]: 'An issue with a Red Hat Product or Service that is actively causing serious interruptions to your business critical operations. This is an issue requiring immediate attention as there is a significant risk to your business.',
88
- ["2 (High)" /* SeverityLevelsInternal.SEV_2 */]: 'An issue with a Red Hat Product or Service that is partially functional (such as degradation of a service but the service is still available) and actively impacting your business operations. This is an issue on a business critical system requiring accelerated attention.',
89
- ["3 (Normal)" /* SeverityLevelsInternal.SEV_3 */]: 'An issue with a Red Hat Product or Service that is currently functioning as expected but you either (1) recently experienced a degradation that you are monitoring or seeking a root cause for or (2) you are seeing indicators of a potential loss of functionality to a business critical system.',
87
+ ["1 (Urgent)" /* SeverityLevelsInternal.SEV_1 */]: 'An issue with a Red Hat Product or Service that is<strong> actively causing serious interruptions to your business critical operations.</strong> This is an issue requiring immediate attention as there is a significant risk to your business.',
88
+ ["2 (High)" /* SeverityLevelsInternal.SEV_2 */]: 'An issue with a Red Hat Product or Service that is <strong> partially functional </strong>(such as degradation of a service but the service is still available) and actively impacting your business operations. This is an issue on a business critical system requiring accelerated attention.',
89
+ ["3 (Normal)" /* SeverityLevelsInternal.SEV_3 */]: 'An issue with a Red Hat Product or Service that is <strong> currently functioning as expected </strong> but you either (1) recently experienced a degradation that you are monitoring or seeking a root cause for or (2) you are seeing indicators of a potential loss of functionality to a business critical system.',
90
90
  ["4 (Low)" /* SeverityLevelsInternal.SEV_4 */]: 'Typically, a query that does not involve any interruption to your business critical operations. ',
91
91
  };
92
92
  export const LargeDescriptionErrorMessage = 'Cumulative case description cannot be more than {{limit}} characters';
@@ -147,7 +147,7 @@ export const setDiscussions = (dispatch, comments, chats, attachments, feedbacks
147
147
  }));
148
148
  const allDiscussions = [...allComments, ...allChats, ...allAttachments, ...allExternalTrackers];
149
149
  const sortedAllDiscussions = orderBy(allDiscussions, 'last_modified_date', 'desc');
150
- // set filter dropdown state
150
+ //set filter dropdown state
151
151
  // when we don't have any result for a discussion type, in filter options dropdown list, we make that type disable
152
152
  discussionFiltersListState.forEach((filter) => {
153
153
  if (filter.value === DiscussionType.ATTACHMENT) {
@@ -3,7 +3,9 @@ import { ICasePayload, ICaseResourceLink, ICepDetails } from '@cee-eng/hydrajs/@
3
3
  import { IEntitlement } from '@cee-eng/hydrajs/@types/api/public/entitlements';
4
4
  import { IContact } from '@cee-eng/hydrajs/@types/models/contact';
5
5
  import { ISolrRecommendation } from '@cee-eng/hydrajs/@types/models/solr/solr';
6
- import { IPortalJwtToken } from '@rh-support/types/shared';
6
+ import { IApiResponseDetails } from '@rh-support/types/shared';
7
+ import { UserAuth } from '@rh-support/user-permissions';
8
+ import React from 'react';
7
9
  import { ICaseState } from './CaseConstNTypes';
8
10
  export declare const getCaseRecommendations: (docs: ISolrRecommendation[], oldDocs: any) => any[];
9
11
  export declare const getCepCommentFromCepDetails: (cepDetails: ICepDetails) => string;
@@ -11,14 +13,14 @@ export declare const getRecommendationObject: (doc: ISolrRecommendation, index:
11
13
  export declare const getUpdatedDescription: (issue: string, environment?: string, periodicityOfIssue?: string, timeFramesAndUrgency?: string, v3ClusterName?: string, product?: string, version?: string) => string;
12
14
  export declare const getDescriptionWOQues: (issue: string, environment?: string, periodicityOfIssue?: string, timeFramesAndUrgency?: string) => string;
13
15
  export declare const getIrtForSLAAndSeverity: (slaProcessId: string, severity: string) => string;
14
- export declare const getNewSeverityStringDef: (severity: string) => string;
16
+ export declare const getNewSeverityStringDef: (severity: string) => string | React.JSX.Element;
15
17
  export declare const getOrtForSLAAndSeverity: (slaProcessId: string, severity: string) => string;
16
18
  export declare const getSeverityDescription: (severity: string) => string;
17
19
  export declare const isClusterIDValid: (caseState: any, allProducts: any) => boolean;
18
- export declare const isCaseStateValid: (caseState: ICaseState, loggedInUserJwtToken: Partial<IPortalJwtToken>) => boolean;
19
- export declare const isIdeaCaseStateValid: (caseState: ICaseState, loggedInUserJwtToken: Partial<IPortalJwtToken>) => boolean;
20
- export declare const isCaseManagementStateValid: (caseState: ICaseState, loggedInUserJwtToken: Partial<IPortalJwtToken>) => boolean;
21
- export declare const isCaseInformationSectionValid: (caseState: ICaseState, loggedInUserJwtToken: Partial<IPortalJwtToken>) => boolean;
20
+ export declare const isCaseStateValid: (caseState: ICaseState, loggedInUserRights: IApiResponseDetails<UserAuth>) => boolean;
21
+ export declare const isIdeaCaseStateValid: (caseState: ICaseState, loggedInUserRights: IApiResponseDetails<UserAuth>) => boolean;
22
+ export declare const isCaseManagementStateValid: (caseState: ICaseState, loggedInUserRights: IApiResponseDetails<UserAuth>) => boolean;
23
+ export declare const isCaseInformationSectionValid: (caseState: ICaseState, loggedInUserRights: IApiResponseDetails<UserAuth>) => boolean;
22
24
  export declare const createCasePayload: (caseState: ICaseState, sessionItem?: ISessionItem, isCaseCreate?: boolean) => Partial<ICasePayload>;
23
25
  export declare const getProcessedEntitlements: (caseEntitlements: IEntitlement[]) => IEntitlement[];
24
26
  export declare const getHasInvalidEntitlements: (caseEntitlements: IEntitlement[]) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAmB3D,OAAO,EAOH,UAAU,EAkBb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,WAAW,KAAG,MAOrE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,mBAAmB,SAAS,MAAM,sBAyB9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,UACvB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,kBACb,MAAM,YACZ,MAAM,YACN,MAAM,KACjB,MAyBF,CAAC;AAIF,eAAO,MAAM,oBAAoB,UACtB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,KAC9B,MAQF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,uBAAuB,aAAc,MAAM,KAAG,MAM1D,CAAC;AA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AAC,KAClD,OA0BF,CAAC;AAEF,eAAO,MAAM,0BAA0B,cACxB,UAAU,sBACD,mBAAmB,CAAC,QAAQ,CAAC,KAClD,OAYF,CAAC;AAIF,eAAO,MAAM,6BAA6B,cAC3B,UAAU,sBACD,mBAAmB,CAAC,QAAQ,CAAC,KAClD,OAkBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,cACf,UAAU,gBACP,YAAY,iBACZ,OAAO,KACtB,OAAO,CAAC,YAAY,CA6EtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,qBAAsB,YAAY,EAAE,KAAG,YAAY,EAEvF,CAAC;AACF,eAAO,MAAM,yBAAyB,qBAAsB,YAAY,EAAE,KAAG,OAE5E,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACrB,YAAY,6BACE,MAAM,mBAChB,MAAM,KACxB,OAAO,CAAC,YAAY,CAiCtB,CAAC;AACF,eAAO,MAAM,yBAAyB,gBACrB,OAAO,CAAC,YAAY,CAAC,gCACJ,QAAQ,EAAE,KACzC,eAiDF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { canManageCase, getAppVersion, getUserAgentForCaseMode, getVersion, isPremiumEntitlement, showFtsOnCreateCasePage, } from '@rh-support/utils';
1
+ import { getAppVersion, getUserAgentForCaseMode, getVersion, isPremiumEntitlement, showFtsOnCreateCasePage, } from '@rh-support/utils';
2
2
  import filter from 'lodash/filter';
3
3
  import forEach from 'lodash/forEach';
4
4
  import isEmpty from 'lodash/isEmpty';
@@ -6,6 +6,7 @@ import map from 'lodash/map';
6
6
  import some from 'lodash/some';
7
7
  import unionBy from 'lodash/unionBy';
8
8
  import uniqBy from 'lodash/uniqBy';
9
+ import React from 'react';
9
10
  import { isPhoneValid, trimAndReplacePlus } from '../components/shared/utils';
10
11
  import { getIsClusterIdInvalid, isClusterIdEnabledForProduct } from '../utils/caseOpenshiftClusterIdUtils';
11
12
  import { CASE_DETAILS_ISSUE_LIMIT, CASE_REFERENCE_NUMBER_LIMIT, CLUSTER_ID_LIMIT, CONTACT_INFO_24X7_LIMIT, DESCRIPTION_LENGTH_LIMIT, HOSTNAME_LENGTH_LIMIT, IDEA_SECOND_KTQUESTION_MAX_LIMIT, ITRForSLASeverity, KTQUESTION_MAX_LIMIT, KtQuestionConstant, SESSION_ENVIRONMENT_LIMIT, SESSION_ISSUE_LIMIT, SESSION_NO_CLUSTER_REASON_EXPLANATION_LENGTH_LIMIT, SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT, SESSION_NOTIFIED_USERS_EXTERNAL_LIMIT, SESSION_NOTIFIED_USERS_INTERNAL_LIMIT, SESSION_PERIODICITY_OF_ISSUE_LIMIT, SESSION_PHONE_LENGTH_LIMIT, SESSION_TIME_FRAMES_URGENCY_LIMIT, SeverityDescription, SeverityDescriptionDetails, TITLE_SUMMARY_LENGTH_LIMIT, } from './CaseConstNTypes';
@@ -90,7 +91,16 @@ export const getNewSeverityStringDef = (severity) => {
90
91
  if (isEmpty(severity)) {
91
92
  return '';
92
93
  }
93
- return SeverityDescriptionDetails[severity];
94
+ const description = SeverityDescriptionDetails[severity];
95
+ if (!description) {
96
+ return '';
97
+ }
98
+ if (!description.includes('<')) {
99
+ return description;
100
+ }
101
+ return React.createElement('span', {
102
+ dangerouslySetInnerHTML: { __html: description },
103
+ });
94
104
  };
95
105
  export const getOrtForSLAAndSeverity = (slaProcessId, severity) => {
96
106
  if (isEmpty(slaProcessId) || isEmpty(severity)) {
@@ -137,7 +147,7 @@ export const isClusterIDValid = (caseState, allProducts) => {
137
147
  return hasValidClusterId() || hasValidReason() || hasValidReasonExplanation() || hasValidV3ClusterName();
138
148
  };
139
149
  // Add a !isEmpty to to make any KTQuestion Mandatory in isCaseStateValid
140
- export const isCaseStateValid = (caseState, loggedInUserJwtToken) => {
150
+ export const isCaseStateValid = (caseState, loggedInUserRights) => {
141
151
  const case_details = caseState.caseDetails;
142
152
  return (!isEmpty(case_details.issue) &&
143
153
  isEmpty(case_details.caseNumber) &&
@@ -162,9 +172,9 @@ export const isCaseStateValid = (caseState, loggedInUserJwtToken) => {
162
172
  (caseState.selectedAccountDetails.data.requireCGroupOnCreate
163
173
  ? !isEmpty(case_details.groupNumber) && case_details.groupNumber !== '-1'
164
174
  : true) &&
165
- canManageCase(loggedInUserJwtToken));
175
+ loggedInUserRights.data.canManageCases());
166
176
  };
167
- export const isIdeaCaseStateValid = (caseState, loggedInUserJwtToken) => {
177
+ export const isIdeaCaseStateValid = (caseState, loggedInUserRights) => {
168
178
  const case_details = caseState.caseDetails;
169
179
  return (!isEmpty(case_details.issue) &&
170
180
  isEmpty(case_details.caseNumber) &&
@@ -186,9 +196,9 @@ export const isIdeaCaseStateValid = (caseState, loggedInUserJwtToken) => {
186
196
  (caseState.selectedAccountDetails.data.requireCGroupOnCreate
187
197
  ? !isEmpty(case_details.groupNumber) && case_details.groupNumber !== '-1'
188
198
  : true) &&
189
- canManageCase(loggedInUserJwtToken));
199
+ loggedInUserRights.data.canManageCases());
190
200
  };
191
- export const isCaseManagementStateValid = (caseState, loggedInUserJwtToken) => {
201
+ export const isCaseManagementStateValid = (caseState, loggedInUserRights) => {
192
202
  const case_details = caseState.caseDetails;
193
203
  return (isEmpty(case_details.caseNumber) &&
194
204
  !isEmpty(case_details.severity) &&
@@ -196,10 +206,10 @@ export const isCaseManagementStateValid = (caseState, loggedInUserJwtToken) => {
196
206
  ? !isEmpty(case_details.groupNumber) && case_details.groupNumber !== '-1'
197
207
  : true) &&
198
208
  isPhoneValid(case_details.phoneCountryCode, case_details.phoneAreaCodePrefixLineNumber) &&
199
- canManageCase(loggedInUserJwtToken));
209
+ loggedInUserRights.data.canManageCases());
200
210
  };
201
211
  // Add a !isEmpty to to make any KTQuestion Mandatory in isCaseInformationSectionValid
202
- export const isCaseInformationSectionValid = (caseState, loggedInUserJwtToken) => {
212
+ export const isCaseInformationSectionValid = (caseState, loggedInUserRights) => {
203
213
  const case_details = caseState.caseDetails;
204
214
  //checks to ensure the ktquestion section is valid
205
215
  return (isEmpty(case_details.caseNumber) &&
@@ -213,7 +223,7 @@ export const isCaseInformationSectionValid = (caseState, loggedInUserJwtToken) =
213
223
  case_details.environment.length <= KTQUESTION_MAX_LIMIT &&
214
224
  case_details.periodicityOfIssue.length <= KTQUESTION_MAX_LIMIT &&
215
225
  !isEmpty(case_details.accountNumberRef) &&
216
- canManageCase(loggedInUserJwtToken));
226
+ loggedInUserRights.data.canManageCases());
217
227
  };
218
228
  export const createCasePayload = (caseState, sessionItem, isCaseCreate = false) => {
219
229
  var _a, _b, _c, _d, _e, _f, _g;
@@ -36,6 +36,7 @@ export declare const deleteNotifiedUsers: (dispatch: CaseReducerDispatchType, ca
36
36
  export declare const addingNotifiedUsers: (dispatch: CaseReducerDispatchType, caseNumber: string, addedUsers: IContact[]) => Promise<void>;
37
37
  export declare const clearSelectedAccount: (dispatch: CaseReducerDispatchType) => void;
38
38
  export declare const setCaseAccountNumber: (dispatch: CaseReducerDispatchType, accountNumber: string, isLoggedInUsersAccount?: boolean, loggedInUserAccount?: Partial<IAccount>) => Promise<void>;
39
+ export declare const fetchCaseGroupsForAccount: (dispatch: CaseReducerDispatchType, accountNumber: string, setCaseGroupToUngroupedOrDefault?: boolean, abortSignal?: AbortSignal, caseGroupNumberToRestore?: string | undefined) => Promise<void>;
39
40
  export declare const setCaseOwner: (dispatch: CaseReducerDispatchType, owner: IContact, product: string, abortSignalCaseGroup?: AbortSignal, abortSignalEntitlements?: AbortSignal, setCaseGroupToUngroupedOrDefault?: boolean, caseGroupNumberToRestore?: string | undefined, canChangeGroup?: boolean, isUserUpdate?: boolean, caseNumber?: string) => Promise<void>;
40
41
  export declare const fetchCaseEntitlements: (dispatch: CaseReducerDispatchType, ssoUserName: string, product?: string, abortSignal?: AbortSignal, isUserUpdate?: boolean, caseNumber?: string) => Promise<void>;
41
42
  export declare const fetchCaseGroupsForSSO: (dispatch: CaseReducerDispatchType, contactSsoUsername: string, setCaseGroupToUngroupedOrDefault?: boolean, abortSignal?: AbortSignal, caseGroupNumberToRestore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jC,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC,EAC5E,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,0BAA0B,EAAE,QAO5D;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,iBAiB1F;AAED,eAAO,MAAM,kBAAkB,aAAc,uBAAuB,QAAQ,OAAO,SAKlF,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAAc,uBAAuB,mBAAmB,MAAM,SAK5F,CAAC"}
@@ -423,6 +423,32 @@ export const setCaseAccountNumber = (dispatch_1, accountNumber_1, ...args_1) =>
423
423
  });
424
424
  }
425
425
  });
426
+ export const fetchCaseGroupsForAccount = (dispatch_1, accountNumber_1, ...args_1) => __awaiter(void 0, [dispatch_1, accountNumber_1, ...args_1], void 0, function* (dispatch, accountNumber, setCaseGroupToUngroupedOrDefault = false, abortSignal, caseGroupNumberToRestore) {
427
+ var _a, _b;
428
+ dispatch({
429
+ type: CaseReducerConstants.caseStateChanged,
430
+ payload: { ownersCaseGroups: getApiResourceObject([], true) },
431
+ });
432
+ try {
433
+ const response = yield publicApi.caseGroups.getCaseGroupsForInternalUser(accountNumber, abortSignal);
434
+ (response || []).sort((a, b) => a.name.localeCompare(b.name));
435
+ const defaultCaseGroup = (_b = (!isEmpty(caseGroupNumberToRestore)
436
+ ? caseGroupNumberToRestore
437
+ : (_a = find(response, (g) => g.isDefault)) === null || _a === void 0 ? void 0 : _a.groupNum)) !== null && _b !== void 0 ? _b : '-1';
438
+ dispatch({
439
+ type: CaseReducerConstants.caseStateChanged,
440
+ payload: { ownersCaseGroups: getApiResourceObject(response, false) },
441
+ });
442
+ setCaseGroupToUngroupedOrDefault && setCaseDetails(dispatch, { groupNumber: defaultCaseGroup });
443
+ }
444
+ catch (e) {
445
+ dispatch({
446
+ type: CaseReducerConstants.caseStateChanged,
447
+ payload: { ownersCaseGroups: getApiResourceObject([], false, true, e.message) },
448
+ });
449
+ setCaseGroupToUngroupedOrDefault && setCaseDetails(dispatch, { groupNumber: '-1' });
450
+ }
451
+ });
426
452
  export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGroup_1, abortSignalEntitlements_1, ...args_1) => __awaiter(void 0, [dispatch_1, owner_1, product_1, abortSignalCaseGroup_1, abortSignalEntitlements_1, ...args_1], void 0, function* (dispatch, owner, product, abortSignalCaseGroup, abortSignalEntitlements, setCaseGroupToUngroupedOrDefault = false, caseGroupNumberToRestore, canChangeGroup = true, isUserUpdate, caseNumber) {
427
453
  if (isEmpty(owner) || isEmpty(owner.ssoUsername)) {
428
454
  dispatch({
@@ -455,8 +481,17 @@ export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGrou
455
481
  type: CaseReducerConstants.caseDetailChanged,
456
482
  payload: { caseDetails: { contactSSOName: owner.ssoUsername } },
457
483
  });
458
- canChangeGroup &&
459
- fetchCaseGroupsForSSO(dispatch, owner.ssoUsername, setCaseGroupToUngroupedOrDefault, abortSignalCaseGroup, caseGroupNumberToRestore);
484
+ if (canChangeGroup) {
485
+ const accountNumber = owner.accountNumber;
486
+ if (owner.isInternal && accountNumber) {
487
+ // For internal users, fetch case groups based on account number
488
+ fetchCaseGroupsForAccount(dispatch, accountNumber, setCaseGroupToUngroupedOrDefault, abortSignalCaseGroup, caseGroupNumberToRestore);
489
+ }
490
+ else {
491
+ // For external users, continue using SSO username
492
+ fetchCaseGroupsForSSO(dispatch, owner.ssoUsername, setCaseGroupToUngroupedOrDefault, abortSignalCaseGroup, caseGroupNumberToRestore);
493
+ }
494
+ }
460
495
  delay(() => __awaiter(void 0, void 0, void 0, function* () {
461
496
  return yield fetchCaseEntitlements(dispatch, owner.ssoUsername, product, abortSignalEntitlements, isUserUpdate, caseNumber);
462
497
  }), 5000, 'later');
@@ -1 +1 @@
1
- {"version":3,"file":"RouteConstNTypes.d.ts","sourceRoot":"","s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AAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,eAAe;CAAG;AACnC,oBAAY,gBAAgB;IACxB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,sBAAsB,2BAA2B;IACjD,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAClB;AAKD,eAAO,MAAM,4BAA4B,EAAE,gBAAgB,EAK1D,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,gBAAgB,EAM9D,CAAC;AAEF,eAAO,MAAM,iCAAiC,oBAQ7C,CAAC;AAEF,eAAO,MAAM,gCAAgC,oBAQ5C,CAAC;AAEF,eAAO,MAAM,4BAA4B,oBAQxC,CAAC;AAGF,eAAO,MAAM,0BAA0B,oBAAiC,CAAC;AAEzE,eAAO,MAAM,mCAAmC,oBAA+D,CAAC;AAEhH,eAAO,MAAM,kCAAkC,oBAO9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,oBAO3C,CAAC;AAEF,eAAO,MAAM,0CAA0C,oBAStD,CAAC;AAEF,eAAO,MAAM,sCAAsC,oBAA4D,CAAC;AAEhH,eAAO,MAAM,qCAAqC,oBAGjD,CAAC;AAEF,eAAO,MAAM,6BAA6B,oBAAiC,CAAC;AAE5E,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAKtD,CAAC"}
@@ -58,6 +58,7 @@ export const openCaseRouteSectionSequence = [
58
58
  export const sessionRestoreCardSections = [AppRouteSections.GET_SUPPORT];
59
59
  export const hideFileUploadSidebarWidgetSections = [AppRouteSections.GET_SUPPORT, AppRouteSections.SUBMIT_CASE];
60
60
  export const showSidebarRecommendationsSections = [
61
+ AppRouteSections.RESOURCES,
61
62
  AppRouteSections.ADDITIONAL_INFORMATION,
62
63
  AppRouteSections.DESCRIBE_IDEA,
63
64
  AppRouteSections.CONFIGURATION,
@@ -10,6 +10,7 @@
10
10
  background-color: rgba(3, 3, 3, 0.619608);
11
11
  box-sizing: border-box;
12
12
  color: rgb(21, 21, 21);
13
+ z-index: 9999;
13
14
 
14
15
  .pf-v6-c-modal-box {
15
16
  max-width: 90%;
@@ -371,8 +372,10 @@ div.pf-v6-c-alert__description div.ea-rule p a.pf-v6-c-button {
371
372
 
372
373
  //override pfe-accordion discloser for modal
373
374
  div pfe-accordion {
374
- --pfe-accordion--FontSize--header: 16px;
375
- --pfe-accordion--FontWeight--header: 600;
375
+ --pfe-accordion--FontSize--header: 18px;
376
+ --pfe-accordion--FontWeight--header: 300;
377
+ border: none !important;
378
+ box-shadow: none !important;
376
379
  }
377
380
 
378
381
  section div.file-recommendations {
@@ -577,6 +580,21 @@ span.pf-v6-c-input-group__text {
577
580
  border-radius: var(--global-border-radius-small, 6px);
578
581
  }
579
582
 
583
+ .top-recommendations {
584
+ border: 1px solid #d2d2d2 !important;
585
+ border-radius: var(--global-border-radius-small, 6px);
586
+ margin-top: 16px;
587
+
588
+ --pfe-accordion--BorderColor: transparent;
589
+ --pfe-accordion--BorderWidth: 0;
590
+ --pfe-accordion--BoxShadow: 0 0 0 transparent;
591
+ }
592
+
593
+ .top-recommendations pfe-accordion-header[expanded] + pfe-accordion-panel {
594
+ border-bottom: 1px solid #d2d2d2;
595
+ padding-bottom: 0.5rem;
596
+ }
597
+
580
598
  .contact-select {
581
599
  font-weight: normal !important;
582
600
 
@@ -744,6 +762,9 @@ label.react-typeahead-label-wrapper {
744
762
  .rbt-token.rbt-token-removeable.rbt-token-active {
745
763
  color: #ffffff;
746
764
  }
765
+ &:has([aria-expanded='true']) {
766
+ height: 350px;
767
+ }
747
768
  }
748
769
  #case-history-paginated-timeline-pagination-bottom-pagination {
749
770
  justify-content: flex-start;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.6.119",
3
+ "version": "2.6.121",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -25,7 +25,7 @@
25
25
  "lib/**/*"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@cee-eng/hydrajs": "4.18.95",
28
+ "@cee-eng/hydrajs": "4.18.97",
29
29
  "@cee-eng/ui-toolkit": "1.1.8",
30
30
  "@patternfly/patternfly": "6.2.1",
31
31
  "@patternfly/react-core": "6.2.1",
@@ -33,11 +33,9 @@
33
33
  "i18next": "^23.15.0",
34
34
  "js-markdown-extra": "^1.2.4",
35
35
  "js-worker-search": "^1.4.1",
36
- "lazysizes": "^5.3.2",
37
36
  "localforage": "^1.10.0",
38
37
  "lodash": "^4.17.21",
39
38
  "mark.js": "^8.11.1",
40
- "marked": "^1.2.4",
41
39
  "qs": "^6.7.0",
42
40
  "react": "18.2.0",
43
41
  "react-dom": "18.2.0",
@@ -49,9 +47,9 @@
49
47
  "react-virtualized": "^9.22.5"
50
48
  },
51
49
  "dependencies": {
52
- "@cee-eng/hydrajs": "4.18.95",
50
+ "@cee-eng/hydrajs": "4.18.97",
53
51
  "@cee-eng/ui-toolkit": "1.1.8",
54
- "@ifd-ui/ask-redhat-core": "^0.0.48",
52
+ "@ifd-ui/ask-redhat-core": "^0.0.38",
55
53
  "@patternfly/patternfly": "6.2.1",
56
54
  "@patternfly/react-core": "6.2.1",
57
55
  "@patternfly/react-table": "6.2.1",
@@ -59,11 +57,11 @@
59
57
  "@progress/kendo-licensing": "1.3.5",
60
58
  "@progress/kendo-react-pdf": "^5.16.0",
61
59
  "@redux-devtools/extension": "^3.3.0",
62
- "@rh-support/components": "2.5.64",
63
- "@rh-support/react-context": "2.5.80",
60
+ "@rh-support/components": "2.5.76",
61
+ "@rh-support/react-context": "2.5.96",
64
62
  "@rh-support/types": "2.0.5",
65
- "@rh-support/user-permissions": "2.5.31",
66
- "@rh-support/utils": "2.5.27",
63
+ "@rh-support/user-permissions": "2.5.49",
64
+ "@rh-support/utils": "2.5.45",
67
65
  "@types/react-redux": "^7.1.33",
68
66
  "@types/redux": "^3.6.0",
69
67
  "date-fns": "3.6.0",
@@ -133,5 +131,5 @@
133
131
  "defaults and supports es6-module",
134
132
  "maintained node versions"
135
133
  ],
136
- "gitHead": "bcd580871dcd6a13b6ba1806ef98cec21d783082"
134
+ "gitHead": "a9ea4448da04c10f3e42f586114a147474f78f8a"
137
135
  }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export default function TopContentSidebar(): React.JSX.Element;
3
- //# sourceMappingURL=TopContentSidebar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TopContentSidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/TopContentSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,MAAM,CAAC,OAAO,UAAU,iBAAiB,sBA2CxC"}
@@ -1,26 +0,0 @@
1
- import { Card, CardBody, CardHeader, Tooltip } from '@patternfly/react-core';
2
- import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
3
- import isEqual from 'lodash/isEqual';
4
- import React, { useContext } from 'react';
5
- import { Trans, useTranslation } from 'react-i18next';
6
- import { useCaseSelector } from '../../context/CaseContext';
7
- import { TCStateContext } from '../../context/TopContentContext';
8
- export default function TopContentSidebar() {
9
- const { t } = useTranslation();
10
- const { topContentState: { topContent }, } = useContext(TCStateContext);
11
- const { version } = useCaseSelector((state) => ({
12
- version: state.caseDetails.version,
13
- }), isEqual);
14
- // Only show if there's a version but no topContent data
15
- if (!version || topContent.data.length > 0) {
16
- return null;
17
- }
18
- return (React.createElement(Card, { id: "card", className: "pf-v6-u-mt-md" },
19
- React.createElement(CardHeader, { id: "card-title" },
20
- React.createElement(Trans, { i18nKey: 'i18nKeyPopularSolutions' }, "Red Hat hand picked support articles"),
21
- React.createElement(Tooltip, { content: React.createElement("div", null,
22
- React.createElement(Trans, null, "Support articles are matched to the product and version details you selected, not the problem details you entered.")) },
23
- React.createElement(InfoCircleIcon, { className: "pf-v6-u-ml-sm", "aria-label": "More info about how support articles are matched" }))),
24
- React.createElement(CardBody, { "aria-label": t('No recommendations for this product'), className: "file-recs-no-recommendation" },
25
- React.createElement(Trans, null, "No recommendations for this product"))));
26
- }
@@ -1,22 +0,0 @@
1
- export interface IUseABOptions {
2
- defaultVariation?: ABEnum;
3
- }
4
- export interface IUseABReturn {
5
- variation: ABEnum;
6
- isVariationA: boolean;
7
- isVariationB: boolean;
8
- }
9
- export interface IUseABComponentOptions extends IUseABOptions {
10
- A: JSX.Element | null;
11
- B: JSX.Element | null;
12
- }
13
- export interface IUseABComponentReturn extends IUseABReturn {
14
- component: JSX.Element | null;
15
- }
16
- export declare enum ABEnum {
17
- A = "A",
18
- B = "B"
19
- }
20
- export declare function useAB(options?: IUseABOptions): IUseABReturn;
21
- export declare function useABComponent(options: IUseABComponentOptions): IUseABComponentReturn;
22
- //# sourceMappingURL=useAB.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAB.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAB.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IACzD,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACvD,SAAS,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACjC;AAED,oBAAY,MAAM;IACd,CAAC,MAAM;IACP,CAAC,MAAM;CACV;AAED,wBAAgB,KAAK,CAAC,OAAO,GAAE,aAAkB,GAAG,YAAY,CAkC/D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAMrF"}
@@ -1,37 +0,0 @@
1
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
2
- import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
3
- import { useContext, useEffect, useState } from 'react';
4
- export var ABEnum;
5
- (function (ABEnum) {
6
- ABEnum["A"] = "A";
7
- ABEnum["B"] = "B";
8
- })(ABEnum || (ABEnum = {}));
9
- export function useAB(options = {}) {
10
- const { globalMetadataState: { pcmConfig, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
11
- const [testVariation, setTestVariation] = useState((options === null || options === void 0 ? void 0 : options.defaultVariation) || ABEnum.A);
12
- useEffect(() => {
13
- if (loggedInUsersAccount.data.hasConfirmedStatesideSupport || loggedInUsersAccount.data.secureSupport) {
14
- setTestVariation(ABEnum.B);
15
- return;
16
- }
17
- const variantAAccountNumbers = getConfigField(pcmConfig.data, 'askRedHatAccountsA', PCM_CONFIG_FIELD_TYPE.STRING);
18
- const userAccountNumber = loggedInUsersAccount.data.accountNumber;
19
- const isUserInVariantAAccountNumbers = variantAAccountNumbers === null || variantAAccountNumbers === void 0 ? void 0 : variantAAccountNumbers.includes(userAccountNumber);
20
- if ((variantAAccountNumbers === null || variantAAccountNumbers === void 0 ? void 0 : variantAAccountNumbers.length) && userAccountNumber && isUserInVariantAAccountNumbers) {
21
- setTestVariation(ABEnum.A);
22
- }
23
- else {
24
- setTestVariation(ABEnum.B);
25
- }
26
- // eslint-disable-next-line react-hooks/exhaustive-deps
27
- }, [pcmConfig.data, loggedInUsersAccount.data.accountNumber]);
28
- return {
29
- variation: testVariation,
30
- isVariationA: testVariation === ABEnum.A,
31
- isVariationB: testVariation === ABEnum.B,
32
- };
33
- }
34
- export function useABComponent(options) {
35
- const variationObject = useAB(options);
36
- return Object.assign(Object.assign({}, variationObject), { component: variationObject.isVariationA ? options.A : options.B });
37
- }