@rh-support/troubleshoot 2.6.353 → 2.6.357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +76 -45
- 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 +23 -10
- 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 +132 -57
- 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 +1 -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 +13 -8
- 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 -271
- 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 +103 -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 +21 -13
- 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 +110 -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 +22 -3
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +15 -22
- 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 +5 -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 +16 -18
- 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 +5 -5
- 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/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/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +104 -62
- package/lib/esm/components/shared/Constants.d.ts +1 -0
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +1 -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 +21 -5
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +207 -34
- 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 +116 -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/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 +9 -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 +13 -10
- 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/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 +21 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +91 -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 +117 -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 +279 -99
- package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RecommendationsReducer.js +16 -19
- 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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { unescape } from 'lodash';
|
|
2
|
+
/**
|
|
3
|
+
* Decodes numeric (&#nn;) and hex (&#xHH;) HTML character references
|
|
4
|
+
* that lodash `unescape` does not handle.
|
|
5
|
+
*/
|
|
6
|
+
function decodeNumericEntities(text) {
|
|
7
|
+
return text
|
|
8
|
+
.replaceAll(/&#x([0-9a-fA-F]+);/g, (_, hex) => String.fromCodePoint(Number.parseInt(hex, 16)))
|
|
9
|
+
.replaceAll(/&#(\d+);/g, (_, dec) => String.fromCodePoint(Number.parseInt(dec, 10)));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The GraphQL API HTML-encodes comment bodies on storage/retrieval
|
|
13
|
+
* (e.g. > becomes >, & becomes &). Two-pass decode
|
|
14
|
+
* handles both single- and double-encoded entities, plus numeric refs.
|
|
15
|
+
*
|
|
16
|
+
* TODO: The double-encoding is a backend bug in the Salesforce UIAPI — it encodes on both
|
|
17
|
+
* write and read. Once the backend is fixed, replace with a single `unescape(text)` call.
|
|
18
|
+
*/
|
|
19
|
+
export function decodeHtmlEntities(text) {
|
|
20
|
+
let decoded = unescape(unescape(text));
|
|
21
|
+
decoded = decodeNumericEntities(decoded);
|
|
22
|
+
return decoded;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Derives the comment author type with priority: Associate > Customer.
|
|
26
|
+
* Falls back to 'Customer' when no flags match.
|
|
27
|
+
*/
|
|
28
|
+
export function deriveCreatedByType(isAssociate, isCustomer) {
|
|
29
|
+
if (isAssociate)
|
|
30
|
+
return 'Associate';
|
|
31
|
+
if (isCustomer)
|
|
32
|
+
return 'Customer';
|
|
33
|
+
return 'Customer';
|
|
34
|
+
}
|
|
35
|
+
export function deriveIsPublic(visibility) {
|
|
36
|
+
if (!visibility)
|
|
37
|
+
return false;
|
|
38
|
+
return visibility === 'Public';
|
|
39
|
+
}
|
|
40
|
+
export function mapVisibility(isPublic) {
|
|
41
|
+
return isPublic ? 'Public' : 'Private';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Converts a raw Salesforce CaseComment GraphQL node (with wrapped `{ value }` fields)
|
|
45
|
+
* into the flat ICaseComment interface expected by the discussion UI layer.
|
|
46
|
+
*/
|
|
47
|
+
export function mapCaseCommentNode(node) {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
49
|
+
const rawBody = (_b = (_a = node.Body__c) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
50
|
+
const body = decodeHtmlEntities(rawBody);
|
|
51
|
+
const visibility = (_d = (_c = node.Visibility__c) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null;
|
|
52
|
+
return {
|
|
53
|
+
id: node.Id,
|
|
54
|
+
commentBody: body,
|
|
55
|
+
createdBy: (_g = (_f = (_e = node.CreatedBy) === null || _e === void 0 ? void 0 : _e.Name) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : '',
|
|
56
|
+
createdByType: deriveCreatedByType(!!((_h = node.IsAssociate__c) === null || _h === void 0 ? void 0 : _h.value), !!((_j = node.IsCustomer__c) === null || _j === void 0 ? void 0 : _j.value)),
|
|
57
|
+
lastModifiedById: (_m = (_l = (_k = node.LastModifiedBy) === null || _k === void 0 ? void 0 : _k.Name) === null || _l === void 0 ? void 0 : _l.value) !== null && _m !== void 0 ? _m : '',
|
|
58
|
+
lastModifiedDate: (_p = (_o = node.LastModifiedDate) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : '',
|
|
59
|
+
createdDate: (_r = (_q = node.CreatedDate) === null || _q === void 0 ? void 0 : _q.value) !== null && _r !== void 0 ? _r : '',
|
|
60
|
+
visibility: visibility !== null && visibility !== void 0 ? visibility : undefined,
|
|
61
|
+
isPublic: deriveIsPublic(visibility),
|
|
62
|
+
contentType: 'markdown',
|
|
63
|
+
isDraft: false,
|
|
64
|
+
publishedDate: '',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function mapCaseCommentsResponse(data) {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
if (!data)
|
|
70
|
+
return [];
|
|
71
|
+
const edges = (_c = (_b = (_a = data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseComment__c) === null || _c === void 0 ? void 0 : _c.edges;
|
|
72
|
+
if (!edges)
|
|
73
|
+
return [];
|
|
74
|
+
return edges.map((edge) => mapCaseCommentNode(edge.node));
|
|
75
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export interface ISalesforceStringField {
|
|
2
|
+
value: string | null;
|
|
3
|
+
}
|
|
4
|
+
export interface ISalesforceBooleanField {
|
|
5
|
+
value: boolean | null;
|
|
6
|
+
}
|
|
7
|
+
export interface ISalesforcePicklistField {
|
|
8
|
+
value: string | null;
|
|
9
|
+
displayValue: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface ICaseCommentCreatedBy {
|
|
12
|
+
Name: ISalesforceStringField;
|
|
13
|
+
}
|
|
14
|
+
export interface ICaseCommentLastModifiedBy {
|
|
15
|
+
Name: ISalesforceStringField;
|
|
16
|
+
}
|
|
17
|
+
export interface ICaseCommentNode {
|
|
18
|
+
Id: string;
|
|
19
|
+
Name: ISalesforceStringField;
|
|
20
|
+
Body__c: ISalesforceStringField;
|
|
21
|
+
CreatedBy: ICaseCommentCreatedBy;
|
|
22
|
+
IsCustomer__c: ISalesforceBooleanField;
|
|
23
|
+
IsAssociate__c: ISalesforceBooleanField;
|
|
24
|
+
LastModifiedDate: ISalesforceStringField;
|
|
25
|
+
Visibility__c: ISalesforcePicklistField;
|
|
26
|
+
LastModifiedBy: ICaseCommentLastModifiedBy;
|
|
27
|
+
CreatedDate: ISalesforceStringField;
|
|
28
|
+
}
|
|
29
|
+
export interface ICaseCommentEdge {
|
|
30
|
+
node: ICaseCommentNode;
|
|
31
|
+
}
|
|
32
|
+
export interface ICaseCommentsConnection {
|
|
33
|
+
edges: ICaseCommentEdge[];
|
|
34
|
+
}
|
|
35
|
+
export interface IGetCaseCommentsQueryResponse {
|
|
36
|
+
redhat_support_uiapi: {
|
|
37
|
+
query: {
|
|
38
|
+
RedHatSupportCaseComment__c: ICaseCommentsConnection;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface ICaseCommentsFilter {
|
|
43
|
+
Case__c: {
|
|
44
|
+
eq: string;
|
|
45
|
+
};
|
|
46
|
+
Visibility__c?: {
|
|
47
|
+
eq: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface ICaseCommentsVariables {
|
|
51
|
+
filter: ICaseCommentsFilter;
|
|
52
|
+
orderBy?: Record<string, {
|
|
53
|
+
order: 'ASC' | 'DESC';
|
|
54
|
+
}>;
|
|
55
|
+
first?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface IUseCaseCommentsOptions {
|
|
58
|
+
caseId: string;
|
|
59
|
+
skip?: boolean;
|
|
60
|
+
orderBy?: Record<string, {
|
|
61
|
+
order: 'ASC' | 'DESC';
|
|
62
|
+
}>;
|
|
63
|
+
first?: number;
|
|
64
|
+
/** When true, only Public comments are fetched (external / customer users). */
|
|
65
|
+
publicOnly?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface ICreateCaseCommentInput {
|
|
68
|
+
Case__c: string;
|
|
69
|
+
Body__c: string;
|
|
70
|
+
Visibility__c: string;
|
|
71
|
+
IsAssociate__c?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface ICreateCaseCommentVariables {
|
|
74
|
+
commentInput: ICreateCaseCommentInput;
|
|
75
|
+
}
|
|
76
|
+
export interface ICreateCaseCommentResponse {
|
|
77
|
+
redhat_support_uiapi: {
|
|
78
|
+
CaseComment__cCreate: {
|
|
79
|
+
RedHatSupportRecord: {
|
|
80
|
+
Id: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,sBAAsB,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE,sBAAsB,CAAC;IAChC,SAAS,EAAE,qBAAqB,CAAC;IACjC,aAAa,EAAE,uBAAuB,CAAC;IACvC,cAAc,EAAE,uBAAuB,CAAC;IACxC,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,aAAa,EAAE,wBAAwB,CAAC;IACxC,cAAc,EAAE,0BAA0B,CAAC;IAC3C,WAAW,EAAE,sBAAsB,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC1C,oBAAoB,EAAE;QAClB,KAAK,EAAE;YACH,2BAA2B,EAAE,uBAAuB,CAAC;SACxD,CAAC;KACL,CAAC;CACL;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,aAAa,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IACxC,YAAY,EAAE,uBAAuB,CAAC;CACzC;AAED,MAAM,WAAW,0BAA0B;IACvC,oBAAoB,EAAE;QAClB,oBAAoB,EAAE;YAClB,mBAAmB,EAAE;gBACjB,EAAE,EAAE,MAAM,CAAC;aACd,CAAC;SACL,CAAC;KACL,CAAC;CACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
|
|
2
|
+
import { IUseCaseCommentsOptions } from './types';
|
|
3
|
+
interface IUseCaseCommentsReturn {
|
|
4
|
+
comments: ICaseComment[];
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: Error | undefined;
|
|
7
|
+
refetch: () => Promise<unknown>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Fetches case comments from the Salesforce GraphQL API for a given case ID.
|
|
11
|
+
* Supports custom sort ordering and pagination clamping (1–2000 records).
|
|
12
|
+
* External / customer users (no VIEW_PRIVATE_COMMENT) only receive Public comments.
|
|
13
|
+
* Returns mapped ICaseComment[] along with loading, error, and refetch handles.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCaseComments({ caseId, skip, orderBy, first, publicOnly, }: IUseCaseCommentsOptions): IUseCaseCommentsReturn;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=useCaseComments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseComments.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/useCaseComments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAOvE,OAAO,EAAuB,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvE,UAAU,sBAAsB;IAC5B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACnC;AAeD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC5B,MAAM,EACN,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,GACb,EAAE,uBAAuB,GAAG,sBAAsB,CAqBlD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client/react';
|
|
2
|
+
import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
3
|
+
import clamp from 'lodash/clamp';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { GET_CASE_COMMENTS } from './caseCommentsQuery';
|
|
6
|
+
import { mapCaseCommentsResponse } from './mapCaseComment';
|
|
7
|
+
const MAX_FIRST = 2000;
|
|
8
|
+
const MIN_FIRST = 1;
|
|
9
|
+
function buildCaseCommentsFilter(caseId, publicOnly) {
|
|
10
|
+
if (publicOnly) {
|
|
11
|
+
return {
|
|
12
|
+
Case__c: { eq: caseId },
|
|
13
|
+
Visibility__c: { eq: 'Public' },
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return { Case__c: { eq: caseId } };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fetches case comments from the Salesforce GraphQL API for a given case ID.
|
|
20
|
+
* Supports custom sort ordering and pagination clamping (1–2000 records).
|
|
21
|
+
* External / customer users (no VIEW_PRIVATE_COMMENT) only receive Public comments.
|
|
22
|
+
* Returns mapped ICaseComment[] along with loading, error, and refetch handles.
|
|
23
|
+
*/
|
|
24
|
+
export function useCaseComments({ caseId, skip, orderBy, first, publicOnly, }) {
|
|
25
|
+
const canSeePrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.VIEW_PRIVATE_COMMENT);
|
|
26
|
+
const shouldFilterPublicOnly = publicOnly !== null && publicOnly !== void 0 ? publicOnly : !canSeePrivateComments;
|
|
27
|
+
const { data, loading, error, refetch } = useQuery(GET_CASE_COMMENTS, {
|
|
28
|
+
variables: {
|
|
29
|
+
filter: buildCaseCommentsFilter(caseId, shouldFilterPublicOnly),
|
|
30
|
+
orderBy: orderBy !== null && orderBy !== void 0 ? orderBy : { LastModifiedDate: { order: 'DESC' } },
|
|
31
|
+
first: clamp(first !== null && first !== void 0 ? first : MAX_FIRST, MIN_FIRST, MAX_FIRST),
|
|
32
|
+
},
|
|
33
|
+
skip: skip || !caseId,
|
|
34
|
+
fetchPolicy: 'cache-and-network',
|
|
35
|
+
});
|
|
36
|
+
const comments = useMemo(() => mapCaseCommentsResponse(data), [data]);
|
|
37
|
+
return { comments, loading, error, refetch };
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface ICreateCaseCommentOptions {
|
|
2
|
+
caseId: string;
|
|
3
|
+
body: string;
|
|
4
|
+
isPublic?: boolean;
|
|
5
|
+
isAssociate?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface IUseCreateCaseCommentReturn {
|
|
8
|
+
createComment: (options: ICreateCaseCommentOptions) => Promise<unknown>;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: Error | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Wraps the CREATE_CASE_COMMENT GraphQL mutation.
|
|
14
|
+
* Returns a `createComment` callback that accepts caseId, body, visibility,
|
|
15
|
+
* and associate flag, along with the mutation's loading and error state.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useCreateCaseComment(): IUseCreateCaseCommentReturn;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=useCreateCaseComment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateCaseComment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/useCreateCaseComment.ts"],"names":[],"mappings":"AAKA,UAAU,yBAAyB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,2BAA2B;IACjC,aAAa,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,2BAA2B,CAiBlE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { useMutation } from '@apollo/client/react';
|
|
11
|
+
import { CREATE_CASE_COMMENT, sanitizeForSalesforce } from '@rh-support/utils';
|
|
12
|
+
import { mapVisibility } from './mapCaseComment';
|
|
13
|
+
/**
|
|
14
|
+
* Wraps the CREATE_CASE_COMMENT GraphQL mutation.
|
|
15
|
+
* Returns a `createComment` callback that accepts caseId, body, visibility,
|
|
16
|
+
* and associate flag, along with the mutation's loading and error state.
|
|
17
|
+
*/
|
|
18
|
+
export function useCreateCaseComment() {
|
|
19
|
+
const [mutate, { loading, error }] = useMutation(CREATE_CASE_COMMENT);
|
|
20
|
+
const createComment = (_a) => __awaiter(this, [_a], void 0, function* ({ caseId, body, isPublic = true, isAssociate = false }) {
|
|
21
|
+
return mutate({
|
|
22
|
+
variables: {
|
|
23
|
+
commentInput: {
|
|
24
|
+
Case__c: caseId,
|
|
25
|
+
Body__c: sanitizeForSalesforce(body),
|
|
26
|
+
Visibility__c: mapVisibility(isPublic),
|
|
27
|
+
IsAssociate__c: isAssociate,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return { createComment, loading, error };
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseGroupUiState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseGroupUiState.ts"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,QAElC;AAED,wBAAgB,qBAAqB,YAGpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import isEqual from 'lodash/isEqual';
|
|
2
|
+
import { useCaseSelector } from '../context/CaseContext';
|
|
3
|
+
import { getCaseGroupUiState } from '../reducers/CaseHelpers';
|
|
4
|
+
export function useCaseGroupUiState() {
|
|
5
|
+
return useCaseSelector((state) => getCaseGroupUiState(state), isEqual);
|
|
6
|
+
}
|
|
7
|
+
export function useShowCaseGroupField() {
|
|
8
|
+
const { shouldHideSelector, groupsLoaded } = useCaseGroupUiState();
|
|
9
|
+
return !shouldHideSelector || !groupsLoaded;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type TypedDocumentNode } from '@apollo/client';
|
|
2
|
+
import type { ICaseHistoryItem, IGetCaseHistoryData, IGetCaseHistoryVars } from '../models/caseHistory';
|
|
3
|
+
/**
|
|
4
|
+
* OldValue/NewValue use inline fragments with aliased fields (e.g. `stringValue: value`).
|
|
5
|
+
* These aliases produce the property names that `extractStringValue` checks against.
|
|
6
|
+
* Changing an alias here without updating `extractStringValue` will silently break
|
|
7
|
+
* value extraction.
|
|
8
|
+
*
|
|
9
|
+
* Supported value types (members of the RedHat_Support_AnyType union):
|
|
10
|
+
* - RedHatSupportStringValue → stringValue
|
|
11
|
+
* - RedHatSupportBooleanValue → booleanValue
|
|
12
|
+
* - RedHatSupportDoubleValue → doubleValue
|
|
13
|
+
* - RedHatSupportDateTimeValue → dateTimeValue
|
|
14
|
+
*
|
|
15
|
+
* `first` defaults to 2000 — a practical cap that covers all observed real-world case
|
|
16
|
+
* histories while staying well within the SF API limit.
|
|
17
|
+
*/
|
|
18
|
+
export declare const GET_CASE_HISTORY: TypedDocumentNode<IGetCaseHistoryData, IGetCaseHistoryVars>;
|
|
19
|
+
interface UseCaseHistoryResult {
|
|
20
|
+
historyItems: ICaseHistoryItem[];
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: Error | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare function useCaseHistory(caseId: string | undefined, first?: number): UseCaseHistoryResult;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=useCaseHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseHistory.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAO,MAAM,gBAAgB,CAAC;AAI7D,OAAO,KAAK,EAER,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,mBAAmB,CA6DxF,CAAC;AAEF,UAAU,oBAAoB;IAC1B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,SAAO,GAAG,oBAAoB,CAgB7F"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useQuery } from '@apollo/client/react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { filterSfdcIdEntries, normalizeNodeToHistoryItem } from '../utils/caseHistoryUtils';
|
|
5
|
+
/**
|
|
6
|
+
* OldValue/NewValue use inline fragments with aliased fields (e.g. `stringValue: value`).
|
|
7
|
+
* These aliases produce the property names that `extractStringValue` checks against.
|
|
8
|
+
* Changing an alias here without updating `extractStringValue` will silently break
|
|
9
|
+
* value extraction.
|
|
10
|
+
*
|
|
11
|
+
* Supported value types (members of the RedHat_Support_AnyType union):
|
|
12
|
+
* - RedHatSupportStringValue → stringValue
|
|
13
|
+
* - RedHatSupportBooleanValue → booleanValue
|
|
14
|
+
* - RedHatSupportDoubleValue → doubleValue
|
|
15
|
+
* - RedHatSupportDateTimeValue → dateTimeValue
|
|
16
|
+
*
|
|
17
|
+
* `first` defaults to 2000 — a practical cap that covers all observed real-world case
|
|
18
|
+
* histories while staying well within the SF API limit.
|
|
19
|
+
*/
|
|
20
|
+
export const GET_CASE_HISTORY = gql `
|
|
21
|
+
query GetCaseHistory($caseId: ID!, $first: Int = 2000) {
|
|
22
|
+
redhat_support_uiapi {
|
|
23
|
+
query {
|
|
24
|
+
RedHatSupportCaseHistory(first: $first, where: { CaseId: { eq: $caseId } }) {
|
|
25
|
+
edges {
|
|
26
|
+
node {
|
|
27
|
+
Id
|
|
28
|
+
RedHatSupportField {
|
|
29
|
+
value
|
|
30
|
+
displayValue
|
|
31
|
+
label
|
|
32
|
+
}
|
|
33
|
+
OldValue {
|
|
34
|
+
... on RedHatSupportStringValue {
|
|
35
|
+
stringValue: value
|
|
36
|
+
}
|
|
37
|
+
... on RedHatSupportBooleanValue {
|
|
38
|
+
booleanValue: value
|
|
39
|
+
}
|
|
40
|
+
... on RedHatSupportDoubleValue {
|
|
41
|
+
doubleValue: value
|
|
42
|
+
}
|
|
43
|
+
... on RedHatSupportDateTimeValue {
|
|
44
|
+
dateTimeValue: value
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
NewValue {
|
|
48
|
+
... on RedHatSupportStringValue {
|
|
49
|
+
stringValue: value
|
|
50
|
+
}
|
|
51
|
+
... on RedHatSupportBooleanValue {
|
|
52
|
+
booleanValue: value
|
|
53
|
+
}
|
|
54
|
+
... on RedHatSupportDoubleValue {
|
|
55
|
+
doubleValue: value
|
|
56
|
+
}
|
|
57
|
+
... on RedHatSupportDateTimeValue {
|
|
58
|
+
dateTimeValue: value
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
CreatedBy {
|
|
62
|
+
Name {
|
|
63
|
+
value
|
|
64
|
+
}
|
|
65
|
+
UserType {
|
|
66
|
+
value
|
|
67
|
+
}
|
|
68
|
+
SmallPhotoUrl {
|
|
69
|
+
value
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
CreatedDate {
|
|
73
|
+
value
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
export function useCaseHistory(caseId, first = 2000) {
|
|
83
|
+
const { data, loading, error } = useQuery(GET_CASE_HISTORY, {
|
|
84
|
+
variables: { caseId: caseId || '', first },
|
|
85
|
+
// Empty string = no case selected; skip avoids a wasted network request.
|
|
86
|
+
skip: !caseId,
|
|
87
|
+
// Shows cached data immediately while revalidating, avoiding a loading flash on re-visits.
|
|
88
|
+
fetchPolicy: 'cache-and-network',
|
|
89
|
+
});
|
|
90
|
+
const historyItems = useMemo(() => {
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
const edges = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseHistory) === null || _c === void 0 ? void 0 : _c.edges;
|
|
93
|
+
if (!edges)
|
|
94
|
+
return [];
|
|
95
|
+
return filterSfdcIdEntries(edges).map(normalizeNodeToHistoryItem);
|
|
96
|
+
}, [data]);
|
|
97
|
+
return { historyItems, loading, error };
|
|
98
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface LabelOption {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface LabelLink {
|
|
6
|
+
linkId: string;
|
|
7
|
+
labelId: string;
|
|
8
|
+
}
|
|
9
|
+
interface UseCaseLabelLinksResult {
|
|
10
|
+
availableLabels: LabelOption[];
|
|
11
|
+
assignedLinks: LabelLink[];
|
|
12
|
+
selectedLabelIds: string[];
|
|
13
|
+
loading: boolean;
|
|
14
|
+
mutating: boolean;
|
|
15
|
+
setAssignedLinks: React.Dispatch<React.SetStateAction<LabelLink[]>>;
|
|
16
|
+
createLink: (caseId: string, labelId: string) => Promise<string | undefined>;
|
|
17
|
+
deleteLink: (linkId: string) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function useCaseLabelLinks(salesforceAccountId?: string, caseId?: string): UseCaseLabelLinksResult;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useCaseLabelLinkMutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseLabelLinkMutations.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseLabelLinkMutations.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,uBAAuB;IAC7B,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7E,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,wBAAgB,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAgGxG"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { useApolloClient, useMutation } from '@apollo/client/react';
|
|
11
|
+
import { CREATE_CASE_LABEL_LINK, DELETE_CASE_LABEL_LINK, GET_CASE_LABEL_LINKS, GET_CASE_LABELS, } from '@rh-support/utils';
|
|
12
|
+
import unescape from 'lodash/unescape';
|
|
13
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
14
|
+
export function useCaseLabelLinks(salesforceAccountId, caseId) {
|
|
15
|
+
const client = useApolloClient();
|
|
16
|
+
const [availableLabels, setAvailableLabels] = useState([]);
|
|
17
|
+
const [assignedLinks, setAssignedLinks] = useState([]);
|
|
18
|
+
const [loading, setLoading] = useState(false);
|
|
19
|
+
const fetchData = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
21
|
+
if (!salesforceAccountId || !caseId)
|
|
22
|
+
return;
|
|
23
|
+
setLoading(true);
|
|
24
|
+
try {
|
|
25
|
+
const [labelsResult, linksResult] = yield Promise.all([
|
|
26
|
+
client.query({
|
|
27
|
+
query: GET_CASE_LABELS,
|
|
28
|
+
variables: { where: { Account__c: { eq: salesforceAccountId } } },
|
|
29
|
+
fetchPolicy: 'network-only',
|
|
30
|
+
}),
|
|
31
|
+
client.query({
|
|
32
|
+
query: GET_CASE_LABEL_LINKS,
|
|
33
|
+
variables: { where: { Case__c: { eq: caseId } } },
|
|
34
|
+
fetchPolicy: 'network-only',
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
37
|
+
const labelEdges = (_e = (_d = (_c = (_b = (_a = labelsResult.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportCaseLabel__c) === null || _d === void 0 ? void 0 : _d.edges) !== null && _e !== void 0 ? _e : [];
|
|
38
|
+
setAvailableLabels(labelEdges
|
|
39
|
+
.map(({ node }) => {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return ({
|
|
42
|
+
id: node.Id,
|
|
43
|
+
name: unescape((_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ''),
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
.filter((l) => l.id && l.name));
|
|
47
|
+
const linkEdges = (_k = (_j = (_h = (_g = (_f = linksResult.data) === null || _f === void 0 ? void 0 : _f.redhat_support_uiapi) === null || _g === void 0 ? void 0 : _g.query) === null || _h === void 0 ? void 0 : _h.RedHatSupportCaseLabelLink__c) === null || _j === void 0 ? void 0 : _j.edges) !== null && _k !== void 0 ? _k : [];
|
|
48
|
+
setAssignedLinks(linkEdges
|
|
49
|
+
.filter(({ node }) => { var _a; return node.Id && ((_a = node.Label__c) === null || _a === void 0 ? void 0 : _a.value); })
|
|
50
|
+
.map(({ node }) => ({
|
|
51
|
+
linkId: node.Id,
|
|
52
|
+
labelId: node.Label__c.value,
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
catch (_l) {
|
|
56
|
+
setAvailableLabels([]);
|
|
57
|
+
setAssignedLinks([]);
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
setLoading(false);
|
|
61
|
+
}
|
|
62
|
+
}), [client, salesforceAccountId, caseId]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
fetchData();
|
|
65
|
+
}, [fetchData]);
|
|
66
|
+
const [createMutate, { loading: createLoading }] = useMutation(CREATE_CASE_LABEL_LINK);
|
|
67
|
+
const createLink = useCallback((caseSfId, labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
var _a, _b, _c, _d;
|
|
69
|
+
const result = yield createMutate({
|
|
70
|
+
variables: {
|
|
71
|
+
input: { RedHatSupportCaseLabelLink__c: { Case__c: caseSfId, Label__c: labelId } },
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
return (_d = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.CaseLabelLink__cCreate) === null || _c === void 0 ? void 0 : _c.RedHatSupportRecord) === null || _d === void 0 ? void 0 : _d.Id;
|
|
75
|
+
}), [createMutate]);
|
|
76
|
+
const [deleteMutate, { loading: deleteLoading }] = useMutation(DELETE_CASE_LABEL_LINK);
|
|
77
|
+
const deleteLink = useCallback((linkId) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
yield deleteMutate({ variables: { id: linkId } });
|
|
79
|
+
}), [deleteMutate]);
|
|
80
|
+
const selectedLabelIds = assignedLinks.map((link) => link.labelId);
|
|
81
|
+
return {
|
|
82
|
+
availableLabels,
|
|
83
|
+
assignedLinks,
|
|
84
|
+
selectedLabelIds,
|
|
85
|
+
loading,
|
|
86
|
+
mutating: createLoading || deleteLoading,
|
|
87
|
+
setAssignedLinks,
|
|
88
|
+
createLink,
|
|
89
|
+
deleteLink,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCaseUpdateErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseUpdateErrorMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCaseUpdateErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseUpdateErrorMessage.ts"],"names":[],"mappings":"AAGA,wBAAgB,yBAAyB;yCAEE,MAAM;EAyBhD"}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import { formattedApiErrorMessage, ToastNotification } from '@rh-support/components';
|
|
1
|
+
import { formattedApiErrorMessage, getDirectErrorMessage, ToastNotification } from '@rh-support/components';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
// TO DO
|
|
4
3
|
export function useCaseUpdateErrorMessage() {
|
|
5
4
|
const { t } = useTranslation();
|
|
6
|
-
const showError = (e,
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
const showError = (e, fallbackMessage) => {
|
|
6
|
+
const errorCode = Number.parseInt((e === null || e === void 0 ? void 0 : e.code) || (e === null || e === void 0 ? void 0 : e.status)) || 0;
|
|
7
|
+
const hasSpecificHandler = errorCode === 500 || errorCode === 403;
|
|
8
|
+
if (hasSpecificHandler) {
|
|
9
|
+
const errorMessage = formattedApiErrorMessage(e, {
|
|
10
|
+
'500': { title: t('There was a problem with your request'), message: t(fallbackMessage) },
|
|
11
|
+
'403': {
|
|
12
|
+
title: t('There was a problem with your request'),
|
|
13
|
+
message: t('You are not authorized to update this case.'),
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
ToastNotification.addDangerMessage(errorMessage);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const directMessage = getDirectErrorMessage(e);
|
|
20
|
+
if (directMessage) {
|
|
21
|
+
ToastNotification.addDangerMessage(directMessage);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
ToastNotification.addDangerMessage(fallbackMessage);
|
|
15
25
|
};
|
|
16
26
|
return { showError };
|
|
17
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"AAcA,wBAAgB,kBAAkB;;EAsCjC"}
|