@rh-support/troubleshoot 2.6.301 → 2.6.302

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 (221) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +28 -40
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +52 -14
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +51 -31
  7. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/Case.js +50 -18
  9. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +25 -8
  11. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +57 -34
  13. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
  14. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  16. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
  17. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
  19. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/CaseOverview/index.js +43 -30
  21. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +76 -30
  23. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
  24. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  25. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +3 -3
  26. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
  27. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +3 -4
  29. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  30. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +13 -17
  31. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +19 -43
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +17 -40
  35. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +3 -0
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +22 -0
  38. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +44 -41
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +8 -7
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +38 -18
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +110 -148
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +5 -5
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +15 -0
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +19 -0
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +49 -0
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +6 -2
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +147 -241
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
  68. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
  70. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  71. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
  72. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
  74. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
  75. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  76. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
  77. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  78. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
  79. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  80. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +30 -52
  81. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  82. package/lib/esm/components/CaseInformation/CaseGroup.js +68 -46
  83. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  84. package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
  85. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  86. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
  87. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  88. package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
  89. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  90. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  91. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -7
  92. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  93. package/lib/esm/components/CaseManagement/Cep.js +4 -7
  94. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  95. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +19 -9
  96. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  97. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +16 -11
  98. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  99. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
  100. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  101. package/lib/esm/components/IdeaInformation/IdeaInformation.js +13 -14
  102. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  103. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  104. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  105. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  106. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  107. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  108. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  109. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  110. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +30 -50
  111. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  112. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  113. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  114. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
  115. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  116. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  117. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  118. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +9 -7
  119. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  120. package/lib/esm/components/Review/Review.js +16 -16
  121. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  122. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  123. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  124. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +5 -8
  125. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  126. package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
  127. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +3 -1
  128. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  129. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +76 -4
  130. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  131. package/lib/esm/components/shared/useIsSectionValid.js +50 -64
  132. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  133. package/lib/esm/components/shared/usePostComment.js +16 -28
  134. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  135. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +120 -24
  136. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  137. package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
  138. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  139. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
  140. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  141. package/lib/esm/graphql/index.d.ts +4 -0
  142. package/lib/esm/graphql/index.d.ts.map +1 -0
  143. package/lib/esm/graphql/index.js +3 -0
  144. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  145. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  146. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  147. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  148. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  149. package/lib/esm/graphql/mutations/index.js +1 -0
  150. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  151. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  152. package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
  153. package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
  154. package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
  155. package/lib/esm/graphql/queries/getParentId.js +16 -0
  156. package/lib/esm/graphql/queries/index.d.ts +3 -0
  157. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  158. package/lib/esm/graphql/queries/index.js +2 -0
  159. package/lib/esm/graphql/schemas/escalation.d.ts +84 -0
  160. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  161. package/lib/esm/graphql/schemas/escalation.js +1 -0
  162. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  163. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  164. package/lib/esm/graphql/schemas/index.js +1 -0
  165. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +4 -0
  166. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +1 -0
  167. package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +12 -0
  168. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
  169. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
  170. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +55 -0
  171. package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
  172. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
  173. package/lib/esm/hooks/useCaseComments/index.js +5 -0
  174. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
  175. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
  176. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +66 -0
  177. package/lib/esm/hooks/useCaseComments/types.d.ts +80 -0
  178. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
  179. package/lib/esm/hooks/useCaseComments/types.js +1 -0
  180. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +16 -0
  181. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
  182. package/lib/esm/hooks/useCaseComments/useCaseComments.js +25 -0
  183. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
  184. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
  185. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
  186. package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
  187. package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
  188. package/lib/esm/hooks/useCaseHistory.js +98 -0
  189. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  190. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  191. package/lib/esm/models/caseHistory.d.ts +80 -0
  192. package/lib/esm/models/caseHistory.d.ts.map +1 -0
  193. package/lib/esm/models/caseHistory.js +1 -0
  194. package/lib/esm/reducers/CaseConstNTypes.d.ts +91 -3
  195. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  196. package/lib/esm/reducers/CaseConstNTypes.js +20 -2
  197. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -4
  198. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  199. package/lib/esm/reducers/CaseDetailsPageReducer.js +39 -23
  200. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +3 -5
  201. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  202. package/lib/esm/reducers/CaseDiscussionTabReducer.js +33 -46
  203. package/lib/esm/reducers/CaseHelpers.d.ts +3 -2
  204. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  205. package/lib/esm/reducers/CaseHelpers.js +108 -41
  206. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  207. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  208. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  209. package/lib/esm/reducers/CaseReducer.d.ts +30 -8
  210. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  211. package/lib/esm/reducers/CaseReducer.js +192 -55
  212. package/lib/esm/utils/TimelineUtils.d.ts +41 -0
  213. package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
  214. package/lib/esm/utils/TimelineUtils.js +134 -0
  215. package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
  216. package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
  217. package/lib/esm/utils/caseHistoryUtils.js +165 -0
  218. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
  219. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  220. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  221. package/package.json +7 -8
@@ -7,6 +7,7 @@ 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';
10
11
  import { Button, Checkbox, Icon, Popover, PopoverPosition, Switch, Tooltip } from '@patternfly/react-core';
