@rh-support/troubleshoot 2.6.354 → 2.6.357

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 (345) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +19 -29
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +91 -16
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +6 -2
  7. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +61 -32
  9. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +8 -0
  10. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +1 -0
  11. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +18 -0
  12. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Case.js +60 -33
  14. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +19 -9
  16. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +15 -4
  18. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +82 -55
  20. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  23. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
  24. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  25. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
  26. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  27. package/lib/esm/components/CaseEditView/CaseOverview/index.js +76 -45
  28. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +203 -109
  30. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
  31. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  33. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
  34. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +5 -9
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +18 -17
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +51 -47
  40. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  41. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +49 -44
  42. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +4 -0
  43. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
  44. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +23 -0
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +51 -45
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +23 -10
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -2
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +132 -57
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +10 -5
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +110 -65
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +40 -26
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +2 -4
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +122 -148
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +76 -145
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +22 -9
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +9 -2
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +8 -1
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +29 -0
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +29 -0
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
  81. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +60 -0
  82. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
  83. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  84. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +18 -7
  85. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +9 -3
  86. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  87. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +217 -267
  88. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -4
  90. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  91. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
  92. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  93. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
  94. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  95. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
  96. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
  97. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  98. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
  99. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  100. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
  101. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  102. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +38 -52
  103. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  104. package/lib/esm/components/CaseInformation/CaseGroup.js +168 -61
  105. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  106. package/lib/esm/components/CaseInformation/CaseInformation.js +10 -9
  107. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +3 -0
  108. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -0
  109. package/lib/esm/components/CaseInformation/CaseLabels.js +103 -0
  110. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  111. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +108 -31
  112. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  113. package/lib/esm/components/CaseInformation/Description.js +1 -1
  114. package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
  115. package/lib/esm/components/CaseInformation/FileDiag.js +2 -5
  116. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  117. package/lib/esm/components/CaseInformation/Fts.js +31 -17
  118. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  119. package/lib/esm/components/CaseInformation/Severity.js +21 -13
  120. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  121. package/lib/esm/components/CaseInformation/SupportLevel.js +36 -55
  122. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +4 -0
  123. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +1 -0
  124. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +110 -0
  125. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  126. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -8
  127. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  128. package/lib/esm/components/CaseManagement/CaseManagement.js +13 -10
  129. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  130. package/lib/esm/components/CaseManagement/Cep.js +11 -9
  131. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +2 -1
  132. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  133. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +22 -3
  134. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  135. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  136. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +15 -22
  137. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  138. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
  139. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  140. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +8 -4
  141. package/lib/esm/components/EditDescription/EditDescription.js +1 -1
  142. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  143. package/lib/esm/components/IdeaInformation/IdeaInformation.js +16 -18
  144. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  145. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  146. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  147. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  148. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  149. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  150. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  151. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  152. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +37 -50
  153. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +3 -0
  154. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +1 -0
  155. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +9 -0
  156. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  157. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  158. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  159. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +9 -1
  160. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  161. package/lib/esm/components/Recommendations/AsideResults.js +4 -3
  162. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  163. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
  164. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  165. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  166. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  167. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  168. package/lib/esm/components/Recommendations/Recommendations.js +3 -9
  169. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  170. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +10 -8
  171. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  172. package/lib/esm/components/Review/Review.js +25 -19
  173. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  174. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  175. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  176. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  177. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  178. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  179. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +104 -62
  180. package/lib/esm/components/shared/Constants.d.ts +5 -0
  181. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  182. package/lib/esm/components/shared/Constants.js +5 -0
  183. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  184. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  185. package/lib/esm/components/shared/fileUpload/FileUpload.js +2 -3
  186. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  187. package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
  188. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +1 -0
  189. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  190. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +4 -3
  191. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  192. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  193. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +21 -5
  194. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  195. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +210 -34
  196. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +5 -1
  197. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  198. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +36 -1
  199. package/lib/esm/components/shared/fileUpload/types/index.d.ts +5 -1
  200. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  201. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  202. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  203. package/lib/esm/components/shared/fileUpload/useFileUploader.js +116 -47
  204. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  205. package/lib/esm/components/shared/useIsSectionValid.js +22 -57
  206. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  207. package/lib/esm/components/shared/usePostComment.js +16 -28
  208. package/lib/esm/components/shared/utils.d.ts +1 -0
  209. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  210. package/lib/esm/components/shared/utils.js +9 -3
  211. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  212. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +178 -38
  213. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  214. package/lib/esm/components/wizardLayout/WizardAside.js +2 -4
  215. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  216. package/lib/esm/components/wizardLayout/WizardLayout.js +12 -13
  217. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  218. package/lib/esm/components/wizardLayout/WizardMain.js +7 -0
  219. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  220. package/lib/esm/components/wizardLayout/WizardNavigation.js +14 -11
  221. package/lib/esm/constants/caseDetailsConstants.d.ts +5 -0
  222. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  223. package/lib/esm/constants/caseDetailsConstants.js +5 -0
  224. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  225. package/lib/esm/css/app.css +28 -0
  226. package/lib/esm/css/case.css +60 -209
  227. package/lib/esm/graphql/index.d.ts +4 -0
  228. package/lib/esm/graphql/index.d.ts.map +1 -0
  229. package/lib/esm/graphql/index.js +3 -0
  230. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  231. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  232. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  233. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  234. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  235. package/lib/esm/graphql/mutations/index.js +1 -0
  236. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  237. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  238. package/lib/esm/graphql/queries/getEscalationDetails.js +31 -0
  239. package/lib/esm/graphql/queries/index.d.ts +2 -0
  240. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  241. package/lib/esm/graphql/queries/index.js +1 -0
  242. package/lib/esm/graphql/schemas/escalation.d.ts +66 -0
  243. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  244. package/lib/esm/graphql/schemas/escalation.js +1 -0
  245. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  246. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  247. package/lib/esm/graphql/schemas/index.js +1 -0
  248. package/lib/esm/hooks/useAB.d.ts.map +1 -1
  249. package/lib/esm/hooks/useAB.js +45 -23
  250. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
  251. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
  252. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +52 -0
  253. package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
  254. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
  255. package/lib/esm/hooks/useCaseComments/index.js +5 -0
  256. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
  257. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
  258. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +75 -0
  259. package/lib/esm/hooks/useCaseComments/types.d.ts +85 -0
  260. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
  261. package/lib/esm/hooks/useCaseComments/types.js +1 -0
  262. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +17 -0
  263. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
  264. package/lib/esm/hooks/useCaseComments/useCaseComments.js +38 -0
  265. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
  266. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
  267. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
  268. package/lib/esm/hooks/useCaseGroupUiState.d.ts +3 -0
  269. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +1 -0
  270. package/lib/esm/hooks/useCaseGroupUiState.js +10 -0
  271. package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
  272. package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
  273. package/lib/esm/hooks/useCaseHistory.js +98 -0
  274. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +21 -0
  275. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
  276. package/lib/esm/hooks/useCaseLabelLinkMutations.js +91 -0
  277. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  278. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  279. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +21 -11
  280. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  281. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  282. package/lib/esm/hooks/useS3Upload.d.ts +5 -4
  283. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  284. package/lib/esm/hooks/useS3Upload.js +28 -30
  285. package/lib/esm/i18n/template-de.d.ts +2 -2
  286. package/lib/esm/i18n/template-de.js +2 -2
  287. package/lib/esm/i18n/template-es.d.ts +2 -2
  288. package/lib/esm/i18n/template-es.js +2 -2
  289. package/lib/esm/i18n/template-fr.d.ts +2 -2
  290. package/lib/esm/i18n/template-fr.js +2 -2
  291. package/lib/esm/i18n/template-it.d.ts +2 -2
  292. package/lib/esm/i18n/template-it.js +2 -2
  293. package/lib/esm/i18n/template-jp.d.ts +2 -2
  294. package/lib/esm/i18n/template-jp.js +2 -2
  295. package/lib/esm/i18n/template-ko.d.ts +2 -2
  296. package/lib/esm/i18n/template-ko.js +2 -2
  297. package/lib/esm/i18n/template-pt.d.ts +2 -2
  298. package/lib/esm/i18n/template-pt.js +2 -2
  299. package/lib/esm/i18n/template-ru.d.ts +2 -2
  300. package/lib/esm/i18n/template-ru.js +2 -2
  301. package/lib/esm/i18n/template-zh.d.ts +2 -2
  302. package/lib/esm/i18n/template-zh.js +2 -2
  303. package/lib/esm/index.js +1 -0
  304. package/lib/esm/models/cache.d.ts +0 -2
  305. package/lib/esm/models/cache.d.ts.map +1 -1
  306. package/lib/esm/models/caseHistory.d.ts +80 -0
  307. package/lib/esm/models/caseHistory.d.ts.map +1 -0
  308. package/lib/esm/models/caseHistory.js +1 -0
  309. package/lib/esm/reducers/CaseConstNTypes.d.ts +123 -9
  310. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  311. package/lib/esm/reducers/CaseConstNTypes.js +31 -7
  312. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +7 -5
  313. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  314. package/lib/esm/reducers/CaseDetailsPageReducer.js +58 -26
  315. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +11 -12
  316. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  317. package/lib/esm/reducers/CaseDiscussionTabReducer.js +63 -70
  318. package/lib/esm/reducers/CaseHelpers.d.ts +11 -1
  319. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  320. package/lib/esm/reducers/CaseHelpers.js +117 -17
  321. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  322. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  323. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  324. package/lib/esm/reducers/CaseReducer.d.ts +56 -11
  325. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  326. package/lib/esm/reducers/CaseReducer.js +279 -99
  327. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  328. package/lib/esm/reducers/RecommendationsReducer.js +15 -18
  329. package/lib/esm/scss/_main.scss +9 -0
  330. package/lib/esm/utils/TimelineUtils.d.ts +41 -0
  331. package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
  332. package/lib/esm/utils/TimelineUtils.js +135 -0
  333. package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
  334. package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
  335. package/lib/esm/utils/caseHistoryUtils.js +165 -0
  336. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
  337. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  338. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  339. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +6 -0
  340. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +1 -0
  341. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +26 -0
  342. package/package.json +9 -8
  343. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +0 -25
  344. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +0 -1
  345. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +0 -88
