@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
@@ -7,45 +7,58 @@ 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, Config, pcm, sessionAttachments } from '@cee-eng/hydrajs';
10
+ import { Config, pcm, sessionAttachments } from '@cee-eng/hydrajs';
11
11
  import { ToastNotification } from '@rh-support/components';
12
- import { getText } from '@rh-support/utils';
12
+ import { CaseAttachmentUploadError, deleteCaseAttachment, fetchCaseDetailsByCaseNumber, GET_CONTENT_DOCUMENT_IDS, getText, MultipartUploadError, pendoTrackEvent, pollAttachmentUploadStatus, pollContentVersionStatus, uploadCaseAttachment, } from '@rh-support/utils';
13
13
  import find from 'lodash/find';
14
- import forEach from 'lodash/forEach';
15
14
  import includes from 'lodash/includes';
16
15
  import isEmpty from 'lodash/isEmpty';
17
16
  import isUndefined from 'lodash/isUndefined';
18
17
  import { AnalysisStatusConstants, AttachmentReducerConstants, defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, resetAttachment, udpateFileUploadMetadata, updateAnalysisMetadata, updateAttachmentIdForFile, UploadStatusConstants, } from './AttachmentReducer';
19
18
  import { FileStatusHelper } from './FileStatusHelper';
20
19
  export const onDrop = (dispatchToAttachmentReducer, isSessionId, isPrivate = false) => (acceptedFiles) => {
21
- const onFilesSelectLocal = (caseFiles) => {
22
- onFilesSelect(dispatchToAttachmentReducer, caseFiles);
23
- };
24
- forEach(acceptedFiles, (file) => __awaiter(void 0, void 0, void 0, function* () {
25
- try {
26
- const fileAccessDetails = yield getFileAccessDetails(file);
27
- const localFile = {
28
- name: file.name,
29
- size: file.size,
30
- lastModified: file.lastModified,
31
- type: file.type,
32
- description: '',
33
- isPrivate: isPrivate,
34
- uploadProgress: Object.assign(Object.assign({}, defaultUploadMetadata), { uploadStatus: isSessionId
35
- ? UploadStatusConstants.attachedOnSession
36
- : UploadStatusConstants.attachedOnCase }),
37
- analysisMetadata: Object.assign({}, defaultAnalysisMetadata),
38
- uploadability: Object.assign({}, fileAccessDetails),
39
- includeResults: true,
40
- };
41
- onFilesSelectLocal({ selectedLocalFiles: [localFile], selectedOriginalFiles: [file] });
42
- }
43
- catch (e) {
44
- if (!e.ableToUpload) {
45
- ToastNotification.addDangerMessage(e.ableToUploadMessage);
20
+ if (!acceptedFiles.length) {
21
+ return;
22
+ }
23
+ void (() => __awaiter(void 0, void 0, void 0, function* () {
24
+ const results = yield Promise.all(acceptedFiles.map((file) => __awaiter(void 0, void 0, void 0, function* () {
25
+ try {
26
+ const fileAccessDetails = yield getFileAccessDetails(file);
27
+ const localFile = {
28
+ name: file.name,
29
+ size: file.size,
30
+ lastModified: file.lastModified,
31
+ type: file.type,
32
+ description: '',
33
+ isPrivate: isPrivate,
34
+ uploadProgress: Object.assign(Object.assign({}, defaultUploadMetadata), { uploadStatus: isSessionId
35
+ ? UploadStatusConstants.attachedOnSession
36
+ : UploadStatusConstants.attachedOnCase }),
37
+ analysisMetadata: Object.assign({}, defaultAnalysisMetadata),
38
+ uploadability: Object.assign({}, fileAccessDetails),
39
+ includeResults: true,
40
+ };
41
+ return { localFile, file };
46
42
  }
43
+ catch (e) {
44
+ if (!e.ableToUpload) {
45
+ ToastNotification.addDangerMessage(e.ableToUploadMessage);
46
+ }
47
+ return null;
48
+ }
49
+ })));
50
+ const selectedLocalFiles = [];
51
+ const selectedOriginalFiles = [];
52
+ results.forEach((result) => {
53
+ if (result) {
54
+ selectedLocalFiles.push(result.localFile);
55
+ selectedOriginalFiles.push(result.file);
56
+ }
57
+ });
58
+ if (selectedLocalFiles.length > 0) {
59
+ onFilesSelect(dispatchToAttachmentReducer, { selectedLocalFiles, selectedOriginalFiles });
47
60
  }
48
- }));
61
+ }))();
49
62
  };
50
63
  const getFileAccessDetails = (file) => __awaiter(void 0, void 0, void 0, function* () {
51
64
  const fileName = (file === null || file === void 0 ? void 0 : file.name) || '';
@@ -62,6 +75,7 @@ const getFileAccessDetails = (file) => __awaiter(void 0, void 0, void 0, functio
62
75
  });
63
76
  export const isUploadingOnSession = (status) => status === UploadStatusConstants.uploadingOnSession;
64
77
  export const isUploadingOnCase = (status) => status === UploadStatusConstants.uploadingOnCase;
78
+ export const isAttachedOnCase = (status) => status === UploadStatusConstants.attachedOnCase;
65
79
  export const isVerifyingSessionUpload = (status) => status === UploadStatusConstants.verifyingSessionUpload;
66
80
  export const isVerifyingCaseUpload = (status) => status === UploadStatusConstants.verifyingCaseUpload;
67
81
  export const isRestoredFromSession = (status) => status === UploadStatusConstants.restoredFromSession;
@@ -86,16 +100,69 @@ export const hasAnalysedSomeAttachments = (selectedLocalFiles) => !isEmpty(find(
86
100
  export const hasSomeUnUploadedAttachments = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isUploading(localFile.uploadProgress.uploadStatus) &&
87
101
  !isUploadComplete(localFile.uploadProgress.uploadStatus) &&
88
102
  !isFileDeleted(localFile.uploadProgress.uploadStatus)));
89
- export const hasSomeSelectedFiles = (selectedLocalFiles) => !isEmpty(selectedLocalFiles);
103
+ /**
104
+ * Files still queued to start uploading. Aborted/failed are terminal and must not
105
+ * block post-upload discussion refresh when other files in the batch succeeded.
106
+ */
107
+ export const hasQueuedAttachmentUploads = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isUploading(localFile.uploadProgress.uploadStatus) &&
108
+ !isUploadComplete(localFile.uploadProgress.uploadStatus) &&
109
+ !isFileDeleted(localFile.uploadProgress.uploadStatus) &&
110
+ !isUploadAborted(localFile.uploadProgress.uploadStatus) &&
111
+ !isUploadFailed(localFile.uploadProgress.uploadStatus)));
112
+ /** Aborted/failed rows should stay in the upload panel until the user clicks Remove. */
113
+ export const hasAbortedOrFailedAttachments = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isUploadAborted(localFile.uploadProgress.uploadStatus) ||
114
+ isUploadFailed(localFile.uploadProgress.uploadStatus)));
115
+ /** True when at least one non-deleted file remains in the upload queue (UI visibility). */
116
+ export const hasSomeSelectedFiles = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isFileDeleted(localFile.uploadProgress.uploadStatus)));
117
+ const MAX_CONCURRENT_SESSION_UPLOADS = 3;
118
+ const SESSION_UPLOAD_MAX_ATTEMPTS = 2;
119
+ const SESSION_UPLOAD_RETRY_DELAY_MS = 500;
120
+ const activeUploadLockKeys = new Set();
121
+ const sessionUploadQueues = new Map();
122
+ const buildUploadLockKey = (idToUploadTo, localFile) => `${idToUploadTo}:${localFile.name}:${localFile.size}:${localFile.lastModified}`;
123
+ export const clearUploadRuntimeState = () => {
124
+ activeUploadLockKeys.clear();
125
+ sessionUploadQueues.clear();
126
+ };
127
+ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
128
+ const acquireSessionUploadSlot = (sessionId) => new Promise((resolve) => {
129
+ const tryAcquire = () => {
130
+ var _a;
131
+ const queue = (_a = sessionUploadQueues.get(sessionId)) !== null && _a !== void 0 ? _a : { activeCount: 0, waiting: [] };
132
+ sessionUploadQueues.set(sessionId, queue);
133
+ if (queue.activeCount < MAX_CONCURRENT_SESSION_UPLOADS) {
134
+ queue.activeCount++;
135
+ resolve(() => {
136
+ queue.activeCount--;
137
+ const next = queue.waiting.shift();
138
+ if (next) {
139
+ next();
140
+ }
141
+ else if (queue.activeCount === 0) {
142
+ sessionUploadQueues.delete(sessionId);
143
+ }
144
+ });
145
+ return;
146
+ }
147
+ queue.waiting.push(tryAcquire);
148
+ };
149
+ tryAcquire();
150
+ });
90
151
  export const isUploadingAttachment = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isUploading(localFile.uploadProgress.uploadStatus)));