11
12
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
12
13
  import ListIcon from '@patternfly/react-icons/dist/js/icons/list-icon';
@@ -25,12 +26,13 @@ import { Link } from 'react-router-dom';
25
26
  import { useCaseSelector } from '../../context/CaseContext';
26
27
  import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
27
28
  import { useRecommendationStateContext } from '../../context/RecommendationContext';
29
+ import { GET_ESCALATION_DETAILS, GET_PARENT_ID } from '../../graphql';
28
30
  import { ActiveCustomerEscalation } from './ActiveCustomerEscalation';
29
31
  import { CaseSolutions } from './CaseSolutions';
30
32
  import { PDFContext } from './PDFContainer';
31
33
  import { ESSRemoteSession, RemoteSessionAgreement } from './RequestRemoteSession';
32
34
  export function CaseDetailsAside(props) {
33
- var _a, _b;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
34
36
  const { t } = useTranslation();
35
37
  const { severity, status, isFetchingCaseDetails, isFetchingCaseDetailsError, acceptedRemoteSessionTerms, product, waitingOnCallback, groupNumber, ownersCaseGroups, } = useCaseSelector((state) => ({
36
38
  severity: state.caseDetails.severity,
@@ -48,6 +50,15 @@ export function CaseDetailsAside(props) {
48
50
  const isCreateRMEVisible = (caseEscalations.data || []).length === 0 || caseEscalations.data.every((item) => item.status === 'Closed');
49
51
  const { recommendationState: { isLoadingRecommendations, allDocs }, } = useRecommendationStateContext();
50
52
  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;
51
62
  const canCreateRME = ability.can(resourceActions.CREATE, resources.RME_ESCALATION);
52
63
  const canCreateICE = ability.can(resourceActions.CREATE, resources.ICE_ESCALATION);
53
64
  const canSeeToggleCustomerView = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_TOGGLE_CUSTOMER_VIEW);
@@ -61,7 +72,8 @@ export function CaseDetailsAside(props) {
61
72
  const isXLScreen = breakPoint.xl;
62
73
  const toggleCustomerViewRef = useRef(null);
63
74
  const isFirstMountRef = useRef(true);
64
- const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount, allProducts }, } = useGlobalStateContext();
75
+ const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount, allProducts, loggedInUserRights }, } = useGlobalStateContext();
76
+ const isInternal = (_g = loggedInUserRights.data) === null || _g === void 0 ? void 0 : _g.isInternal();
65
77
  const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
66
78
  // To check if user has read only access
67
79
  const canReadCase = ability.can(resourceActions.READ, resources.CASE_DETAILS);
@@ -77,9 +89,14 @@ export function CaseDetailsAside(props) {
77
89
  const [viewAsInternalPref, setViewAsInternalPref] = useState();
78
90
  const [isDefaultBoxChecked, setIsDefaultBoxChecked] = useState(true);
79
91
  const { isExportingPDF } = useContext(PDFContext);
92
+ // TODO: When casegroups is deployed on SCT stage, update this logic to properly gate on ownersCaseGroups.data
80
93
  const isWritePermissionforCase = useMemo(() => {
81
- return (ownersCaseGroups.data || []).some((group) => group.groupNum === groupNumber) || groupNumber === '-1';
82
- }, [groupNumber, ownersCaseGroups.data]);
94
+ if (isInternal || !groupNumber)
95
+ return true;
96
+ if (!ownersCaseGroups.data)
97
+ return true;
98
+ return (ownersCaseGroups.data || []).some((group) => group.groupNum === groupNumber);
99
+ }, [groupNumber, ownersCaseGroups.data, isInternal]);
83
100
  useEffect(() => {
84
101
  const userPreferredCaseView = () => __awaiter(this, void 0, void 0, function* () {
85
102
  try {
@@ -157,7 +174,7 @@ export function CaseDetailsAside(props) {
157
174
  setIsDefaultBoxChecked(!isDefaultBoxChecked);
158
175
  toggleViewAsCustomerFlag(globalMetadataDispatchContext);
159
176
  };
160
- const isSideBarExpanded = (_a = caseDetailsAsidePanelRef.current) === null || _a === void 0 ? void 0 : _a.expanded;
177
+ const isSideBarExpanded = (_h = caseDetailsAsidePanelRef.current) === null || _h === void 0 ? void 0 : _h.expanded;
161
178
  if (isFetchingCaseDetails || isFetchingCaseDetailsError)
162
179
  return null;
163
180
  const renderCasePrefPopoverText = () => {
@@ -169,7 +186,7 @@ export function CaseDetailsAside(props) {
169
186
  }
170
187
  };
171
188
  // To check if the user is ESS Customer and Product has ESS Support
172
- const isESSCustomer = isSpecialSupportOfferingEnabled((_b = allProducts.data) === null || _b === void 0 ? void 0 : _b.productsResult, selectedProduct);
189
+ const isESSCustomer = isSpecialSupportOfferingEnabled((_j = allProducts.data) === null || _j === void 0 ? void 0 : _j.productsResult, selectedProduct);
173
190
  return (React.createElement("aside", { className: `grid-aside ${isSideBarExpanded ? '' : 'sidebar-collapsed'} ` },
174
191
  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' : ''}` },
175
192
  React.createElement("div", { className: "case-detail-collapse-panel" },
@@ -186,7 +203,7 @@ export function CaseDetailsAside(props) {
186
203
  !isLoadingRecommendations && allDocs.length > 0 && (React.createElement(Tooltip, { content: t('Top recommendations'), position: "left" },
187
204
  React.createElement(Button, { icon: React.createElement(Icon, { className: "pf-v6-u-p-sm", size: "lg" },
188
205
  React.createElement(ListIcon, null)), variant: "link", onClick: () => setSectionToScollRef(topSolutionsRef), className: "sidebar-section-toggle-btn", "aria-label": t('Top recommendations') }))),
189
- !caseEscalations.isFetching && (canCreateICE || (canCreateRME && isCreateRMEVisible)) && (React.createElement(Tooltip, { content: t('Request an escalation'), position: "left" },
206
+ !isEscalationsFetching && (canCreateICE || (canCreateRME && isCreateRMEVisible)) && (React.createElement(Tooltip, { content: t('Request an escalation'), position: "left" },
190
207
  React.createElement(Button, { icon: React.createElement(Icon, { className: "pf-v6-u-p-sm", size: "lg" },
191
208
  React.createElement(TrendUpIcon, null)), variant: "link", className: "sidebar-section-toggle-btn", onClick: () => setSectionToScollRef(createEscalationRef), "aria-label": t('Request an escalation') }))))))),
192
209
  React.createElement("pfe-collapse-panel", { className: "sidebar-content", "pfe-animation": "false", id: "case-details-aside-content", ref: caseDetailsAsidePanelRef },
@@ -213,6 +230,6 @@ export function CaseDetailsAside(props) {
213
230
  React.createElement(ESSRemoteSession, { waitingOnCallback: waitingOnCallback, remoteSessionTermsAcked: acceptedRemoteSessionTerms, caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, readOnly: canReadCase }))),
214
231
  !isESSCustomer && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement section') } },
215
232
  React.createElement(RemoteSessionAgreement, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, waitingOnCallback: waitingOnCallback, acceptedRemoteSessionTerms: acceptedRemoteSessionTerms && waitingOnCallback, readOnly: canReadCase }))),
216
- !caseEscalations.isFetching && isWritePermissionforCase && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading customer escalation section') } },
233
+ !isEscalationsFetching && isWritePermissionforCase && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading customer escalation section') } },
217
234
  React.createElement(ActiveCustomerEscalation, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef })))))));
