@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.
- package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/AccountSelector.js +19 -29
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +91 -16
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +6 -2
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +61 -32
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +8 -0
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +18 -0
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +60 -33
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +19 -9
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +15 -4
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +82 -55
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +79 -47
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +203 -109
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +5 -9
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +18 -17
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +51 -47
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +49 -44
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +4 -0
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +23 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +51 -45
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +63 -17
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +130 -55
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +10 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +110 -65
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +40 -26
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +122 -148
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +76 -145
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +22 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +9 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +8 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +29 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +29 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +60 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +18 -7
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +9 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +217 -267
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +38 -52
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +168 -61
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +10 -9
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts +3 -0
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -0
- package/lib/esm/components/CaseInformation/CaseLabels.js +106 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +108 -31
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
- package/lib/esm/components/CaseInformation/Description.js +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.js +2 -5
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +31 -17
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +33 -24
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +36 -55
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +4 -0
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +1 -0
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +141 -0
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -8
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +13 -10
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +11 -9
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +2 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +20 -3
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +0 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +19 -32
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
- package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
- package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +8 -4
- package/lib/esm/components/EditDescription/EditDescription.js +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +23 -17
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +37 -50
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +3 -0
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +1 -0
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +9 -0
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +9 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +4 -3
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
- package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +3 -9
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +10 -8
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +25 -19
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +139 -91
- package/lib/esm/components/shared/Constants.d.ts +5 -0
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +5 -0
- package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
- package/lib/esm/components/shared/fileUpload/FileUpload.js +2 -3
- package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +1 -0
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +4 -3
- package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +22 -5
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +307 -59
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +5 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +36 -1
- package/lib/esm/components/shared/fileUpload/types/index.d.ts +5 -1
- package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.js +119 -47
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +22 -57
- package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
- package/lib/esm/components/shared/usePostComment.js +16 -28
- package/lib/esm/components/shared/utils.d.ts +1 -0
- package/lib/esm/components/shared/utils.d.ts.map +1 -1
- package/lib/esm/components/shared/utils.js +9 -3
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +178 -38
- package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/MainSection.js +2 -1
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +2 -4
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +12 -13
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +7 -0
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +14 -11
- package/lib/esm/constants/caseDetailsConstants.d.ts +5 -0
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +5 -0
- package/lib/esm/context/CaseContext.d.ts.map +1 -1
- package/lib/esm/css/app.css +28 -0
- package/lib/esm/css/case.css +60 -209
- package/lib/esm/graphql/index.d.ts +4 -0
- package/lib/esm/graphql/index.d.ts.map +1 -0
- package/lib/esm/graphql/index.js +3 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
- package/lib/esm/graphql/mutations/index.d.ts +2 -0
- package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/index.js +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.js +31 -0
- package/lib/esm/graphql/queries/index.d.ts +2 -0
- package/lib/esm/graphql/queries/index.d.ts.map +1 -0
- package/lib/esm/graphql/queries/index.js +1 -0
- package/lib/esm/graphql/schemas/escalation.d.ts +66 -0
- package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/escalation.js +1 -0
- package/lib/esm/graphql/schemas/index.d.ts +2 -0
- package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/index.js +1 -0
- package/lib/esm/hooks/useAB.d.ts.map +1 -1
- package/lib/esm/hooks/useAB.js +45 -23
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +52 -0
- package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
- package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/index.js +5 -0
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +75 -0
- package/lib/esm/hooks/useCaseComments/types.d.ts +85 -0
- package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/types.js +1 -0
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +17 -0
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +38 -0
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
- package/lib/esm/hooks/useCaseGroupUiState.d.ts +3 -0
- package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseGroupUiState.js +10 -0
- package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
- package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseHistory.js +98 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +23 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +84 -0
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseUpdateErrorMessage.js +21 -11
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +18 -11
- package/lib/esm/hooks/useS3Upload.d.ts +5 -4
- package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
- package/lib/esm/hooks/useS3Upload.js +28 -30
- package/lib/esm/i18n/template-de.d.ts +2 -2
- package/lib/esm/i18n/template-de.js +2 -2
- package/lib/esm/i18n/template-es.d.ts +2 -2
- package/lib/esm/i18n/template-es.js +2 -2
- package/lib/esm/i18n/template-fr.d.ts +2 -2
- package/lib/esm/i18n/template-fr.js +2 -2
- package/lib/esm/i18n/template-it.d.ts +2 -2
- package/lib/esm/i18n/template-it.js +2 -2
- package/lib/esm/i18n/template-jp.d.ts +2 -2
- package/lib/esm/i18n/template-jp.js +2 -2
- package/lib/esm/i18n/template-ko.d.ts +2 -2
- package/lib/esm/i18n/template-ko.js +2 -2
- package/lib/esm/i18n/template-pt.d.ts +2 -2
- package/lib/esm/i18n/template-pt.js +2 -2
- package/lib/esm/i18n/template-ru.d.ts +2 -2
- package/lib/esm/i18n/template-ru.js +2 -2
- package/lib/esm/i18n/template-zh.d.ts +2 -2
- package/lib/esm/i18n/template-zh.js +2 -2
- package/lib/esm/index.js +1 -0
- package/lib/esm/models/cache.d.ts +0 -2
- package/lib/esm/models/cache.d.ts.map +1 -1
- package/lib/esm/models/caseHistory.d.ts +80 -0
- package/lib/esm/models/caseHistory.d.ts.map +1 -0
- package/lib/esm/models/caseHistory.js +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +123 -9
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +31 -7
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +7 -5
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +58 -26
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +11 -12
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +63 -70
- package/lib/esm/reducers/CaseHelpers.d.ts +11 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +119 -17
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
- package/lib/esm/reducers/CaseReducer.d.ts +56 -11
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +284 -100
- package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RecommendationsReducer.js +15 -18
- package/lib/esm/scss/_main.scss +9 -0
- package/lib/esm/utils/TimelineUtils.d.ts +41 -0
- package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
- package/lib/esm/utils/TimelineUtils.js +135 -0
- package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
- package/lib/esm/utils/caseHistoryUtils.js +165 -0
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +6 -0
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +1 -0
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +26 -0
- package/package.json +9 -8
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +0 -25
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +0 -88
|
@@ -7,12 +7,12 @@ 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 {
|
|
11
|
-
import {
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
11
|
+
import { MenuToggle, Select, SelectList, SelectOption } from '@patternfly/react-core';
|
|
12
12
|
import { AlertMessage, AlertType, ErrorBoundary, LoadingIndicator, ToastNotification } from '@rh-support/components';
|
|
13
13
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
14
14
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
15
|
-
import {
|
|
15
|
+
import { downloadCaseAttachment, dtmTrackEventCaseStepEncountered, getUrlParsedParams, scrollIntoView, } from '@rh-support/utils';
|
|
16
16
|
import cloneDeep from 'lodash/cloneDeep';
|
|
17
17
|
import filter from 'lodash/filter';
|
|
18
18
|
import findIndex from 'lodash/findIndex';
|
|
@@ -26,16 +26,16 @@ import { AutoSizer, CellMeasurer, CellMeasurerCache, List, WindowScroller } from
|
|
|
26
26
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
27
27
|
import { useCaseDetailsPageDispatchContext, useCaseDetailsPageStateContext, } from '../../../../context/CaseDetailsPageContext';
|
|
28
28
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../../context/CaseDiscussionTabContext';
|
|
29
|
-
import {
|
|
29
|
+
import { clearReplyingTo, discussionSortOrderConst, DiscussionType, setDiscussions, setReplyingTo, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateDiscussionStateAttachments, } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
30
30
|
import { setCaseState } from '../../../../reducers/CaseReducer';
|
|
31
31
|
import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
32
32
|
import { PDFContext } from '../../PDFContainer';
|
|
33
33
|
import CaseAttachment from './CaseAttachment';
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import CaseExternalTrackerUpdate from './CaseExternalTrackerUpdate';
|
|
34
|
+
import CaseComments from './CaseComments';
|
|
35
|
+
// import CaseExternalTrackerUpdate from './CaseExternalTrackerUpdate';
|
|
37
36
|
import { CommentSearch } from './CommentSearch';
|
|
38
37
|
import { PostComment } from './PostComment';
|
|
38
|
+
/** Threshold above which comments render in a virtualized (windowed) list for performance. */
|
|
39
39
|
const VC_MINIMUM_COMMENT = 150;
|
|
40
40
|
let cellMeasureCache = new CellMeasurerCache({
|
|
41
41
|
fixedWidth: true,
|
|
@@ -43,30 +43,26 @@ let cellMeasureCache = new CellMeasurerCache({
|
|
|
43
43
|
});
|
|
44
44
|
export default function CaseDiscussion(props) {
|
|
45
45
|
const { t } = useTranslation();
|
|
46
|
-
const { isPostingRemoteRequestCommentCompleted,
|
|
46
|
+
const { isPostingRemoteRequestCommentCompleted, product, version, caseSalesforceId } = useCaseSelector((state) => ({
|
|
47
47
|
isPostingRemoteRequestCommentCompleted: state.isPostingRemoteRequestCommentCompleted,
|
|
48
|
-
screenSessionRequested: state.caseDetails.screenSessionRequested,
|
|
49
48
|
product: state.caseDetails.product,
|
|
50
49
|
version: state.caseDetails.version,
|
|
50
|
+
caseSalesforceId: state.caseDetails.id,
|
|
51
51
|
}), isEqual);
|
|
52
52
|
const urlSearchParams = getUrlParsedParams(useLocation().search);
|
|
53
|
-
const discussionIdFromUrl = ((urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.commentId) ||
|
|
54
|
-
(urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.externalTrackerId) ||
|
|
55
|
-
(urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.attachmentId) ||
|
|
56
|
-
(urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.chatId));
|
|
53
|
+
const discussionIdFromUrl = ((urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.commentId) || (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.attachmentId));
|
|
57
54
|
const activeDiscussionElementRef = useRef(null);
|
|
58
|
-
const { sort, discussionFiltersListState, allDiscussions,
|
|
59
|
-
const { globalMetadataState: {
|
|
55
|
+
const { sort, discussionFiltersListState, allDiscussions, replyingToAuthor, replyingToTimestamp } = useCaseDiscussionTabStateContext();
|
|
56
|
+
const { globalMetadataState: { navBarRef, loggedInUsersAccount }, } = useGlobalStateContext();
|
|
60
57
|
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
61
|
-
const
|
|
62
|
-
const { caseDetailsPageState: { caseFeedbacksHydra, caseAttachmentHydra, caseExternalTrackersUpdate }, } = useCaseDetailsPageStateContext();
|
|
58
|
+
const { caseDetailsPageState: { caseAttachmentHydra }, } = useCaseDetailsPageStateContext();
|
|
63
59
|
const dispatchCaseDetailsHydraAttachments = useCaseDetailsPageDispatchContext();
|
|
64
|
-
const
|
|
65
|
-
const
|
|
60
|
+
const caseDispatch = useCaseDispatch();
|
|
61
|
+
const apolloClient = useApolloClient();
|
|
66
62
|
const ability = useContext(AbilityContext);
|
|
67
|
-
const canSeeExternalTracker = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER);
|
|
68
|
-
const canSeeChat = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_CHAT);
|
|
69
63
|
const canSeeAttachments = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS);
|
|
64
|
+
const { caseNumber } = props;
|
|
65
|
+
const activeElementId = useRef(null);
|
|
70
66
|
const listRef = React.useRef(null);
|
|
71
67
|
const windowScrollerRef = React.useRef(null);
|
|
72
68
|
const commentRef = React.useRef(null);
|
|
@@ -77,11 +73,7 @@ export default function CaseDiscussion(props) {
|
|
|
77
73
|
const [isCommentSearchCleared, setIsCommentSearchCleared] = useState(false);
|
|
78
74
|
const [isJumpToCommentClicked, setJumpToCommentClicked] = useState(false);
|
|
79
75
|
const [canUpdateScrollTop, setCanUpdateScrollTop] = useState(true);
|
|
80
|
-
const [replyingToPrivateComment, setReplyingToPrivateComment] = useState(null);
|
|
81
|
-
// used for tracking comment section width changes
|
|
82
76
|
const [discussionSectionWidth, setDiscussionSectionWidth] = useState(null);
|
|
83
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
84
|
-
const [selectedFilterItems, setSelectedFilterItems] = useState([]);
|
|
85
77
|
const [isSortOpen, setIsSortOpen] = useState(false);
|
|
86
78
|
const [sortSelected, setSortSelected] = useState('Select a value');
|
|
87
79
|
if (props.isDiscussionTab) {
|
|
@@ -90,19 +82,10 @@ export default function CaseDiscussion(props) {
|
|
|
90
82
|
defaultHeight: 100,
|
|
91
83
|
});
|
|
92
84
|
}
|
|
93
|
-
const computeFilterComment = () => {
|
|
94
|
-
return filter(allDiscussions, (discussion) => {
|
|
95
|
-
const activeFilter = discussionFiltersListState.filter((filter) => filter.value === discussion.discussionType && filter.isSelected);
|
|
96
|
-
return activeFilter.length === 1 ? discussion : null;
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
85
|
const shouldRenderRVComponent = !isExportingPDF && allDiscussions.length > VC_MINIMUM_COMMENT;
|
|
100
|
-
const hasAsaComment = (props.caseComments || []).some((comment) => (comment === null || comment === void 0 ? void 0 : comment.createdBy) === AUTOMATED_SUPPORT_ASSISTANT);
|
|
101
|
-
// filter comments on the basis of filterBy and search api
|
|
102
|
-
const computeFilteredComments = computeFilterComment();
|
|
103
86
|
const comuteSearchedComments = searchResult.length === 0
|
|
104
|
-
? cloneDeep(
|
|
105
|
-
: filter([...
|
|
87
|
+
? cloneDeep(allDiscussions)
|
|
88
|
+
: filter([...allDiscussions], (o) => { var _a; return searchResult.indexOf((_a = o === null || o === void 0 ? void 0 : o.item) === null || _a === void 0 ? void 0 : _a.id) !== -1; });
|
|
106
89
|
const isSearchResultEmpty = !isEmpty(searchCommentText) && (searchResult.length === 0 || comuteSearchedComments.length === 0);
|
|
107
90
|
const setVRCommentIndex = (cId) => {
|
|
108
91
|
setCommentIndex(cId < 0 ? 0 : cId);
|
|
@@ -121,8 +104,6 @@ export default function CaseDiscussion(props) {
|
|
|
121
104
|
if (allDiscussions.length > VC_MINIMUM_COMMENT) {
|
|
122
105
|
const commentIndex = findIndex([...comuteSearchedComments], (discussion) => discussion.item.id === discussionIdFromUrl);
|
|
123
106
|
setVRCommentIndex(commentIndex);
|
|
124
|
-
// to fix scrolling to comment index when scrollTop value from window scroller is 0
|
|
125
|
-
// initial list items
|
|
126
107
|
if (0 <= commentIndex && commentIndex <= 3) {
|
|
127
108
|
const offset = 80;
|
|
128
109
|
const scrollTopValue = ((_a = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _a === void 0 ? void 0 : _a._positionFromTop) - offset;
|
|
@@ -147,56 +128,37 @@ export default function CaseDiscussion(props) {
|
|
|
147
128
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
148
129
|
}, [discussionIdFromUrl, allDiscussions, activeElementId.current]);
|
|
149
130
|
useEffect(() => {
|
|
150
|
-
if (!
|
|
151
|
-
|
|
131
|
+
if (!isExportingPDF) {
|
|
132
|
+
setDiscussions(dispatchDiscussion, props.caseComments, [], caseAttachmentHydra.data, [], [], discussionFiltersListState, false, false, canSeeAttachments);
|
|
152
133
|
}
|
|
153
|
-
|
|
154
|
-
|
|
134
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
|
+
}, [props.caseComments, caseAttachmentHydra, canSeeAttachments]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (!caseAttachmentHydra.isFetching && caseAttachmentHydra.isError) {
|
|
138
|
+
ToastNotification.addDangerMessage(t('There was an error loading attachments.'));
|
|
155
139
|
}
|
|
156
|
-
|
|
157
|
-
|
|
140
|
+
}, [caseAttachmentHydra.isFetching, caseAttachmentHydra.isError, t]);
|
|
141
|
+
const onCommentAdded = () => __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
try {
|
|
143
|
+
yield props.refetchComments();
|
|
158
144
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
!caseAttachmentHydra.isFetching &&
|
|
162
|
-
!caseFeedbacksHydra.isFetching &&
|
|
163
|
-
!caseExternalTrackersUpdate.isFetching) {
|
|
164
|
-
setDiscussions(dispatchDiscussion, props.caseComments, props.caseChats, caseAttachmentHydra.data, caseFeedbacksHydra.data, caseExternalTrackersUpdate.data, discussionFiltersListState, canSeeExternalTracker, canSeeChat, canSeeAttachments);
|
|
145
|
+
catch (e) {
|
|
146
|
+
console.error('Failed to refetch comments:', e);
|
|
165
147
|
}
|
|
166
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
167
|
-
}, [props.caseComments, caseAttachmentHydra, props.caseChats, caseFeedbacksHydra, caseExternalTrackersUpdate]);
|
|
168
|
-
const onAttachmentRemove = (uuid_removed) => {
|
|
169
|
-
updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
|
|
170
|
-
};
|
|
171
|
-
const onFeedbackUpdate = (comment_id, feedback, feedbackReason) => {
|
|
172
|
-
updateCommentStateFeedback(dispatchDiscussion, comment_id, feedback, allDiscussions, feedbackReason);
|
|
173
|
-
};
|
|
174
|
-
const onCommentAdded = () => __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
yield updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
176
148
|
dtmTrackEventCaseStepEncountered('comment', caseNumber, product, version);
|
|
177
149
|
});
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
yield updateDiscussionStateAttachments(dispatchDiscussion, caseNumber, allDiscussions, sort, loggedInUsersAccount.data.secureSupport, discussionFiltersListState, dispatchCaseDetailsHydraAttachments);
|
|
181
|
-
});
|
|
182
|
-
const onReply = (commentText, commentCreator, isPublic) => {
|
|
183
|
-
var _a;
|
|
184
|
-
setReplyingToPrivateComment(!isPublic);
|
|
185
|
-
setCommentText(dispatchDiscussion, commentText, commentCreator);
|
|
150
|
+
const onReply = (author, commentId, timestamp) => {
|
|
151
|
+
setReplyingTo(dispatchDiscussion, author, commentId, timestamp);
|
|
186
152
|
scrollIntoView(props.tabRef, { navBarRef, timeout: 0, onlyIfNotInViewport: true, offset: 30 });
|
|
187
|
-
commentIndex !== -1 && setCommentIndex(-1);
|
|
188
|
-
isCommentSearchCleared && setIsCommentSearchCleared(false);
|
|
189
|
-
(_a = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _a === void 0 ? void 0 : _a.scrollToPosition(0);
|
|
190
153
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
setReplyingToPrivateComment(null);
|
|
154
|
+
const onClearReply = () => {
|
|
155
|
+
clearReplyingTo(dispatchDiscussion);
|
|
194
156
|
};
|
|
157
|
+
/** Strips special chars to prevent regex injection, then HTML-escapes via DOM round-trip to prevent XSS. */
|
|
195
158
|
const sanitizedSearchInput = (value) => {
|
|
196
159
|
if (!value)
|
|
197
160
|
return '';
|
|
198
161
|
const sanitizedValue = value.replace(/[^a-zA-Z0-9]/g, '');
|
|
199
|
-
// To escape HTML-like characters (e.g., <, >, &) in sanitizedValue
|
|
200
162
|
const div = document.createElement('div');
|
|
201
163
|
div.textContent = sanitizedValue;
|
|
202
164
|
return div.innerHTML;
|
|
@@ -210,10 +172,10 @@ export default function CaseDiscussion(props) {
|
|
|
210
172
|
isCommentSearchCleared && setIsCommentSearchCleared(false);
|
|
211
173
|
};
|
|
212
174
|
const highlightSearchResults = (searchTerm) => {
|
|
175
|
+
// Delay allows the DOM (especially virtualized rows) to finish rendering before mark.js can highlight matches.
|
|
213
176
|
setTimeout(() => {
|
|
214
|
-
// to mark attachment link button text
|
|
215
177
|
if (!isEmpty(sanitizedSearchInput(searchTerm))) {
|
|
216
|
-
const sanitizedSearchTerm = sanitizedSearchInput(searchTerm);
|
|
178
|
+
const sanitizedSearchTerm = sanitizedSearchInput(searchTerm);
|
|
217
179
|
document.querySelectorAll('button.attachment-download-btn').forEach((button) => {
|
|
218
180
|
var _a, _b;
|
|
219
181
|
if ((_a = button === null || button === void 0 ? void 0 : button.textContent) === null || _a === void 0 ? void 0 : _a.includes(sanitizedSearchTerm)) {
|
|
@@ -227,9 +189,6 @@ export default function CaseDiscussion(props) {
|
|
|
227
189
|
done: () => {
|
|
228
190
|
if (isEmpty(searchTerm))
|
|
229
191
|
return;
|
|
230
|
-
// removed { separateWordSearch: false }
|
|
231
|
-
// so the search term is split into individual words, and each word is matched separately.
|
|
232
|
-
// Search Term: "frontend developer" Matches: Text containing "frontend" or "developer".
|
|
233
192
|
markInstance.mark(searchTerm);
|
|
234
193
|
},
|
|
235
194
|
});
|
|
@@ -241,22 +200,26 @@ export default function CaseDiscussion(props) {
|
|
|
241
200
|
highlightSearchResults('');
|
|
242
201
|
setSearchResult([]);
|
|
243
202
|
if (cId === discussionIdFromUrl) {
|
|
244
|
-
// reason to reset activeElementId if comment id is same in the url on click jump to comment button
|
|
245
|
-
// we need to re compute filtered comments after clear search results.
|
|
246
|
-
// it will call useEffect and will set virtual comment Index(setVRCommentIndex())
|
|
247
203
|
activeElementId.current = '';
|
|
248
204
|
}
|
|
249
205
|
};
|
|
206
|
+
const onAttachmentRemove = (uuid_removed) => {
|
|
207
|
+
updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
|
|
208
|
+
};
|
|
209
|
+
const onAttachmentAdded = () => __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
var _a;
|
|
211
|
+
yield updateDiscussionStateAttachments(dispatchDiscussion, caseNumber, allDiscussions, sort, discussionFiltersListState, dispatchCaseDetailsHydraAttachments, apolloClient, caseSalesforceId, Boolean((_a = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.secureSupport));
|
|
212
|
+
});
|
|
250
213
|
const onMetadataUpdate = (attachmentId, updatedAttachment) => {
|
|
251
214
|
updateAttachment(dispatchDiscussion, attachmentId, updatedAttachment, allDiscussions);
|
|
252
215
|
};
|
|
253
|
-
const downloadAttachment = (
|
|
216
|
+
const downloadAttachment = ({ caseNumber: attachmentCaseNumber, uuid, name }) => {
|
|
254
217
|
const tempToastId = ToastNotification.addInfoMessage(t('Starting file download'));
|
|
255
218
|
try {
|
|
256
|
-
|
|
219
|
+
downloadCaseAttachment(attachmentCaseNumber, uuid, name);
|
|
257
220
|
}
|
|
258
221
|
catch (e) {
|
|
259
|
-
ToastNotification.addDangerMessage(t(
|
|
222
|
+
ToastNotification.addDangerMessage(t('Could not download {{filename}}: {{error}}', {
|
|
260
223
|
filename: name,
|
|
261
224
|
error: e === null || e === void 0 ? void 0 : e.message,
|
|
262
225
|
}));
|
|
@@ -264,11 +227,7 @@ export default function CaseDiscussion(props) {
|
|
|
264
227
|
finally {
|
|
265
228
|
tempToastId && ToastNotification.clearToast(tempToastId);
|
|
266
229
|
}
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* We need to clear the cell measurer cache if user resizes the window or discussion section width is changed
|
|
270
|
-
* so that the height of the rows are re-calculated
|
|
271
|
-
*/
|
|
230
|
+
};
|
|
272
231
|
useEffect(() => {
|
|
273
232
|
if (discussionSectionWidth && shouldRenderRVComponent) {
|
|
274
233
|
cellMeasureCache && cellMeasureCache.clearAll();
|
|
@@ -283,7 +242,6 @@ export default function CaseDiscussion(props) {
|
|
|
283
242
|
return (React.createElement(WindowScroller, { ref: windowScrollerRef, onScroll: handleScroll }, ({ height, registerChild, onChildScroll, isScrolling, scrollTop }) => {
|
|
284
243
|
return (React.createElement("div", { ref: commentRef, "data-tracking-id": "vr-case-comments" },
|
|
285
244
|
React.createElement(AutoSizer, { disableHeight: true }, ({ width }) => {
|
|
286
|
-
// setTimeout to update state in the next tick and avoid bad setState warnings
|
|
287
245
|
discussionSectionWidth !== width &&
|
|
288
246
|
setTimeout(() => setDiscussionSectionWidth(width), 0);
|
|
289
247
|
return (React.createElement("div", { ref: registerChild },
|
|
@@ -297,16 +255,19 @@ export default function CaseDiscussion(props) {
|
|
|
297
255
|
if (isEmpty(discussion) || isEmpty(discussion.item))
|
|
298
256
|
return null;
|
|
299
257
|
return (React.createElement("div", { "data-tracking-id": "discussion-elements", key: discussion.item.id },
|
|
300
|
-
discussion.discussionType === DiscussionType.COMMENT && (React.createElement(CaseComments, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, comment: discussion.item, onFeedBackUpdate:
|
|
301
|
-
discussion.discussionType === DiscussionType.ATTACHMENT && (React.createElement(CaseAttachment, { attachment: discussion.item, onAttachmentRemove: onAttachmentRemove, onMetadataUpdate: onMetadataUpdate, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null }))
|
|
302
|
-
discussion.discussionType === DiscussionType.CHAT && (React.createElement(CaseChat, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, chat: discussion.item, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment })),
|
|
303
|
-
discussion.discussionType === DiscussionType.EXTERNAL_TRACKER && (React.createElement(CaseExternalTrackerUpdate, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, trackerUpdate: discussion.item, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment }))));
|
|
258
|
+
discussion.discussionType === DiscussionType.COMMENT && (React.createElement(CaseComments, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, comment: discussion.item, onFeedBackUpdate: () => { }, feedback: discussion.feedback, accountNumber: props.accountNumber, onReply: onReply, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment })),
|
|
259
|
+
discussion.discussionType === DiscussionType.ATTACHMENT && (React.createElement(CaseAttachment, { attachment: discussion.item, onAttachmentRemove: onAttachmentRemove, onMetadataUpdate: onMetadataUpdate, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null }))));
|
|
304
260
|
};
|
|
305
|
-
const rowRenderer = ({ index, parent, key, style }) => {
|
|
261
|
+
const rowRenderer = ({ index, parent, key, style, }) => {
|
|
306
262
|
const discussion = comuteSearchedComments[index];
|
|
307
263
|
return (React.createElement(CellMeasurer, { key: key, cache: cellMeasureCache, parent: parent, columnIndex: 0, rowIndex: index },
|
|
308
264
|
React.createElement("div", { className: "comment-virtualized-row", key: key, style: style }, renderCaseCommentElement(discussion))));
|
|
309
265
|
};
|
|
266
|
+
/**
|
|
267
|
+
* One-shot scroll override used after search/filter changes.
|
|
268
|
+
* Resets the virtualized list to the top, then yields control back to
|
|
269
|
+
* WindowScroller's default onChildScroll for subsequent scroll events.
|
|
270
|
+
*/
|
|
310
271
|
const customChildScroll = ({ scrollTop }) => {
|
|
311
272
|
var _a;
|
|
312
273
|
if (!canUpdateScrollTop) {
|
|
@@ -319,23 +280,25 @@ export default function CaseDiscussion(props) {
|
|
|
319
280
|
};
|
|
320
281
|
const handleScroll = ({ scrollTop }) => {
|
|
321
282
|
var _a, _b, _c, _d, _e, _f;
|
|
322
|
-
// here we are doing couple of things
|
|
323
|
-
// 1. check scroll position on the first comment, 2. set scrollposition as par window top
|
|
324
|
-
// 3. if user click on jump to comment button then select row as per commentid and adding css class.
|
|
325
283
|
isCommentSearchCleared && setIsCommentSearchCleared(false);
|
|
326
284
|
if (listRef && commentRef) {
|
|
285
|
+
// Skip one scroll cycle after a search/filter reset to let customChildScroll re-sync
|
|
327
286
|
if (!canUpdateScrollTop) {
|
|
328
287
|
setCanUpdateScrollTop(true);
|
|
329
288
|
return;
|
|
330
289
|
}
|
|
331
290
|
const commentTop = (_b = (_a = commentRef === null || commentRef === void 0 ? void 0 : commentRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.top;
|
|
291
|
+
// Re-apply search highlights on scroll since virtualized rows re-mount
|
|
332
292
|
!isEmpty(searchCommentText) && highlightSearchResults(searchCommentText);
|
|
293
|
+
// Normal browsing or comment section visible above viewport — sync list position
|
|
333
294
|
if (isEmpty(discussionIdFromUrl) || commentTop > 0) {
|
|
334
295
|
(_c = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _c === void 0 ? void 0 : _c.scrollToPosition(commentTop > 0 ? 0 : Math.abs(commentTop));
|
|
335
296
|
}
|
|
336
297
|
else if (commentTop < 0 && !isEmpty(discussionIdFromUrl) && !isJumpToCommentClicked) {
|
|
298
|
+
// Deep-link navigation: let WindowScroller drive the list scroll position
|
|
337
299
|
(_d = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _d === void 0 ? void 0 : _d.scrollToPosition(scrollTop);
|
|
338
300
|
}
|
|
301
|
+
// After a "jump to comment" click, scroll the virtualized list to the target row
|
|
339
302
|
if (isJumpToCommentClicked) {
|
|
340
303
|
(_e = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _e === void 0 ? void 0 : _e.scrollToRow(commentIndex);
|
|
341
304
|
(_f = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _f === void 0 ? void 0 : _f.updatePosition();
|
|
@@ -343,7 +306,6 @@ export default function CaseDiscussion(props) {
|
|
|
343
306
|
}
|
|
344
307
|
}
|
|
345
308
|
};
|
|
346
|
-
const list = discussionFiltersListState.filter((filter) => filter.canSee);
|
|
347
309
|
useEffect(() => {
|
|
348
310
|
if (isPostingRemoteRequestCommentCompleted) {
|
|
349
311
|
onCommentAdded();
|
|
@@ -351,64 +313,33 @@ export default function CaseDiscussion(props) {
|
|
|
351
313
|
}
|
|
352
314
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
353
315
|
}, [isPostingRemoteRequestCommentCompleted]);
|
|
354
|
-
const onToggleClick = (e) => {
|
|
355
|
-
e.stopPropagation();
|
|
356
|
-
setIsOpen(!isOpen);
|
|
357
|
-
};
|
|
358
316
|
const onSortToggleClick = (e) => {
|
|
359
317
|
e.stopPropagation();
|
|
360
318
|
setIsSortOpen(!isSortOpen);
|
|
361
319
|
};
|
|
362
|
-
const
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
: prevSelectedFiltersValue;
|
|
369
|
-
setFilter(dispatchDiscussion, newSelectedFilters, discussionFiltersListState);
|
|
370
|
-
shouldRenderRVComponent && setCanUpdateScrollTop(false);
|
|
371
|
-
setSelectedFilterItems(prevSelectedFiltersValue);
|
|
372
|
-
};
|
|
373
|
-
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true }, getDropdownBtnPlaceholder(t('Select a filter'), list.filter((i) => i.isSelected).map((i) => i.filterLabel), ' ', list.length, t('All comments'))));
|
|
374
|
-
const onSortSelect = (_event, selectedSort) => {
|
|
375
|
-
setSort(dispatchDiscussion, selectedSort, allDiscussions);
|
|
376
|
-
setSortSelected(selectedSort.value);
|
|
320
|
+
const onSortSelect = (_event, value) => {
|
|
321
|
+
const selectedSort = discussionSortOrderConst.find((option) => option.name === value);
|
|
322
|
+
if (selectedSort) {
|
|
323
|
+
setSort(dispatchDiscussion, selectedSort, allDiscussions);
|
|
324
|
+
setSortSelected(selectedSort.name);
|
|
325
|
+
}
|
|
377
326
|
setIsSortOpen(false);
|
|
378
327
|
};
|
|
379
328
|
const onSortToggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onSortToggleClick, isExpanded: isSortOpen, isFullWidth: true }, sort.name));
|
|
380
329
|
return (React.createElement(React.Fragment, null,
|
|
381
|
-
hasAsaComment && (React.createElement(Alert, { className: `asa-discussion-alert ${isExportingPDF ? 'hide-in-pdf' : ''}`, isInline: true, variant: "info", title: t('Important'), "data-tracking-id": "case-discussion-asa-notice" },
|
|
382
|
-
React.createElement(Trans, null,
|
|
383
|
-
"This feature uses AI technology to analyze interactions and provide you with support. Interactions may be used to improve Red Hat products or services. For more information about Red Hat's privacy practices, please refer to the",
|
|
384
|
-
' ',
|
|
385
|
-
React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" }, "Red Hat Privacy Statement")))),
|
|
386
330
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading post comment section') } },
|
|
387
331
|
React.createElement(AttachmentContextProvider, null,
|
|
388
|
-
React.createElement(PostComment, { caseNumber: caseNumber, allDiscussions: allDiscussions, onCommentAdded: onCommentAdded, onAttachmentAdded: onAttachmentAdded,
|
|
389
|
-
React.createElement(LoadingIndicator, {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
!caseAttachmentHydra.isFetching &&
|
|
394
|
-
!caseFeedbacksHydra.isFetching &&
|
|
395
|
-
!caseExternalTrackersUpdate.isFetching &&
|
|
396
|
-
!screenSessionRequested &&
|
|
397
|
-
allDiscussions.length === 0 && React.createElement(Trans, null, "No comments"),
|
|
398
|
-
!caseAttachmentHydra.isFetching &&
|
|
399
|
-
!caseFeedbacksHydra.isFetching &&
|
|
400
|
-
!caseExternalTrackersUpdate.isFetching &&
|
|
401
|
-
allDiscussions.length !== 0 && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading comments. Try refreshing.') } },
|
|
332
|
+
React.createElement(PostComment, { caseNumber: caseNumber, allDiscussions: allDiscussions, onCommentAdded: onCommentAdded, onAttachmentAdded: onAttachmentAdded, onAttachmentRemove: onAttachmentRemove, replyingToAuthor: replyingToAuthor, replyingToTimestamp: replyingToTimestamp, onClearReply: onClearReply }))),
|
|
333
|
+
props.commentsLoading && allDiscussions.length === 0 && React.createElement(LoadingIndicator, { size: "sm" }),
|
|
334
|
+
props.commentsError && allDiscussions.length === 0 && (React.createElement(AlertMessage, { variant: AlertType.DANGER, show: true, title: t('Failed to load comments. Try refreshing.') })),
|
|
335
|
+
!props.commentsLoading && !props.commentsError && allDiscussions.length === 0 && (React.createElement(Trans, null, "No comments")),
|
|
336
|
+
allDiscussions.length !== 0 && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading comments. Try refreshing.') } },
|
|
402
337
|
React.createElement("div", { className: `pfe-l-grid pfe-m-all-6-col pfe-m-gutters push-bottom ${isExportingPDF ? 'hide-in-pdf' : ''}` },
|
|
403
|
-
React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions:
|
|
404
|
-
React.createElement("span", { className: "push-top-narrow" },
|
|
405
|
-
React.createElement("label", { htmlFor: "case-list-comments-dropdown", className: "pf-v6-u-mb-sm" }, t('Filter by')),
|
|
406
|
-
React.createElement(Select, { "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", role: "menu", isOpen: isOpen, selected: selectedFilterItems, onSelect: onFilterSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
|
|
407
|
-
React.createElement(SelectList, null, list.map((option) => (React.createElement(SelectOption, { hasCheckbox: true, value: option, isSelected: option.isSelected, isDisabled: option.isDisabled }, option.filterLabel)))))),
|
|
338
|
+
React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions: allDiscussions || [], onCommentSearch: onCaseCommentSearch, isCommentSearchCleared: isCommentSearchCleared }))),
|
|
408
339
|
React.createElement("span", { className: "push-top-narrow" },
|
|
409
340
|
React.createElement("label", { htmlFor: "se-discussion-sort", className: "pf-v6-u-mb-sm" }, t('Sort by')),
|
|
410
341
|
React.createElement(Select, { id: "se-discussion-sort", "data-tracking-id": "discussions-sort-dropdown", isOpen: isSortOpen, selected: sortSelected, onSelect: onSortSelect, onOpenChange: (isSortOpen) => setIsSortOpen(isSortOpen), toggle: onSortToggle, shouldFocusToggleOnSelect: true, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
|
|
411
|
-
React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { value: option, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
|
|
342
|
+
React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { value: option.name, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
|
|
412
343
|
React.createElement("div", { className: "support-comment-section" }, !shouldRenderRVComponent &&
|
|
413
344
|
!isSearchResultEmpty &&
|
|
414
345
|
comuteSearchedComments.map((discussion, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentSearch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommentSearch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5F,UAAU,MAAM;IACZ,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA6G1C"}
|
|
@@ -46,18 +46,24 @@ export function CommentSearch(props) {
|
|
|
46
46
|
}
|
|
47
47
|
else if (discussion.discussionType === DiscussionType.ATTACHMENT) {
|
|
48
48
|
const caseAttachment = discussion.item;
|
|
49
|
-
const
|
|
49
|
+
const attachmentSizeBytes = caseAttachment.size > 0
|
|
50
|
+
? caseAttachment.size
|
|
51
|
+
: caseAttachment.sizeKB > 0
|
|
52
|
+
? caseAttachment.sizeKB * 1024
|
|
53
|
+
: 0;
|
|
54
|
+
const attachmentSizeText = attachmentSizeBytes > 0 ? humanizeSize(attachmentSizeBytes) : '';
|
|
55
|
+
const caseAttachmentText = `delete ${caseAttachment.modifiedBy} ${caseAttachment.description || ''} ${caseAttachment.lastModifiedDate} ${caseAttachment.checksum || ''} Attached file ${caseAttachment.fileName}${attachmentSizeText ? ` ${attachmentSizeText}` : ''} to this case.`;
|
|
50
56
|
searchApi.indexDocument(discussion.item.id, caseAttachmentText || '');
|
|
51
57
|
}
|
|
52
58
|
else if (discussion.discussionType === DiscussionType.CHAT) {
|
|
53
59
|
const caseChat = discussion.item;
|
|
54
60
|
const caseChatText = `Chat transcript ${caseChat.startTime} Between ${caseChat.agentName} and ${caseChat.visitorName} ${caseChat.body}`;
|
|
55
61
|
searchApi.indexDocument(discussion.item.id, caseChatText || '');
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const externalTracker = discussion.item;
|
|
59
|
-
const externalTrackerText = `${externalTracker.updateBy} ${externalTracker.createdDate} ${externalTracker.originatingSystem} ${externalTracker.body}`;
|
|
60
|
-
searchApi.indexDocument(discussion.item.id, externalTrackerText || '');
|
|
62
|
+
// TODO: Uncomment when External Trackers has a functioning GraphQL endpoint
|
|
63
|
+
// } else if (discussion.discussionType === DiscussionType.EXTERNAL_TRACKER) {
|
|
64
|
+
// const externalTracker = discussion.item as IExternalTrackerUpdate;
|
|
65
|
+
// const externalTrackerText = `${externalTracker.updateBy} ${externalTracker.createdDate} ${externalTracker.originatingSystem} ${externalTracker.body}`;
|
|
66
|
+
// searchApi.indexDocument(discussion.item.id, externalTrackerText || '');
|
|
61
67
|
}
|
|
62
68
|
});
|
|
63
69
|
try {
|
|
@@ -69,15 +75,22 @@ export function CommentSearch(props) {
|
|
|
69
75
|
}
|
|
70
76
|
});
|
|
71
77
|
const computeCommentFooter = (comment) => {
|
|
72
|
-
if (!comment.isPublic) {
|
|
78
|
+
if (!comment.isPublic && comment.createdBy === 'Automated Support Assistant') {
|
|
79
|
+
return 'Private automated comment';
|
|
80
|
+
}
|
|
81
|
+
else if (!comment.isPublic) {
|
|
73
82
|
return 'Private comment';
|
|
74
83
|
}
|
|
84
|
+
else if (comment.createdBy === 'Automated Support Assistant') {
|
|
85
|
+
return 'Automated comment';
|
|
86
|
+
}
|
|
75
87
|
};
|
|
76
88
|
props.isCommentSearchCleared && !isEmpty(searchValue) && setSearchValue('');
|
|
77
89
|
return (React.createElement("form", { onSubmit: handleSubmit },
|
|
78
90
|
React.createElement("div", { className: "case-comment-input-container", "data-tracking-id": "case-comment-search" },
|
|
79
|
-
React.createElement(
|
|
80
|
-
|
|
91
|
+
React.createElement("div", { className: "case-comment-search-input-wrapper" },
|
|
92
|
+
React.createElement(TextInput, { type: "search", value: searchValue, placeholder: t('Search for a comment'), id: "case-comment-search", "aria-label": t('Search for a comment'), onChange: (_event, value) => onSearchValChange(value), "data-tracking-id": "case-comment-search-input" }),
|
|
93
|
+
searchValue && (React.createElement(Button, { icon: React.createElement(TimesIcon, null), onClick: clearSearchVal, className: "clear-btn", variant: "plain", "data-tracking-id": "case-comment-search-clear-button", "aria-label": t('Clear this search') }))),
|
|
81
94
|
React.createElement(Button, { variant: "secondary", type: "submit", "data-tracking-id": "case-comment-search-button" },
|
|
82
95
|
React.createElement(Trans, null, "Search")))));
|
|
83
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscussionItemLink.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,UAAU,MAAM;IACZ,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"DiscussionItemLink.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,UAAU,MAAM;IACZ,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAClB;AAUD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAiC/C"}
|
|
@@ -7,7 +7,8 @@ const trackingIdMap = {
|
|
|
7
7
|
[DiscussionType.CHAT]: 'chatid-link',
|
|
8
8
|
[DiscussionType.ATTACHMENT]: 'attachmentid-link',
|
|
9
9
|
[DiscussionType.COMMENT]: 'public-private-comment-link',
|
|
10
|
-
|
|
10
|
+
// TODO: Uncomment when External Trackers has a functioning GraphQL endpoint
|
|
11
|
+
// [DiscussionType.EXTERNAL_TRACKER]: 'externaltrackerid-link',
|
|
11
12
|
};
|
|
12
13
|
export function DiscussionItemLink(props) {
|
|
13
14
|
const currentQuery = getUrlParsedParams(useLocation().search);
|
|
@@ -18,8 +19,14 @@ export function DiscussionItemLink(props) {
|
|
|
18
19
|
};
|
|
19
20
|
return getStringifiedParams(Object.assign(Object.assign({}, requiredQueries), newQueryObj));
|
|
20
21
|
};
|
|
22
|
+
const handleClick = (e) => {
|
|
23
|
+
if (props.isCopyLink) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
}
|
|
26
|
+
props.onClick();
|
|
27
|
+
};
|
|
21
28
|
return (React.createElement(Link, { replace: true, to: {
|
|
22
29
|
pathname: `/case/${props.caseNumber}/discussion`,
|
|
23
30
|
search: getQueryString(),
|
|
24
|
-
}, className: "case-public-private-link", onClick:
|
|
31
|
+
}, className: "case-public-private-link", onClick: handleClick, "data-tracking-id": `${!props.isCopyLink ? 'jumptocomment-' : 'case-'}${trackingIdMap[props.discussionType]}` }, props.children));
|
|
25
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JumpAndCopyLink.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAG/E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"JumpAndCopyLink.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAG/E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,CAAC;CAClC;AAQD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA+BrC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -4,13 +4,20 @@ import { useCopyToClipboard } from '@rh-support/components';
|
|
|
4
4
|
import React, { useRef } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { DiscussionItemLink } from './DiscussionItemLink';
|
|
7
|
+
function getAppBasePath() {
|
|
8
|
+
const path = window.location.pathname;
|
|
9
|
+
if (path.startsWith('/support-beta'))
|
|
10
|
+
return '/support-beta';
|
|
11
|
+
return '/support/cases';
|
|
12
|
+
}
|
|
7
13
|
function JumpAndCopyLink(props) {
|
|
8
14
|
const { t } = useTranslation();
|
|
9
15
|
const clipboardRefLink = useRef(null);
|
|
10
16
|
const queryString = `${props.discussionType}Id=${props.cardId}`;
|
|
17
|
+
const basePath = getAppBasePath();
|
|
11
18
|
const { clipboardText, copyToClipboard } = useCopyToClipboard(clipboardRefLink);
|
|
12
19
|
return (React.createElement(React.Fragment, null,
|
|
13
|
-
React.createElement("div", { ref: clipboardRefLink, style: { position: 'absolute', left: '-9999px' } }, `https://${window.location.host}
|
|
20
|
+
React.createElement("div", { ref: clipboardRefLink, style: { position: 'absolute', left: '-9999px' } }, `https://${window.location.host}${basePath}/#/case/${props.caseNumber}/discussion?${queryString}`),
|
|
14
21
|
React.createElement(DiscussionItemLink, { onClick: copyToClipboard, caseNumber: props.caseNumber, discussionType: props.discussionType, itemId: props.cardId, isCopyLink: true },
|
|
15
22
|
React.createElement(Popover, { position: PopoverPosition.top, bodyContent: (hide) => React.createElement("div", null, clipboardText), hasAutoWidth: true, showClose: false },
|
|
16
23
|
React.createElement(LinkIcon, { title: t('Copy link') })))));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Dispatch, MutableRefObject } from 'react';
|
|
2
|
+
import { ICaseDetailsState } from '../../../../../reducers/CaseConstNTypes';
|
|
3
|
+
interface UseAttachmentUploadCompletionParams {
|
|
4
|
+
isUploadingAttachments: boolean;
|
|
5
|
+
hasQueuedUploads: boolean;
|
|
6
|
+
hasAbortedOrFailed: boolean;
|
|
7
|
+
isUploadingAttachmentPrevious: MutableRefObject<boolean>;
|
|
8
|
+
batchSuccessCountRef: MutableRefObject<number>;
|
|
9
|
+
caseDispatch: Dispatch<any>;
|
|
10
|
+
apolloClient: {
|
|
11
|
+
query: (options: any) => Promise<any>;
|
|
12
|
+
mutate: (options: any) => Promise<any>;
|
|
13
|
+
};
|
|
14
|
+
caseNumber: string;
|
|
15
|
+
existingCaseDetails?: Partial<ICaseDetailsState>;
|
|
16
|
+
isInternal: boolean;
|
|
17
|
+
status: string | undefined;
|
|
18
|
+
resetAttachmentSection: () => void;
|
|
19
|
+
setCssCommentAgreed: (v: boolean) => void;
|
|
20
|
+
onAttachmentBatchAdded?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Batch cleanup after uploads settle.
|
|
24
|
+
* Per-file success toasts fire immediately; discussion list refresh runs once here
|
|
25
|
+
* when the batch finishes so we avoid N full list refetches for N files.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useAttachmentUploadCompletion({ isUploadingAttachments, hasQueuedUploads, hasAbortedOrFailed, isUploadingAttachmentPrevious, batchSuccessCountRef, caseDispatch, apolloClient, caseNumber, existingCaseDetails, isInternal, status, resetAttachmentSection, setCssCommentAgreed, onAttachmentBatchAdded, }: UseAttachmentUploadCompletionParams): void;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=useAttachmentUploadCompletion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAttachmentUploadCompletion.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,UAAU,mCAAmC;IACzC,sBAAsB,EAAE,OAAO,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,6BAA6B,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD,oBAAoB,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/C,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,YAAY,EAAE;QAAE,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;IAChG,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAC1C,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC7B,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,MAAM,EACN,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,GACzB,EAAE,mCAAmC,QAuBrC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { checkForCaseStatusToggleOnAttachOrComment } from '../../../../../reducers/CaseReducer';
|
|
3
|
+
/**
|
|
4
|
+
* Batch cleanup after uploads settle.
|
|
5
|
+
* Per-file success toasts fire immediately; discussion list refresh runs once here
|
|
6
|
+
* when the batch finishes so we avoid N full list refetches for N files.
|
|
7
|
+
*/
|
|
8
|
+
export function useAttachmentUploadCompletion({ isUploadingAttachments, hasQueuedUploads, hasAbortedOrFailed, isUploadingAttachmentPrevious, batchSuccessCountRef, caseDispatch, apolloClient, caseNumber, existingCaseDetails, isInternal, status, resetAttachmentSection, setCssCommentAgreed, onAttachmentBatchAdded, }) {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const justFinished = isUploadingAttachmentPrevious.current && !isUploadingAttachments && !hasQueuedUploads;
|
|
11
|
+
if (justFinished) {
|
|
12
|
+
if (batchSuccessCountRef.current > 0) {
|
|
13
|
+
batchSuccessCountRef.current = 0;
|
|
14
|
+
onAttachmentBatchAdded === null || onAttachmentBatchAdded === void 0 ? void 0 : onAttachmentBatchAdded();
|
|
15
|
+
}
|
|
16
|
+
if (!hasAbortedOrFailed) {
|
|
17
|
+
resetAttachmentSection();
|
|
18
|
+
}
|
|
19
|
+
void checkForCaseStatusToggleOnAttachOrComment(caseDispatch, isInternal, status, {
|
|
20
|
+
apolloClient,
|
|
21
|
+
caseNumber,
|
|
22
|
+
existingCaseDetails,
|
|
23
|
+
});
|
|
24
|
+
setCssCommentAgreed(false);
|
|
25
|
+
}
|
|
26
|
+
isUploadingAttachmentPrevious.current = isUploadingAttachments;
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
}, [isUploadingAttachments, hasQueuedUploads, hasAbortedOrFailed]);
|
|
29
|
+
}
|