91
152
  export const isAnalysingAnyAttachment = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isAnalysingFile(localFile.analysisMetadata.analysisStatus)));
92
153
  export const canShowProgressBar = (file) => isUploading(file.uploadProgress.uploadStatus) || isAnalysingFile(file.analysisMetadata.analysisStatus);
154
+ /** Case discussion: show radial progress while queued (attachedOnCase) or actively uploading. */
155
+ export const shouldShowUploadProgressIndicator = (file, isSessionUpload) => isUploading(file.uploadProgress.uploadStatus) ||
156
+ (!isSessionUpload && isAttachedOnCase(file.uploadProgress.uploadStatus));
93
157
  export const shouldHideDescription = (file, isSessionUpload) => !file.uploadability.ableToUpload ||
94
158
  isUploading(file.uploadProgress.uploadStatus) ||
95
159
  (!isSessionUpload &&
96
- ((file.uploadability.ableToUpload &&
97
- file.uploadProgress.percentUploaded > 0 &&
98
- (file.description || '').length === 0) ||
160
+ (isAttachedOnCase(file.uploadProgress.uploadStatus) ||
161
+ isUploadAborted(file.uploadProgress.uploadStatus) ||
162
+ isUploadFailed(file.uploadProgress.uploadStatus) ||
163
+ (file.uploadability.ableToUpload &&
164
+ file.uploadProgress.percentUploaded > 0 &&
165
+ (file.description || '').length === 0) ||
99
166
  isUploadComplete(file.uploadProgress.uploadStatus)));
100
167
  export const isUploadOnTrack = (file) => !isUploadFailed(file.uploadProgress.uploadStatus) &&
101
168
  !isUploadAborted(file.uploadProgress.uploadStatus) &&
@@ -110,30 +177,50 @@ export const isUploadedAndAnalysisSkipped = (file) => isSessionUploadComplete(fi
110
177
  export const updateUploadMetadata = (dispatch, fileIndexToEdit, newUploadMetadata) => {
111
178
  udpateFileUploadMetadata(dispatch, newUploadMetadata, fileIndexToEdit);
112
179
  };
113
- export const uploadAllFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, caseFiles, isSecureSupport, needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, }) {
114
- forEach(caseFiles.selectedLocalFiles, (localFile, index) => __awaiter(void 0, void 0, void 0, function* () {
180
+ export const uploadAllFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, caseFiles,
181
+ // isSecureSupport, // TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
182
+ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient, caseSalesforceId, onCaseFileUploaded, }) {
183
+ const eligibleIndices = [];
184
+ caseFiles.selectedLocalFiles.forEach((localFile, index) => {
115
185
  const fileStatus = new FileStatusHelper(localFile);
116
186
  if (fileStatus.isUploadComplete() ||
117
187
  fileStatus.isAnalysingFile() ||
118
188
  fileStatus.isAnalysisFailed() ||
119
189
  fileStatus.isUploading() ||
120
190
  fileStatus.isVerifyingUpload() ||
121
- fileStatus.isFileDeleted())
191
+ fileStatus.isFileDeleted()) {
122
192
  return;
123
- uploadFile({
193
+ }
194
+ eligibleIndices.push(index);
195
+ });
196
+ const eligibleCount = eligibleIndices.length;
197
+ if (eligibleCount === 0) {
198
+ return;
199
+ }
200
+ const startEligibleUpload = (index) => {
201
+ const localFile = caseFiles.selectedLocalFiles[index];
202
+ return uploadFile({
124
203
  dispatch,
125
204
  idToUploadTo,
126
205
  localFile,
127
206
  originalFile: caseFiles.selectedOriginalFiles[index],
128
207
  index,
129
- isSecureSupport,
130
208
  needsAnalyzing,
131
209
  isSessionId,
132
210
  slowUploadConfig,
211
+ apolloClient,
212
+ caseSalesforceId,
213
+ onCaseFileUploaded,
133
214
  });
134
- }));
215
+ };
216
+ eligibleIndices.forEach((index) => {
217
+ void startEligibleUpload(index);
218
+ });
135
219
  });