218
235
  }
@@ -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;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"}
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;AA6BlE,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,qBAyT5C"}
@@ -12,25 +12,41 @@ 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';
15
16
  import { PDFContext } from './PDFContainer';
16
17
  import CaseDetailsManagement from './Tabs/CaseDetails/CaseDetailsManagement';
17
18
  import CaseHistory from './Tabs/CaseHistory/CaseHistory';
18
19
  import { CaseSummary } from './Tabs/CaseSummary/CaseSummary';
19
- const RelatedTasks = React.lazy(() => import(/* webpackChunkName: 'CaseBugzilla' */ './Tabs/RelatedTasks/RelatedTasks'));
20
- const CaseActionPlan = React.lazy(() => import(/* webpackChunkName: 'CaseActionPlan' */ './Tabs/CaseActionPlan/CaseActionPlan'));
20
+ // TODO: Uncomment when External Trackers has a functioning GraphQL endpoint
21
+ // const RelatedTasks = React.lazy(
22
+ // () => import(/* webpackChunkName: 'CaseBugzilla' */ './Tabs/RelatedTasks/RelatedTasks')
23
+ // );
24
+ // TODO: Re-enable Action Plan tab when ready
25
+ // const CaseActionPlan = React.lazy(
26
+ // () => import(/* webpackChunkName: 'CaseActionPlan' */ './Tabs/CaseActionPlan/CaseActionPlan')
27
+ // );
21
28
  const CasePrivateNotes = React.lazy(() => import(/* webpackChunkName: 'CasePrivateNotes' */ './Tabs/CasePrivateNotes/CasePrivateNotes'));
22
29
  const CaseDiscussion = React.lazy(() => import(/* webpackChunkName: 'CaseDiscussion' */ './Tabs/CaseDiscussion/CaseDiscussion'));
23
30
  const RMEEscalationList = React.lazy(() => import(/* webpackChunkName: 'RMEEscalationList' */ './Tabs/RMEEscalations/RMEEscalationList'));