@@ -7,341 +7,291 @@ 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 { publicApi } from '@cee-eng/hydrajs';
11
- import { Button, ButtonVariant, Checkbox, debounce, Tooltip } from '@patternfly/react-core';
10
+ import { useApolloClient } from '@apollo/client/react';
11
+ import { Button, ButtonVariant, Checkbox } from '@patternfly/react-core';
12
12
  import PlusIcon from '@patternfly/react-icons/dist/js/icons/plus-icon';
13
- import { EditorMode, LoadingIndicator, MarkdownEditor, ToastNotification, useFetch, usePrevious, } from '@rh-support/components';
14
- import { FeatureAnnouncementKeys, GlobalMetadataStateContext, NewFeaturePopoverAnnouncement, useCanEditCase, useUserPreferences, } from '@rh-support/react-context';
15
- import { ability, CaseDiscussionFields, CaseListFields, resourceActions, resources, } from '@rh-support/user-permissions';
13
+ import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
14
+ import { LoadingIndicator, RichTextEditor, ToastNotification, usePrevious } from '@rh-support/components';
15
+ import { GlobalMetadataStateContext, useCanEditCase, useUserPreferences } from '@rh-support/react-context';
16
+ import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
17
+ import { formatDateTime, getHydraAttachmentImageUrl } from '@rh-support/utils';
16
18
  import isEmpty from 'lodash/isEmpty';
17
19
  import isEqual from 'lodash/isEqual';
