@rh-support/troubleshoot 2.6.355 → 2.6.358

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 (349) 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 +79 -47
  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 +63 -17
  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 +130 -55
  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 +106 -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 +33 -24
  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 +141 -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 +20 -3
  134. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  135. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  136. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +0 -1
  137. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  138. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +19 -32
  139. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  140. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
  141. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  142. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +8 -4
  143. package/lib/esm/components/EditDescription/EditDescription.js +1 -1
  144. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  145. package/lib/esm/components/IdeaInformation/IdeaInformation.js +23 -17
  146. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  147. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  148. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  149. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  150. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  151. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  152. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  153. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  154. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +37 -50
  155. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +3 -0
  156. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +1 -0
  157. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +9 -0
  158. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  159. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  160. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  161. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +9 -1
  162. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  163. package/lib/esm/components/Recommendations/AsideResults.js +4 -3
  164. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  165. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
  166. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  167. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  168. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  169. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  170. package/lib/esm/components/Recommendations/Recommendations.js +3 -9
  171. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  172. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +10 -8
  173. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  174. package/lib/esm/components/Review/Review.js +25 -19
  175. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  176. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  177. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  178. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  179. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  180. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  181. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +139 -91
  182. package/lib/esm/components/shared/Constants.d.ts +5 -0
  183. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  184. package/lib/esm/components/shared/Constants.js +5 -0
  185. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  186. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  187. package/lib/esm/components/shared/fileUpload/FileUpload.js +2 -3
  188. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  189. package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
  190. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +1 -0
  191. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  192. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +4 -3
  193. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  194. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  195. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +22 -5
  196. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  197. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +307 -59
  198. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +5 -1
  199. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  200. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +36 -1
  201. package/lib/esm/components/shared/fileUpload/types/index.d.ts +5 -1
  202. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  203. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  204. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  205. package/lib/esm/components/shared/fileUpload/useFileUploader.js +119 -47
  206. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  207. package/lib/esm/components/shared/useIsSectionValid.js +22 -57
  208. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  209. package/lib/esm/components/shared/usePostComment.js +16 -28
  210. package/lib/esm/components/shared/utils.d.ts +1 -0
  211. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  212. package/lib/esm/components/shared/utils.js +9 -3
  213. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  214. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +178 -38
  215. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  216. package/lib/esm/components/wizardLayout/MainSection.js +2 -1
  217. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  218. package/lib/esm/components/wizardLayout/WizardAside.js +2 -4
  219. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  220. package/lib/esm/components/wizardLayout/WizardLayout.js +12 -13
  221. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  222. package/lib/esm/components/wizardLayout/WizardMain.js +7 -0
  223. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  224. package/lib/esm/components/wizardLayout/WizardNavigation.js +14 -11
  225. package/lib/esm/constants/caseDetailsConstants.d.ts +5 -0
  226. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  227. package/lib/esm/constants/caseDetailsConstants.js +5 -0
  228. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  229. package/lib/esm/css/app.css +28 -0
  230. package/lib/esm/css/case.css +60 -209
  231. package/lib/esm/graphql/index.d.ts +4 -0
  232. package/lib/esm/graphql/index.d.ts.map +1 -0
  233. package/lib/esm/graphql/index.js +3 -0
  234. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  235. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  236. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  237. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  238. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  239. package/lib/esm/graphql/mutations/index.js +1 -0
  240. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  241. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  242. package/lib/esm/graphql/queries/getEscalationDetails.js +31 -0
  243. package/lib/esm/graphql/queries/index.d.ts +2 -0
  244. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  245. package/lib/esm/graphql/queries/index.js +1 -0
  246. package/lib/esm/graphql/schemas/escalation.d.ts +66 -0
  247. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  248. package/lib/esm/graphql/schemas/escalation.js +1 -0
  249. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  250. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  251. package/lib/esm/graphql/schemas/index.js +1 -0
  252. package/lib/esm/hooks/useAB.d.ts.map +1 -1
  253. package/lib/esm/hooks/useAB.js +45 -23
  254. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
  255. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
  256. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +52 -0
  257. package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
  258. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
  259. package/lib/esm/hooks/useCaseComments/index.js +5 -0
  260. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
  261. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
  262. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +75 -0
  263. package/lib/esm/hooks/useCaseComments/types.d.ts +85 -0
  264. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
  265. package/lib/esm/hooks/useCaseComments/types.js +1 -0
  266. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +17 -0
  267. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
  268. package/lib/esm/hooks/useCaseComments/useCaseComments.js +38 -0
  269. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
  270. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
  271. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
  272. package/lib/esm/hooks/useCaseGroupUiState.d.ts +3 -0
  273. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +1 -0
  274. package/lib/esm/hooks/useCaseGroupUiState.js +10 -0
  275. package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
  276. package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
  277. package/lib/esm/hooks/useCaseHistory.js +98 -0
  278. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +23 -0
  279. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
  280. package/lib/esm/hooks/useCaseLabelLinkMutations.js +84 -0
  281. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  282. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  283. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +21 -11
  284. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  285. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  286. package/lib/esm/hooks/useS3Upload.d.ts +5 -4
  287. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  288. package/lib/esm/hooks/useS3Upload.js +28 -30
  289. package/lib/esm/i18n/template-de.d.ts +2 -2
  290. package/lib/esm/i18n/template-de.js +2 -2
  291. package/lib/esm/i18n/template-es.d.ts +2 -2
  292. package/lib/esm/i18n/template-es.js +2 -2
  293. package/lib/esm/i18n/template-fr.d.ts +2 -2
  294. package/lib/esm/i18n/template-fr.js +2 -2
  295. package/lib/esm/i18n/template-it.d.ts +2 -2
  296. package/lib/esm/i18n/template-it.js +2 -2
  297. package/lib/esm/i18n/template-jp.d.ts +2 -2
  298. package/lib/esm/i18n/template-jp.js +2 -2
  299. package/lib/esm/i18n/template-ko.d.ts +2 -2
  300. package/lib/esm/i18n/template-ko.js +2 -2
  301. package/lib/esm/i18n/template-pt.d.ts +2 -2
  302. package/lib/esm/i18n/template-pt.js +2 -2
  303. package/lib/esm/i18n/template-ru.d.ts +2 -2
  304. package/lib/esm/i18n/template-ru.js +2 -2
  305. package/lib/esm/i18n/template-zh.d.ts +2 -2
  306. package/lib/esm/i18n/template-zh.js +2 -2
  307. package/lib/esm/index.js +1 -0
  308. package/lib/esm/models/cache.d.ts +0 -2
  309. package/lib/esm/models/cache.d.ts.map +1 -1
  310. package/lib/esm/models/caseHistory.d.ts +80 -0
  311. package/lib/esm/models/caseHistory.d.ts.map +1 -0
  312. package/lib/esm/models/caseHistory.js +1 -0
  313. package/lib/esm/reducers/CaseConstNTypes.d.ts +123 -9
  314. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  315. package/lib/esm/reducers/CaseConstNTypes.js +31 -7
  316. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +7 -5
  317. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  318. package/lib/esm/reducers/CaseDetailsPageReducer.js +58 -26
  319. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +11 -12
  320. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  321. package/lib/esm/reducers/CaseDiscussionTabReducer.js +63 -70
  322. package/lib/esm/reducers/CaseHelpers.d.ts +11 -1
  323. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  324. package/lib/esm/reducers/CaseHelpers.js +119 -17
  325. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  326. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  327. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  328. package/lib/esm/reducers/CaseReducer.d.ts +56 -11
  329. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  330. package/lib/esm/reducers/CaseReducer.js +284 -100
  331. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  332. package/lib/esm/reducers/RecommendationsReducer.js +15 -18
  333. package/lib/esm/scss/_main.scss +9 -0
  334. package/lib/esm/utils/TimelineUtils.d.ts +41 -0
  335. package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
  336. package/lib/esm/utils/TimelineUtils.js +135 -0
  337. package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
  338. package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
  339. package/lib/esm/utils/caseHistoryUtils.js +165 -0
  340. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
  341. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  342. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  343. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +6 -0
  344. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +1 -0
  345. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +26 -0
  346. package/package.json +9 -8
  347. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +0 -25
  348. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +0 -1
  349. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +0 -88