24
31
  export function CaseDetailsTabs(props) {
25
32
  const { caseNumber } = props;
26
33
  const { activeTab } = useParams();
27
- const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount, pcmConfig, viewAsCustomer }, } = useContext(GlobalMetadataStateContext);
28
- const { accountNumber, chats, comments, status } = useCaseSelector((state) => ({
29
- accountNumber: state.caseDetails.accountNumberRef,
30
- chats: state.caseDetails.chats,
31
- comments: state.caseDetails.comments,
32
- status: state.caseDetails.status,
33
- }), isEqual);
34
+ const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
35
+ const { accountNumber, status, caseSalesforceId, privateNotes } = useCaseSelector((state) => {
36
+ var _a;
37
+ return ({
38
+ accountNumber: state.caseDetails.accountNumberRef,
39
+ // TODO: Re-enable after GraphQL migration of chats
40
+ // chats: state.caseDetails.chats,
41
+ status: state.caseDetails.status,
42
+ caseSalesforceId: state.caseDetails.id,
43
+ privateNotes: (_a = state.caseDetails.notes) !== null && _a !== void 0 ? _a : '',
44
+ });
45
+ }, isEqual);
46
+ const { comments, loading: commentsLoading, error: commentsError, refetch: refetchComments, } = useCaseComments({
47
+ caseId: caseSalesforceId,
48
+ skip: !caseSalesforceId,
49
+ });
34
50
  const { t } = useTranslation();
35
51
  const [activeTabKey, setActiveTabKey] = useState(0);
36
52
  const { caseDetailsPageState: { caseEscalations }, } = useCaseDetailsPageStateContext();