18
- import uniqBy from 'lodash/uniqBy';
19
- import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
20
+ import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
20
21
  import { useDropzone } from 'react-dropzone';
21
22
  import { Trans, useTranslation } from 'react-i18next';
22
23
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
23
- import { CaseDetailsCacheNamespaces } from '../../../../enums/cache';
24
- import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
25
- import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
26
- import { addingNotifiedUsers, checkForCaseStatusToggleOnAttachOrComment, setNotifiedUser, } from '../../../../reducers/CaseReducer';
27
- import { CaseDetailsCacheUtils } from '../../../../utils/caseDetailsCacheUtils';
28
- import { AttachmentDispatchContext, AttachmentStateContext, hasSomeSelectedFiles, hasSomeUnUploadedAttachments, isUploadingAttachment, resetAttachment, } from '../../../shared/fileUpload';
24
+ import { useCreateCaseComment } from '../../../../hooks/useCaseComments';
25
+ import { useS3Upload } from '../../../../hooks/useS3Upload';
26
+ import { checkForCaseStatusToggleOnAttachOrComment } from '../../../../reducers/CaseReducer';
27
+ import { AttachmentDispatchContext, AttachmentStateContext, hasAbortedOrFailedAttachments, hasQueuedAttachmentUploads, hasSomeSelectedFiles, isUploadingAttachment, resetAttachment, } from '../../../shared/fileUpload';
29
28
  import FileSelectorButton from '../../../shared/fileUpload/fileSelectors/FileSelectorButton';
30
29
  import FileUpload from '../../../shared/fileUpload/FileUpload';
31
30
  import { PDFContext } from '../../PDFContainer';
31
+ import { useAttachmentUploadCompletion } from './PostComment/useAttachmentUploadCompletion';
32
+ import { useCommentDrafts } from './PostComment/useCommentDrafts';
32
33
  import { useMarkdownFileUploader } from './PostComment/useMarkdownFileUploader';
33
34
  import { VerifyCaseStatusModal } from './VerifyCaseStatusModal/VerifyCaseStatusModal';
34
35
  export function PostComment(props) {
35
- var _a, _b;
36
+ var _a, _b, _c, _d, _e, _f, _g;
36
37
  const { t } = useTranslation();
37
- const caseUpdateError = useCaseUpdateErrorMessage();
38
38
  let { caseNumber } = props;
39
39
  const [isTextAreaFocused, setIsTextAreaFocused] = useState(false);
40
- const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
41
40
  const canPostPrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.POST_PRIVATE_COMMENT);
42
- const { request, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
43
- propgateErrors: true,
44
- });
41
+ const { createComment, loading: isPostingComment } = useCreateCaseComment();
45
42
  const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
46
43
  const { attachmentState } = useContext(AttachmentStateContext);
47
- const [commentText, setCommentText] = useState(props.commentText || '');
48
- const [isPublic, setIsPublic] = useState(props.defaultIsPublic === null ? true : props.defaultIsPublic);
49
- const isPublicRef = useRef(isPublic);
50
44
  const isUploadingAttachmentPrevious = useRef(false);
45
+ const batchSuccessCountRef = useRef(0);
51
46
  const isUploadingAttachments = isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles);
52
- const hasSomeUnUploadedFiles = hasSomeUnUploadedAttachments(attachmentState.caseFiles.selectedLocalFiles);
47
+ const hasQueuedUploads = hasQueuedAttachmentUploads(attachmentState.caseFiles.selectedLocalFiles);
48
+ const hasAbortedOrFailed = hasAbortedOrFailedAttachments(attachmentState.caseFiles.selectedLocalFiles);
53
49
  const hasSomeSelectedFilesLocal = hasSomeSelectedFiles(attachmentState.caseFiles.selectedLocalFiles);
54
- const [commentType, setCommentType] = useState(EditorMode.PLAIN);
50
+ const [isPublic, setIsPublic] = useState((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true);
55
51
  const [commentSignature, setCommentSignature] = useState('');
52
+ const [commentText, setCommentText] = useState('');
56
53
  const { isExportingPDF } = useContext(PDFContext);
57
54
  const { getCommentTypeFromPreference, getCommentSignature } = useUserPreferences();
58
- const userOriginalCommentPrefs = () => __awaiter(this, void 0, void 0, function* () {
59
- try {
60
- const retrievedComment = yield getCommentTypeFromPreference();
61
- const retrievedCommentSignature = yield getCommentSignature();
62
- const defaultCommentType = retrievedComment ? retrievedComment : EditorMode.PLAIN;
63
- // @ts-ignore
64
- setCommentType(defaultCommentType);
65
- const defaultCommentSignature = retrievedCommentSignature || '';
66
- setCommentSignature(defaultCommentSignature);
67
- if (isEmpty(commentText) && !isEmpty(defaultCommentSignature)) {
68
- setCommentText(`\n ${defaultCommentSignature}` || '');
69
- }
70
- }
71
- catch (error) {
72
- console.log(error);
73
- }
74
- });
55
+ const applySignature = useCallback((text) => {
56
+ if (isEmpty(commentSignature))
57
+ return;
58
+ const signatureHtml = `<p>${commentSignature}</p>`;
59
+ const signed = text.includes(commentSignature) ? text : text + signatureHtml;
60
+ setCommentText(signed);
61
+ }, [commentSignature]);
75
62
  useEffect(() => {
76
- userOriginalCommentPrefs();
63
+ function loadPrefs() {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ try {
66
+ yield getCommentTypeFromPreference();
67
+ const sig = (yield getCommentSignature()) || '';
68
+ setCommentSignature(sig);
69
+ if (isEmpty(commentText) && !isEmpty(sig)) {
70
+ setCommentText(`<p><br></p><p>${sig}</p>`);
71
+ }
72
+ }
73
+ catch (error) {
74
+ console.error('Failed to load comment preferences:', error);
75
+ }
76
+ });
77
+ }
78
+ loadPrefs();
77
79
  // eslint-disable-next-line react-hooks/exhaustive-deps
78
80
  }, []);
