@rh-support/troubleshoot 2.6.299 → 2.6.300

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 (178) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +40 -28
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +19 -46
  5. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/Case.js +17 -49
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -25
  9. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +17 -31
  11. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
  12. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
  14. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/index.js +28 -39
  16. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
  17. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +4 -3
  19. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +7 -4
  21. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -13
  23. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +33 -11
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +34 -38
  27. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
  29. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  30. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +59 -19
  31. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
  33. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
  34. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +148 -110
  36. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +2 -6
  37. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +241 -147
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -5
  41. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
  43. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  44. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
  45. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
  47. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  48. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
  49. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  50. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +9 -7
  51. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  52. package/lib/esm/components/CaseInformation/CaseInformation.js +5 -7
  53. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  54. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +24 -37
  55. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  56. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -32
  57. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  58. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  59. package/lib/esm/components/CaseManagement/CaseManagement.js +9 -4
  60. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  61. package/lib/esm/components/CaseManagement/Cep.js +7 -4
  62. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  63. package/lib/esm/components/IdeaInformation/IdeaInformation.js +12 -11
  64. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  65. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  66. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  67. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  68. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  69. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  70. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  71. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  72. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -30
  73. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  74. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  75. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  76. package/lib/esm/components/Review/Review.js +18 -16
  77. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  78. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  79. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  80. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +8 -5
  81. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  82. package/lib/esm/components/shared/useIsSectionValid.js +64 -50
  83. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  84. package/lib/esm/components/shared/usePostComment.js +10 -6
  85. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  86. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +24 -105
  87. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  88. package/lib/esm/components/wizardLayout/WizardLayout.js +7 -6
  89. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  90. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -10
  91. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  92. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  93. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  94. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -86
  95. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  96. package/lib/esm/reducers/CaseConstNTypes.js +1 -5
  97. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +1 -3
  98. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  99. package/lib/esm/reducers/CaseDetailsPageReducer.js +5 -22
  100. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -0
  101. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  102. package/lib/esm/reducers/CaseDiscussionTabReducer.js +28 -1
  103. package/lib/esm/reducers/CaseHelpers.d.ts +1 -2
  104. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  105. package/lib/esm/reducers/CaseHelpers.js +2 -34
  106. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  107. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  108. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  109. package/lib/esm/reducers/CaseReducer.d.ts +8 -27
  110. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  111. package/lib/esm/reducers/CaseReducer.js +33 -127
  112. package/package.json +6 -6
  113. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -3
  114. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  115. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -22
  116. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -15
  117. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  118. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -19
  119. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  120. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  121. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -49
  122. package/lib/esm/graphql/index.d.ts +0 -4
  123. package/lib/esm/graphql/index.d.ts.map +0 -1
  124. package/lib/esm/graphql/index.js +0 -3
  125. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  126. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  127. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  128. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  129. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  130. package/lib/esm/graphql/mutations/index.js +0 -1
  131. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  132. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  133. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -24
  134. package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
  135. package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
  136. package/lib/esm/graphql/queries/getParentId.js +0 -16
  137. package/lib/esm/graphql/queries/index.d.ts +0 -3
  138. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  139. package/lib/esm/graphql/queries/index.js +0 -2
  140. package/lib/esm/graphql/schemas/escalation.d.ts +0 -84
  141. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  142. package/lib/esm/graphql/schemas/escalation.js +0 -1
  143. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  144. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  145. package/lib/esm/graphql/schemas/index.js +0 -1
  146. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +0 -4
  147. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
  148. package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
  149. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  150. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  151. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -55
  152. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
  153. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  154. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  155. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  156. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  157. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -66
  158. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -80
  159. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  160. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  161. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -16
  162. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  163. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -25
  164. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  165. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  166. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  167. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  168. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  169. package/lib/esm/hooks/useCaseHistory.js +0 -98
  170. package/lib/esm/models/caseHistory.d.ts +0 -80
  171. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  172. package/lib/esm/models/caseHistory.js +0 -1
  173. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  174. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  175. package/lib/esm/utils/TimelineUtils.js +0 -134
  176. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
  177. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  178. package/lib/esm/utils/caseHistoryUtils.js +0 -165
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAOnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBAmKrC;kBAnKQ,eAAe;;;AAuKxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAOnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA6KrC;kBA7KQ,eAAe;;;AAiLxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import './css/accountSelector.css';
11
- import { useApolloClient } from '@apollo/client/react';
11
+ import { accounts } from '@cee-eng/hydrajs';
12
12
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
13
  import { AlertMessage, AlertType } from '@rh-support/components';
14
14
  import { AccountSelectorInternal, GlobalMetadataStateContext } from '@rh-support/react-context';