@@ -49,15 +65,17 @@ export function CaseDetailsTabs(props) {
49
65
  // const bugZillaTabRef: React.MutableRefObject<HTMLDivElement> = useRef(null);
50
66
  const managementTabRef = useRef(null);
51
67
  const privateNotesTabRef = useRef(null);
52
- const actionPlanTabRef = useRef(null);
68
+ // const actionPlanTabRef: React.MutableRefObject<HTMLDivElement> = useRef(null);
53
69
  const escalationTabRef = useRef(null);
54
- const relatedTasksRef = useRef(null);
70
+ // TODO: Uncomment when External Trackers has a functioning GraphQL endpoint
71
+ // const relatedTasksRef: React.MutableRefObject<HTMLDivElement> = useRef(null);
55
72
  const caseHistoryTabRef = useRef(null);
56
73
  const generateAiCaseSummaryTabRef = useRef(null);
57
74
  const tabsToRender = [];
58
- const handleTabClick = (event, tabIndex) => {
59
- setActiveTabKey(tabIndex);
60
- setSelectedTab(tabsToRender[tabIndex].title);
75
+ const handleTabClick = (_event, tabIndex) => {
76
+ const index = Number(tabIndex);
77
+ setActiveTabKey(index);
78
+ setSelectedTab(tabsToRender[index].title);
61
79
  };
62
80
  const isCaseHistoryEnabled = getConfigField(pcmConfig.data, 'isCaseHistoryEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
63
81
  tabsToRender.push({
@@ -66,7 +84,10 @@ export function CaseDetailsTabs(props) {
66
84
  title: CaseDetailsTabsEnum.DISCUSSION,
67
85
  ref: discussionTabRef,
68
86
  routePath: 'discussion',
69
- component: (React.createElement(CaseDiscussion, { caseNumber: caseNumber, tabRef: discussionTabRef, caseComments: comments, caseChats: chats, accountNumber: accountNumber, isDiscussionTab: selectedTab === CaseDetailsTabsEnum.DISCUSSION })),
87
+ component: (React.createElement(CaseDiscussion, { caseNumber: caseNumber, tabRef: discussionTabRef, caseComments: comments, commentsLoading: commentsLoading, commentsError: commentsError,
88
+ // TODO: Re-enable after GraphQL migration of chats
89
+ // caseChats={chats}
90
+ accountNumber: accountNumber, isDiscussionTab: selectedTab === CaseDetailsTabsEnum.DISCUSSION, refetchComments: refetchComments })),
70
91
  });
71
92
  tabsToRender.push({
72
93
  'data-tracking-id': 'case-details-tab',
@@ -76,24 +97,26 @@ export function CaseDetailsTabs(props) {
76
97
  ref: managementTabRef,
77
98
  component: (React.createElement(CaseDetailsManagement, { caseNumber: caseNumber, routeProps: props.routeProps, tabRef: managementTabRef })),
78
99
  });
79
- loggedInUserRights.data.isInternal() &&
80
- !viewAsCustomer &&
81
- tabsToRender.push({
82
- 'data-tracking-id': 'case-details-related-tasks-tab',
83
- key: 'relatedTasks',
84
- ref: relatedTasksRef,
85
- routePath: 'related-tasks',
86
- title: CaseDetailsTabsEnum.RELATED_TASKS,
87
- component: React.createElement(RelatedTasks, null),
88
- });
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
- });
100
+ // TODO: Uncomment when External Trackers has a functioning GraphQL endpoint
101
+ // loggedInUserRights.data.isInternal() &&
102
+ // !viewAsCustomer &&
103
+ // tabsToRender.push({
104
+ // 'data-tracking-id': 'case-details-related-tasks-tab',
105
+ // key: 'relatedTasks',
106
+ // ref: relatedTasksRef,
107
+ // routePath: 'related-tasks',
108
+ // title: CaseDetailsTabsEnum.RELATED_TASKS,
109
+ // component: <RelatedTasks />,
110
+ // });
111
+ // TODO: Re-enable Action Plan tab when ready
112
+ // tabsToRender.push({
113
+ // 'data-tracking-id': 'case-details-actionplan-tab',
114
+ // key: 'action plan',
115
+ // ref: actionPlanTabRef,
116
+ // title: CaseDetailsTabsEnum.ACTION_PLAN,
117
+ // routePath: 'plan',
118
+ // component: <CaseActionPlan caseNumber={caseNumber} />,
119
+ // });
97
120
  canSeePrivateNotes &&
98
121
  tabsToRender.push({
99
122
  'data-tracking-id': 'case-details-pvtnotes-tab',
@@ -101,7 +124,7 @@ export function CaseDetailsTabs(props) {
101
124
  ref: privateNotesTabRef,
102
125
  title: CaseDetailsTabsEnum.PRIVATE_NOTES,
103
126
  routePath: 'notes',
104
- component: React.createElement(CasePrivateNotes, { caseNumber: caseNumber }),
127
+ component: React.createElement(CasePrivateNotes, { caseNumber: caseNumber, privateNotes: privateNotes }),
105
128
  });
106
129
  canSeeRMEs &&
107
130
  (caseEscalations.data || []).length > 0 &&
@@ -3,6 +3,8 @@ import { IApiResponseDetails } from '@rh-support/types/shared';
3
3
  import React from 'react';
4
4
  interface IProps {
5
5
  owner: string;
6
+ isLoading: boolean;
7
+ isError: boolean;
6
8
  caseDetailsHydra: IApiResponseDetails<Partial<ICase>>;
7
9
  }
8
10
  export default function CaseOwnerInfo(props: IProps): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseOwnerInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseOwnerInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAI5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,qBAqElD"}
1
+ {"version":3,"file":"CaseOwnerInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseOwnerInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAI5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,qBAqElD"}
@@ -8,9 +8,9 @@ export default function CaseOwnerInfo(props) {
8
8
  var _a, _b;
9
9
  const { isExportingPDF } = useContext(PDFContext);
10
10
  return (React.createElement("div", { className: `case-owner ${isExportingPDF ? 'hide-in-pdf' : ''}` },
11
- React.createElement(LoadingIndicator, { isInline: true, show: props.caseDetailsHydra.isFetching }),
12
- props.caseDetailsHydra.isError && React.createElement("div", null, "There was error loading case owner info"),
13
- !props.caseDetailsHydra.isFetching && !props.caseDetailsHydra.isError && (React.createElement("div", null,
11
+ React.createElement(LoadingIndicator, { isInline: true, show: props.isLoading }),
12
+ props.isError && React.createElement("div", null, "There was error loading case owner info"),
13
+ !props.isLoading && !props.isError && (React.createElement("div", null,
14
14
  React.createElement("h3", { className: "subheading subheading-sm" },
15
15
  React.createElement(Trans, null, "Assigned to")),
16
16
  props.owner,
@@ -2,9 +2,8 @@ import { IDClassNameProps } from '@rh-support/types/shared';
2
2
  import React from 'react';
3
3
  interface IProps extends IDClassNameProps {
4
4
  selectedStatus: string;
5
- onStatusChange: (val: string) => void | Promise<void>;
5
+ onStatusChange: (portalStatus: string) => void | Promise<void>;
6
6
  isDisabled: boolean;
7
- allStatuses: string[];
8
7
  isFetching: boolean;
9
8
  hasError: boolean;
10
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8DhC;kBA9DQ,UAAU;;;AAiEnB,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CaseStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAAwC,MAAM,OAAO,CAAC;AAO7D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAmEhC;kBAnEQ,UAAU;;;AAsEnB,eAAe,UAAU,CAAC"}
@@ -8,9 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { SingleSelectDropdown, ValueChangedIcon } from '@rh-support/components';
11
+ import { mapSfdcStatusToPortalStatus, PORTAL_DISPLAY_STATUSES } from '@rh-support/utils';
11
12
  import isEmpty from 'lodash/isEmpty';
12
13
  import map from 'lodash/map';
13
- import React, { useContext, useState } from 'react';
14
+ import React, { useContext, useMemo, useState } from 'react';
14
15
  import { Trans, useTranslation } from 'react-i18next';
15
16
  import { CaseValuesToWatch } from '../../shared/Constants';
16
17
  import { getChangedValueTooltip } from '../../shared/utils';
@@ -26,29 +27,30 @@ function CaseStatus(props) {
26
27
  setIsCaseStatusInValid(isEmpty(selectedItem));
27
28
  };
28
29
  const { isExportingPDF } = useContext(PDFContext);
30
+ const selectedPortalStatus = useMemo(() => mapSfdcStatusToPortalStatus(props.selectedStatus), [props.selectedStatus]);
29
31
  // value changed logic to show a non local status change
30
32
  const [localStatusChange, setLocalStatusChange] = useState(false);
31
33
  const afterLocalChange = () => setLocalStatusChange(false);
32
34
  const onCaseStatusChange = (option) => __awaiter(this, void 0, void 0, function* () {
33
- if (option.value === props.selectedStatus) {
35
+ if (option.value === selectedPortalStatus) {
34
36
  return;
35
37
  }
36
38
  yield props.onStatusChange(option.value);
37
39
  setLocalStatusChange(true);
38
40
  validateCaseStatus(option);
39
41
  });
40
- const getDropdownOptions = map(props.allStatuses || [], (option) => ({
42
+ const getDropdownOptions = map(PORTAL_DISPLAY_STATUSES, (option) => ({
41
43
  label: option,
42
44
  value: option,
43
45
  }));
44
46
  const getSelectedDropdownOption = {
45
- label: props.selectedStatus,
46
- value: props.selectedStatus,
47
+ label: selectedPortalStatus,
48
+ value: selectedPortalStatus,
47
49
  };
48
50
  return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
49
51
  React.createElement("h3", { className: "subheading subheading-sm" },
50
52
  React.createElement(Trans, null, "Status"),
51
- React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localStatusChange, value: props.selectedStatus, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.status) }),
53
+ React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localStatusChange, value: selectedPortalStatus, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.status) }),
52
54
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*")),
53
55
  React.createElement(SingleSelectDropdown, { placeholder: t(`Select a status`), dataTrackingId: "case-details-status-selector", options: getDropdownOptions, selected: getSelectedDropdownOption, isDisabled: props.hasError || props.isDisabled || props.isFetching, isLoading: props.isFetching, isInvalid: isCaseStatusInValid, onSelect: onCaseStatusChange })));
54
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA4BvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,qBA0fjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA2BvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,qBAghBjD"}
@@ -7,13 +7,14 @@ 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';
10
11
  import { Alert, AlertVariant, Button, ButtonVariant, ExpandableSection, Label, ModalVariant, } from '@patternfly/react-core';
11
12
  import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
12
13
  import LockIcon from '@patternfly/react-icons/dist/js/icons/lock-icon';
13
14
  import { ToastNotification, useConfirmation } from '@rh-support/components';
14
- import { CloseCaseModal, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
15
+ import { CloseCaseModal, fetchAllStatuses, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
15
16
  import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
16
- import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct, PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, } from '@rh-support/utils';
17
+ import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct, mapSfdcStatusToPortalStatus, PreviousCaseTypes, resolvePortalStatusToApiValue, toNewCaseTypeMapper, toNewCaseTypeSwitcher, } from '@rh-support/utils';
17
18
  import isEqual from 'lodash/isEqual';
18
19
  import React, { useContext, useEffect, useRef, useState } from 'react';
19
20
  import { Trans, useTranslation } from 'react-i18next';
@@ -22,8 +23,8 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
22
23
  import { CaseOverviewDispatchContext, CaseOverviewStateContext } from '../../../context/CaseOverviewContext';
23
24
  import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMessage';
24
25
  import { SupportLevelDisplay } from '../../../reducers/CaseConstNTypes';
25
- import { fetchAllStatuses, fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
26
- import { updateCaseDetails } from '../../../reducers/CaseReducer';
26
+ import { fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
27
+ import { updateCaseDetailsGraphQL } from '../../../reducers/CaseReducer';
27
28
  import Severity from '../../CaseInformation/Severity';
28
29
  import { usePostComment } from '../../shared/usePostComment';
29
30
  import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
@@ -49,15 +50,17 @@ export default function CaseOverview(props) {
49
50
  const { isExportingPDF, exportPDFButton } = useContext(PDFContext);
50
51
  const reopenStatusRef = useRef(null);
51
52
  const { postComment, isPostingComment } = usePostComment({ caseNumber: props.caseNumber });
52
- const { product, version, status, caseType, createdDate, createdById, ownerId, caseNumber, entitlementSla, cep, accountNumber, isPrivate, isCaseUpdating, contactIsPartner, hotfixRequested, hotfixDelivered, selectedAccountDetails, firstCaseInactivityWarningSentAt, secondCaseInactivityWarningSentAt, } = useCaseSelector((state) => ({
53
+ const { product, version, status, caseType, createdDate, createdByName, ownerName, isFetchingCaseDetails, isFetchingCaseDetailsError, caseNumber, entitlementSla, cep, accountNumber, isPrivate, isCaseUpdating, contactIsPartner, hotfixRequested, hotfixDelivered, selectedAccountDetails, firstCaseInactivityWarningSentAt, secondCaseInactivityWarningSentAt, } = useCaseSelector((state) => ({
53
54
  product: state.caseDetails.product,
54
55
  version: state.caseDetails.version,
55
56
  status: state.caseDetails.status,
56
57
  caseType: state.caseDetails.caseType,
57
58
  caseSeverity: state.caseDetails.severity,
58
59
  createdDate: state.caseDetails.createdDate,
59
- createdById: state.caseDetails.createdById,
60
- ownerId: state.caseDetails.ownerId,
60
+ createdByName: state.caseDetails.createdByName,
61
+ ownerName: state.caseDetails.ownerName,
62
+ isFetchingCaseDetails: state.isFetchingCaseDetails,
63
+ isFetchingCaseDetailsError: state.isFetchingCaseDetailsError,
61
64
  caseNumber: state.caseDetails.caseNumber,
62
65
  entitlementSla: state.caseDetails.entitlementSla,
63
66
  cep: state.caseDetails.cep,
@@ -74,7 +77,12 @@ export default function CaseOverview(props) {
74
77
  const canEditCase = useCanEditCase();
75
78
  const caseDispatch = useCaseDispatch();
76
79
  const globalMetadataDispatchContext = useContext(GlobalMetadataDispatchContext);
77
- const { globalMetadataState: { allCaseTypes, allCaseSeverities, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
80
+ const apolloClient = useApolloClient();
81
+ const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
82
+ const updateOverviewCaseDetails = (payload) => updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, payload, false, {
83
+ existingCaseDetails,
84
+ });
85
+ const { globalMetadataState: { allCaseTypes, allCaseSeverities, allCaseStatuses, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
78
86
  const canManageCase = loggedInUserRights.data.canManageCases();
79
87
  const switchedCaseType = toNewCaseTypeSwitcher(caseType);
80
88
  const updatingUser = loggedInUsersAccount.data.name;
@@ -89,24 +97,24 @@ export default function CaseOverview(props) {
89
97
  }
90
98
  }
91
99
  if (haventLoadedMetadata(allCaseSeverities)) {
92
- fetchCaseSeverities(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
100
+ fetchCaseSeverities(globalMetadataDispatchContext, apolloClient);
93
101
  }
94
102
  if (haventLoadedMetadata(allCaseTypes)) {
95
- fetchCaseTypes(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
103
+ fetchCaseTypes(globalMetadataDispatchContext, apolloClient);
96
104
  }
97
- if (haventLoadedMetadata(caseOverviewState.allCaseStatuses)) {
98
- fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
105
+ if (haventLoadedMetadata(allCaseStatuses)) {
106
+ fetchAllStatuses(globalMetadataDispatchContext, apolloClient);
99
107
  }
100
108
  // eslint-disable-next-line react-hooks/exhaustive-deps
101
109
  }, [
102
110
  globalMetadataDispatchContext,
111
+ apolloClient,
103
112
  allCaseSeverities,
104
113
  allCaseTypes,
105
- caseOverviewState.allCaseStatuses,
114
+ allCaseStatuses,
106
115
  caseOverviewState.caseDetailsHydra,
107
116
  canSeeCaseOwnerInfo,
108
117
  caseNumber,
109
- loggedInUsersAccount.data.secureSupport,
110
118
  ]);
111
119
  const onTypeChange = (type) => __awaiter(this, void 0, void 0, function* () {
112
120
  if (canEditCase.alert())
@@ -117,7 +125,7 @@ export default function CaseOverview(props) {
117
125
  if (type === PreviousCaseTypes.FEATURE_ENHANCEMENT) {
118
126
  newCaseDetails = Object.assign(Object.assign({}, newCaseDetails), { fts: false });
119
127
  }
120
- yield updateCaseDetails(caseDispatch, props.caseNumber, newCaseDetails);
128
+ yield updateOverviewCaseDetails(newCaseDetails);
121
129
  setTypeUpdating(caseOverviewDispatch, false);
122
130
  ToastNotification.addSuccessMessage(t('Support type has been successfully updated'));
123
131
  }
@@ -138,7 +146,7 @@ export default function CaseOverview(props) {
138
146
  });
139
147
  setSeverityUpdating(caseOverviewDispatch, true);
140
148
  try {
141
- yield updateCaseDetails(caseDispatch, props.caseNumber, payLoad);
149
+ yield updateOverviewCaseDetails(payLoad);
142
150
  setSeverityUpdating(caseOverviewDispatch, false);
143
151
  ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
144
152
  }
@@ -157,7 +165,7 @@ export default function CaseOverview(props) {
157
165
  reopenedReasonOther: reopenedReasonOther,
158
166
  };
159
167
  try {
160
- yield updateCaseDetails(caseDispatch, props.caseNumber, updateStatusObj);
168
+ yield updateOverviewCaseDetails(updateStatusObj);
161
169
  setStatusUpdating(caseOverviewDispatch, false);
162
170
  onStatusUpdate && (yield onStatusUpdate());
163
171
  ToastNotification.addSuccessMessage(t('Status has been successfully updated'));
@@ -167,24 +175,28 @@ export default function CaseOverview(props) {
167
175
  caseUpdateError.showError(e, t('Status failed to update'));
168
176
  }
169
177
  });
170
- const onStatusChange = (newStatus) => __awaiter(this, void 0, void 0, function* () {
178
+ const onStatusChange = (newPortalStatus) => __awaiter(this, void 0, void 0, function* () {
171
179
  if (canEditCase.alert())
172
180
  return;
173
- if (status === CaseStatusEnum.CLOSED && newStatus !== CaseStatusEnum.CLOSED) {
174
- onCaseReopen(newStatus);
181
+ const currentPortalStatus = mapSfdcStatusToPortalStatus(status);
182
+ const newApiStatus = resolvePortalStatusToApiValue(newPortalStatus, status);
183
+ if (currentPortalStatus === 'Closed' && newPortalStatus !== 'Closed') {
184
+ onCaseReopen(newPortalStatus);
175
185
  }
176
- else if (newStatus === CaseStatusEnum.CLOSED) {
186
+ else if (newPortalStatus === 'Closed') {
177
187
  onCaseClose();
178
188
  }
179
189
  else {
180
190
  yield confirm({
181
191
  title: t(`Update the status of the case?`),
182
- description: t('Are you sure you want to change the case status to {{newStatus}}?', { newStatus }),
192
+ description: t('Are you sure you want to change the case status to {{newStatus}}?', {
193
+ newStatus: newPortalStatus,
194
+ }),
183
195
  confirmText: t('Yes, confirm'),
184
196
  cancelText: t('No, cancel'),
185
197
  modalVariant: ModalVariant.small,
186
198
  });
187
- updateStatusState(newStatus);
199
+ updateStatusState(newApiStatus);
188
200
  }
189
201
  });
190
202
  const onCaseClose = () => __awaiter(this, void 0, void 0, function* () {
@@ -223,7 +235,7 @@ export default function CaseOverview(props) {
223
235
  React.createElement("span", { className: "pf-v6-u-ml-sm" },
224
236
  React.createElement(ExternalLinkAltIcon, null))));
225
237
  };
226
- const isCaseInOpenState = status !== CaseStatusEnum.CLOSED;
238
+ const isCaseInOpenState = mapSfdcStatusToPortalStatus(status) !== 'Closed';
227
239
  // To switch from old case type to new support type
228
240
  const newCaseTypesArray = toNewCaseTypeMapper(allCaseTypes.data).sort();
229
241
  return (React.createElement(React.Fragment, null,
@@ -289,13 +301,13 @@ export default function CaseOverview(props) {
289
301
  React.createElement("div", { className: "created-by" },
290
302
  React.createElement("h3", { className: "subheading subheading-sm" },
291
303
  React.createElement(Trans, null, "Created by")),
292
- React.createElement("div", null, createdById),
304
+ React.createElement("div", null, createdByName),
293
305
  React.createElement("div", null, createdDate ? React.createElement(DateTime, { dateTimeString: createdDate }) : null)),
294
- canSeeCaseOwnerInfo && (React.createElement(CaseOwnerInfo, { owner: ownerId, caseDetailsHydra: caseOverviewState.caseDetailsHydra }))),
306
+ canSeeCaseOwnerInfo && (React.createElement(CaseOwnerInfo, { owner: ownerName !== null && ownerName !== void 0 ? ownerName : '', isLoading: isFetchingCaseDetails, isError: isFetchingCaseDetailsError, caseDetailsHydra: caseOverviewState.caseDetailsHydra }))),
295
307
  React.createElement("div", { className: "case-overview-secondary card card-md card-light push-bottom" },
296
308
  React.createElement("div", { className: "pf-v6-l-grid pf-m-gutter pf-m-all-4-col-on-lg" },
297
309
  React.createElement("div", { className: "form-wrapper" },
298
- React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || caseOverviewState.allCaseStatuses.isFetching, allStatuses: caseOverviewState.allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: caseOverviewState.allCaseStatuses.isError })),
310
+ React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || allCaseStatuses.isFetching, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: allCaseStatuses.isError })),
299
311
  React.createElement("div", { className: "form-wrapper" },
300
312
  React.createElement(CaseType, { selectedType: switchedCaseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching || isCaseUpdating, allTypes: newCaseTypesArray, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
301
313
  React.createElement("div", { className: "form-wrapper" },
@@ -310,13 +322,14 @@ export default function CaseOverview(props) {
310
322
  }), isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, onClose: () => {
311
323
  setShowCaseCloseModal(false);
312
324
  }, caseNumber: caseNumber })),
313
- showReOpenCaseModal && (React.createElement(ReopenCaseModal, { isInternal: loggedInUserRights.data.isInternal(), onConfirm: (commentBody, newStatus, reopenedAt, reopenedBySSOName, reopenedReason, reopenedReasonOther) => __awaiter(this, void 0, void 0, function* () {
314
- yield updateStatusState(newStatus, reopenedAt || null, reopenedBySSOName || null, reopenedReason || null, reopenedReasonOther || null, () => __awaiter(this, void 0, void 0, function* () {
325
+ showReOpenCaseModal && (React.createElement(ReopenCaseModal, { isInternal: loggedInUserRights.data.isInternal(), onConfirm: (commentBody, newPortalStatus, reopenedAt, reopenedBySSOName, reopenedReason, reopenedReasonOther) => __awaiter(this, void 0, void 0, function* () {
326
+ const newApiStatus = resolvePortalStatusToApiValue(newPortalStatus, status);
327
+ yield updateStatusState(newApiStatus, reopenedAt || null, reopenedBySSOName || null, reopenedReason || null, reopenedReasonOther || null, () => __awaiter(this, void 0, void 0, function* () {
315
328
  yield postCommentAfterStatusUpdate(commentBody);
316
329
  dtmTrackEventCaseStepEncountered('reopen', caseNumber, product, version);
317
330
  }));
318
331
  setShowReopenCaseModal(false);
319
332
  }), onClose: () => {
320
333
  setShowReopenCaseModal(false);
321
- }, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, allStatuses: caseOverviewState.allCaseStatuses.data, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
334
+ }, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
322
335
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAuF3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAuhBxB,CAAC"}
1
+ {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAwF3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAwhBxB,CAAC"}