@@ -0,0 +1,84 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useApolloClient, useMutation } from '@apollo/client/react';
11
+ import { CREATE_CASE_LABEL_LINK, DELETE_CASE_LABEL_LINK, fetchAllAccountCaseLabels, fetchAllCaseLabelLinksForCase, } from '@rh-support/utils';
12
+ import unescape from 'lodash/unescape';
13
+ import { useCallback, useEffect, useState } from 'react';
14
+ const mapCaseLabelNode = (node) => {
15
+ var _a, _b;
16
+ return ({
17
+ id: node.Id,
18
+ name: unescape((_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ''),
19
+ });
20
+ };
21
+ export function useCaseLabelLinks(salesforceAccountId, caseId) {
22
+ const client = useApolloClient();
23
+ const [availableLabels, setAvailableLabels] = useState([]);
24
+ const [assignedLinks, setAssignedLinks] = useState([]);
25
+ const [loading, setLoading] = useState(false);
26
+ const [error, setError] = useState(undefined);
27
+ const fetchData = useCallback(() => __awaiter(this, void 0, void 0, function* () {
28
+ if (!salesforceAccountId || !caseId)
29
+ return;
30
+ setLoading(true);
31
+ setError(undefined);
32
+ try {
33
+ const [labelNodes, linkNodes] = yield Promise.all([
34
+ fetchAllAccountCaseLabels(client, salesforceAccountId),
35
+ fetchAllCaseLabelLinksForCase(client, caseId),
36
+ ]);
37
+ setAvailableLabels(labelNodes.map(mapCaseLabelNode).filter((l) => l.id && l.name));
38
+ setAssignedLinks(linkNodes
39
+ .filter((node) => { var _a; return node.Id && ((_a = node.Label__c) === null || _a === void 0 ? void 0 : _a.value); })
40
+ .map((node) => ({
41
+ linkId: node.Id,
42
+ labelId: node.Label__c.value,
43
+ })));
44
+ }
45
+ catch (e) {
46
+ setError(e);
47
+ setAvailableLabels([]);
48
+ setAssignedLinks([]);
49
+ }
50
+ finally {
51
+ setLoading(false);
52
+ }
53
+ }), [client, salesforceAccountId, caseId]);
54
+ useEffect(() => {
55
+ fetchData();
56
+ }, [fetchData]);
57
+ const [createMutate, { loading: createLoading }] = useMutation(CREATE_CASE_LABEL_LINK);
58
+ const createLink = useCallback((caseSfId, labelId) => __awaiter(this, void 0, void 0, function* () {
59
+ var _a, _b, _c, _d;
60
+ const result = yield createMutate({
61
+ variables: {
62
+ input: { RedHatSupportCaseLabelLink__c: { Case__c: caseSfId, Label__c: labelId } },
63
+ },
64
+ });
65
+ return (_d = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.CaseLabelLink__cCreate) === null || _c === void 0 ? void 0 : _c.RedHatSupportRecord) === null || _d === void 0 ? void 0 : _d.Id;
66
+ }), [createMutate]);
67
+ const [deleteMutate, { loading: deleteLoading }] = useMutation(DELETE_CASE_LABEL_LINK);
68
+ const deleteLink = useCallback((linkId) => __awaiter(this, void 0, void 0, function* () {
69
+ yield deleteMutate({ variables: { id: linkId } });
70
+ }), [deleteMutate]);
71
+ const selectedLabelIds = assignedLinks.map((link) => link.labelId);
72
+ return {
73
+ availableLabels,
74
+ assignedLinks,
75
+ selectedLabelIds,
76
+ loading,
77
+ error,
78
+ mutating: createLoading || deleteLoading,
79
+ setAssignedLinks,
80
+ createLink,
81
+ deleteLink,
82
+ refetch: fetchData,
83
+ };
84
+ }
@@ -1,4 +1,4 @@
1
1
  export declare function useCaseUpdateErrorMessage(): {
2
- showError: (e: any, message500: any) => void;
2
+ showError: (e: any, fallbackMessage: string) => void;
3
3
  };