79
81
  const [isModalOpen, setIsModalOpen] = useState(false);
80
82
  const [cssCommentAgreed, setCssCommentAgreed] = useState(false);
81
- const [isProcessing, setIsProcessing] = useState(isPostingComment || isUploadingAttachments);
83
+ const [isProcessing, setIsProcessing] = useState(false);
82
84
  const { globalMetadataState: { loggedInUser, loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
83
- const { onFileAttach, onFileDelete, isUploadingFile, isMarkdownFileUploadInProgress, cancelFileUpload } = useMarkdownFileUploader({
85
+ const { onFileAttach, cancelFileUpload } = useMarkdownFileUploader({
84
86
  caseNumber,
85
- secureSupport: loggedInUsersAccount.data.secureSupport,
86
- onAttachmentAdded: props.onAttachmentAdded,
87
+ onAttachmentAdded: (_b = props.onAttachmentAdded) !== null && _b !== void 0 ? _b : (() => undefined),
87
88
  });
88
- const { selectedNotificationContacts, status, contactSSOName, selectedAccountDetails } = useCaseSelector((state) => ({
89
+ const { getRootProps, getInputProps } = useDropzone({
90
+ onDrop: (files) => onFileAttach(files, isPublic),
91
+ multiple: false,
92
+ noClick: true,
93
+ noKeyboard: true,
94
+ });
95
+ const { status, caseSalesforceId, existingCaseDetails } = useCaseSelector((state) => ({
89
96
  status: state.caseDetails.status,
90
- contactSSOName: state.caseDetails.contactSSOName,
91
- selectedNotificationContacts: state.selectedNotificationContacts,
92
- selectedAccountDetails: state.selectedAccountDetails,
97
+ caseSalesforceId: state.caseDetails.id,
98
+ existingCaseDetails: state.caseDetails,
93
99
  }), isEqual);
94
- const isConfirmedStateSideSupport = ((_a = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.hasConfirmedStatesideSupport) ||
95
- ((_b = selectedAccountDetails === null || selectedAccountDetails === void 0 ? void 0 : selectedAccountDetails.data) === null || _b === void 0 ? void 0 : _b.hasConfirmedStatesideSupport);
100
+ const apolloClient = useApolloClient();
101
+ const { uploadFile: uploadImageFile } = useS3Upload(caseNumber, apolloClient, caseSalesforceId);
102
+ const onImageUpload = useCallback((file) => __awaiter(this, void 0, void 0, function* () {
103
+ const attachmentId = yield uploadImageFile({ file });
104
+ if (!attachmentId) {
105
+ throw new Error('Upload did not return an attachment id.');
106
+ }
107
+ return getHydraAttachmentImageUrl(caseNumber, attachmentId);
108
+ }), [caseNumber, uploadImageFile]);
109
+ const isConfirmedStateSideSupport = (_c = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _c === void 0 ? void 0 : _c.hasConfirmedStatesideSupport;
96
110
  const caseDispatch = useCaseDispatch();
97
111
  const [isCommentTooLong, setIsCommentTooLong] = useState(false);
98
- const canEditCase = useCanEditCase();
112
+ const canEditCase = useCanEditCase(status);
113
+ const isCaseReadOnly = canEditCase.isCaseNotEditable;
99
114
  const componentRef = useRef(null);
100
- let passedReply = props.commentText;
101
- const { getRootProps, getInputProps, open } = useDropzone({
102
- onDrop: (files) => onFileAttach(files, isPublic),
103
- multiple: false,
104
- });
105
- // Allows the isPublic default state to be changed by the parent component
106
- const resetIsPublic = useCallback(() => setIsPublic(props.defaultIsPublic === null ? true : props.defaultIsPublic), [props.defaultIsPublic]);
115
+ const resetIsPublic = useCallback(() => { var _a; return setIsPublic((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true); }, [props.defaultIsPublic]);
107
116
  const previousDefaultIsPublic = usePrevious(props.defaultIsPublic);
108
117
  useEffect(() => {
118
+ var _a;
109
119
  if (previousDefaultIsPublic === props.defaultIsPublic)
110
120
  return;
111
- props.defaultIsPublic === null ? resetIsPublic() : setIsPublic(props.defaultIsPublic);
121
+ setIsPublic((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true);
112
122
  }, [props.defaultIsPublic, resetIsPublic, previousDefaultIsPublic]);
113
- // why usecallback instead of useRef?
114
- // https://reactjs.org/docs/hooks-faq.html#how-can-i-measure-a-dom-node
115
- const textAreaRef = useCallback((node) => {
116
- if (node !== null &&
117
- props.commentText &&
118
- props.commentCreator &&
119
- commentText &&
120
- commentText === getReplyText(props.commentText, props.commentCreator)) {
121
- node.scrollTop = node.scrollHeight;
122
- node.focus();
123
- }
124
- },
125
- // eslint-disable-next-line react-hooks/exhaustive-deps
126
- [commentText]);
123
+ const quillEditorRef = useRef(null);
124
+ const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
125
+ const { saveDraft, clearDraft } = useCommentDrafts({
126
+ caseNumber,
127
+ loggedInUserSSO,
128
+ isInternal: loggedInUserRights.data.isInternal(),
129
+ commentSignature,
130
+ canPostPrivateComments,
131
+ setCommentText,
132
+ setIsPublic,
133
+ applySignature,
134
+ });
127
135
  const resetCommentSection = () => __awaiter(this, void 0, void 0, function* () {
128
136
  setCommentText('');
129
137
  setIsTextAreaFocused(false);
130
138
  resetIsPublic();
131
- const { value: prevDraftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername())) || {};
132
- if (prevDraftComments[caseNumber]) {
133
- delete prevDraftComments[caseNumber];
134
- }
135
- CaseDetailsCacheUtils.set(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername(), { value: prevDraftComments });
136
- props.onCommentClear && props.onCommentClear();
137
- setCommentText(`\n ${commentSignature}` || '');
139
+ yield clearDraft();
140
+ setCommentText(commentSignature ? `<p><br></p><p>${commentSignature}</p>` : '');
138
141
  });
139
142
  const resetAttachmentSection = () => {
140
143
  resetAttachment(dispatchToAttachmentReducer);
141
144
  };
145
+ const onCaseFileUploaded = () => {
146
+ ToastNotification.addSuccessMessage(t('Attachment uploaded successfully'));
147
+ batchSuccessCountRef.current += 1;
148
+ };
149
+ useAttachmentUploadCompletion({
150
+ isUploadingAttachments,
151
+ hasQueuedUploads,
152
+ hasAbortedOrFailed,
153
+ isUploadingAttachmentPrevious,
154
+ batchSuccessCountRef,
155
+ caseDispatch,
156
+ apolloClient,
157
+ caseNumber,
158
+ existingCaseDetails,
159
+ isInternal: loggedInUserRights.data.isInternal(),
160
+ status,
161
+ resetAttachmentSection,
162
+ setCssCommentAgreed,
163
+ onAttachmentBatchAdded: props.onAttachmentAdded,
164
+ });
142
165
  const onCancelClick = () => {
166
+ // Cancel only clears comment text; file removal stays on FileLister Remove.
143
167
  resetCommentSection();
144
- resetAttachmentSection();
145
168
  cancelFileUpload();
146
169
  };
147
- const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
148
- // https://github.com/facebook/react/issues/19240
149
- const debouncedCacheSave = useMemo(() => debounce(function (value, mode, publicFlag) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- const { value: prevDraftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO)) || {};
152
- if (prevDraftComments[caseNumber]) {
153
- }
154
- prevDraftComments[caseNumber] = { text: value, privateFlag: !publicFlag, type: mode };
155
- CaseDetailsCacheUtils.set(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO, {
156
- value: prevDraftComments,
157
- });
158
- });
159
- }, 500), [caseNumber, loggedInUserSSO]);
160
- const onCommentTextChange = (value, mode) => __awaiter(this, void 0, void 0, function* () {
161
- setCommentType(mode);
162
- setCommentText(value);
163
- debouncedCacheSave(value, mode, isPublic);
164
- });
165
- const addUserToNotifyList = () => __awaiter(this, void 0, void 0, function* () {
166
- const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
167
- if (loggedInUserSSO !== contactSSOName &&
168
- !(selectedNotificationContacts || []).map((item) => item.ssoUsername).includes(loggedInUserSSO)) {
169
- yield addingNotifiedUsers(caseDispatch, caseNumber, [{ ssoUsername: loggedInUserSSO }]);
170
- setNotifiedUser(caseDispatch, uniqBy([...selectedNotificationContacts, loggedInUser.data], 'ssoUsername'));
171
- }
172
- });
173
- useEffect(() => {
174
- isPublicRef.current = isPublic;
175
- }, [isPublic]);
176
- useEffect(() => {
177
- if (isCommentEmpty) {
178
- props.onCommentClear && props.onCommentClear();
179
- }
180
- // eslint-disable-next-line react-hooks/exhaustive-deps
181
- }, [commentText]);
182
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
170
+ const onCommentTextChange = (html) => {
171
+ setCommentText(html);
172
+ saveDraft(html, isPublic);
173
+ };
174
+ const onCancel = () => {
175
+ setIsModalOpen(false);
176
+ };
177
+ const isNotInternalConfirm = () => {
178
+ onPostComment();
179
+ };
180
+ const onConfirm = () => {
181
+ setIsModalOpen(false);
182
+ isNotInternalConfirm();
183
+ };
184
+ const onBtnClick = () => {
185
+ setIsModalOpen(true);
186
+ };
187
+ // TODO: Re-enable after GraphQL migration (REST notification)
188
+ // const addUserToNotifyList = async () => {
189
+ // const sso = loggedInUserRights.data.getSSOUsername();
190
+ // const alreadyNotified = (selectedNotificationContacts || []).some((item) => item.ssoUsername === sso);
191
+ // if (sso === contactSSOName || alreadyNotified) return;
192
+ // await addingNotifiedUsers(caseDispatch, caseNumber, [{ ssoUsername: sso }]);
193
+ // setNotifiedUser(caseDispatch, uniqBy([...selectedNotificationContacts, loggedInUser.data], 'ssoUsername'));
194
+ // };
195
+ const plainTextContent = (_g = (_f = (_e = (_d = quillEditorRef.current) === null || _d === void 0 ? void 0 : _d.getText) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.trim()) !== null && _g !== void 0 ? _g : '';
196
+ const checkCommentSignature = plainTextContent.replace(commentSignature, '');
197
+ const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
183
198
  const onPostComment = () => __awaiter(this, void 0, void 0, function* () {
199
+ var _a, _b;
184
200
  if (canEditCase.alert())
185
201
  return;
186
- if (commentText) {
187
- try {
188
- setIsProcessing(true);
189
- const newCommentText = commentText.replace(/(^|\n)(-\s.+)(\n(?![-\s]))/g, '$1$2\n\n');
190
- yield request({ caseNumber, commentBody: newCommentText, isPublic, contentType: commentType });
191
- checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
192
- !isPublic && setIsPublic(true);
193
- addUserToNotifyList();
194
- // update state
195
- yield props.onCommentAdded();
196
- resetCommentSection();
197
- ToastNotification.addSuccessMessage(t('Comment submitted'));
198
- setCssCommentAgreed(false);
199
- }
200
- catch (e) {
201
- caseUpdateError.showError(e, t('Could not submit comment'));
202
- }
203
- finally {
204
- setIsProcessing(false);
205
- }
202
+ if (!commentText)
203
+ return;
204
+ if (!caseSalesforceId)
205
+ return;
206
+ let body = commentText;
207
+ if (props.replyingToAuthor) {
208
+ const formattedTimestamp = props.replyingToTimestamp ? formatDateTime(props.replyingToTimestamp) : '';
209
+ const replyPrefix = formattedTimestamp
210
+ ? t('(replying to {{commentCreator}}, {{timestamp}}) \n', {
211
+ commentCreator: props.replyingToAuthor,
212
+ timestamp: formattedTimestamp,
213
+ })
214
+ : t('(replying to {{commentCreator}}) \n', {
215
+ commentCreator: props.replyingToAuthor,
216
+ });
217
+ body = `<p>${replyPrefix}</p>${body}`;
218
+ }
219
+ try {
220
+ setIsProcessing(true);
221
+ yield createComment({
222
+ caseId: caseSalesforceId,
223
+ body,
224
+ isPublic,
225
+ isAssociate: loggedInUserRights.data.isInternal(),
226
+ });
227
+ yield checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status, {
228
+ apolloClient,
229
+ caseNumber,
230
+ existingCaseDetails,
231
+ });
232
+ if (!isPublic)
233
+ setIsPublic(true);
234
+ // TODO: Re-enable after GraphQL migration (REST notification)
235
+ // addUserToNotifyList();
236
+ yield ((_a = props.onCommentAdded) === null || _a === void 0 ? void 0 : _a.call(props));
237
+ resetCommentSection();
238
+ (_b = props.onClearReply) === null || _b === void 0 ? void 0 : _b.call(props);
239
+ ToastNotification.addSuccessMessage(t('Comment submitted'));
240
+ setCssCommentAgreed(false);
241
+ }
242
+ catch (_c) {
243
+ ToastNotification.addDangerMessage(t('Could not submit comment. Please refresh the page and try again.'));
244
+ }
245
+ finally {
246
+ setIsProcessing(false);
206
247
  }
207
248
  });
208
249
  const handleCheckboxToggle = () => {
209
250
  setIsPublic((publicComment) => !publicComment);
210
251
  };
211
252
  function isCommentSignatureMatch() {
212
- return commentText.trim() === commentSignature;
253
+ var _a, _b, _c, _d;
254
+ const plainText = (_d = (_c = (_b = (_a = quillEditorRef.current) === null || _a === void 0 ? void 0 : _a.getText) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : commentText.trim();
255
+ return plainText === commentSignature;
213
256
  }
214
257
  const isPostCommentDisabled = isProcessing || !commentText || isCommentSignatureMatch();
215
- const isFileUploadDisabled = isConfirmedStateSideSupport && !cssCommentAgreed;
258
+ const isFileUploadDisabled = (isConfirmedStateSideSupport && !cssCommentAgreed) || isCaseReadOnly;
216
259
  const onFileUploadClick = () => {
217
260
  ToastNotification.addInfoMessage(t('Uploading Attachment(s)'));
218
261
  };
219
- const getReplyText = (replyText, commentCreator) => {
220
- const person = t(`(replying to {{commentCreator}}) \n`, { commentCreator });
221
- const reply = replyText
222
- .substring(0, 1000)
223
- .split(/\n/)
224
- .reduce((acc, line) => (acc += '> ' + line + '\n'), person);
225
- return reply;
226
- };
227
- const addCommentSignature = (preSigComment) => {
228
- if (!isEmpty(commentSignature)) {
229
- let signedComment = '';
230
- // Checks if somment signature already exists and depending on that check, adds the signature
231
- if (preSigComment.includes(commentSignature)) {
232
- signedComment = preSigComment;
233
- }
234
- else {
235
- signedComment = preSigComment + '\n' + commentSignature;
236
- }
237
- setCommentText(signedComment);
238
- }
239
- };
240
- useEffect(() => {
241
- if (!props.commentText || !props.commentCreator) {
242
- return;
243
- }
244
- const reply = getReplyText(props.commentText, props.commentCreator);
245
- if (reply.includes(commentSignature)) {
246
- setCommentText(reply);
247
- }
248
- else {
249
- addCommentSignature(reply);
250
- }
251
- // eslint-disable-next-line react-hooks/exhaustive-deps
252
- }, [props.commentText, props.commentCreator]);
253
- useEffect(() => {
254
- if (isUploadingAttachmentPrevious.current && !isUploadingAttachments && !hasSomeUnUploadedFiles) {
255
- ToastNotification.addSuccessMessage(t('Attachment(s) uploaded successfully'));
256
- checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
257
- // update state
258
- resetAttachmentSection();
259
- props.onAttachmentAdded();
260
- setCssCommentAgreed(false);
261
- }
262
- isUploadingAttachmentPrevious.current = isUploadingAttachments;
263
- // eslint-disable-next-line react-hooks/exhaustive-deps
264
- }, [isUploadingAttachments]);
265
- useEffect(() => {
266
- function getDraftComments() {
267
- return __awaiter(this, void 0, void 0, function* () {
268
- const { value: draftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername())) || {};
269
- if (draftComments[caseNumber]) {
270
- const { text, privateFlag, type } = draftComments[caseNumber];
271
- if (text.trim()) {
272
- addCommentSignature(text);
273
- privateFlag === true && setIsPublic(false);
274
- setCommentType(type);
275
- }
276
- }
277
- });
278
- }
279
- getDraftComments();
280
- // eslint-disable-next-line react-hooks/exhaustive-deps
281
- }, [commentSignature]);
282
262
  const onTextAreaBlur = () => {
283
- !commentText && setIsTextAreaFocused(false);
263
+ if (!commentText)
264
+ setIsTextAreaFocused(false);
284
265
  };
285
266
  const onCommentExceedCharsLimit = (lengthExceededNew) => {
286
267
  if (isCommentTooLong !== lengthExceededNew)
287
268
  setIsCommentTooLong(lengthExceededNew);
288
269
  };
289
- const showCaseIsNotEditableAlert = () => {
290
- if (canEditCase.alert())
291
- return;
292
- };
293
- const fileUploadButton = (React.createElement(React.Fragment, null, canEditCase.isCaseNotEditable ? (React.createElement(Button, { variant: ButtonVariant.secondary, onClick: showCaseIsNotEditableAlert, isDisabled: isFileUploadDisabled }, t(isPublic || !canPostPrivateComments ? 'Attach files' : 'Attach private files'))) : (React.createElement(FileSelectorButton, { buttonLabel: t(isPublic || !canPostPrivateComments ? 'Attach files' : 'Attach private files'), isSessionId: false, isPrivate: !isPublic, "data-tracking-id": "case-discussion-file-selector-button", isDisabled: isFileUploadDisabled }))));
294
- const markdownToolbarFileSelectorBtn = (React.createElement(Button, { type: "button", onClick: open, "data-tracking-id": "inline-image-attach-file", isDisabled: isUploadingFile, variant: ButtonVariant.link, icon: React.createElement(PlusIcon, null) }, t(isPublic ? 'Attach files' : 'Attach private files')));
295
- // This is where we get all attachments to show in dropdown
296
- const getAllAttachments = () => {
297
- return (props.allDiscussions || [])
298
- .filter((item) => item.discussionType === DiscussionType.ATTACHMENT)
299
- .map((elem) => elem.item);
300
- };
301
- const onClipboardPaste = (files) => {
302
- onFileAttach(files, isPublicRef.current);
303
- };
304
- const onCancel = () => {
305
- setIsModalOpen(false);
306
- };
307
- const isNotInternalConfirm = () => {
308
- onPostComment();
309
- };
310
- const onConfirm = (commentText) => {
311
- setIsModalOpen(false);
312
- isNotInternalConfirm();
313
- };
314
- const onBtnClick = () => {
315
- setIsModalOpen(true);
316
- };
317
- // To check is commment is empty
318
- const checkCommentSignature = commentText.replace(commentSignature, '');
319
- const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
320
- // To check is comment reply is empty and disable if it is
321
- const isReplyDisabled = () => {
322
- let parsedPassedReply = getReplyText(passedReply, props.commentCreator);
323
- return (parsedPassedReply === null || parsedPassedReply === void 0 ? void 0 : parsedPassedReply.trim()) === (commentText === null || commentText === void 0 ? void 0 : commentText.trim());
324
- };
325
- const isSubmitDisabled = isReplyDisabled() ||
326
- isCommentEmpty ||
327
- isPostCommentDisabled ||
328
- (isConfirmedStateSideSupport && !cssCommentAgreed);
270
+ // Submit stays independent of attachment upload so comments can be posted mid-upload (PCM-15915).
271
+ const isSubmitDisabled = isCommentEmpty || isPostCommentDisabled || (isConfirmedStateSideSupport && !cssCommentAgreed) || isCaseReadOnly;
329
272
  return (React.createElement("div", { className: `pf-v6-u-mb-md ${isExportingPDF ? 'hide-in-pdf' : ''}`, ref: componentRef },
330
- React.createElement(MarkdownEditor, { className: `${!isPublic && canPostPrivateComments ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", showMarkdownPlainTextToggle: true, editorMode: commentType, onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, rows: isTextAreaFocused ? 12 : 4, bindTextArea: textAreaRef, onCommentExceedCharsLimit: onCommentExceedCharsLimit, mdPlaceholder: isPublic || !canPostPrivateComments
331
- ? 'Add a comment using markdown'
332
- : 'Add a comment or attach a file privately', plainTextPlaceholder: isPublic || !canPostPrivateComments
333
- ? 'Add a comment to this case'
334
- : 'Add a comment or attach a file privately', fileSelectorProps: {
335
- showFileSelectorInToolbar: !loggedInUsersAccount.data.secureSupport,
336
- filesList: getAllAttachments(),
337
- onFileDelete: onFileDelete,
338
- isSupportedFile: (extension) => true,
339
- attachFileBtn: markdownToolbarFileSelectorBtn,
340
- isUploadingFile: isMarkdownFileUploadInProgress,
341
- onClipboardPaste,
273
+ props.replyingToAuthor && (React.createElement("div", { className: "post-comment-reply-banner pf-v6-u-mb-sm", "data-tracking-id": "reply-banner" },
274
+ React.createElement("span", null,
275
+ React.createElement(Trans, null, "Replying to"),
276
+ " ",
277
+ React.createElement("strong", null, props.replyingToAuthor),
278
+ props.replyingToTimestamp && (React.createElement("span", { className: "pf-v6-u-ml-xs pf-v6-u-color-200" },
279
+ "(",
280
+ formatDateTime(props.replyingToTimestamp),
281
+ ")"))),
282
+ React.createElement(Button, { variant: ButtonVariant.plain, "aria-label": t('Cancel reply'), onClick: props.onClearReply, "data-tracking-id": "cancel-reply-button" },
283
+ React.createElement(TimesIcon, null)))),
284
+ React.createElement(RichTextEditor, { key: `${caseNumber}-${isCaseReadOnly}`, className: `${!isPublic && canPostPrivateComments ? 'is-private' : ''}`, disabled: isProcessing || isCaseReadOnly, hideToolbar: isCaseReadOnly, "aria-label": "comment text area", onFocus: () => {
285
+ if (isCaseReadOnly)
286
+ return;
287
+ setIsTextAreaFocused(true);
288
+ }, onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, height: isTextAreaFocused ? 313 : 120, onCharLimitExceeded: onCommentExceedCharsLimit, placeholder: !isPublic && canPostPrivateComments
289
+ ? 'Add a comment or attach a file privately'
290
+ : 'Add a comment to this case', charLimit: 32000, onImageUpload: onImageUpload, bindEditor: (editor) => {
291
+ quillEditorRef.current = editor;
342
292
  } }),
343
293
  isConfirmedStateSideSupport && (React.createElement("div", { className: "pf-v6-u-mt-md pf-v6-u-mb-lg" },
344
- React.createElement("input", { type: "checkbox", id: "css-case-comment-agreement", name: "css-case-comment-agreement", "data-tracking-id": "css-case-comment-agreement", checked: cssCommentAgreed, onChange: (e) => setCssCommentAgreed(e.target.checked) }),
294
+ React.createElement("input", { type: "checkbox", id: "css-case-comment-agreement", name: "css-case-comment-agreement", "data-tracking-id": "css-case-comment-agreement", checked: cssCommentAgreed, disabled: isCaseReadOnly, onChange: (e) => setCssCommentAgreed(e.target.checked) }),
345
295
  React.createElement("label", { htmlFor: "css-case-comment-agreement", className: "pf-v6-u-font-weight-normal pf-v6-u-font-size-sm" },
346
296
  React.createElement(Trans, null, "I will not transmit controlled unclassified information to or export it from the Red Hat Customer Portal."),
347
297
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")))),
@@ -349,15 +299,15 @@ export function PostComment(props) {
349
299
  isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
350
300
  React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isSubmitDisabled, className: "postcomment-submit" },
351
301
  React.createElement(Trans, null, "Submit")),
352
- canAddAttachments &&
353
- (isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
354
- React.createElement(Button, { className: "secondary-button-pill", "data-tracking-id": "postcomment-cancel-button", type: "button", variant: ButtonVariant.link, onClick: onCancelClick, isDisabled: isPostCommentDisabled },
302
+ React.createElement(FileSelectorButton, { isSessionId: false, isDisabled: isFileUploadDisabled, buttonLabel: React.createElement(React.Fragment, null,
303
+ React.createElement(PlusIcon, null),
304
+ " ",
305
+ React.createElement(Trans, null, "Attach files")) }),
306
+ React.createElement(Button, { className: "secondary-button-pill", "data-tracking-id": "postcomment-cancel-button", type: "button", variant: ButtonVariant.link, onClick: onCancelClick, isDisabled: isCommentEmpty || isProcessing || isCaseReadOnly },
355
307
  React.createElement(Trans, null, "Cancel")),
356
308
  canPostPrivateComments && (React.createElement("span", { className: "post-comment-checkbox" },
357
- React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic && canPostPrivateComments, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
358
- React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-v6-u-mt-lg pf-v6-u-p-lg' : ''}`, idToUploadTo: caseNumber, onUploadClick: onFileUploadClick, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport, isPrivate: !isPublic, autoUploadOnSelect: true, showDescriptionInfoMsg: true }),
359
- React.createElement("span", Object.assign({}, getRootProps(), { tabIndex: -1 }),
360
- React.createElement("input", Object.assign({ style: { display: 'none !important' } }, getInputProps()))),
361
- !loggedInUsersAccount.data.secureSupport && (React.createElement(NewFeaturePopoverAnnouncement, { "aria-label": "Attach and embed images! You'll find all of your uploaded images here.", featureName: FeatureAnnouncementKeys.MARKDOWN_INLINE_IMAGES, sectionRef: componentRef, bodyContent: React.createElement("div", null,
362
- React.createElement(Trans, null, "Attach and embed images! You'll find all of your uploaded images here.")), triggerRef: () => document.getElementById('md-editor-toolbar-file-selector') }))));
309
+ React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic && canPostPrivateComments, isDisabled: isCaseReadOnly, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
310
+ React.createElement("div", Object.assign({}, getRootProps(), { className: "post-comment-dropzone" }),
311
+ React.createElement("input", Object.assign({}, getInputProps())),
312
+ React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-v6-u-mt-lg pf-v6-u-p-lg' : ''}`, idToUploadTo: caseNumber, caseSalesforceId: caseSalesforceId, onUploadClick: onFileUploadClick, onCaseFileUploaded: onCaseFileUploaded, isSessionId: false, needsAnalyzing: false, autoUploadOnSelect: loggedInUsersAccount.data.secureSupport ? false : true, isPrivate: !isPublic, showDescriptionInfoMsg: true }))));
363
313
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA6IlD"}
1
+ {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAiJlD"}
@@ -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 { useApolloClient } from '@apollo/client/react';
10
11
  import { Button, ButtonVariant, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, } from '@patternfly/react-core';
11
12
  import { SingleSelectDropdown, ToastNotification } from '@rh-support/components';
12
13
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
@@ -43,11 +44,12 @@ export function VerifyCaseStatusModal(props) {
43
44
  selectedAccountDetails: state.selectedAccountDetails,
44
45
  }), isEqual);
45
46
  const { status } = caseState.caseDetails;
46
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
47
+ const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
48
+ const apolloClient = useApolloClient();
47
49
  const canManageCase = loggedInUserRights.data.canManageCases();
48
50
  useEffect(() => {
49
- fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
50
- }, [caseOverviewDispatch, loggedInUsersAccount.data.secureSupport]);
51
+ fetchAllStatuses(caseOverviewDispatch, apolloClient);
52
+ }, [caseOverviewDispatch, apolloClient]);
51
53
  const { isCaseUpdating } = caseState;
52
54
  const canEditCase = useCanEditCase();
53
55
  const caseDispatch = useCaseDispatch();
@@ -69,7 +71,7 @@ export function VerifyCaseStatusModal(props) {
69
71
  }
70
72
  catch (e) {
71
73
  setStatusUpdating(caseOverviewDispatch, false);
72
- caseUpdateError.showError(e, t('Status failed to update'));
74
+ caseUpdateError.showError(e, t('Status failed to update, try refreshing the page. Please contact us if the problem persists.'));
73
75
  }
74
76
  }
75
77
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHistory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/CaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,MAAM,sBAMjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"CaseHistory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/CaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,MAAM,sBAQjC,CAAC;AAEF,eAAe,WAAW,CAAC"}