136
- export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, localFile, originalFile, index, isSecureSupport, needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, }) {
220
+ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, localFile, originalFile, index,
221
+ // isSecureSupport = false, // TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
222
+ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient, caseSalesforceId, onCaseFileUploaded, }) {
223
+ var _b;
137
224
  if (!localFile.uploadability.ableToUpload) {
138
225
  return;
139
226
  }
@@ -142,6 +229,12 @@ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ d
142
229
  if (isUploading(uploadStatus) || isUploadComplete(uploadStatus)) {
143
230
  return;
144
231
  }
232
+ const uploadLockKey = buildUploadLockKey(idToUploadTo, localFile);
233
+ if (activeUploadLockKeys.has(uploadLockKey)) {
234
+ return;
235
+ }
236
+ activeUploadLockKeys.add(uploadLockKey);
237
+ let releaseSessionUploadSlot;
145
238
  // For Metadata you must add x-amz-meta
146
239
  // only add x-amz-meta if the value is present else the aws throws signature invalid errors
147
240
  const putObjectRequest = {
@@ -150,6 +243,8 @@ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ d
150
243
  Metadata: Object.assign(Object.assign(Object.assign(Object.assign({}, (localFile.description && { 'x-amz-meta-description': localFile.description })), (localFile.name && { 'x-amz-meta-fileName': localFile.name })), (localFile.size && { 'x-amz-meta-byteLength': localFile.size.toString() })), (localFile.type && { 'x-amz-meta-content-type': localFile.type })),
151
244
  };
152
245
  let triggerTrackSlowUpload = true;
246
+ // Hoisted so catch can treat S3 403-after-abort as user cancel, not a hard failure.
247
+ let userAborted = false;
153
248
  try {
154
249
  const listener = (progress, abort, isUploadingWithSlowConfig) => {
155
250
  if (isUploadingWithSlowConfig && triggerTrackSlowUpload) {
@@ -195,22 +290,108 @@ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ d
195
290
  updateUploadMetadata(dispatch, index, initialUploadPayload);
196
291
  let attachmentId = '';
197
292
  if (isSessionId) {
198
- attachmentId = yield sessionAttachments.uploadSessionAttachmentS3(idToUploadTo, {
199
- description: localFile.description,
200
- fileName: localFile.name,
201
- sessionId: idToUploadTo,
202
- size: localFile.size,
203
- }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
293
+ releaseSessionUploadSlot = yield acquireSessionUploadSlot(idToUploadTo);
294
+ for (let attempt = 1; attempt <= SESSION_UPLOAD_MAX_ATTEMPTS; attempt++) {
295
+ try {
296
+ attachmentId = yield sessionAttachments.uploadSessionAttachmentS3(idToUploadTo, {
297
+ description: localFile.description,
298
+ fileName: localFile.name,
299
+ sessionId: idToUploadTo,
300
+ size: localFile.size,
301
+ }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
302
+ break;
303
+ }
304
+ catch (error) {
305
+ const isUserAbort = (error === null || error === void 0 ? void 0 : error.message) === 'Request aborted by user';
306
+ if (isUserAbort || attempt >= SESSION_UPLOAD_MAX_ATTEMPTS) {
307
+ throw error;
308
+ }
309
+ updateUploadMetadata(dispatch, index, {
310
+ uploadStatus: UploadStatusConstants.uploadingOnSession,
311
+ uploadErrorMessage: '',
312
+ percentUploaded: 0,
313
+ onAbort: undefined,
314
+ });
315
+ yield delay(SESSION_UPLOAD_RETRY_DELAY_MS * attempt);
316
+ }
317
+ }
204
318
  }
205
319
  else {
206
- attachmentId = yield caseAttachments.uploadAttachmentS3(idToUploadTo, {
207
- description: localFile.description,
208
- fileName: localFile.name,
209
- isPrivate: localFile.isPrivate,
210
- size: localFile.size,
211
- }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, isSecureSupport, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
320
+ // Mirror master Hydra listener behavior for circular progress + abort button.
321
+ let abortUpload;
322
+ const onAbort = (abortedFileIndex) => {
323
+ userAborted = true;
324
+ const abortPayload = {
325
+ percentUploaded: 0,
326
+ onAbort: undefined,
327
+ uploadStatus: UploadStatusConstants.aborted,
328
+ };
329
+ abortUpload === null || abortUpload === void 0 ? void 0 : abortUpload();
330
+ updateUploadMetadata(dispatch, abortedFileIndex, abortPayload);
331
+ };
332
+ // Register abort handler immediately so Cancel works before first progress tick
333
+ updateUploadMetadata(dispatch, index, {
334
+ uploadStatus: UploadStatusConstants.uploadingOnCase,
335
+ percentUploaded: 0,
336
+ uploadErrorMessage: '',
337
+ onAbort,
338
+ });
339
+ attachmentId = yield uploadCaseAttachment(idToUploadTo, originalFile, (percent) => {
340
+ if (userAborted)
341
+ return;
342
+ const verifyingUpdate = percent === 100;
343
+ updateUploadMetadata(dispatch, index, {
344
+ uploadStatus: verifyingUpdate
345
+ ? UploadStatusConstants.verifyingCaseUpload
346
+ : UploadStatusConstants.uploadingOnCase,
347
+ percentUploaded: percent,
348
+ uploadErrorMessage: '',
349
+ onAbort: verifyingUpdate ? undefined : onAbort,
350
+ });
351
+ }, (abort) => {
352
+ abortUpload = abort;
353
+ if (userAborted) {
354
+ abort();
355
+ return;
356
+ }
357
+ updateUploadMetadata(dispatch, index, {
358
+ uploadStatus: UploadStatusConstants.uploadingOnCase,
359
+ onAbort,
360
+ });
361
+ }, undefined, localFile.uploadProgress.multipartResumeState
362
+ ? {
363
+ attachmentId: localFile.uploadProgress.multipartResumeState.attachmentId,
364
+ uploadId: localFile.uploadProgress.multipartResumeState.uploadId,
365
+ parts: localFile.uploadProgress.multipartResumeState.parts,
366
+ completedParts: localFile.uploadProgress.multipartResumeState.completedParts,
367
+ }
368
+ : undefined, (initAttachmentId) => {
369
+ updateAttachmentIdForFile(dispatch, initAttachmentId, index);
370
+ });
371
+ if (userAborted) {
372
+ return;
373
+ }
374
+ if (apolloClient && caseSalesforceId) {
375
+ updateUploadMetadata(dispatch, index, {
376
+ uploadStatus: UploadStatusConstants.verifyingCaseUpload,
377
+ percentUploaded: 100,
378
+ onAbort: undefined,
379
+ });
380
+ yield pollAttachmentUploadStatus(apolloClient, caseSalesforceId, attachmentId);
381
+ }
212
382
  }
213
383
  attachmentId && updateAttachmentIdForFile(dispatch, attachmentId, index);
384
+ if (!isSessionId && attachmentId) {
385
+ // Hide from upload queue without shifting indices of in-flight siblings, then refresh discussion
386
+ updateUploadMetadata(dispatch, index, {
387
+ uploadStatus: UploadStatusConstants.deleted,
388
+ uploadErrorMessage: '',
389
+ percentUploaded: 100,
390
+ onAbort: undefined,
391
+ });
392
+ onCaseFileUploaded === null || onCaseFileUploaded === void 0 ? void 0 : onCaseFileUploaded();
393
+ return;
394
+ }
214
395
  const uploadPayload = {
215
396
  uploadStatus: isSessionId ? UploadStatusConstants.uploadedOnSession : UploadStatusConstants.uploadedOnCase,
216
397
  uploadErrorMessage: '',
@@ -224,8 +405,24 @@ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ d
224
405
  }
225
406
  }
226
407
  catch (error) {
227
- if (error.message === 'Request aborted by user') {
228
- // Show alert if needed
408
+ const isUserAbort = userAborted || (error === null || error === void 0 ? void 0 : error.message) === 'Request aborted by user';
409
+ const attachmentIdFromError = (error instanceof MultipartUploadError && ((_b = error.resumeData) === null || _b === void 0 ? void 0 : _b.attachmentId)) ||
410
+ (error instanceof CaseAttachmentUploadError && error.attachmentId) ||
411
+ undefined;
412
+ if (attachmentIdFromError) {
413
+ updateAttachmentIdForFile(dispatch, attachmentIdFromError, index);
414
+ }
415
+ if (isUserAbort) {
416
+ if (!isSessionId && attachmentIdFromError) {
417
+ try {
418
+ yield deleteCaseAttachment(idToUploadTo, attachmentIdFromError);
419
+ }
420
+ catch (_c) {
421
+ // Best-effort: file stays in queue as ABORTED for retry
422
+ }
423
+ }
424
+ const resumeState = error instanceof MultipartUploadError ? error.resumeData : undefined;
425
+ updateUploadMetadata(dispatch, index, Object.assign({ uploadStatus: UploadStatusConstants.aborted, uploadErrorMessage: '', onAbort: undefined, percentUploaded: 0 }, (resumeState && resumeState.completedParts.length > 0 ? { multipartResumeState: resumeState } : {})));
229
426
  }
230
427
  else {
231
428
  console.error(error);
@@ -234,13 +431,19 @@ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ d
234
431
  ? UploadStatusConstants.uploadOnSessionFailed
235
432
  : UploadStatusConstants.uploadOnCaseFailed,
236
433
  uploadErrorMessage: error.message,
237
- percentUploaded: 0,
238
434
  onAbort: undefined,
435
+ multipartResumeState: error instanceof MultipartUploadError ? error.resumeData : undefined,
239
436
  };
240
- updateAttachmentIdForFile(dispatch, null, index);
437
+ if (!uploadErrorPayload.multipartResumeState) {
438
+ uploadErrorPayload.percentUploaded = 0;
439
+ }
241
440
  updateUploadMetadata(dispatch, index, uploadErrorPayload);
242
441
  }
243
442
  }
443
+ finally {
444
+ releaseSessionUploadSlot === null || releaseSessionUploadSlot === void 0 ? void 0 : releaseSessionUploadSlot();
445
+ activeUploadLockKeys.delete(uploadLockKey);
446
+ }
244
447
  });
245
448
  export function doSosReportAnalysisForAllFiles(dispatch, idToUploadTo, localFiles, isSessionId) {
246
449
  return __awaiter(this, void 0, void 0, function* () {
@@ -321,8 +524,10 @@ export function computeAnalysisResults(idToUploadTo, attachmentId, fileSize, isS
321
524
  return analysisResults;
322
525
  });
323
526
  }
324
- export function moveSessionAttachmentToCase(dispatch, caseNumber, sessionId, localFile, fileIndex) {
527
+ const SCT_PART_SIZE = 5 * 1024 * 1024;
528
+ export function moveSessionAttachmentToCase(dispatch, caseNumber, sessionId, localFile, fileIndex, apolloClient, caseSalesforceId) {
325
529
  return __awaiter(this, void 0, void 0, function* () {
530
+ var _a, _b, _c, _d, _e;
326
531
  if (!caseNumber || !sessionId || !localFile.attachmentId)
327
532
  return;
328
533
  const currentUploadPayload = {
@@ -330,9 +535,49 @@ export function moveSessionAttachmentToCase(dispatch, caseNumber, sessionId, loc
330
535
  uploadStatus: UploadStatusConstants.movingToCase,
331
536
  };
332
537
  updateUploadMetadata(dispatch, fileIndex, currentUploadPayload);
333
- const fileMetadata = yield sessionAttachments.moveSessionAttachmentsToCase(sessionId, [localFile.attachmentId], caseNumber);
334
538
  try {
335
- yield sessionAttachments.pollFileMoveProcess(sessionId, fileMetadata[0].id, fileMetadata[0]);
539
+ let resolvedCaseSalesforceId = caseSalesforceId;
540
+ if (apolloClient && !resolvedCaseSalesforceId) {
541
+ const caseDetails = yield fetchCaseDetailsByCaseNumber(apolloClient, caseNumber);
542
+ resolvedCaseSalesforceId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.id;
543
+ }
544
+ const totalChunks = Math.ceil(localFile.size / SCT_PART_SIZE);
545
+ const moveResponse = yield sessionAttachments.moveSessionAttachmentsToCaseSCT(sessionId, {
546
+ caseNumber,
547
+ attachments: [
548
+ {
549
+ attachmentId: localFile.attachmentId,
550
+ fileName: localFile.name,
551
+ fileSize: String(localFile.size),
552
+ totalChunks: String(totalChunks),
553
+ clientId: 'pcm',
554
+ description: localFile.description || '',
555
+ },
556
+ ],
557
+ });
558
+ const sctAttachmentId = (_a = moveResponse === null || moveResponse === void 0 ? void 0 : moveResponse[0]) === null || _a === void 0 ? void 0 : _a.attachmentId;
559
+ if (!sctAttachmentId) {
560
+ throw new Error('Missing attachmentId from SCT move response');
561
+ }
562
+ if (!resolvedCaseSalesforceId || !apolloClient) {
563
+ updateUploadMetadata(dispatch, fileIndex, {
564
+ uploadStatus: UploadStatusConstants.uploadedOnCase,
565
+ });
566
+ return;
567
+ }
568
+ const { data: docLinkData } = yield apolloClient.query({
569
+ query: GET_CONTENT_DOCUMENT_IDS,
570
+ variables: { linkedEntityId: { eq: resolvedCaseSalesforceId } },
571
+ fetchPolicy: 'network-only',
572
+ });
573
+ const contentDocumentIds = ((_e = (_d = (_c = (_b = docLinkData === null || docLinkData === void 0 ? void 0 : docLinkData.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportContentDocumentLink) === null || _d === void 0 ? void 0 : _d.edges) !== null && _e !== void 0 ? _e : []).map((edge) => edge.node.ContentDocumentId.value);
574
+ if (contentDocumentIds.length === 0) {
575
+ updateUploadMetadata(dispatch, fileIndex, {
576
+ uploadStatus: UploadStatusConstants.uploadedOnCase,
577
+ });
578
+ return;
579
+ }
580
+ yield pollContentVersionStatus(apolloClient, contentDocumentIds, sctAttachmentId);
336
581
  updateUploadMetadata(dispatch, fileIndex, {
337
582
  uploadStatus: UploadStatusConstants.uploadedOnCase,
338
583
  });
@@ -432,10 +677,13 @@ export const isAnyFileDiagnosticsAttachment = (selectedLocalFiles) => {
432
677
  return selectedLocalFiles.some(isDiagnosticsAttachment);
433
678
  };
434
679
  export const trackSlowUpload = (dispatch) => {
680
+ // show an alert
681
+ //track in pendo
435
682
  dispatch({
436
683
  type: AttachmentReducerConstants.setShowUploadingOnSlowConnectionMsg,
437
684
  payload: {
438
685
  showUploadingOnSlowConnectionMsg: true,
439
686
  },
440
687
  });
688
+ pendoTrackEvent('PCM-Next > S3-Slow-Upload');
441
689
  };
@@ -1,6 +1,7 @@
1
1
  import { CaseDiagnosticsStatus, ICaseDiagnosticsResponse } from '@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics';
2
2
  import { Report } from '@cee-eng/hydrajs/@types/models/insights';
3
3
  import { IAction } from '@rh-support/types/shared';
4
+ import { IMultipartResumeData } from '@rh-support/utils';
4
5
  export declare enum AttachmentReducerConstants {
5
6
  caseFileSelected = "caseFileSelected",
6
7
  caseLocalFileEdited = "caseLocalFileEdited",
@@ -10,7 +11,8 @@ export declare enum AttachmentReducerConstants {
10
11
  updateAttachmentIdForFile = "updateAttachmentIdForFile",
11
12
  updateAnalysisMetadata = "updateAnalysisMetadata",
12
13
  udpateFileUploadMetadata = "udpateFileUploadMetadata",
13
- setShowUploadingOnSlowConnectionMsg = "setShowUploadingOnSlowConnectionMsg"
14
+ setShowUploadingOnSlowConnectionMsg = "setShowUploadingOnSlowConnectionMsg",
15
+ clearCompletedAttachments = "clearCompletedAttachments"
14
16
  }
15
17
  export declare enum UploadStatusConstants {
16
18
  attachedOnCase = "ATTACHED_ON_CASE",
@@ -53,6 +55,7 @@ export interface IUploadMetadata {
53
55
  uploadErrorMessage: string;
54
56
  onAbort: (abortedFileIndex: number) => void;
55
57
  percentUploaded: number;
58
+ multipartResumeState?: IMultipartResumeData;
56
59
  }
57
60
  export interface IAnalysisMetadata {
58
61
  analysisErrorMesssage?: string;
@@ -102,6 +105,7 @@ export declare const onFilesSelect: (dispatch: AttachmentReducerDispatchType, ca
102
105
  export declare const onFileEdit: (dispatch: AttachmentReducerDispatchType, editedLocalFile: IFileLocal, fileIndexToEdit: number) => void;
103
106
  export declare const onFileRemove: (dispatch: AttachmentReducerDispatchType, fileIndexToRemove: number) => void;
104
107
  export declare const resetAttachment: (dispatch: AttachmentReducerDispatchType) => void;
108
+ export declare const clearCompletedAttachments: (dispatch: AttachmentReducerDispatchType) => void;
105
109
  export declare const onIncludeExcludeResults: (dispatch: AttachmentReducerDispatchType, includeResults: boolean) => void;
106
110
  export declare const updateAttachmentIdForFile: (dispatch: AttachmentReducerDispatchType, attachmentId: string, fileIndexToEdit: number) => void;
107
111
  export declare const updateAnalysisMetadata: (dispatch: AttachmentReducerDispatchType, analysisMetadata: Partial<IAnalysisMetadata>, fileIndexToEdit: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentReducer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAMnD,oBAAY,0BAA0B;IAClC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,sBAAsB,2BAA2B;IACjD,wBAAwB,6BAA6B;IACrD,mCAAmC,wCAAwC;CAC9E;AAED,oBAAY,qBAAqB;IAC7B,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,eAAe,sBAAsB;IACrC,kBAAkB,yBAAyB;IAC3C,mBAAmB,0BAA0B;IAC7C,sBAAsB,6BAA6B;IACnD,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,kBAAkB,0BAA0B;IAC5C,qBAAqB,6BAA6B;IAClD,YAAY,mBAAmB;IAC/B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,mBAAmB,wBAAwB;CAC9C;AAED,oBAAY,uBAAuB;IAC/B,kBAAkB,yBAAyB;IAC3C,iBAAiB,yBAAyB;IAC1C,gBAAgB,sBAAsB;IACtC,cAAc,oB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vC,cAAc,MAAM,EACpB,iBAAiB,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAC/B,UAAU,6BAA6B,EACvC,kBAAkB,OAAO,CAAC,iBAAiB,CAAC,EAC5C,iBAAiB,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACjC,UAAU,6BAA6B,EACvC,gBAAgB,OAAO,CAAC,eAAe,CAAC,EACxC,iBAAiB,MAAM,SAM1B,CAAC"}
1
+ {"version":3,"file":"AttachmentReducer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD,oBAAY,0BAA0B;IAClC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,sBAAsB,2BAA2B;IACjD,wBAAwB,6BAA6B;IACrD,mCAAmC,wCAAwC;IAC3E,yBAAyB,8BAA8B;CAC1D;AAED,oBAAY,qBAAqB;IAC7B,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,eAAe,sBAAsB;IACrC,kBAAkB,yBAAyB;IAC3C,mBAAmB,0BAA0B;IAC7C,sBAAsB,6BAA6B;IACnD,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,kBAAkB,0BAA0B;IAC5C,qBAAqB,6BAA6B;IAClD,YAAY,mBAAmB;IAC/B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,mBAAmB,wBAAwB;CAC9C;AAED,oBAAY,uBAAuB;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ACF,eAAO,MAAM,yBAAyB,GAAI,UAAU,6BAA6B,SAEhF,CAAC;AACF,eAAO,MAAM,uBAAuB,GAAI,UAAU,6BAA6B,EAAE,gBAAgB,OAAO,SAEvG,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAClC,UAAU,6BAA6B,EACvC,cAAc,MAAM,EACpB,iBAAiB,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAC/B,UAAU,6BAA6B,EACvC,kBAAkB,OAAO,CAAC,iBAAiB,CAAC,EAC5C,iBAAiB,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACjC,UAAU,6BAA6B,EACvC,gBAAgB,OAAO,CAAC,eAAe,CAAC,EACxC,iBAAiB,MAAM,SAM1B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { pcm } from '@cee-eng/hydrajs';
2
2
  import forEach from 'lodash/forEach';
3
- import { isAnalysingAnyAttachment, isUploadingAttachment } from './AttachmentHelper';
3
+ import { isAnalysingAnyAttachment, isUploadComplete, isUploadingAttachment } from './AttachmentHelper';
4
4
  // Constants
5
5
  export var AttachmentReducerConstants;
6
6
  (function (AttachmentReducerConstants) {
@@ -13,6 +13,7 @@ export var AttachmentReducerConstants;
13
13
  AttachmentReducerConstants["updateAnalysisMetadata"] = "updateAnalysisMetadata";
14
14
  AttachmentReducerConstants["udpateFileUploadMetadata"] = "udpateFileUploadMetadata";
15
15
  AttachmentReducerConstants["setShowUploadingOnSlowConnectionMsg"] = "setShowUploadingOnSlowConnectionMsg";
16
+ AttachmentReducerConstants["clearCompletedAttachments"] = "clearCompletedAttachments";
16
17
  })(AttachmentReducerConstants || (AttachmentReducerConstants = {}));
17
18
  export var UploadStatusConstants;
18
19
  (function (UploadStatusConstants) {
@@ -59,6 +60,7 @@ export const initialAttachmentState = {
59
60
  includeAnalysisResults: true,
60
61
  showUploadingOnSlowConnectionMsg: false,
61
62
  };
63
+ const getLocalFileAtIndex = (selectedLocalFiles, index) => index >= 0 && index < selectedLocalFiles.length ? selectedLocalFiles[index] : undefined;
62
64
  export const attachmentReducer = (pState, action) => {
63
65
  switch (action.type) {
64
66
  case AttachmentReducerConstants.caseFileSelected: {
@@ -78,6 +80,9 @@ export const attachmentReducer = (pState, action) => {
78
80
  case AttachmentReducerConstants.caseLocalFileEdited: {
79
81
  const editedLocalFile = action.payload.editedLocalFile;
80
82
  const indexToEdit = action.payload.fileIndexToEdit;
83
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
84
+ return pState;
85
+ }
81
86
  const newState = Object.assign({}, pState);
82
87
  const newCaseFiles = Object.assign({}, newState.caseFiles);
83
88
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -129,6 +134,9 @@ export const attachmentReducer = (pState, action) => {
129
134
  }
130
135
  case AttachmentReducerConstants.updateAttachmentIdForFile: {
131
136
  const indexToEdit = action.payload.fileIndexToEdit;
137
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
138
+ return pState;
139
+ }
132
140
  const newState = Object.assign({}, pState);
133
141
  const newCaseFiles = Object.assign({}, newState.caseFiles);
134
142
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -139,6 +147,9 @@ export const attachmentReducer = (pState, action) => {
139
147
  }
140
148
  case AttachmentReducerConstants.updateAnalysisMetadata: {
141
149
  const indexToEdit = action.payload.fileIndexToEdit;
150
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
151
+ return pState;
152
+ }
142
153
  const newState = Object.assign({}, pState);
143
154
  const newCaseFiles = Object.assign({}, newState.caseFiles);
144
155
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -149,6 +160,9 @@ export const attachmentReducer = (pState, action) => {
149
160
  }
150
161
  case AttachmentReducerConstants.udpateFileUploadMetadata: {
151
162
  const indexToEdit = action.payload.fileIndexToEdit;
163
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
164
+ return pState;
165
+ }
152
166
  const newState = Object.assign({}, pState);
153
167
  const newCaseFiles = Object.assign({}, newState.caseFiles);
154
168
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -160,6 +174,24 @@ export const attachmentReducer = (pState, action) => {
160
174
  case AttachmentReducerConstants.setShowUploadingOnSlowConnectionMsg: {
161
175
  return Object.assign(Object.assign({}, pState), { showUploadingOnSlowConnectionMsg: action.payload.showUploadingOnSlowConnectionMsg });
162
176
  }
177
+ case AttachmentReducerConstants.clearCompletedAttachments: {
178
+ const selectedLocalFiles = pState.caseFiles.selectedLocalFiles;
179
+ const selectedOriginalFiles = pState.caseFiles.selectedOriginalFiles;
180
+ const keptLocalFiles = [];
181
+ const keptOriginalFiles = [];
182
+ selectedLocalFiles.forEach((localFile, index) => {
183
+ if (!isUploadComplete(localFile.uploadProgress.uploadStatus)) {
184
+ keptLocalFiles.push(localFile);
185
+ if (selectedOriginalFiles[index]) {
186
+ keptOriginalFiles.push(selectedOriginalFiles[index]);
187
+ }
188
+ }
189
+ });
190
+ return Object.assign(Object.assign({}, pState), { caseFiles: {
191
+ selectedLocalFiles: keptLocalFiles,
192
+ selectedOriginalFiles: keptOriginalFiles,
193
+ } });
194
+ }
163
195
  default: {
164
196
  return pState;
165
197
  }
@@ -178,6 +210,9 @@ export const onFileRemove = (dispatch, fileIndexToRemove) => {
178
210
  export const resetAttachment = (dispatch) => {
179
211
  dispatch({ type: AttachmentReducerConstants.resetAttachment });
180
212
  };
213
+ export const clearCompletedAttachments = (dispatch) => {
214
+ dispatch({ type: AttachmentReducerConstants.clearCompletedAttachments });
215
+ };
181
216
  export const onIncludeExcludeResults = (dispatch, includeResults) => {
182
217
  dispatch({ type: AttachmentReducerConstants.caseFileIncludeExclude, payload: { includeResults } });
183
218
  };