@@ -30,14 +30,12 @@ export const defaultProps = {
30
30
  function AccountSelector(props) {
31
31
  var _a;
32
32
  const [showNotEntitledMessage, setShowNotEntitledMessage] = useState(false);
33
- const { accountNumber, selectedAccountDetails, hasInvalidEntitlements } = useCaseSelector((state) => ({
33
+ const { accountNumber, selectedAccountDetails } = useCaseSelector((state) => ({
34
34
  accountNumber: state.caseDetails.accountNumberRef,
35
35
  selectedAccountDetails: state.selectedAccountDetails,
36
- hasInvalidEntitlements: state.hasInvalidEntitlements,
37
36
  }), isEqual);
38
37
  const isSelectedAccountSubscriptionAbused = ((_a = selectedAccountDetails === null || selectedAccountDetails === void 0 ? void 0 : selectedAccountDetails.data) === null || _a === void 0 ? void 0 : _a.subscriptionAbuse) || false;
39
38
  const caseDispatch = useCaseDispatch();
40
- const apolloClient = useApolloClient();
41
39
  const routeDispatch = useRouteDispatchContext();
42
40
  const { globalMetadataState: { bookmarkedGroupAccounts, loggedInUserRights, managedAccounts, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
43
41
  const { t } = useTranslation();
@@ -45,7 +43,7 @@ function AccountSelector(props) {
45
43
  const ability = useContext(AbilityContext);
46
44
  const canAccessManagedAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.MANAGED_ACCOUNTS);
47
45
  const canBookmarkAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.BOOKMARK_ACCOUNTS);
48
- // const canUseFindMyAccount = loggedInUserRights.data.isAccountDifferentFromLoggedInAccount(accountNumber!);
46
+ const canUseFindMyAccount = loggedInUserRights.data.isAccountDifferentFromLoggedInAccount(accountNumber);
49
47
  // Account Change Handler
50
48
  const onAccountChange = (account) => __awaiter(this, void 0, void 0, function* () {
51
49
  if (selectedAccountDetails.data.accountNumber === account.accountNumber)
@@ -54,7 +52,7 @@ function AccountSelector(props) {
54
52
  clearSelectedAccount(caseDispatch);
55
53
  return;
56
54
  }
57
- setCaseAccountNumber(caseDispatch, account.accountNumber, loggedInUserRights.data.isAccountSameAsLoggedInAccount(account.accountNumber), loggedInUsersAccount.data, apolloClient);
55
+ setCaseAccountNumber(caseDispatch, account.accountNumber, loggedInUserRights.data.isAccountSameAsLoggedInAccount(account.accountNumber), loggedInUsersAccount.data);
58
56
  });
59
57
  const onInternalAccountSelect = (accounts) => {
60
58
  if (!isArray(accounts))
@@ -66,36 +64,48 @@ function AccountSelector(props) {
66
64
  selection.accountNum &&
67
65
  onAccountChange({ accountNumber: selection.accountNum, name: selection.name });
68
66
  };
69
- // const onFindMyAccountClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
70
- // !isEmpty(loggedInUserRights.data) &&
71
- // onAccountChange({
72
- // accountNumber: loggedInUserRights.data.getAccountNumber(),
73
- // name: loggedInUserRights.data.getAccountName(),
74
- // });
75
- // };
67
+ const onFindMyAccountClick = (event) => {
68
+ !isEmpty(loggedInUserRights.data) &&
69
+ onAccountChange({
70
+ accountNumber: loggedInUserRights.data.getAccountNumber(),
71
+ name: loggedInUserRights.data.getAccountName(),
72
+ });
73
+ };
76
74
  const selectedAccount = {
77
75
  name: selectedAccountDetails.data.name,
78
76
  accountNumber: selectedAccountDetails.data.accountNumber,
79
77
  subscriptionAbuse: selectedAccountDetails.data.subscriptionAbuse,
80
78
  };
79
+ // When internal user wants to open a case for a customer but customer account doesn't have entitlement, we show an error
81
80
  useEffect(() => {
82
- if (!loggedInUserRights.data.isInternal() || !selectedAccountDetails.data.accountNumber) {
83
- return;
84
- }
85
- if (selectedAccountDetails.data.accountNumber === loggedInUsersAccount.data.accountNumber) {
86
- setNoValidEntitlement(routeDispatch, false);
81
+ const getAccountEntitlement = () => __awaiter(this, void 0, void 0, function* () {
82
+ // internal user doesn't open case for customer. No need to check account entitlement
83
+ if (selectedAccountDetails.data.accountNumber === loggedInUsersAccount.data.accountNumber) {
84
+ setNoValidEntitlement(routeDispatch, false);
85
+ setShowNotEntitledMessage(false);
86
+ return;
87
+ }
87
88
  setShowNotEntitledMessage(false);
88
- return;
89
+ try {
90
+ const res = yield accounts.getAccountEntitlementByInternalUser(selectedAccountDetails.data.accountNumber);
91
+ if (isEmpty(res)) {
92
+ setShowNotEntitledMessage(true);
93
+ setNoValidEntitlement(routeDispatch, true);
94
+ }
95
+ else {
96
+ setShowNotEntitledMessage(false);
97
+ setNoValidEntitlement(routeDispatch, false);
98
+ }
99
+ }
100
+ catch (e) {
101
+ console.log(e);
102
+ }
103
+ });
104
+ if (loggedInUserRights.data.isInternal() && selectedAccountDetails.data.accountNumber) {
105
+ getAccountEntitlement();
89
106
  }
90
- setShowNotEntitledMessage(hasInvalidEntitlements);
91
- setNoValidEntitlement(routeDispatch, hasInvalidEntitlements);
92
107
  // eslint-disable-next-line react-hooks/exhaustive-deps
93
- }, [
94
- selectedAccountDetails.data.accountNumber,
95
- loggedInUserRights.data,
96
- loggedInUsersAccount.data,
97
- hasInvalidEntitlements,
98
- ]);
108
+ }, [selectedAccountDetails.data.accountNumber, loggedInUserRights.data, loggedInUsersAccount.data]);
99
109
  if (isEmpty(loggedInUserRights.data))
100
110
  return React.createElement(React.Fragment, null);
101
111
  return (React.createElement("div", { id: props.id, className: `form-group ${props.className}` },
@@ -104,7 +114,9 @@ function AccountSelector(props) {
104
114
  React.createElement("label", { htmlFor: "account-selector" },
105
115
  React.createElement(Trans, null, "Account"),
106
116
  ' ',
107
- React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
117
+ React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
118
+ canUseFindMyAccount && (React.createElement("button", { role: "link", className: "btn btn-link btn-app find-my-account pf-v6-u-ml-auto", onClick: onFindMyAccountClick, disabled: selectedAccountDetails.isFetching, "data-tracking-id": "get-support-find-my-account", type: "button" },
119
+ React.createElement(Trans, null, "Find my account")))),
108
120
  React.createElement("div", { className: "account-selector-wrapper" },
109
121
  React.createElement(AccountSelectorInternal, { selectedAccounts: [selectedAccount], canBookmarkAccount: canBookmarkAccounts, bookmarkedAccounts: bookmarkedGroupAccounts.data, id: "account-or-bookmark-selector", className: "account-selector", name: "account-or-bookmark-selector", placeholder: t(`Search for an account ${loggedInUserRights.data.isExternal() ? 'or select a bookmark' : ''} `), onSelect: onInternalAccountSelect, disabled: loggedInUserRights.data.isExternal() || selectedAccountDetails.isFetching, isInValid: isSelectedAccountSubscriptionAbused, restrictedOnSubscriptionAbuse: true })),
110
122
  canAccessManagedAccounts && !isEmpty(managedAccounts.data) && (React.createElement(ManagedAccountsDropdown, { className: "managed-account-selector pf-v6-u-mt-xl", onManagedAccountChange: onManagedAccountChange, managedAccounts: managedAccounts, selectedAccountNumber: accountNumber, disabled: selectedAccountDetails.isFetching })),
@@ -1 +1 @@
1
- {"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAmBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBAuXnD"}
1
+ {"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBA6WnD"}
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
11
10
  import { escalations, publicApi } from '@cee-eng/hydrajs';
12
11
  import { Button, Form, FormGroup, FormHelperText, Grid, GridItem, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, Popover, TextArea, TextInput, Title, ValidatedOptions, } from '@patternfly/react-core';
13
12
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
@@ -17,18 +16,17 @@ import isEmpty from 'lodash/isEmpty';
17
16
  import React, { useEffect, useState } from 'react';
18
17
  import { Trans, useTranslation } from 'react-i18next';
19
18
  import { useCaseDispatch } from '../../../context/CaseContext';
20
- import { useCaseDetailsPageDispatchContext } from '../../../context/CaseDetailsPageContext';
19
+ import { useCaseDetailsPageDispatchContext, useCaseDetailsPageStateContext, } from '../../../context/CaseDetailsPageContext';
20
+ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
21
21
  import { CustomerGEOs } from '../../../enums/customerGEOs';
22
- import { CREATE_RME_CASE_ESCALATION, GET_PARENT_ID, } from '../../../graphql';
23
- import { GET_CASE_COMMENTS } from '../../../hooks/useCaseComments';
24
22
  import { ESCALATION_SUBJECT_LENGTH_LIMIT } from '../../../reducers/CaseConstNTypes';
25
23
  import { fetchCaseEscalations } from '../../../reducers/CaseDetailsPageReducer';
26
- import { checkForCaseStatusToggleOnAttachOrComment, fetchCaseDetailsHydra } from '../../../reducers/CaseReducer';
24
+ import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
25
+ import { checkForCaseStatusToggleOnAttachOrComment, fetchCaseDetails } from '../../../reducers/CaseReducer';
27
26
  const customerGEOKeys = Object.keys(CustomerGEOs);
28
27
  export function RequestEscalationModal(props) {
29
28
  const { globalMetadataState: { loggedInUser, loggedInUserRights }, } = useGlobalStateContext();
30
29
  const { t } = useTranslation();
31
- const apolloClient = useApolloClient();
32
30
  const [categories, setCategories] = useState([]);
33
31
  const initialState = {
34
32
  subject: '',
@@ -44,13 +42,15 @@ export function RequestEscalationModal(props) {
44
42
  // checks if all the fields have values.
45
43
  const hasRequiredInfo = () => Object.keys(formState).reduce((accumulator, currentValue) => { var _a; return !accumulator ? accumulator : formState[currentValue].length > 0 && ((_a = formState[currentValue]) === null || _a === void 0 ? void 0 : _a.trim()); }, true);
46
44
  const setFormStateValue = (key, value) => setFormState((pre) => (Object.assign(Object.assign({}, pre), { [key]: value })));
47
- const [isCreatingEscalation, setIsCreatingEscalation] = useState(false);
45
+ const createEscalationFetch = useFetch(escalations.createIceEscalation, { propgateErrors: true });
48
46
  const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
49
47
  propgateErrors: true,
50
48
  });
51
49
  const { request: updateCaseRequest, isFetching: isUpdatingCase } = useFetch(publicApi.kase.updateCase);
52
50
  const { request: getRmeCategories, isFetching: isCategoriesFetching } = useFetch(escalations.getEscalationCategories, { propgateErrors: true });
53
- const client = useApolloClient();
51
+ const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
52
+ const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
53
+ const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
54
54
  const caseDetailsPageDispatch = useCaseDetailsPageDispatchContext();
55
55
  const caseDispatch = useCaseDispatch();
56
56
  const [creationError, setCreationError] = useState(false);
@@ -62,12 +62,13 @@ export function RequestEscalationModal(props) {
62
62
  setFormState(Object.assign(Object.assign({}, formState), { rmeCategory: selection.value }));
63
63
  };
64
64
  const submitEscalationComment = (escalationNum, comment) => __awaiter(this, void 0, void 0, function* () {
65
- escalationNum && fetchCaseEscalations(caseDetailsPageDispatch, props.caseNumber, apolloClient, false);
65
+ escalationNum &&
66
+ fetchCaseEscalations(caseDetailsPageDispatch, props.caseNumber, loggedInUserRights.data.getAccountNumber(), false);
66
67
  yield postCommentRequest({ caseNumber: props.caseNumber, commentBody: comment, contentType: 'markdown' });
67
- client.refetchQueries({ include: [GET_CASE_COMMENTS] });
68
+ updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
68
69
  yield updateCaseRequest(props.caseNumber, { customerEscalation: true });
69
70
  checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), props.caseStatus);
70
- yield fetchCaseDetailsHydra(caseDispatch, props.caseNumber, loggedInUserRights.data, loggedInUser.data, apolloClient);
71
+ yield fetchCaseDetails(caseDispatch, props.caseNumber, loggedInUserRights.data, loggedInUser.data);
71
72
  escalationNum &&
72
73
  ToastNotification.addSuccessMessage(t('Your escalation request has been successfully submitted.'));
73
74
  });
@@ -77,7 +78,7 @@ export function RequestEscalationModal(props) {
77
78
  setFormState(Object.assign(Object.assign({}, formState), { subject }));
78
79
  };
79
80
  const onCancel = () => {
80
- if (isPostingComment || isUpdatingCase || isCreatingEscalation)
81
+ if (isPostingComment || isUpdatingCase || createEscalationFetch.isFetching)
81
82
  return;
82
83
  setSubmitSaveButtonIsClicked(false);
83
84
  setFormState(initialState);
@@ -85,37 +86,11 @@ export function RequestEscalationModal(props) {
85
86
  props.onClose();
86
87
  };
87
88
  const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
88
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
89
89
  setSubmitSaveButtonIsClicked(true);
90
90
  if (!hasRequiredInfo() || hasLargeSubject)
91
91
  return;
92
92
  try {
93
- setIsCreatingEscalation(true);
94
- const { data: parentData } = yield apolloClient.query({
95
- query: GET_PARENT_ID,
96
- variables: { where: { CaseNumber: { eq: props.caseNumber } } },
97
- });
98
- const parentId = (_f = (_e = (_d = (_c = (_b = (_a = parentData === null || parentData === void 0 ? void 0 : parentData.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportCase) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Id;
99
- if (!parentId)
100
- throw new Error('Could not find parent case ID');
101
- const { data: escalationData } = yield apolloClient.mutate({
102
- mutation: CREATE_RME_CASE_ESCALATION,
103
- variables: {
104
- caseInput: {
105
- Subject: formState.subject,
106
- Description: formState.description,
107
- Status: 'New',
108
- Origin: 'Portal ACE',
109
- Priority: props.severity ? `P${props.severity.charAt(0)}` : 'Medium',
110
- Type: 'RME',
111
- RecordTypeId: '012Ek00000JUtx5IAD',
112
- ParentId: parentId,
113
- EscalationCategory__c: formState.rmeCategory,
114
- ImpactOnUserOrBusiness__c: formState.businessImpactDescription,
115
- },
116
- },
117
- });
118
- const createdCaseNumber = (_k = (_j = (_h = (_g = escalationData === null || escalationData === void 0 ? void 0 : escalationData.salesforce_support_uiapi) === null || _g === void 0 ? void 0 : _g.CaseCreate) === null || _h === void 0 ? void 0 : _h.SalesforceSupportRecord) === null || _j === void 0 ? void 0 : _j.CaseNumber) === null || _k === void 0 ? void 0 : _k.value;
93
+ const res = yield createEscalationFetch.request(Object.assign(Object.assign({}, formState), { recordType: 'Active Customer Escalation', escalationSource: 'RME Escalation', status: 'New', accountNumber: loggedInUserRights.data.getAccountNumber(), caseNumber: props.caseNumber, requestor: `${loggedInUser.data.firstName} ${loggedInUser.data.lastName}`, requestorEmail: loggedInUser.data.email, requestorPhone: loggedInUser.data.phone, alreadyEscalated: false, severity: props.severity ? props.severity.charAt(0) : '3' }));
119
94
  const fullComment = t('### Request Management Escalation:\n\n**Subject**\n{{subject}}\n\n**Category**\n{{rmeCategory}}\n\n**Description**\n{{description}}\n\n**Expectations**\n{{expectations}}\n\n**Business Impact**\n{{businessImpactDescription}}', {
120
95
  category: formState.rmeCategory,
121
96
  subject: formState.subject,
@@ -125,7 +100,7 @@ export function RequestEscalationModal(props) {
125
100
  rmeCategory: formState.rmeCategory,
126
101
  });
127
102
  try {
128
- yield submitEscalationComment(createdCaseNumber, fullComment);
103
+ yield submitEscalationComment(res.name, fullComment);
129
104
  }
130
105
  catch (e) {
131
106
  // silently fails, escalation is created but adding comment fails
@@ -133,11 +108,9 @@ export function RequestEscalationModal(props) {
133
108
  props.onClose();
134
109
  }
135
110
  catch (error) {
111
+ //=> handle error
136
112
  setCreationError(true);
137
113
  }
138
- finally {
139
- setIsCreatingEscalation(false);
140
- }
141
114
  });
142
115
  const header = (React.createElement(Title, { className: "pf-v6-u-mb-0", id: "custom-header-label", headingLevel: "h1" },
143
116
  React.createElement(Trans, null, "Request an escalation"),
@@ -219,9 +192,9 @@ export function RequestEscalationModal(props) {
219
192
  : ValidatedOptions.default, placeholder: t('Does your business impact change with this escalation? Please describe how it changed.'), id: "business-impact-input", value: formState.businessImpactDescription, "aria-label": t('Business impact'), resizeOrientation: "vertical" }))))),
220
193
  React.createElement(ModalFooter, null,
221
194
  React.createElement(Button, { key: "submit", variant: "primary", onClick: onSubmit, "data-tracking-id": "request-rme-submit", isDisabled: submitButtonIsClicked &&
222
- (isPostingComment || isUpdatingCase || isCreatingEscalation || !hasRequiredInfo()), "aria-label": t('Submit') },
223
- (isPostingComment || isUpdatingCase || isCreatingEscalation) && (React.createElement(LoadingIndicator, { key: "loading", isInline: true })),
195
+ (isPostingComment || isUpdatingCase || createEscalationFetch.isFetching || !hasRequiredInfo()), "aria-label": t('Submit') },
196
+ (isPostingComment || isUpdatingCase || createEscalationFetch.isFetching) && (React.createElement(LoadingIndicator, { key: "loading", isInline: true })),
224
197
  ' ',
225
198
  t('Submit')),
226
- React.createElement(Button, { key: "cancel", variant: "link", onClick: onCancel, "data-tracking-id": "request-rme-cancel", isDisabled: isCreatingEscalation || isPostingComment || isUpdatingCase, "aria-label": t('Cancel') }, t('Cancel')))));
199
+ React.createElement(Button, { key: "cancel", variant: "link", onClick: onCancel, "data-tracking-id": "request-rme-cancel", isDisabled: createEscalationFetch.isFetching || isPostingComment || isUpdatingCase, "aria-label": t('Cancel') }, t('Cancel')))));
227
200
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAoB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,qBA0PzC"}
1
+ {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,qBAmPzC"}
@@ -7,9 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
11
10
  import { CoverSpinner, ErrorBoundary, OverviewContentLoader, ToastNotification, useDocumentTitle, usePrevious, } from '@rh-support/components';
12
- import { fetchCaseDetails, GlobalMetadataStateContext, HostnameAwarenessModal } from '@rh-support/react-context';
11
+ import { GlobalMetadataStateContext, HostnameAwarenessModal } from '@rh-support/react-context';
13
12
  import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
14
13
  import { getUrlParsedParams, isValidCaseNumber } from '@rh-support/utils';
15
14
  import isEmpty from 'lodash/isEmpty';
@@ -20,14 +19,8 @@ import { Route, Switch, useLocation, useParams, useRouteMatch } from 'react-rout
20
19
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
21
20
  import { useCaseDetailsPageDispatchContext } from '../../context/CaseDetailsPageContext';
22
21
  import { CaseReducerConstants } from '../../reducers/CaseConstNTypes';
23
- import {
24
- // TODO: Re-enable after GraphQL migration
25
- // fetchAttachments,
26
- fetchCaseEscalations,
27
- // fetchExternalTrackers,
28
- // fetchFeedbacks,
29
- } from '../../reducers/CaseDetailsPageReducer';
30
- import { setCaseAccountNumber } from '../../reducers/CaseReducer';
22
+ import { fetchAttachments, fetchCaseEscalations, fetchExternalTrackers, fetchFeedbacks, } from '../../reducers/CaseDetailsPageReducer';
23
+ import { fetchCaseDetails, setCaseAccountNumber } from '../../reducers/CaseReducer';
31
24
  import { CaseDetailsAside } from './CaseDetailsAside';
32
25
  import { CaseDetailsErrorMessage } from './CaseDetailsErrorMessage';
33
26
  import CaseDetailsModals from './CaseDetailsModals';
@@ -35,9 +28,8 @@ import { CaseDetailsTabs } from './CaseDetailsTabs';
35
28
  import CaseOverview from './CaseOverview';
36
29
  import { PDFContext } from './PDFContainer';
37
30
  export default function Case(props) {
38
- const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
31
+ const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount, loggedInUser }, } = useContext(GlobalMetadataStateContext);
39
32
  const caseDetailsPageDispatch = useCaseDetailsPageDispatchContext();
40
- const apolloClient = useApolloClient();
41
33
  const { t } = useTranslation();
42
34
  // The `path` lets us build <Route> paths that are
43
35
  // relative to the parent route, while the `url` lets
@@ -51,18 +43,8 @@ export default function Case(props) {
51
43
  const canSeeFeedbackButtons = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_FEEDBACK_BUTTONS);
52
44
  const canReadCase = ability.can(resourceActions.READ, resources.CASE_DETAILS);
53
45
  const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
54
- // TODO: Re-enable after GraphQL migration of external trackers
55
- // const canSeeExternalTracker = ability.can(
56
- // resourceActions.PATCH,
57
- // resources.CASE_DETAILS,
58
- // CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER
59
- // );
60
- // TODO: Re-enable after GraphQL migration of attachments
61
- // const canSeeAttachments = ability.can(
62
- // resourceActions.PATCH,
63
- // resources.CASE_DETAILS,
64
- // CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS
65
- // );
46
+ const canSeeExternalTracker = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER);
47
+ const canSeeAttachments = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS);
66
48
  const canSeeRMEs = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_RMES);
67
49
  const { product, isFetchingCaseDetails, isFetchingCaseDetailsError, caseDetailsError, selectedAccountDetails } = useCaseSelector((state) => ({
68
50
  product: state.caseDetails.product,
@@ -97,7 +79,6 @@ export default function Case(props) {
97
79
  useEffect(() => {
98
80
  if (!isEmpty(loggedInUsersAccount.data) &&
99
81
  !isEmpty(selectedAccountDetails.data) &&
100
- selectedAccountDetails.data.accountNumber &&
101
82
  loggedInUserRights.data.isAccountSameAsLoggedInAccount(selectedAccountDetails.data.accountNumber) &&
102
83
  !isEqual(loggedInUsersAccount.data, selectedAccountDetails.data)) {
103
84
  setCaseAccountNumber(caseDispatch, loggedInUsersAccount.data.accountNumber, true, loggedInUsersAccount.data);
@@ -126,34 +107,21 @@ export default function Case(props) {
126
107
  caseDispatch(action);
127
108
  }
128
109
  };
129
- yield fetchCaseDetails(safeDispatch, apolloClient, targetCaseNumber, setCaseAccountNumber);
110
+ yield fetchCaseDetails(safeDispatch, targetCaseNumber, loggedInUserRights.data, loggedInUser.data);
130
111
  if (currentCaseRef.current !== targetCaseNumber)
131
112
  return;
132
113
  if (canSeeRMEs) {
133
- fetchCaseEscalations((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber, apolloClient);
114
+ fetchCaseEscalations((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber, loggedInUserRights.data.getAccountNumber());
115
+ }
116
+ if (canSeeAttachments) {
117
+ fetchAttachments((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber, loggedInUsersAccount.data.secureSupport);
118
+ }
119
+ if (canSeeExternalTracker) {
120
+ fetchExternalTrackers((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber);
121
+ }
122
+ if (canSeeFeedbackButtons) {
123
+ fetchFeedbacks((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber);
134
124
  }
135
- // TODO: Re-enable after GraphQL migration of attachments
136
- // if (canSeeAttachments) {
137
- // fetchAttachments(
138
- // (action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action),
139
- // targetCaseNumber,
140
- // loggedInUsersAccount.data.secureSupport!
141
- // );
142
- // }
143
- // TODO: Re-enable after GraphQL migration of external trackers
144
- // if (canSeeExternalTracker) {
145
- // fetchExternalTrackers(
146
- // (action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action),
147
- // targetCaseNumber
148
- // );
149
- // }
150
- // TODO: Re-enable after GraphQL migration of feedback
151
- // if (canSeeFeedbackButtons) {
152
- // fetchFeedbacks(
153
- // (action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action),
154
- // targetCaseNumber
155
- // );
156
- // }
157
125
  if (currentCaseRef.current === targetCaseNumber) {
158
126
  checkRemoteSessionFlag();
159
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAahF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA2Z7C"}
1
+ {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAYhF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAyY7C"}
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useQuery } from '@apollo/client/react';
11
10
  import { Button, Checkbox, Icon, Popover, PopoverPosition, Switch, Tooltip } from '@patternfly/react-core';
12
11
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
12
  import ListIcon from '@patternfly/react-icons/dist/js/icons/list-icon';
@@ -26,13 +25,12 @@ import { Link } from 'react-router-dom';
26
25
  import { useCaseSelector } from '../../context/CaseContext';
27
26
  import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
28
27
  import { useRecommendationStateContext } from '../../context/RecommendationContext';
29
- import { GET_ESCALATION_DETAILS, GET_PARENT_ID } from '../../graphql';
30
28
  import { ActiveCustomerEscalation } from './ActiveCustomerEscalation';
31
29
  import { CaseSolutions } from './CaseSolutions';
32
30
  import { PDFContext } from './PDFContainer';
33
31
  import { ESSRemoteSession, RemoteSessionAgreement } from './RequestRemoteSession';
34
32
  export function CaseDetailsAside(props) {
35
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
33
+ var _a, _b;
36
34
  const { t } = useTranslation();
37
35
  const { severity, status, isFetchingCaseDetails, isFetchingCaseDetailsError, acceptedRemoteSessionTerms, product, waitingOnCallback, groupNumber, ownersCaseGroups, } = useCaseSelector((state) => ({
38
36
  severity: state.caseDetails.severity,
@@ -50,15 +48,6 @@ export function CaseDetailsAside(props) {
50
48
  const isCreateRMEVisible = (caseEscalations.data || []).length === 0 || caseEscalations.data.every((item) => item.status === 'Closed');
51
49
  const { recommendationState: { isLoadingRecommendations, allDocs }, } = useRecommendationStateContext();
52
50
  const { caseNumber } = props;
53
- const { data: parentData, loading: isLoadingParentId } = useQuery(GET_PARENT_ID, {
54
- variables: { where: { CaseNumber: { eq: caseNumber } } },
55
- });
56
- const parentId = (_f = (_e = (_d = (_c = (_b = (_a = parentData === null || parentData === void 0 ? void 0 : parentData.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportCase) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Id;
57
- const { loading: isLoadingEscalations } = useQuery(GET_ESCALATION_DETAILS, {
58
- variables: { where: { ParentId: { eq: parentId } } },
59
- skip: !parentId,
60
- });
61
- const isEscalationsFetching = isLoadingParentId || isLoadingEscalations;
62
51
  const canCreateRME = ability.can(resourceActions.CREATE, resources.RME_ESCALATION);
63
52
  const canCreateICE = ability.can(resourceActions.CREATE, resources.ICE_ESCALATION);
64
53
  const canSeeToggleCustomerView = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_TOGGLE_CUSTOMER_VIEW);
@@ -72,8 +61,7 @@ export function CaseDetailsAside(props) {
72
61
  const isXLScreen = breakPoint.xl;
73
62
  const toggleCustomerViewRef = useRef(null);
74
63
  const isFirstMountRef = useRef(true);
75
- const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount, allProducts, loggedInUserRights }, } = useGlobalStateContext();
76
- const isInternal = (_g = loggedInUserRights.data) === null || _g === void 0 ? void 0 : _g.isInternal();
64
+ const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount, allProducts }, } = useGlobalStateContext();
77
65
  const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
78
66
  // To check if user has read only access
79
67
  const canReadCase = ability.can(resourceActions.READ, resources.CASE_DETAILS);
@@ -89,14 +77,9 @@ export function CaseDetailsAside(props) {
89
77
  const [viewAsInternalPref, setViewAsInternalPref] = useState();
90
78
  const [isDefaultBoxChecked, setIsDefaultBoxChecked] = useState(true);
91
79
  const { isExportingPDF } = useContext(PDFContext);
92
- // TODO: When casegroups is deployed on SCT stage, update this logic to properly gate on ownersCaseGroups.data
93
80
  const isWritePermissionforCase = useMemo(() => {
94
- if (isInternal || groupNumber === '-1')
95
- return true;
96
- if (!ownersCaseGroups.data)
97
- return true;
98
- return (ownersCaseGroups.data || []).some((group) => group.groupNum === groupNumber);
99
- }, [groupNumber, ownersCaseGroups.data, isInternal]);
81
+ return (ownersCaseGroups.data || []).some((group) => group.groupNum === groupNumber) || groupNumber === '-1';
82
+ }, [groupNumber, ownersCaseGroups.data]);
100
83
  useEffect(() => {
101
84
  const userPreferredCaseView = () => __awaiter(this, void 0, void 0, function* () {
102
85
  try {
@@ -174,7 +157,7 @@ export function CaseDetailsAside(props) {
174
157
  setIsDefaultBoxChecked(!isDefaultBoxChecked);
175
158
  toggleViewAsCustomerFlag(globalMetadataDispatchContext);
176
159
  };
177
- const isSideBarExpanded = (_h = caseDetailsAsidePanelRef.current) === null || _h === void 0 ? void 0 : _h.expanded;
160
+ const isSideBarExpanded = (_a = caseDetailsAsidePanelRef.current) === null || _a === void 0 ? void 0 : _a.expanded;
178
161
  if (isFetchingCaseDetails || isFetchingCaseDetailsError)
179
162
  return null;
180
163
  const renderCasePrefPopoverText = () => {
@@ -186,7 +169,7 @@ export function CaseDetailsAside(props) {
186
169
  }
187
170
  };
188
171
  // To check if the user is ESS Customer and Product has ESS Support
189
- const isESSCustomer = isSpecialSupportOfferingEnabled((_j = allProducts.data) === null || _j === void 0 ? void 0 : _j.productsResult, selectedProduct);
172
+ const isESSCustomer = isSpecialSupportOfferingEnabled((_b = allProducts.data) === null || _b === void 0 ? void 0 : _b.productsResult, selectedProduct);
190
173
  return (React.createElement("aside", { className: `grid-aside ${isSideBarExpanded ? '' : 'sidebar-collapsed'} ` },
191
174
  React.createElement("pfe-collapse-toggle", { "aria-label": `${isSideBarExpanded ? t('Collapse sidebar') : t('Expand sidebar')}`, "aria-controls": "case-details-aside-content", onClick: onToggleAside }, isSideBarExpanded ? (React.createElement("div", { className: `sidebar-header ${isExportingPDF ? 'hide-in-pdf' : ''}` },
192
175
  React.createElement("div", { className: "case-detail-collapse-panel" },
@@ -203,7 +186,7 @@ export function CaseDetailsAside(props) {
203
186
  !isLoadingRecommendations && allDocs.length > 0 && (React.createElement(Tooltip, { content: t('Top recommendations'), position: "left" },
204
187
  React.createElement(Button, { icon: React.createElement(Icon, { className: "pf-v6-u-p-sm", size: "lg" },
205
188
  React.createElement(ListIcon, null)), variant: "link", onClick: () => setSectionToScollRef(topSolutionsRef), className: "sidebar-section-toggle-btn", "aria-label": t('Top recommendations') }))),
206
- !isEscalationsFetching && (canCreateICE || (canCreateRME && isCreateRMEVisible)) && (React.createElement(Tooltip, { content: t('Request an escalation'), position: "left" },
189
+ !caseEscalations.isFetching && (canCreateICE || (canCreateRME && isCreateRMEVisible)) && (React.createElement(Tooltip, { content: t('Request an escalation'), position: "left" },
207
190
  React.createElement(Button, { icon: React.createElement(Icon, { className: "pf-v6-u-p-sm", size: "lg" },
208
191
  React.createElement(TrendUpIcon, null)), variant: "link", className: "sidebar-section-toggle-btn", onClick: () => setSectionToScollRef(createEscalationRef), "aria-label": t('Request an escalation') }))))))),
209
192
  React.createElement("pfe-collapse-panel", { className: "sidebar-content", "pfe-animation": "false", id: "case-details-aside-content", ref: caseDetailsAsidePanelRef },
@@ -230,6 +213,6 @@ export function CaseDetailsAside(props) {
230
213
  React.createElement(ESSRemoteSession, { waitingOnCallback: waitingOnCallback, remoteSessionTermsAcked: acceptedRemoteSessionTerms, caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, readOnly: canReadCase }))),
231
214
  !isESSCustomer && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement section') } },
232
215
  React.createElement(RemoteSessionAgreement, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, waitingOnCallback: waitingOnCallback, acceptedRemoteSessionTerms: acceptedRemoteSessionTerms && waitingOnCallback, readOnly: canReadCase }))),
233
- !isEscalationsFetching && isWritePermissionforCase && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading customer escalation section') } },
216
+ !caseEscalations.isFetching && isWritePermissionforCase && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading customer escalation section') } },
234
217
  React.createElement(ActiveCustomerEscalation, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef })))))));
235
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AA4BlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAsT5C"}
1
+ {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AA0BlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoS5C"}
@@ -12,16 +12,12 @@ import { useParams } from 'react-router-dom';
12
12
  import { CaseDetailsTabsEnum } from '../../constants/caseDetailsConstants';
13
13
  import { useCaseSelector } from '../../context/CaseContext';
14
14
  import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
15
- import { useCaseComments } from '../../hooks/useCaseComments';
16
15
  import { PDFContext } from './PDFContainer';
17
16
  import CaseDetailsManagement from './Tabs/CaseDetails/CaseDetailsManagement';
18
17
  import CaseHistory from './Tabs/CaseHistory/CaseHistory';
19
18
  import { CaseSummary } from './Tabs/CaseSummary/CaseSummary';
20
19
  const RelatedTasks = React.lazy(() => import(/* webpackChunkName: 'CaseBugzilla' */ './Tabs/RelatedTasks/RelatedTasks'));
21
- // TODO: Re-enable Action Plan tab when ready
22
- // const CaseActionPlan = React.lazy(
23
- // () => import(/* webpackChunkName: 'CaseActionPlan' */ './Tabs/CaseActionPlan/CaseActionPlan')
24
- // );
20
+ const CaseActionPlan = React.lazy(() => import(/* webpackChunkName: 'CaseActionPlan' */ './Tabs/CaseActionPlan/CaseActionPlan'));
25
21
  const CasePrivateNotes = React.lazy(() => import(/* webpackChunkName: 'CasePrivateNotes' */ './Tabs/CasePrivateNotes/CasePrivateNotes'));
26
22
  const CaseDiscussion = React.lazy(() => import(/* webpackChunkName: 'CaseDiscussion' */ './Tabs/CaseDiscussion/CaseDiscussion'));
27
23
  const RMEEscalationList = React.lazy(() => import(/* webpackChunkName: 'RMEEscalationList' */ './Tabs/RMEEscalations/RMEEscalationList'));
@@ -29,17 +25,12 @@ export function CaseDetailsTabs(props) {
29
25
  const { caseNumber } = props;
30
26
  const { activeTab } = useParams();
31
27
  const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount, pcmConfig, viewAsCustomer }, } = useContext(GlobalMetadataStateContext);
32
- const { accountNumber, status, caseSalesforceId } = useCaseSelector((state) => ({
28
+ const { accountNumber, chats, comments, status } = useCaseSelector((state) => ({
33
29
  accountNumber: state.caseDetails.accountNumberRef,
34
- // TODO: Re-enable after GraphQL migration of chats
35
- // chats: state.caseDetails.chats,
30
+ chats: state.caseDetails.chats,
31
+ comments: state.caseDetails.comments,
36
32
  status: state.caseDetails.status,
37
- caseSalesforceId: state.caseDetails.id,
38
33
  }), isEqual);
39
- const { comments, loading: commentsLoading, error: commentsError, refetch: refetchComments, } = useCaseComments({
40
- caseId: caseSalesforceId,
41
- skip: !caseSalesforceId,
42
- });
43
34
  const { t } = useTranslation();
44
35
  const [activeTabKey, setActiveTabKey] = useState(0);
45
36
  const { caseDetailsPageState: { caseEscalations }, } = useCaseDetailsPageStateContext();
@@ -58,16 +49,15 @@ export function CaseDetailsTabs(props) {
58
49
  // const bugZillaTabRef: React.MutableRefObject<HTMLDivElement> = useRef(null);
59
50
  const managementTabRef = useRef(null);
60
51
  const privateNotesTabRef = useRef(null);
61
- // const actionPlanTabRef: React.MutableRefObject<HTMLDivElement> = useRef(null);
52
+ const actionPlanTabRef = useRef(null);
62
53
  const escalationTabRef = useRef(null);
63
54
  const relatedTasksRef = useRef(null);
64
55
  const caseHistoryTabRef = useRef(null);
65
56
  const generateAiCaseSummaryTabRef = useRef(null);
66
57
  const tabsToRender = [];
67
- const handleTabClick = (_event, tabIndex) => {
68
- const index = Number(tabIndex);
69
- setActiveTabKey(index);
70
- setSelectedTab(tabsToRender[index].title);
58
+ const handleTabClick = (event, tabIndex) => {
59
+ setActiveTabKey(tabIndex);
60
+ setSelectedTab(tabsToRender[tabIndex].title);
71
61
  };
72
62
  const isCaseHistoryEnabled = getConfigField(pcmConfig.data, 'isCaseHistoryEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
73
63
  tabsToRender.push({
@@ -76,10 +66,7 @@ export function CaseDetailsTabs(props) {
76
66
  title: CaseDetailsTabsEnum.DISCUSSION,
77
67
  ref: discussionTabRef,
78
68
  routePath: 'discussion',
79
- component: (React.createElement(CaseDiscussion, { caseNumber: caseNumber, tabRef: discussionTabRef, caseComments: comments, commentsLoading: commentsLoading, commentsError: commentsError,
80
- // TODO: Re-enable after GraphQL migration of chats
81
- // caseChats={chats}
82
- accountNumber: accountNumber, isDiscussionTab: selectedTab === CaseDetailsTabsEnum.DISCUSSION, refetchComments: refetchComments })),
69
+ component: (React.createElement(CaseDiscussion, { caseNumber: caseNumber, tabRef: discussionTabRef, caseComments: comments, caseChats: chats, accountNumber: accountNumber, isDiscussionTab: selectedTab === CaseDetailsTabsEnum.DISCUSSION })),
83
70
  });
84
71
  tabsToRender.push({
85
72
  'data-tracking-id': 'case-details-tab',
@@ -99,15 +86,14 @@ export function CaseDetailsTabs(props) {
99
86
  title: CaseDetailsTabsEnum.RELATED_TASKS,
100
87
  component: React.createElement(RelatedTasks, null),
101
88
  });
102
- // TODO: Re-enable Action Plan tab when ready
103
- // tabsToRender.push({
104
- // 'data-tracking-id': 'case-details-actionplan-tab',
105
- // key: 'action plan',
106
- // ref: actionPlanTabRef,
107
- // title: CaseDetailsTabsEnum.ACTION_PLAN,
108
- // routePath: 'plan',
109
- // component: <CaseActionPlan caseNumber={caseNumber} />,
110
- // });
89
+ tabsToRender.push({
90
+ 'data-tracking-id': 'case-details-actionplan-tab',
91
+ key: 'action plan',
92
+ ref: actionPlanTabRef,
93
+ title: CaseDetailsTabsEnum.ACTION_PLAN,
94
+ routePath: 'plan',
95
+ component: React.createElement(CaseActionPlan, { caseNumber: caseNumber }),
96
+ });
111
97
  canSeePrivateNotes &&
112
98
  tabsToRender.push({
113
99
  'data-tracking-id': 'case-details-pvtnotes-tab',