@rh-support/troubleshoot 2.6.361 → 2.6.364
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 +29 -19
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +17 -92
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +2 -6
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +32 -61
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +33 -60
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +9 -19
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +7 -28
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +57 -88
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +0 -2
- 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 +2 -3
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +11 -24
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +57 -92
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +109 -203
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +1 -0
- 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 +3 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +9 -5
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +17 -18
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +49 -55
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +46 -53
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +3 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +46 -52
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +17 -63
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +2 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +2 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +56 -131
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +6 -11
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.js +1 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +71 -111
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +10 -17
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +25 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +102 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +26 -42
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +4 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +148 -152
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -10
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +146 -252
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +9 -22
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +1 -8
- 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 +7 -18
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +3 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +271 -215
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +4 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +2 -7
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -36
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +230 -62
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +5 -4
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +8 -24
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -8
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +52 -38
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +62 -173
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +9 -10
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +31 -108
- 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 +5 -2
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +19 -33
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +24 -33
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +55 -36
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +8 -2
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +10 -13
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +10 -12
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -2
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +3 -20
- 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 +1 -0
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +32 -19
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +2 -4
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +2 -4
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +40 -34
- package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
- package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +4 -8
- package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
- package/lib/esm/components/EditDescription/EditDescription.js +2 -4
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +17 -23
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -37
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -9
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +3 -4
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +4 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +4 -1
- 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 +9 -3
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +8 -10
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +19 -25
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
- 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 +93 -141
- package/lib/esm/components/shared/Constants.d.ts +0 -5
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +0 -5
- 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 +3 -2
- package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/FileUploader.js +1 -3
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +0 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -4
- 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 +5 -22
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +59 -307
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +1 -5
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +1 -36
- package/lib/esm/components/shared/fileUpload/types/index.d.ts +1 -5
- 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 +47 -119
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +57 -22
- package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
- package/lib/esm/components/shared/usePostComment.js +28 -16
- package/lib/esm/components/shared/utils.d.ts +0 -1
- package/lib/esm/components/shared/utils.d.ts.map +1 -1
- package/lib/esm/components/shared/utils.js +3 -9
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +38 -178
- package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/MainSection.js +1 -2
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +4 -2
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +13 -12
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +0 -7
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +11 -14
- package/lib/esm/constants/caseDetailsConstants.d.ts +0 -5
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +0 -5
- package/lib/esm/context/CaseContext.d.ts.map +1 -1
- package/lib/esm/css/app.css +0 -28
- package/lib/esm/css/case.css +212 -209
- package/lib/esm/hooks/useAB.d.ts.map +1 -1
- package/lib/esm/hooks/useAB.js +23 -45
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -9
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseUpdateErrorMessage.js +11 -108
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +11 -18
- package/lib/esm/hooks/useS3Upload.d.ts +4 -5
- package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
- package/lib/esm/hooks/useS3Upload.js +30 -28
- 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 +0 -1
- package/lib/esm/models/cache.d.ts +2 -0
- package/lib/esm/models/cache.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +9 -123
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +7 -31
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -7
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +26 -58
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +12 -12
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +73 -88
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -11
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +17 -119
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
- package/lib/esm/reducers/CaseReducer.d.ts +11 -56
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +100 -284
- package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RecommendationsReducer.js +18 -15
- package/lib/esm/scss/_main.scss +0 -9
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +2 -1
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
- package/package.json +8 -10
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +0 -8
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +0 -18
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -10
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -31
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -29
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -29
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -62
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts +0 -3
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +0 -1
- package/lib/esm/components/CaseInformation/CaseLabels.js +0 -108
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +0 -4
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +0 -1
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +0 -141
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +0 -3
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +0 -1
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +0 -9
- package/lib/esm/graphql/index.d.ts +0 -4
- package/lib/esm/graphql/index.d.ts.map +0 -1
- package/lib/esm/graphql/index.js +0 -3
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
- package/lib/esm/graphql/mutations/index.d.ts +0 -2
- package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
- package/lib/esm/graphql/mutations/index.js +0 -1
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
- package/lib/esm/graphql/queries/getEscalationDetails.js +0 -36
- package/lib/esm/graphql/queries/index.d.ts +0 -2
- package/lib/esm/graphql/queries/index.d.ts.map +0 -1
- package/lib/esm/graphql/queries/index.js +0 -1
- package/lib/esm/graphql/schemas/escalation.d.ts +0 -66
- package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
- package/lib/esm/graphql/schemas/escalation.js +0 -1
- package/lib/esm/graphql/schemas/index.d.ts +0 -2
- package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
- package/lib/esm/graphql/schemas/index.js +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -57
- package/lib/esm/hooks/useCaseComments/index.d.ts +0 -8
- package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/index.js +0 -5
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -75
- package/lib/esm/hooks/useCaseComments/types.d.ts +0 -93
- package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/types.js +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -26
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -113
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
- package/lib/esm/hooks/useCaseGroupUiState.d.ts +0 -3
- package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseGroupUiState.js +0 -10
- package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
- package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseHistory.js +0 -107
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +0 -23
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +0 -84
- package/lib/esm/models/caseHistory.d.ts +0 -86
- package/lib/esm/models/caseHistory.d.ts.map +0 -1
- package/lib/esm/models/caseHistory.js +0 -1
- package/lib/esm/utils/TimelineUtils.d.ts +0 -41
- package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
- package/lib/esm/utils/TimelineUtils.js +0 -135
- package/lib/esm/utils/caseHistoryUtils.d.ts +0 -85
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
- package/lib/esm/utils/caseHistoryUtils.js +0 -196
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +0 -6
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +0 -1
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +0 -26
- package/lib/esm/utils/linkifyHtmlTextNodes.d.ts +0 -8
- package/lib/esm/utils/linkifyHtmlTextNodes.d.ts.map +0 -1
- package/lib/esm/utils/linkifyHtmlTextNodes.js +0 -37
|
@@ -1,93 +0,0 @@
|
|
|
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 IPageInfo {
|
|
33
|
-
hasNextPage: boolean;
|
|
34
|
-
endCursor: string | null;
|
|
35
|
-
}
|
|
36
|
-
export interface ICaseCommentsConnection {
|
|
37
|
-
edges: ICaseCommentEdge[];
|
|
38
|
-
pageInfo?: IPageInfo;
|
|
39
|
-
}
|
|
40
|
-
export interface IGetCaseCommentsQueryResponse {
|
|
41
|
-
redhat_support_uiapi: {
|
|
42
|
-
query: {
|
|
43
|
-
RedHatSupportCaseComment__c: ICaseCommentsConnection;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export interface ICaseCommentsFilter {
|
|
48
|
-
Case__c: {
|
|
49
|
-
eq: string;
|
|
50
|
-
};
|
|
51
|
-
Visibility__c?: {
|
|
52
|
-
eq: string;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export interface ICaseCommentsVariables {
|
|
56
|
-
filter: ICaseCommentsFilter;
|
|
57
|
-
orderBy?: Record<string, {
|
|
58
|
-
order: 'ASC' | 'DESC';
|
|
59
|
-
}>;
|
|
60
|
-
first?: number;
|
|
61
|
-
after?: string;
|
|
62
|
-
}
|
|
63
|
-
export interface IUseCaseCommentsOptions {
|
|
64
|
-
caseId: string;
|
|
65
|
-
skip?: boolean;
|
|
66
|
-
orderBy?: Record<string, {
|
|
67
|
-
order: 'ASC' | 'DESC';
|
|
68
|
-
}>;
|
|
69
|
-
first?: number;
|
|
70
|
-
/** When true, only Public comments are fetched (external / customer users). */
|
|
71
|
-
publicOnly?: boolean;
|
|
72
|
-
/** Cursor for pagination — pass to resume from a previous page. */
|
|
73
|
-
after?: string;
|
|
74
|
-
}
|
|
75
|
-
export interface ICreateCaseCommentInput {
|
|
76
|
-
Case__c: string;
|
|
77
|
-
Body__c: string;
|
|
78
|
-
Visibility__c: string;
|
|
79
|
-
IsAssociate__c?: boolean;
|
|
80
|
-
}
|
|
81
|
-
export interface ICreateCaseCommentVariables {
|
|
82
|
-
commentInput: ICreateCaseCommentInput;
|
|
83
|
-
}
|
|
84
|
-
export interface ICreateCaseCommentResponse {
|
|
85
|
-
redhat_support_uiapi: {
|
|
86
|
-
CaseComment__cCreate: {
|
|
87
|
-
RedHatSupportRecord: {
|
|
88
|
-
Id: string;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,SAAS;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;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;IACf,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;IACrB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
|
|
2
|
-
import { IUseCaseCommentsOptions } from './types';
|
|
3
|
-
export interface IUseCaseCommentsReturn {
|
|
4
|
-
comments: ICaseComment[];
|
|
5
|
-
loading: boolean;
|
|
6
|
-
error: Error | undefined;
|
|
7
|
-
refetch: () => Promise<unknown>;
|
|
8
|
-
fetchMore: () => Promise<unknown>;
|
|
9
|
-
hasNextPage: boolean;
|
|
10
|
-
isLoadingMore: boolean;
|
|
11
|
-
loadMoreError: boolean;
|
|
12
|
-
loadMoreRetryCount: number;
|
|
13
|
-
retryLoadMore: () => Promise<unknown>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Fetches case comments from the Salesforce GraphQL API for a given case ID.
|
|
17
|
-
* Supports custom sort ordering and pagination clamping (1–2000 records).
|
|
18
|
-
* External / customer users (no VIEW_PRIVATE_COMMENT) only receive Public comments.
|
|
19
|
-
* Returns mapped ICaseComment[] along with loading, error, and refetch handles.
|
|
20
|
-
*
|
|
21
|
-
* Pagination uses Apollo's fetchMore; pages accumulate in the cache via
|
|
22
|
-
* relayStylePagination. nextFetchPolicy returns 'cache-first' after the first
|
|
23
|
-
* result so cache-and-network does not refetch and overwrite merged pages.
|
|
24
|
-
*/
|
|
25
|
-
export declare function useCaseComments({ caseId, skip, orderBy, first, publicOnly, after, }: IUseCaseCommentsOptions): IUseCaseCommentsReturn;
|
|
26
|
-
//# sourceMappingURL=useCaseComments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCaseComments.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/useCaseComments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAOvE,OAAO,EAAuB,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACnC,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;IAChC,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC;AAgBD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAC5B,MAAM,EACN,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,KAAK,GACR,EAAE,uBAAuB,GAAG,sBAAsB,CA4GlD"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { NetworkStatus } from '@apollo/client/core';
|
|
2
|
-
import { useQuery } from '@apollo/client/react';
|
|
3
|
-
import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
4
|
-
import clamp from 'lodash/clamp';
|
|
5
|
-
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
|
-
import { GET_CASE_COMMENTS } from './caseCommentsQuery';
|
|
7
|
-
import { mapCaseCommentsResponse } from './mapCaseComment';
|
|
8
|
-
const MAX_FIRST = 2000;
|
|
9
|
-
const MIN_FIRST = 1;
|
|
10
|
-
const DEFAULT_PAGE_SIZE = 20;
|
|
11
|
-
function buildCaseCommentsFilter(caseId, publicOnly) {
|
|
12
|
-
if (publicOnly) {
|
|
13
|
-
return {
|
|
14
|
-
Case__c: { eq: caseId },
|
|
15
|
-
Visibility__c: { eq: 'Public' },
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return { Case__c: { eq: caseId } };
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Fetches case comments from the Salesforce GraphQL API for a given case ID.
|
|
22
|
-
* Supports custom sort ordering and pagination clamping (1–2000 records).
|
|
23
|
-
* External / customer users (no VIEW_PRIVATE_COMMENT) only receive Public comments.
|
|
24
|
-
* Returns mapped ICaseComment[] along with loading, error, and refetch handles.
|
|
25
|
-
*
|
|
26
|
-
* Pagination uses Apollo's fetchMore; pages accumulate in the cache via
|
|
27
|
-
* relayStylePagination. nextFetchPolicy returns 'cache-first' after the first
|
|
28
|
-
* result so cache-and-network does not refetch and overwrite merged pages.
|
|
29
|
-
*/
|
|
30
|
-
export function useCaseComments({ caseId, skip, orderBy, first, publicOnly, after, }) {
|
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
32
|
-
const canSeePrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.VIEW_PRIVATE_COMMENT);
|
|
33
|
-
const shouldFilterPublicOnly = publicOnly !== null && publicOnly !== void 0 ? publicOnly : !canSeePrivateComments;
|
|
34
|
-
const clampedFirst = clamp(first !== null && first !== void 0 ? first : DEFAULT_PAGE_SIZE, MIN_FIRST, MAX_FIRST);
|
|
35
|
-
const { data, loading, error, refetch, fetchMore: apolloFetchMore, networkStatus, } = useQuery(GET_CASE_COMMENTS, {
|
|
36
|
-
variables: Object.assign({ filter: buildCaseCommentsFilter(caseId, shouldFilterPublicOnly), orderBy: orderBy !== null && orderBy !== void 0 ? orderBy : { LastModifiedDate: { order: 'DESC' } }, first: clampedFirst }, (after ? { after } : {})),
|
|
37
|
-
skip: skip || !caseId,
|
|
38
|
-
fetchPolicy: 'cache-and-network',
|
|
39
|
-
nextFetchPolicy(_currentFetchPolicy, { reason }) {
|
|
40
|
-
if (reason === 'variables-changed') {
|
|
41
|
-
return 'cache-and-network';
|
|
42
|
-
}
|
|
43
|
-
return 'cache-first';
|
|
44
|
-
},
|
|
45
|
-
notifyOnNetworkStatusChange: true,
|
|
46
|
-
});
|
|
47
|
-
const [loadMoreError, setLoadMoreError] = useState(false);
|
|
48
|
-
const [loadMoreRetryCount, setLoadMoreRetryCount] = useState(0);
|
|
49
|
-
const fetchLockRef = useRef(false);
|
|
50
|
-
const pageInfo = (_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.RedHatSupportCaseComment__c) === null || _c === void 0 ? void 0 : _c.pageInfo;
|
|
51
|
-
const hasNextPage = (_d = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.hasNextPage) !== null && _d !== void 0 ? _d : false;
|
|
52
|
-
const endCursor = (_e = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.endCursor) !== null && _e !== void 0 ? _e : null;
|
|
53
|
-
const isLoadingMore = networkStatus === NetworkStatus.fetchMore;
|
|
54
|
-
const comments = useMemo(() => mapCaseCommentsResponse(data), [data]);
|
|
55
|
-
// DEBUG: track every render of the hook
|
|
56
|
-
const edgeCount = (_k = (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _f === void 0 ? void 0 : _f.query) === null || _g === void 0 ? void 0 : _g.RedHatSupportCaseComment__c) === null || _h === void 0 ? void 0 : _h.edges) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0;
|
|
57
|
-
console.log('[useCaseComments] render', {
|
|
58
|
-
networkStatus,
|
|
59
|
-
loading,
|
|
60
|
-
isLoadingMore,
|
|
61
|
-
hasNextPage,
|
|
62
|
-
endCursor: endCursor === null || endCursor === void 0 ? void 0 : endCursor.slice(0, 20),
|
|
63
|
-
edgeCount,
|
|
64
|
-
commentsMapped: comments.length,
|
|
65
|
-
fetchLocked: fetchLockRef.current,
|
|
66
|
-
});
|
|
67
|
-
const fetchMore = useCallback(() => {
|
|
68
|
-
if (fetchLockRef.current || !hasNextPage || !endCursor) {
|
|
69
|
-
console.log('[useCaseComments] fetchMore SKIPPED', {
|
|
70
|
-
fetchLocked: fetchLockRef.current,
|
|
71
|
-
hasNextPage,
|
|
72
|
-
endCursor: !!endCursor,
|
|
73
|
-
});
|
|
74
|
-
return Promise.resolve();
|
|
75
|
-
}
|
|
76
|
-
fetchLockRef.current = true;
|
|
77
|
-
setLoadMoreError(false);
|
|
78
|
-
console.log('[useCaseComments] fetchMore START', { endCursor: endCursor === null || endCursor === void 0 ? void 0 : endCursor.slice(0, 20) });
|
|
79
|
-
return apolloFetchMore({
|
|
80
|
-
variables: { after: endCursor },
|
|
81
|
-
})
|
|
82
|
-
.then(() => {
|
|
83
|
-
console.log('[useCaseComments] fetchMore SUCCESS');
|
|
84
|
-
setLoadMoreRetryCount(0);
|
|
85
|
-
setLoadMoreError(false);
|
|
86
|
-
})
|
|
87
|
-
.catch((err) => {
|
|
88
|
-
console.log('[useCaseComments] fetchMore ERROR', err === null || err === void 0 ? void 0 : err.message);
|
|
89
|
-
setLoadMoreError(true);
|
|
90
|
-
setLoadMoreRetryCount((prev) => prev + 1);
|
|
91
|
-
})
|
|
92
|
-
.finally(() => {
|
|
93
|
-
fetchLockRef.current = false;
|
|
94
|
-
});
|
|
95
|
-
}, [hasNextPage, endCursor, apolloFetchMore]);
|
|
96
|
-
const retryLoadMore = useCallback(() => {
|
|
97
|
-
setLoadMoreError(false);
|
|
98
|
-
fetchLockRef.current = false;
|
|
99
|
-
return fetchMore();
|
|
100
|
-
}, [fetchMore]);
|
|
101
|
-
return {
|
|
102
|
-
comments,
|
|
103
|
-
loading,
|
|
104
|
-
error,
|
|
105
|
-
refetch,
|
|
106
|
-
fetchMore,
|
|
107
|
-
hasNextPage,
|
|
108
|
-
isLoadingMore,
|
|
109
|
-
loadMoreError,
|
|
110
|
-
loadMoreRetryCount,
|
|
111
|
-
retryLoadMore,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCaseGroupUiState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseGroupUiState.ts"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,QAElC;AAED,wBAAgB,qBAAqB,YAGpC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type TypedDocumentNode } from '@apollo/client';
|
|
2
|
-
import type { CaseHistorySortOrder, 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, isViewerInternal?: boolean, sortOrder?: CaseHistorySortOrder, first?: number): UseCaseHistoryResult;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=useCaseHistory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EACR,oBAAoB,EAEpB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,mBAAmB,CAiExF,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,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,gBAAgB,UAAO,EACvB,SAAS,GAAE,oBAA6B,EACxC,KAAK,SAAO,GACb,oBAAoB,CAqBtB"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { useQuery } from '@apollo/client/react';
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { filterInternalOnlyEntries, 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(
|
|
22
|
-
$caseId: ID!
|
|
23
|
-
$first: Int = 2000
|
|
24
|
-
$orderBy: RedHatSupportCaseHistory_OrderBy = { CreatedDate: { order: DESC } }
|
|
25
|
-
) {
|
|
26
|
-
redhat_support_uiapi {
|
|
27
|
-
query {
|
|
28
|
-
RedHatSupportCaseHistory(first: $first, where: { CaseId: { eq: $caseId } }, orderBy: $orderBy) {
|
|
29
|
-
edges {
|
|
30
|
-
node {
|
|
31
|
-
Id
|
|
32
|
-
RedHatSupportField {
|
|
33
|
-
value
|
|
34
|
-
displayValue
|
|
35
|
-
label
|
|
36
|
-
}
|
|
37
|
-
OldValue {
|
|
38
|
-
... on RedHatSupportStringValue {
|
|
39
|
-
stringValue: value
|
|
40
|
-
}
|
|
41
|
-
... on RedHatSupportBooleanValue {
|
|
42
|
-
booleanValue: value
|
|
43
|
-
}
|
|
44
|
-
... on RedHatSupportDoubleValue {
|
|
45
|
-
doubleValue: value
|
|
46
|
-
}
|
|
47
|
-
... on RedHatSupportDateTimeValue {
|
|
48
|
-
dateTimeValue: value
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
NewValue {
|
|
52
|
-
... on RedHatSupportStringValue {
|
|
53
|
-
stringValue: value
|
|
54
|
-
}
|
|
55
|
-
... on RedHatSupportBooleanValue {
|
|
56
|
-
booleanValue: value
|
|
57
|
-
}
|
|
58
|
-
... on RedHatSupportDoubleValue {
|
|
59
|
-
doubleValue: value
|
|
60
|
-
}
|
|
61
|
-
... on RedHatSupportDateTimeValue {
|
|
62
|
-
dateTimeValue: value
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
CreatedBy {
|
|
66
|
-
Name {
|
|
67
|
-
value
|
|
68
|
-
}
|
|
69
|
-
UserType {
|
|
70
|
-
value
|
|
71
|
-
}
|
|
72
|
-
SmallPhotoUrl {
|
|
73
|
-
value
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
CreatedDate {
|
|
77
|
-
value
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
86
|
-
export function useCaseHistory(caseId, isViewerInternal = true, sortOrder = 'DESC', first = 2000) {
|
|
87
|
-
const { data, loading, error } = useQuery(GET_CASE_HISTORY, {
|
|
88
|
-
variables: {
|
|
89
|
-
caseId: caseId || '',
|
|
90
|
-
first,
|
|
91
|
-
orderBy: { CreatedDate: { order: sortOrder } },
|
|
92
|
-
},
|
|
93
|
-
// Empty string = no case selected; skip avoids a wasted network request.
|
|
94
|
-
skip: !caseId,
|
|
95
|
-
// Shows cached data immediately while revalidating, avoiding a loading flash on re-visits.
|
|
96
|
-
fetchPolicy: 'cache-and-network',
|
|
97
|
-
});
|
|
98
|
-
const historyItems = useMemo(() => {
|
|
99
|
-
var _a, _b, _c;
|
|
100
|
-
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;
|
|
101
|
-
if (!edges)
|
|
102
|
-
return [];
|
|
103
|
-
const normalized = filterSfdcIdEntries(edges).map(normalizeNodeToHistoryItem);
|
|
104
|
-
return isViewerInternal ? normalized : filterInternalOnlyEntries(normalized);
|
|
105
|
-
}, [data, isViewerInternal]);
|
|
106
|
-
return { historyItems, loading, error };
|
|
107
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
error: Error | undefined;
|
|
15
|
-
mutating: boolean;
|
|
16
|
-
setAssignedLinks: React.Dispatch<React.SetStateAction<LabelLink[]>>;
|
|
17
|
-
createLink: (caseId: string, labelId: string) => Promise<string | undefined>;
|
|
18
|
-
deleteLink: (linkId: string) => Promise<void>;
|
|
19
|
-
refetch: () => Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
export declare function useCaseLabelLinks(salesforceAccountId?: string, caseId?: string): UseCaseLabelLinksResult;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=useCaseLabelLinkMutations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCaseLabelLinkMutations.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseLabelLinkMutations.ts"],"names":[],"mappings":"AAeA,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;AAOD,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,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,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;IAC9C,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,wBAAgB,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAoFxG"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { useApolloClient, useMutation } from '@apollo/client/react';
|
|
11
|
-
import { CREATE_CASE_LABEL_LINK, DELETE_CASE_LABEL_LINK, fetchAllAccountCaseLabels, fetchAllCaseLabelLinksForCase, } from '@rh-support/utils';
|
|
12
|
-
import unescape from 'lodash/unescape';
|
|
13
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
14
|
-
const mapCaseLabelNode = (node) => {
|
|
15
|
-
var _a, _b;
|
|
16
|
-
return ({
|
|
17
|
-
id: node.Id,
|
|
18
|
-
name: unescape((_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ''),
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export function useCaseLabelLinks(salesforceAccountId, caseId) {
|
|
22
|
-
const client = useApolloClient();
|
|
23
|
-
const [availableLabels, setAvailableLabels] = useState([]);
|
|
24
|
-
const [assignedLinks, setAssignedLinks] = useState([]);
|
|
25
|
-
const [loading, setLoading] = useState(false);
|
|
26
|
-
const [error, setError] = useState(undefined);
|
|
27
|
-
const fetchData = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
if (!salesforceAccountId || !caseId)
|
|
29
|
-
return;
|
|
30
|
-
setLoading(true);
|
|
31
|
-
setError(undefined);
|
|
32
|
-
try {
|
|
33
|
-
const [labelNodes, linkNodes] = yield Promise.all([
|
|
34
|
-
fetchAllAccountCaseLabels(client, salesforceAccountId),
|
|
35
|
-
fetchAllCaseLabelLinksForCase(client, caseId),
|
|
36
|
-
]);
|
|
37
|
-
setAvailableLabels(labelNodes.map(mapCaseLabelNode).filter((l) => l.id && l.name));
|
|
38
|
-
setAssignedLinks(linkNodes
|
|
39
|
-
.filter((node) => { var _a; return node.Id && ((_a = node.Label__c) === null || _a === void 0 ? void 0 : _a.value); })
|
|
40
|
-
.map((node) => ({
|
|
41
|
-
linkId: node.Id,
|
|
42
|
-
labelId: node.Label__c.value,
|
|
43
|
-
})));
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
setError(e);
|
|
47
|
-
setAvailableLabels([]);
|
|
48
|
-
setAssignedLinks([]);
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
setLoading(false);
|
|
52
|
-
}
|
|
53
|
-
}), [client, salesforceAccountId, caseId]);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
fetchData();
|
|
56
|
-
}, [fetchData]);
|
|
57
|
-
const [createMutate, { loading: createLoading }] = useMutation(CREATE_CASE_LABEL_LINK);
|
|
58
|
-
const createLink = useCallback((caseSfId, labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
var _a, _b, _c, _d;
|
|
60
|
-
const result = yield createMutate({
|
|
61
|
-
variables: {
|
|
62
|
-
input: { RedHatSupportCaseLabelLink__c: { Case__c: caseSfId, Label__c: labelId } },
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
return (_d = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.CaseLabelLink__cCreate) === null || _c === void 0 ? void 0 : _c.RedHatSupportRecord) === null || _d === void 0 ? void 0 : _d.Id;
|
|
66
|
-
}), [createMutate]);
|
|
67
|
-
const [deleteMutate, { loading: deleteLoading }] = useMutation(DELETE_CASE_LABEL_LINK);
|
|
68
|
-
const deleteLink = useCallback((linkId) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
yield deleteMutate({ variables: { id: linkId } });
|
|
70
|
-
}), [deleteMutate]);
|
|
71
|
-
const selectedLabelIds = assignedLinks.map((link) => link.labelId);
|
|
72
|
-
return {
|
|
73
|
-
availableLabels,
|
|
74
|
-
assignedLinks,
|
|
75
|
-
selectedLabelIds,
|
|
76
|
-
loading,
|
|
77
|
-
error,
|
|
78
|
-
mutating: createLoading || deleteLoading,
|
|
79
|
-
setAssignedLinks,
|
|
80
|
-
createLink,
|
|
81
|
-
deleteLink,
|
|
82
|
-
refetch: fetchData,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export interface ISFStringValue {
|
|
2
|
-
stringValue: string;
|
|
3
|
-
}
|
|
4
|
-
export interface ISFBooleanValue {
|
|
5
|
-
booleanValue: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface ISFDoubleValue {
|
|
8
|
-
doubleValue: number;
|
|
9
|
-
}
|
|
10
|
-
export interface ISFDateTimeValue {
|
|
11
|
-
dateTimeValue: string;
|
|
12
|
-
}
|
|
13
|
-
export type SFValue = ISFStringValue | ISFBooleanValue | ISFDoubleValue | ISFDateTimeValue | null;
|
|
14
|
-
export interface ICaseHistoryNode {
|
|
15
|
-
Id: string;
|
|
16
|
-
RedHatSupportField: {
|
|
17
|
-
value: string;
|
|
18
|
-
displayValue: string | null;
|
|
19
|
-
label: string | null;
|
|
20
|
-
};
|
|
21
|
-
OldValue: SFValue;
|
|
22
|
-
NewValue: SFValue;
|
|
23
|
-
CreatedBy: {
|
|
24
|
-
Name: {
|
|
25
|
-
value: string;
|
|
26
|
-
};
|
|
27
|
-
UserType: {
|
|
28
|
-
value: string;
|
|
29
|
-
} | null;
|
|
30
|
-
SmallPhotoUrl: {
|
|
31
|
-
value: string | null;
|
|
32
|
-
} | null;
|
|
33
|
-
};
|
|
34
|
-
CreatedDate: {
|
|
35
|
-
value: string;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export interface ICaseHistoryEdge {
|
|
39
|
-
node: ICaseHistoryNode;
|
|
40
|
-
}
|
|
41
|
-
export interface IGetCaseHistoryData {
|
|
42
|
-
redhat_support_uiapi: {
|
|
43
|
-
query: {
|
|
44
|
-
RedHatSupportCaseHistory: {
|
|
45
|
-
edges: ICaseHistoryEdge[];
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export type CaseHistorySortOrder = 'ASC' | 'DESC';
|
|
51
|
-
export interface IGetCaseHistoryVars {
|
|
52
|
-
caseId: string;
|
|
53
|
-
first?: number;
|
|
54
|
-
orderBy?: {
|
|
55
|
-
CreatedDate: {
|
|
56
|
-
order: CaseHistorySortOrder;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Normalized representation of a single Salesforce case history entry.
|
|
62
|
-
*
|
|
63
|
-
* Discriminated on `type`:
|
|
64
|
-
* - `'Action'` — lifecycle events (created, closed, owner transfer) where no field
|
|
65
|
-
* value changed. `outputText` contains the human-readable sentence.
|
|
66
|
-
* - `'Change'` — field-value mutations. `outputText` is empty; the Timeline layer
|
|
67
|
-
* formats display text via `applyReplacements` / `handleFieldChange`.
|
|
68
|
-
*/
|
|
69
|
-
export interface ICaseHistoryItem {
|
|
70
|
-
id: string;
|
|
71
|
-
/** Raw Salesforce API field name (e.g. `Status`, `Case_Language__c`, `created`). */
|
|
72
|
-
fieldName: string;
|
|
73
|
-
/** Resolved human-readable label for the field (from FIELD_NAME_DISPLAY_MAP, SF label, or displayValue). */
|
|
74
|
-
displayName: string;
|
|
75
|
-
label: string | null;
|
|
76
|
-
oldValue: string | null;
|
|
77
|
-
newValue: string | null;
|
|
78
|
-
createdDate: string;
|
|
79
|
-
createdByUserName: string;
|
|
80
|
-
createdByCustomer: boolean;
|
|
81
|
-
photoUrl: string | null;
|
|
82
|
-
type: 'Action' | 'Change';
|
|
83
|
-
/** Pre-built sentence for Action items (e.g. "created the case"); empty for Change items. */
|
|
84
|
-
outputText: string;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=caseHistory.d.ts.map
|