4
4
  //# sourceMappingURL=useCaseUpdateErrorMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCaseUpdateErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseUpdateErrorMessage.ts"],"names":[],"mappings":"AAIA,wBAAgB,yBAAyB;;EAaxC"}
1
+ {"version":3,"file":"useCaseUpdateErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseUpdateErrorMessage.ts"],"names":[],"mappings":"AAGA,wBAAgB,yBAAyB;yCAEE,MAAM;EAyBhD"}
@@ -1,17 +1,27 @@
1
- import { formattedApiErrorMessage, ToastNotification } from '@rh-support/components';
1
+ import { formattedApiErrorMessage, getDirectErrorMessage, ToastNotification } from '@rh-support/components';
2
2
  import { useTranslation } from 'react-i18next';
3
- // TO DO
4
3
  export function useCaseUpdateErrorMessage() {
5
4
  const { t } = useTranslation();
6
- const showError = (e, message500) => {
7
- const errorMessage = formattedApiErrorMessage(e, {
8
- '500': { title: t('There was a problem with your request'), message: message500 },
9
- '403': {
10
- title: t('There was a problem with your request'),
11
- message: t('You are not authorized to update this case.'),
12
- },
13
- });
14
- ToastNotification.addDangerMessage(errorMessage);
5
+ const showError = (e, fallbackMessage) => {
6
+ const errorCode = Number.parseInt((e === null || e === void 0 ? void 0 : e.code) || (e === null || e === void 0 ? void 0 : e.status)) || 0;
7
+ const hasSpecificHandler = errorCode === 500 || errorCode === 403;
8
+ if (hasSpecificHandler) {
9
+ const errorMessage = formattedApiErrorMessage(e, {
10
+ '500': { title: t('There was a problem with your request'), message: t(fallbackMessage) },
11
+ '403': {
12
+ title: t('There was a problem with your request'),
13
+ message: t('You are not authorized to update this case.'),
14
+ },
15
+ });
16
+ ToastNotification.addDangerMessage(errorMessage);
17
+ return;
18
+ }
19
+ const directMessage = getDirectErrorMessage(e);
20
+ if (directMessage) {
21
+ ToastNotification.addDangerMessage(directMessage);
22
+ return;
23
+ }
24
+ ToastNotification.addDangerMessage(fallbackMessage);
15
25
  };
16
26
  return { showError };
17
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB;;EA2CjC"}
1
+ {"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"AAcA,wBAAgB,kBAAkB;;EAsCjC"}
@@ -1,4 +1,3 @@
1
- import { fetchLoggedInUser, fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
2
1
  import { useContext } from 'react';
3
2
  import { AttachmentDispatchContext, resetAttachment } from '../components/shared/fileUpload';
4
3
  import { useCaseDispatch } from '../context/CaseContext';
@@ -7,7 +6,6 @@ import { useRecommendationDispatchContext } from '../context/RecommendationConte
7
6
  import { RulesDispatchContext } from '../context/RulesContext';
8
7
  import { TCDispatchContext } from '../context/TopContentContext';
9
8
  import { CaseReducerConstants } from '../reducers/CaseConstNTypes';
10
- import { setCaseAccountNumber, setCaseOwner } from '../reducers/CaseReducer';
11
9
  import { resetClusterRecommendations } from '../reducers/ClusterRecommendationsReducer';
12
10
  import { resetRecommendations } from '../reducers/RecommendationsReducer';
13
11
  import { resetEARules } from '../reducers/RulesReducer';
@@ -17,22 +15,31 @@ export function useResetCaseCreate() {
17
15
  const tcDispatch = useContext(TCDispatchContext);
18
16
  const recommendationsDispatch = useRecommendationDispatchContext();
19
17
  const caseDispatch = useCaseDispatch();
20
- const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
21
18
  const rulesDispatch = useContext(RulesDispatchContext);
22
19
  const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
23
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
24
20
  const resetCaseCreateState = () => {
25
- // On case creation we refetch the user contact details to get users updated phone number
26
- fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, {});
21
+ // Commented out don't refetch logged-in user contact details on case creation
22
+ // fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, {});
27
23
  resetAttachment(dispatchToAttachmentReducer);
28
24
  resetTopContent(tcDispatch);
29
25
  resetRecommendations(recommendationsDispatch);
30
26
  caseDispatch({ type: CaseReducerConstants.resetCaseState });
31
- // on case creation we refetch the account details to check if user still has all valid
32
- // access for next case creation. For ex. may be user has exhausted his available enhanced sla limit
33
- fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true);
34
- setCaseAccountNumber(caseDispatch, loggedInUserRights.data.getAccountNumber(), true, loggedInUsersAccount.data);
35
- setCaseOwner(caseDispatch, loggedInUserRights.data.getHydraContactFromLoggedInUser(), '', undefined, undefined, true, undefined, true, undefined, undefined, loggedInUserRights.data.isInternal() ? loggedInUserRights.data.getAccountNumber() : undefined);
27
+ // Commented out don't refetch account details or auto-populate account/owner on case creation
28
+ // fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
29
+ // setCaseAccountNumber(caseDispatch, loggedInUserRights.data.getAccountNumber(), true, loggedInUsersAccount.data);
30
+ // setCaseOwner(
31
+ // caseDispatch,
32
+ // loggedInUserRights.data.getHydraContactFromLoggedInUser(),
33
+ // '',
34
+ // undefined,
35
+ // undefined,
36
+ // true,
37
+ // undefined,
38
+ // true,
39
+ // undefined,
40
+ // undefined,
41
+ // loggedInUserRights.data.isInternal() ? loggedInUserRights.data.getAccountNumber() : undefined
42
+ // );
36
43
  resetEARules(rulesDispatch);
37
44
  resetClusterRecommendations(clusterRecommendationsDispatch);
38
45
  };
@@ -1,9 +1,10 @@
1
- export declare function useS3Upload(idToUploadTo: any, isSecureSupport: any): {
2
- uploadFile: ({ file, description, isPrivate, listenerFn }: {
3
- file: any;
1
+ import { ApolloQueryClient } from '@rh-support/utils';
2
+ export declare function useS3Upload(caseNumber: string, apolloClient?: ApolloQueryClient, caseSalesforceId?: string): {
3
+ uploadFile: ({ file, description, isPrivate, listenerFn, }: {
4
+ file: File;
4
5
  description?: string;
5
6
  isPrivate?: boolean;
6
- listenerFn?: (percent: any, abort: any) => void;
7
+ listenerFn?: (percent: number, abort: () => void) => void;
7
8
  }) => Promise<string>;
8
9
  isUploadingFile: boolean;
9
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useS3Upload.d.ts","sourceRoot":"","sources":["../../../src/hooks/useS3Upload.ts"],"names":[],"mappings":"AASA,wBAAgB,WAAW,CAAC,YAAY,KAAA,EAAE,eAAe,KAAA;;;;;;;;EA0ExD"}
1
+ {"version":3,"file":"useS3Upload.d.ts","sourceRoot":"","sources":["../../../src/hooks/useS3Upload.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,iBAAiB,EAIpB,MAAM,mBAAmB,CAAC;AAU3B,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,EAAE,MAAM;gEA0BpG;QACC,IAAI,EAAE,IAAI,CAAC;QACX,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;KAC7D;;EAgDJ"}
@@ -7,14 +7,15 @@ 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 { caseAttachments } from '@cee-eng/hydrajs';
11
- import { ToastNotification, useFetch } from '@rh-support/components';
10
+ import { ToastNotification } from '@rh-support/components';
11
+ import { useGlobalStateContext } from '@rh-support/react-context';
12
+ import { fetchCaseDetailsByCaseNumber, pollAttachmentUploadStatus, uploadCaseAttachment, } from '@rh-support/utils';
12
13
  import { useTranslation } from 'react-i18next';
13
- export function useS3Upload(idToUploadTo, isSecureSupport) {
14
- const { request, isFetching: isUploadingFile } = useFetch(caseAttachments.uploadAttachmentS3, {
15
- propgateErrors: true,
16
- });
14
+ // TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
15
+ // Previously: useS3Upload(idToUploadTo, isSecureSupport) and passed isSecureSupport into uploadAttachmentS3
16
+ export function useS3Upload(caseNumber, apolloClient, caseSalesforceId) {
17
17
  const { t } = useTranslation();
18
+ const { globalMetadataState: { loggedInUsersAccount }, } = useGlobalStateContext();
18
19
  const getFileAccessDetails = (file) => __awaiter(this, void 0, void 0, function* () {
19
20
  const fileName = (file === null || file === void 0 ? void 0 : file.name) || '';
20
21
  if (file.size === 0) {
@@ -23,12 +24,12 @@ export function useS3Upload(idToUploadTo, isSecureSupport) {
23
24
  const reader = new FileReader();
24
25
  return new Promise((resolve, reject) => {
25
26
  reader.onloadend = () => resolve({ ableToUpload: true, ableToUploadMessage: 'File attached, but not yet uploaded' });
26
- reader.onerror = (ev) => reject({ ableToUpload: false, ableToUploadMessage: `${fileName} ${t("Can't be selected")}` });
27
- // only read the first 10 bytes. readAsBinaryString is not supported in IE 11
27
+ reader.onerror = () => reject({ ableToUpload: false, ableToUploadMessage: `${fileName} ${t("Can't be selected")}` });
28
28
  reader.readAsArrayBuffer(file.slice(0, 10));
29
29
  });
30
30
  });
31
- const uploadFile = (_a) => __awaiter(this, [_a], void 0, function* ({ file, description = '', isPrivate = false, listenerFn = (percent, abort) => { } }) {
31
+ const uploadFile = (_a) => __awaiter(this, [_a], void 0, function* ({ file, description = '', isPrivate = false, listenerFn = (_percent, _abort) => { }, }) {
32
+ var _b;
32
33
  try {
33
34
  yield getFileAccessDetails(file);
34
35
  }
@@ -38,33 +39,30 @@ export function useS3Upload(idToUploadTo, isSecureSupport) {
38
39
  return;
39
40
  }
40
41
  }
41
- const listener = (progress, abort) => {
42
- const decimal = progress.loaded / progress.total;
43
- const percent = decimal * 100;
44
- // const verifyingUpdate = decimal === 1;
45
- const currentUploadProgress = Math.floor(percent);
46
- // Forwarding abort single to parent callback function
47
- listenerFn(currentUploadProgress, abort);
48
- };
49
- const putObjectRequest = {
50
- Body: file, // use the original file for upload
51
- ContentLength: file.size,
52
- Metadata: Object.assign(Object.assign(Object.assign(Object.assign({}, (description && { 'x-amz-meta-description': description })), (file.name && { 'x-amz-meta-fileName': file.name })), (file.size && { 'x-amz-meta-byteLength': file.size.toString() })), (file.type && { 'x-amz-meta-content-type': file.type })),
53
- };
54
42
  try {
55
- const attachmentId = yield request(idToUploadTo, {
56
- description: description,
57
- fileName: file.name,
58
- isPrivate: isPrivate,
59
- size: file.size,
60
- }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, isSecureSupport);
43
+ let abortFn;
44
+ const attachmentId = yield uploadCaseAttachment(caseNumber, file, (percent) => listenerFn(percent, () => abortFn === null || abortFn === void 0 ? void 0 : abortFn()), (abort) => {
45
+ abortFn = abort;
46
+ });
47
+ let resolvedCaseSalesforceId = caseSalesforceId;
48
+ if (apolloClient && !resolvedCaseSalesforceId) {
49
+ const caseDetails = yield fetchCaseDetailsByCaseNumber(apolloClient, caseNumber, Boolean((_b = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.secureSupport));
50
+ resolvedCaseSalesforceId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.id;
51
+ }
52
+ if (apolloClient && resolvedCaseSalesforceId) {
53
+ yield pollAttachmentUploadStatus(apolloClient, resolvedCaseSalesforceId, attachmentId);
54
+ }
61
55
  return attachmentId;
62
56
  }
63
57
  catch (error) {
64
58
  if (error.message === 'Request aborted by user') {
65
- // Show alert if needed
59
+ return;
66
60
  }
61
+ throw error;
67
62
  }
68
63
  });
69
- return { uploadFile, isUploadingFile };
64
+ return {
65
+ uploadFile,
66
+ isUploadingFile: false,
67
+ };
70
68
  }
@@ -137,7 +137,7 @@ declare const _default: {
137
137
  'Exporting CSV': string;
138
138
  'Could not export CSV': string;
139
139
  '4 (Low)': string;
140
- '3 (Normal)': string;
140
+ '3 (Medium)': string;
141
141
  '2 (High)': string;
142
142
  '1 (Urgent)': string;
143
143
  'Saved for later': string;
@@ -533,7 +533,7 @@ declare const _default: {
533
533
  STANDARD: string;
534
534
  PREMIUM: string;
535
535
  '4 (Low) - 2 business days': string;
536
- '3 (Normal) - 1 business day': string;
536
+ '3 (Medium) - 1 business day': string;
537
537
  '2 (High) - 4 business hours': string;
538
538
  '1 (Urgent) - 1 business hour': string;
539
539
  'Loading...': string;
@@ -137,7 +137,7 @@ export default {
137
137
  'Exporting CSV': 'CSV wird exportiert',
138
138
  'Could not export CSV': 'CSV nicht exportiert',
139
139
  '4 (Low)': '4 (Niedrig)',
140
- '3 (Normal)': '3 (Normal)',
140
+ '3 (Medium)': '3 (Medium)',
141
141
  '2 (High)': '2 (Hoch)',
142
142
  '1 (Urgent)': '1 (Dringend)',
143
143
  'Saved for later': 'Gespeichert für später',
@@ -533,7 +533,7 @@ export default {
533
533
  STANDARD: 'STANDARD',
534
534
  PREMIUM: 'PREMIUM',
535
535
  '4 (Low) - 2 business days': '4 (Niedrig) – 2 Werktage',
536
- '3 (Normal) - 1 business day': '3 (Normal) – 1 Werktag',
536
+ '3 (Medium) - 1 business day': '3 (Medium) – 1 Werktag',
537
537
  '2 (High) - 4 business hours': '2 (Hoch) – 4 Geschäftsstunden',
538
538
  '1 (Urgent) - 1 business hour': '1 (Dringend) – 1 Geschäftsstunde',
539
539
  'Loading...': 'Laden...',
@@ -138,7 +138,7 @@ declare const _default: {
138
138
  'Exporting CSV': string;
139
139
  'Could not export CSV': string;
140
140
  '4 (Low)': string;
141
- '3 (Normal)': string;
141
+ '3 (Medium)': string;
142
142
  '2 (High)': string;
143
143
  '1 (Urgent)': string;
144
144
  'Saved for later': string;
@@ -534,7 +534,7 @@ declare const _default: {
534
534
  STANDARD: string;
535
535
  PREMIUM: string;
536
536
  '4 (Low) - 2 business days': string;
537
- '3 (Normal) - 1 business day': string;
537
+ '3 (Medium) - 1 business day': string;
538
538
  '2 (High) - 4 business hours': string;
539
539
  '1 (Urgent) - 1 business hour': string;
540
540
  'Loading...': string;
@@ -138,7 +138,7 @@ export default {
138
138
  'Exporting CSV': 'Exportación de CSV',
139
139
  'Could not export CSV': 'No pudo exportar el CSV',
140
140
  '4 (Low)': '4 (bajo)',
141
- '3 (Normal)': '3 (Normal)',
141
+ '3 (Medium)': '3 (Medium)',
142
142
  '2 (High)': '2 (alto)',
143
143
  '1 (Urgent)': '1 (urgente)',
144
144
  'Saved for later': 'Guardado para más tarde',
@@ -534,7 +534,7 @@ export default {
534
534
  STANDARD: 'STANDARD',
535
535
  PREMIUM: 'PREMIUM',
536
536
  '4 (Low) - 2 business days': '4 (Bajo) - 2 días hábiles',
537
- '3 (Normal) - 1 business day': '3 (Normal) - 1 día hábil',
537
+ '3 (Medium) - 1 business day': '3 (Medium) - 1 día hábil',
538
538
  '2 (High) - 4 business hours': '2 (Alto) - 4 horas de trabajo',
539
539
  '1 (Urgent) - 1 business hour': '1 (Urgente) - 1 hora de trabajo',
540
540
  'Loading...': 'Cargando...',
@@ -138,7 +138,7 @@ declare const _default: {
138
138
  'Exporting CSV': string;
139
139
  'Could not export CSV': string;
140
140
  '4 (Low)': string;
141
- '3 (Normal)': string;
141
+ '3 (Medium)': string;
142
142
  '2 (High)': string;
143
143
  '1 (Urgent)': string;
144
144
  'Saved for later': string;
@@ -533,7 +533,7 @@ declare const _default: {
533
533
  STANDARD: string;
534
534
  PREMIUM: string;
535
535
  '4 (Low) - 2 business days': string;
536
- '3 (Normal) - 1 business day': string;
536
+ '3 (Medium) - 1 business day': string;
537
537
  '2 (High) - 4 business hours': string;
538
538
  '1 (Urgent) - 1 business hour': string;
539
539
  'Loading...': string;
@@ -138,7 +138,7 @@ export default {
138
138
  'Exporting CSV': 'Exportation de CSV',
139
139
  'Could not export CSV': 'N’a pas pu exporter CSV',
140
140
  '4 (Low)': '4 (faible)',
141
- '3 (Normal)': '3 (normal)',
141
+ '3 (Medium)': '3 (normal)',
142
142
  '2 (High)': '2 (élevé)',
143
143
  '1 (Urgent)': '1 (urgent)',
144
144
  'Saved for later': 'Sauvegardé pour plus tard',
@@ -534,7 +534,7 @@ export default {
534
534
  STANDARD: 'STANDARD',
535
535
  PREMIUM: 'PREMIUM',
536
536
  '4 (Low) - 2 business days': '4 (faible) - 2 jours ouvrables',
537
- '3 (Normal) - 1 business day': '3 (normal) - 1 jour ouvrable',
537
+ '3 (Medium) - 1 business day': '3 (normal) - 1 jour ouvrable',
538
538
  '2 (High) - 4 business hours': '2 (élevé) - 4 heures ouvrables',
539
539
  '1 (Urgent) - 1 business hour': '1 (Urgent) - 1 heure ouvrable',
540
540
  'Loading...': 'Chargement...',
@@ -138,7 +138,7 @@ declare const _default: {
138
138
  'Exporting CSV': string;
139
139
  'Could not export CSV': string;
140
140
  '4 (Low)': string;
141
- '3 (Normal)': string;
141
+ '3 (Medium)': string;
142
142
  '2 (High)': string;
143
143
  '1 (Urgent)': string;
144
144
  'Saved for later': string;
@@ -534,7 +534,7 @@ declare const _default: {
534
534
  STANDARD: string;
535
535
  PREMIUM: string;
536
536
  '4 (Low) - 2 business days': string;
537
- '3 (Normal) - 1 business day': string;
537
+ '3 (Medium) - 1 business day': string;
538
538
  '2 (High) - 4 business hours': string;
539
539
  '1 (Urgent) - 1 business hour': string;
540
540
  'Loading...': string;
@@ -138,7 +138,7 @@ export default {
138
138
  'Exporting CSV': 'Esportazione CSV',
139
139
  'Could not export CSV': 'Impossibile esportare CSV',
140
140
  '4 (Low)': '4 (basso)',
141
- '3 (Normal)': '3 (normale)',
141
+ '3 (Medium)': '3 (normale)',
142
142
  '2 (High)': '2 (alto)',
143
143
  '1 (Urgent)': '1 (urgente)',
144
144
  'Saved for later': 'Salvato per dopo',
@@ -534,7 +534,7 @@ export default {
534
534
  STANDARD: 'STANDARD',
535
535
  PREMIUM: 'PREMIUM',
536
536
  '4 (Low) - 2 business days': '4 (Basso): 2 giorni lavorativi',
537
- '3 (Normal) - 1 business day': '3 (Normale): 1 giorno lavorativo',
537
+ '3 (Medium) - 1 business day': '3 (Normale): 1 giorno lavorativo',
538
538
  '2 (High) - 4 business hours': '2 (alto): 4 ore lavorative',
539
539
  '1 (Urgent) - 1 business hour': '1 (urgente): 1 ora lavorativa',
540
540
  'Loading...': 'Caricamento in corso',
@@ -138,7 +138,7 @@ declare const _default: {
138
138
  'Exporting CSV': string;
139
139
  'Could not export CSV': string;
140
140
  '4 (Low)': string;
141
- '3 (Normal)': string;
141
+ '3 (Medium)': string;
142
142
  '2 (High)': string;
143
143
  '1 (Urgent)': string;
144
144
  'Saved for later': string;
@@ -533,7 +533,7 @@ declare const _default: {
533
533
  STANDARD: string;
534
534
  PREMIUM: string;
535
535
  '4 (Low) - 2 business days': string;
536
- '3 (Normal) - 1 business day': string;
536
+ '3 (Medium) - 1 business day': string;
537
537
  '2 (High) - 4 business hours': string;
538
538
  '1 (Urgent) - 1 business hour': string;
539
539
  'Loading...': string;
@@ -138,7 +138,7 @@ export default {
138
138
  'Exporting CSV': 'CSV をエクスポート中です',
139
139
  'Could not export CSV': 'CSV をエクスポートできません',
140
140
  '4 (Low)': '4 (低)',
141
- '3 (Normal)': '3 (中)',
141
+ '3 (Medium)': '3 (中)',
142
142
  '2 (High)': '2 (高)',
143
143
  '1 (Urgent)': '1 (緊急)',
144
144
  'Saved for later': '一時保存しました',
@@ -534,7 +534,7 @@ export default {
534
534
  STANDARD: 'STANDARD',
535
535
  PREMIUM: 'PREMIUM',
536
536
  '4 (Low) - 2 business days': '4 (低) - 2 営業日',
537
- '3 (Normal) - 1 business day': '3 (中) - 1 営業日',
537
+ '3 (Medium) - 1 business day': '3 (中) - 1 営業日',
538
538
  '2 (High) - 4 business hours': '2 (高) - 4 営業時間',
539
539
  '1 (Urgent) - 1 business hour': '1 (緊急) - 1 営業時間',
540
540
  'Loading...': '読み込み中...',
@@ -138,7 +138,7 @@ declare const _default: {
138
138
  'Exporting CSV': string;
139
139
  'Could not export CSV': string;
140
140
  '4 (Low)': string;
141
- '3 (Normal)': string;
141
+ '3 (Medium)': string;
142
142
  '2 (High)': string;
143
143
  '1 (Urgent)': string;
144
144
  'Saved for later': string;
@@ -535,7 +535,7 @@ declare const _default: {
535
535
  STANDARD: string;
536
536
  PREMIUM: string;
537
537
  '4 (Low) - 2 business days': string;
538
- '3 (Normal) - 1 business day': string;
538
+ '3 (Medium) - 1 business day': string;
539
539
  '2 (High) - 4 business hours': string;
540
540
  '1 (Urgent) - 1 business hour': string;
541
541
  'Loading...': string;
@@ -138,7 +138,7 @@ export default {
138
138
  'Exporting CSV': 'CSV 내보내기',
139
139
  'Could not export CSV': 'CSV를 내보낼 수 없습니다',
140
140
  '4 (Low)': '4 (낮음)',
141
- '3 (Normal)': '3 (보통)',
141
+ '3 (Medium)': '3 (보통)',
142
142
  '2 (High)': '2 (높음)',
143
143
  '1 (Urgent)': '1 (긴급)',
144
144
  'Saved for later': '임시 저장했습니다',
@@ -536,7 +536,7 @@ export default {
536
536
  STANDARD: 'STANDARD',
537
537
  PREMIUM: 'PREMIUM',
538
538
  '4 (Low) - 2 business days': '4 (낮음)-영업일 기준 2 일',
539
- '3 (Normal) - 1 business day': '3 (중간)-영업일 기준 1 일',
539
+ '3 (Medium) - 1 business day': '3 (중간)-영업일 기준 1 일',
540
540
  '2 (High) - 4 business hours': '2 (높음) - 4 시간 (영업 시간)',
541
541
  '1 (Urgent) - 1 business hour': '1 (긴급) - 1 시간 (영업 시간)',
542
542
  'Loading...': '로드 중 ...',
@@ -137,7 +137,7 @@ declare const _default: {
137
137
  'Exporting CSV': string;
138
138
  'Could not export CSV': string;
139
139
  '4 (Low)': string;
140
- '3 (Normal)': string;
140
+ '3 (Medium)': string;
141
141
  '2 (High)': string;
142
142
  '1 (Urgent)': string;
143
143
  'Saved for later': string;
@@ -534,7 +534,7 @@ declare const _default: {
534
534
  STANDARD: string;
535
535
  PREMIUM: string;
536
536
  '4 (Low) - 2 business days': string;
537
- '3 (Normal) - 1 business day': string;
537
+ '3 (Medium) - 1 business day': string;
538
538
  '2 (High) - 4 business hours': string;
539
539
  '1 (Urgent) - 1 business hour': string;
540
540
  'Loading...': string;
@@ -137,7 +137,7 @@ export default {
137
137
  'Exporting CSV': 'Exportando CSV',
138
138
  'Could not export CSV': 'Não foi possível exportar CSV',
139
139
  '4 (Low)': '4 (Baixa)',
140
- '3 (Normal)': '3 (Normal)',
140
+ '3 (Medium)': '3 (Medium)',
141
141
  '2 (High)': '2 (Alta)',
142
142
  '1 (Urgent)': '1 (Urgente)',
143
143
  'Saved for later': 'Salvo para mais tarde',
@@ -534,7 +534,7 @@ export default {
534
534
  STANDARD: 'STANDARD',
535
535
  PREMIUM: 'PREMIUM',
536
536
  '4 (Low) - 2 business days': '4 (Baixa) - 2 dias úteis',
537
- '3 (Normal) - 1 business day': '3 (Normal) - 1 dia útil',
537
+ '3 (Medium) - 1 business day': '3 (Medium) - 1 dia útil',
538
538
  '2 (High) - 4 business hours': '2 (Alta) - 4 horas úteis',
539
539
  '1 (Urgent) - 1 business hour': '1 (Urgente) - 1 hora útil',
540
540
  'Loading...': 'Carregando...',
@@ -137,7 +137,7 @@ declare const _default: {
137
137
  'Exporting CSV': string;
138
138
  'Could not export CSV': string;
139
139
  '4 (Low)': string;
140
- '3 (Normal)': string;
140
+ '3 (Medium)': string;
141
141
  '2 (High)': string;
142
142
  '1 (Urgent)': string;
143
143
  'Saved for later': string;
@@ -534,7 +534,7 @@ declare const _default: {
534
534
  STANDARD: string;
535
535
  PREMIUM: string;
536
536
  '4 (Low) - 2 business days': string;
537
- '3 (Normal) - 1 business day': string;
537
+ '3 (Medium) - 1 business day': string;
538
538
  '2 (High) - 4 business hours': string;
539
539
  '1 (Urgent) - 1 business hour': string;
540
540
  'Loading...': string;
@@ -137,7 +137,7 @@ export default {
137
137
  'Exporting CSV': 'Экспорт CSV',
138
138
  'Could not export CSV': 'Не удалось экспортировать CSV',
139
139
  '4 (Low)': '4 (низкий)',
140
- '3 (Normal)': '3 (обычный)',
140
+ '3 (Medium)': '3 (обычный)',
141
141
  '2 (High)': '2 (высокий)',
142
142
  '1 (Urgent)': '1 (срочный)',
143
143
  'Saved for later': 'Сохранено на будущее',
@@ -534,7 +534,7 @@ export default {
534
534
  STANDARD: 'STANDARD',
535
535
  PREMIUM: 'PREMIUM',
536
536
  '4 (Low) - 2 business days': '4 (низкий) — 2 рабочих дня',
537
- '3 (Normal) - 1 business day': '3 (нормальный) — 1 рабочий день',
537
+ '3 (Medium) - 1 business day': '3 (нормальный) — 1 рабочий день',
538
538
  '2 (High) - 4 business hours': '2 (высокий) — 4 рабочих часа',
539
539
  '1 (Urgent) - 1 business hour': '1 (срочный) — 1 рабочий час',
540
540
  'Loading...': 'Загрузка...',
@@ -137,7 +137,7 @@ declare const _default: {
137
137
  'Exporting CSV': string;
138
138
  'Could not export CSV': string;
139
139
  '4 (Low)': string;
140
- '3 (Normal)': string;
140
+ '3 (Medium)': string;
141
141
  '2 (High)': string;
142
142
  '1 (Urgent)': string;
143
143
  'Saved for later': string;
@@ -527,7 +527,7 @@ declare const _default: {
527
527
  STANDARD: string;
528
528
  PREMIUM: string;
529
529
  '4 (Low) - 2 business days': string;
530
- '3 (Normal) - 1 business day': string;
530
+ '3 (Medium) - 1 business day': string;
531
531
  '2 (High) - 4 business hours': string;
532
532
  '1 (Urgent) - 1 business hour': string;
533
533
  'Loading...': string;