@rh-support/troubleshoot 2.6.340 → 2.6.349
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 +16 -91
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +1 -1
- 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 +10 -39
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +4 -15
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +55 -82
- 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 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +45 -76
- 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 +47 -51
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +44 -49
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +45 -51
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +10 -21
- 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 +2 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +2 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +57 -132
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +4 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +58 -93
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
- 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 +91 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +33 -78
- 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 +153 -122
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +137 -74
- 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 +263 -211
- 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 +1 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
- 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 +5 -18
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
- 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 +57 -123
- 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 +30 -107
- package/lib/esm/components/CaseInformation/Description.js +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.js +7 -10
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +1 -2
- 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.js +2 -2
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +7 -8
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +9 -11
- 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 -22
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -9
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +18 -13
- 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 +3 -8
- 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 +18 -16
- 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.js +2 -2
- 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 +16 -20
- 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 +62 -135
- 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.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +2 -2
- 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 -21
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +34 -210
- 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 -4
- 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 -116
- 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 -160
- 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 +12 -11
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -11
- 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/case.css +202 -60
- 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 +11 -21
- 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 -121
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +7 -30
- 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 -11
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +70 -63
- package/lib/esm/reducers/CaseHelpers.d.ts +2 -3
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +15 -98
- 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 -50
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +99 -270
- 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 -9
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +0 -7
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +0 -17
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -4
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -23
- 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 -60
- 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 -103
- 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 -109
- 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 -31
- package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
- package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
- package/lib/esm/graphql/queries/getParentId.js +0 -16
- package/lib/esm/graphql/queries/index.d.ts +0 -3
- package/lib/esm/graphql/queries/index.d.ts.map +0 -1
- package/lib/esm/graphql/queries/index.js +0 -2
- package/lib/esm/graphql/schemas/escalation.d.ts +0 -88
- 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 -52
- package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
- 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 -85
- 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 -17
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -38
- 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/useCaseHistory.d.ts +0 -26
- package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseHistory.js +0 -98
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +0 -21
- 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 -80
- 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 -66
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
- package/lib/esm/utils/caseHistoryUtils.js +0 -165
|
@@ -76,19 +76,6 @@ export const recommandationsReducer = (state, action) => {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
const dispatchReceivedRecommendations = (dispatch, response, page_size) => {
|
|
80
|
-
var _a;
|
|
81
|
-
const highlightedDocs = replaceHighlightingData(response.response.docs, response.highlighting);
|
|
82
|
-
const docs = uniqueRecommendationDocs(highlightedDocs);
|
|
83
|
-
dispatch({
|
|
84
|
-
type: RecommendationsConstants.receivedRecommendations,
|
|
85
|
-
payload: {
|
|
86
|
-
allDocs: docs,
|
|
87
|
-
visibleDocs: docs.slice(0, page_size),
|
|
88
|
-
numFound: Math.max(0, ((_a = response.response.numFound) !== null && _a !== void 0 ? _a : docs.length) - (highlightedDocs.length - docs.length)),
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
79
|
// Actions
|
|
93
80
|
export const fetchRecommendations = (dispatch_1, body_1, max_rows_1, page_size_1, highlighted_fragment_size_1, ...args_1) => __awaiter(void 0, [dispatch_1, body_1, max_rows_1, page_size_1, highlighted_fragment_size_1, ...args_1], void 0, function* (dispatch, body, max_rows, page_size, highlighted_fragment_size, seQueryFields = false, caseNumber, isSecureSupportAccount, additionalFilters, abortSignal) {
|
|
94
81
|
dispatch({
|
|
@@ -104,7 +91,15 @@ export const fetchRecommendations = (dispatch_1, body_1, max_rows_1, page_size_1
|
|
|
104
91
|
const response = yield search.getRecommendationsForCase(body, Object.assign(Object.assign({}, searchParams), { caseNumber,
|
|
105
92
|
isSecureSupportAccount }), // Need to pass caseNumber and isSecureSupportAccount flag with SOLR parameter which will be used in service worker strategy.
|
|
106
93
|
abortSignal);
|
|
107
|
-
|
|
94
|
+
const docs = uniqueRecommendationDocs(replaceHighlightingData(response.response.docs, response.highlighting));
|
|
95
|
+
dispatch({
|
|
96
|
+
type: RecommendationsConstants.receivedRecommendations,
|
|
97
|
+
payload: {
|
|
98
|
+
allDocs: docs,
|
|
99
|
+
visibleDocs: docs.slice(0, page_size),
|
|
100
|
+
numFound: docs.length,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
108
103
|
}
|
|
109
104
|
catch (error) {
|
|
110
105
|
dispatch({ type: RecommendationsConstants.receivedRecommendationsError });
|
|
@@ -123,7 +118,15 @@ export const fetchWatsonXRecommendations = (dispatch_1, query_1, max_rows_1, pag
|
|
|
123
118
|
description: getTrimmedCharacters(query.description, WATSONX_DESCRIPTION_LIMIT),
|
|
124
119
|
};
|
|
125
120
|
const response = yield search.getWatsonXRecommendationsForCase2(convertObjToEncodedQueryParams(Object.assign({ rerank: true }, getSolrParams(max_rows, highlighted_fragment_size, additionalFilters, seQueryFields))), bodyPayload, abortSignal);
|
|
126
|
-
|
|
121
|
+
const docs = uniqueRecommendationDocs(replaceHighlightingData(response.response.docs, response.highlighting));
|
|
122
|
+
dispatch({
|
|
123
|
+
type: RecommendationsConstants.receivedRecommendations,
|
|
124
|
+
payload: {
|
|
125
|
+
allDocs: docs,
|
|
126
|
+
visibleDocs: docs.slice(0, page_size),
|
|
127
|
+
numFound: docs.length,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
127
130
|
}
|
|
128
131
|
catch (error) {
|
|
129
132
|
dispatch({ type: RecommendationsConstants.receivedRecommendationsError });
|
package/lib/esm/scss/_main.scss
CHANGED
|
@@ -605,15 +605,6 @@ div.support-grid-case-details.support-case {
|
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
.post-comment-reply-banner {
|
|
609
|
-
display: flex;
|
|
610
|
-
align-items: center;
|
|
611
|
-
justify-content: space-between;
|
|
612
|
-
padding: var(--pf-t--global--spacer--xs) var(--pf-t--global--spacer--sm);
|
|
613
|
-
background: var(--pf-t--global--background--color--secondary--default);
|
|
614
|
-
border-radius: var(--pf-t--global--border--radius--small);
|
|
615
|
-
}
|
|
616
|
-
|
|
617
608
|
.text-danger {
|
|
618
609
|
color: #c9190b !important;
|
|
619
610
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IClusterSubscription } from '@cee-eng/hydrajs/@types/models/cloud';
|
|
2
|
+
import { ISEProduct } from '@cee-eng/hydrajs/@types/models/product';
|
|
2
3
|
export interface IClusterSubscriptionExtended extends IClusterSubscription {
|
|
3
4
|
openshift_version: string;
|
|
4
5
|
}
|
|
5
6
|
export declare const getDisplayNameForCluster: (cluster: Partial<IClusterSubscriptionExtended>) => string;
|
|
6
7
|
export declare const invalidGuidHelperText = "Please enter a valid Cluster ID (For example: d3aa88e2-c754-41e0-8ba6-4198a34aa0a2)";
|
|
7
|
-
export declare const isClusterIdEnabledForProduct: (selectedProduct: string) => boolean;
|
|
8
|
+
export declare const isClusterIdEnabledForProduct: (selectedProduct: string, allProducts: Partial<ISEProduct>[]) => boolean;
|
|
8
9
|
export declare const getIsClusterIdInvalid: (openshiftClusterID: any) => boolean;
|
|
9
10
|
//# sourceMappingURL=caseOpenshiftClusterIdUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseOpenshiftClusterIdUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseOpenshiftClusterIdUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"caseOpenshiftClusterIdUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseOpenshiftClusterIdUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAIpE,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACtE,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB,GAAI,SAAS,OAAO,CAAC,4BAA4B,CAAC,WAKtF,CAAC;AAEF,eAAO,MAAM,qBAAqB,wFACuD,CAAC;AAE1F,eAAO,MAAM,4BAA4B,GAAI,iBAAiB,MAAM,EAAE,aAAa,OAAO,CAAC,UAAU,CAAC,EAAE,YAIvG,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,uBAAkB,YACY,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isValidGuid } from '@rh-support/utils';
|
|
2
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import { CLUSTER_ID_ENABLED_PRODUCTS } from '../reducers/CaseConstNTypes';
|
|
4
3
|
export const getDisplayNameForCluster = (cluster) => {
|
|
5
4
|
if (isEmpty(cluster))
|
|
6
5
|
return '';
|
|
@@ -10,9 +9,10 @@ export const getDisplayNameForCluster = (cluster) => {
|
|
|
10
9
|
return `${clusterId} <${cluster.display_name}>`;
|
|
11
10
|
};
|
|
12
11
|
export const invalidGuidHelperText = 'Please enter a valid Cluster ID (For example: d3aa88e2-c754-41e0-8ba6-4198a34aa0a2)';
|
|
13
|
-
export const isClusterIdEnabledForProduct = (selectedProduct) => {
|
|
14
|
-
|
|
12
|
+
export const isClusterIdEnabledForProduct = (selectedProduct, allProducts) => {
|
|
13
|
+
const productDetails = (allProducts || []).find((product) => product.name === selectedProduct);
|
|
14
|
+
if (isEmpty(productDetails))
|
|
15
15
|
return false;
|
|
16
|
-
return
|
|
16
|
+
return productDetails.openShiftClusterIdRelevantInCases;
|
|
17
17
|
};
|
|
18
18
|
export const getIsClusterIdInvalid = (openshiftClusterID) => !isEmpty(openshiftClusterID) && !isValidGuid(openshiftClusterID);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.349",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"lib/**/*"
|
|
22
22
|
],
|
|
23
23
|
"peerDependencies": {
|
|
24
|
+
"@cee-eng/hydrajs": "4.18.111",
|
|
24
25
|
"@cee-eng/ui-toolkit": "1.1.9",
|
|
25
26
|
"@patternfly/patternfly": "6.2.1",
|
|
26
27
|
"@patternfly/react-core": "6.2.1",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"react-virtualized": "^9.22.5"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@cee-eng/hydrajs": "
|
|
46
|
+
"@cee-eng/hydrajs": "4.18.111",
|
|
46
47
|
"@cee-eng/ui-toolkit": "1.1.9",
|
|
47
48
|
"@ifd-ui/ask-redhat-core": "^0.0.61",
|
|
48
49
|
"@patternfly/patternfly": "6.2.1",
|
|
@@ -52,11 +53,11 @@
|
|
|
52
53
|
"@progress/kendo-licensing": "1.3.5",
|
|
53
54
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
54
55
|
"@redux-devtools/extension": "^3.3.0",
|
|
55
|
-
"@rh-support/components": "2.5.
|
|
56
|
-
"@rh-support/react-context": "2.5.
|
|
56
|
+
"@rh-support/components": "2.5.222",
|
|
57
|
+
"@rh-support/react-context": "2.5.318",
|
|
57
58
|
"@rh-support/types": "2.0.26",
|
|
58
|
-
"@rh-support/user-permissions": "2.5.
|
|
59
|
-
"@rh-support/utils": "2.5.
|
|
59
|
+
"@rh-support/user-permissions": "2.5.170",
|
|
60
|
+
"@rh-support/utils": "2.5.149",
|
|
60
61
|
"@types/react-redux": "^7.1.33",
|
|
61
62
|
"@types/redux": "^3.6.0",
|
|
62
63
|
"date-fns": "3.6.0",
|
|
@@ -84,8 +85,6 @@
|
|
|
84
85
|
"timers": "^0.1.1"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
87
|
-
"@patternfly/react-styles": "^6.2.1",
|
|
88
|
-
"@patternfly/react-tokens": "^6.2.1",
|
|
89
88
|
"@testing-library/dom": "^10.4.0",
|
|
90
89
|
"@testing-library/jest-dom": "^6.2.0",
|
|
91
90
|
"@testing-library/react": "^14.1.2",
|
|
@@ -128,5 +127,5 @@
|
|
|
128
127
|
"defaults and supports es6-module",
|
|
129
128
|
"maintained node versions"
|
|
130
129
|
],
|
|
131
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "cc1c26280084d477ee0abcec8d46963c8213b783"
|
|
132
131
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArchivedCaseBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/ArchivedCaseBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,uBAAuB;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,uBAAuB,qBAmBzE"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Alert, AlertVariant } from '@patternfly/react-core';
|
|
2
|
-
import { isCaseArchivedStatus } from '@rh-support/utils';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Trans } from 'react-i18next';
|
|
5
|
-
export function ArchivedCaseBanner({ caseStatus }) {
|
|
6
|
-
if (!isCaseArchivedStatus(caseStatus)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
return (React.createElement(Alert, { className: "pf-v6-u-mb-md", isInline: true, variant: AlertVariant.info, title: React.createElement(Trans, null,
|
|
10
|
-
"This case is archived and read-only. If you need further assistance,",
|
|
11
|
-
' ',
|
|
12
|
-
React.createElement("a", { href: "/support/contact/" }, "contact us"),
|
|
13
|
-
" or",
|
|
14
|
-
' ',
|
|
15
|
-
React.createElement("a", { href: "/support/cases/#/troubleshoot" }, "open a new case"),
|
|
16
|
-
".") }));
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remoteSessionUtils.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAEtD,eAAO,MAAM,0BAA0B,GAAI,YAAY,MAAM,KAAG,MAa/D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,KAAG,MAOxD,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const REMOTE_SESSION_FIELD_LENGTH_LIMIT = 2000;
|
|
2
|
-
export const getLocaleNameFromLocalCode = (localeCode) => {
|
|
3
|
-
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
4
|
-
try {
|
|
5
|
-
const [lang, locale] = localeCode.includes('_') ? localeCode.split('_') : localeCode.split('-');
|
|
6
|
-
// https://github.com/microsoft/TypeScript/issues/41338
|
|
7
|
-
const langName = new Intl.DisplayNames([lang], { type: 'language' });
|
|
8
|
-
const regionNamesInLang = new Intl.DisplayNames([lang], { type: 'region' });
|
|
9
|
-
return `${regionNamesInLang.of(locale)} (${langName.of(lang)})`;
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
return localeCode;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return localeCode;
|
|
16
|
-
};
|
|
17
|
-
export const formatSessionLinks = (sessionLink) => {
|
|
18
|
-
const links = sessionLink
|
|
19
|
-
.split(/[;,| \n\r\t]+/)
|
|
20
|
-
.map((link) => link.trim())
|
|
21
|
-
.filter(Boolean);
|
|
22
|
-
return links.map((link) => `<a href="${link}">${link}</a>`).join('<br>');
|
|
23
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Dispatch, MutableRefObject } from 'react';
|
|
2
|
-
import { ICaseDetailsState } from '../../../../../reducers/CaseConstNTypes';
|
|
3
|
-
interface UseAttachmentUploadCompletionParams {
|
|
4
|
-
isUploadingAttachments: boolean;
|
|
5
|
-
hasQueuedUploads: boolean;
|
|
6
|
-
hasAbortedOrFailed: boolean;
|
|
7
|
-
isUploadingAttachmentPrevious: MutableRefObject<boolean>;
|
|
8
|
-
batchSuccessCountRef: MutableRefObject<number>;
|
|
9
|
-
caseDispatch: Dispatch<any>;
|
|
10
|
-
apolloClient: {
|
|
11
|
-
query: (options: any) => Promise<any>;
|
|
12
|
-
mutate: (options: any) => Promise<any>;
|
|
13
|
-
};
|
|
14
|
-
caseNumber: string;
|
|
15
|
-
existingCaseDetails?: Partial<ICaseDetailsState>;
|
|
16
|
-
isInternal: boolean;
|
|
17
|
-
status: string | undefined;
|
|
18
|
-
resetAttachmentSection: () => void;
|
|
19
|
-
setCssCommentAgreed: (v: boolean) => void;
|
|
20
|
-
onAttachmentBatchAdded?: () => void;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Batch cleanup after uploads settle.
|
|
24
|
-
* Per-file success toasts fire immediately; discussion list refresh runs once here
|
|
25
|
-
* when the batch finishes so we avoid N full list refetches for N files.
|
|
26
|
-
*/
|
|
27
|
-
export declare function useAttachmentUploadCompletion({ isUploadingAttachments, hasQueuedUploads, hasAbortedOrFailed, isUploadingAttachmentPrevious, batchSuccessCountRef, caseDispatch, apolloClient, caseNumber, existingCaseDetails, isInternal, status, resetAttachmentSection, setCssCommentAgreed, onAttachmentBatchAdded, }: UseAttachmentUploadCompletionParams): void;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=useAttachmentUploadCompletion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentUploadCompletion.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,UAAU,mCAAmC;IACzC,sBAAsB,EAAE,OAAO,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,6BAA6B,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD,oBAAoB,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/C,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,YAAY,EAAE;QAAE,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;IAChG,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAC1C,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC7B,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,MAAM,EACN,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,GACzB,EAAE,mCAAmC,QAuBrC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { checkForCaseStatusToggleOnAttachOrComment } from '../../../../../reducers/CaseReducer';
|
|
3
|
-
/**
|
|
4
|
-
* Batch cleanup after uploads settle.
|
|
5
|
-
* Per-file success toasts fire immediately; discussion list refresh runs once here
|
|
6
|
-
* when the batch finishes so we avoid N full list refetches for N files.
|
|
7
|
-
*/
|
|
8
|
-
export function useAttachmentUploadCompletion({ isUploadingAttachments, hasQueuedUploads, hasAbortedOrFailed, isUploadingAttachmentPrevious, batchSuccessCountRef, caseDispatch, apolloClient, caseNumber, existingCaseDetails, isInternal, status, resetAttachmentSection, setCssCommentAgreed, onAttachmentBatchAdded, }) {
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const justFinished = isUploadingAttachmentPrevious.current && !isUploadingAttachments && !hasQueuedUploads;
|
|
11
|
-
if (justFinished) {
|
|
12
|
-
if (batchSuccessCountRef.current > 0) {
|
|
13
|
-
batchSuccessCountRef.current = 0;
|
|
14
|
-
onAttachmentBatchAdded === null || onAttachmentBatchAdded === void 0 ? void 0 : onAttachmentBatchAdded();
|
|
15
|
-
}
|
|
16
|
-
if (!hasAbortedOrFailed) {
|
|
17
|
-
resetAttachmentSection();
|
|
18
|
-
}
|
|
19
|
-
void checkForCaseStatusToggleOnAttachOrComment(caseDispatch, isInternal, status, {
|
|
20
|
-
apolloClient,
|
|
21
|
-
caseNumber,
|
|
22
|
-
existingCaseDetails,
|
|
23
|
-
});
|
|
24
|
-
setCssCommentAgreed(false);
|
|
25
|
-
}
|
|
26
|
-
isUploadingAttachmentPrevious.current = isUploadingAttachments;
|
|
27
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
-
}, [isUploadingAttachments, hasQueuedUploads, hasAbortedOrFailed]);
|
|
29
|
-
}
|
package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
interface UseCommentDraftsParams {
|
|
3
|
-
caseNumber: string;
|
|
4
|
-
loggedInUserSSO: string;
|
|
5
|
-
isInternal: boolean;
|
|
6
|
-
commentSignature: string;
|
|
7
|
-
canPostPrivateComments: boolean;
|
|
8
|
-
setCommentText: Dispatch<SetStateAction<string>>;
|
|
9
|
-
setIsPublic: Dispatch<SetStateAction<boolean>>;
|
|
10
|
-
applySignature: (text: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function useCommentDrafts({ caseNumber, loggedInUserSSO, isInternal, commentSignature, canPostPrivateComments, setCommentText, setIsPublic, applySignature, }: UseCommentDraftsParams): {
|
|
13
|
-
saveDraft: (...args: any[]) => void;
|
|
14
|
-
clearDraft: () => Promise<void>;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=useCommentDrafts.d.ts.map
|
package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCommentDrafts.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAsB,MAAM,OAAO,CAAC;AAMrE,UAAU,sBAAsB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,OAAO,CAAC;IAChC,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,UAAU,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,WAAW,EACX,cAAc,GACjB,EAAE,sBAAsB;;;EA4DxB"}
|
|
@@ -1,60 +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 { debounce } from '@patternfly/react-core';
|
|
11
|
-
import { useEffect, useMemo } from 'react';
|
|
12
|
-
import { CaseDetailsCacheNamespaces } from '../../../../../enums/cache';
|
|
13
|
-
import { CaseDetailsCacheUtils } from '../../../../../utils/caseDetailsCacheUtils';
|
|
14
|
-
export function useCommentDrafts({ caseNumber, loggedInUserSSO, isInternal, commentSignature, canPostPrivateComments, setCommentText, setIsPublic, applySignature, }) {
|
|
15
|
-
const saveDraft = useMemo(() => debounce(function (value, publicFlag) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const div = document.createElement('div');
|
|
18
|
-
div.innerHTML = value;
|
|
19
|
-
const plainText = (div.textContent || '').trim();
|
|
20
|
-
if (!plainText || plainText === commentSignature) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const { value: prevDraftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO)) || {};
|
|
24
|
-
prevDraftComments[caseNumber] = { text: value, privateFlag: !(publicFlag !== null && publicFlag !== void 0 ? publicFlag : true) };
|
|
25
|
-
CaseDetailsCacheUtils.set(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO, {
|
|
26
|
-
value: prevDraftComments,
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}, 500), [caseNumber, commentSignature, loggedInUserSSO]);
|
|
30
|
-
const clearDraft = () => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const { value: prevDraftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO)) || {};
|
|
32
|
-
delete prevDraftComments[caseNumber];
|
|
33
|
-
CaseDetailsCacheUtils.set(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO, {
|
|
34
|
-
value: prevDraftComments,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
function loadDraft() {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
var _a;
|
|
41
|
-
const { value: draftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO)) || {};
|
|
42
|
-
const draft = draftComments[caseNumber];
|
|
43
|
-
if (!((_a = draft === null || draft === void 0 ? void 0 : draft.text) === null || _a === void 0 ? void 0 : _a.trim()))
|
|
44
|
-
return;
|
|
45
|
-
// Legacy guard: old drafts stored as plain text without HTML tags
|
|
46
|
-
let draftText = draft.text;
|
|
47
|
-
if (!/<[a-z][\s\S]*>/i.test(draftText)) {
|
|
48
|
-
draftText = `<p>${draftText}</p>`;
|
|
49
|
-
}
|
|
50
|
-
setCommentText(draftText);
|
|
51
|
-
applySignature(draftText);
|
|
52
|
-
if (draft.privateFlag && canPostPrivateComments)
|
|
53
|
-
setIsPublic(false);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
loadDraft();
|
|
57
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
|
-
}, [commentSignature]);
|
|
59
|
-
return { saveDraft, clearDraft };
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseLabels.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseLabels.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAWzD,MAAM,CAAC,OAAO,UAAU,UAAU,sBAmLjC"}
|
|
@@ -1,103 +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 { Label, MenuToggle, Select, SelectList, SelectOption, Spinner, } from '@patternfly/react-core';
|
|
11
|
-
import { ToastNotification } from '@rh-support/components';
|
|
12
|
-
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
|
-
import isEqual from 'lodash/isEqual';
|
|
14
|
-
import React, { useContext, useState } from 'react';
|
|
15
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
16
|
-
import { Link } from 'react-router-dom';
|
|
17
|
-
import { useCaseSelector } from '../../context/CaseContext';
|
|
18
|
-
import { useCaseLabelLinks } from '../../hooks/useCaseLabelLinkMutations';
|
|
19
|
-
const NUM_VISIBLE_LABELS = 3;
|
|
20
|
-
export default function CaseLabels() {
|
|
21
|
-
const { t } = useTranslation();
|
|
22
|
-
const canEditCase = useCanEditCase();
|
|
23
|
-
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
24
|
-
const isOrgAdmin = loggedInUser.data.isOrgAdmin;
|
|
25
|
-
const { caseId, salesforceAccountId } = useCaseSelector((state) => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
return ({
|
|
28
|
-
caseId: state.caseDetails.id,
|
|
29
|
-
salesforceAccountId: (_b = (_a = state.selectedAccountDetails) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId,
|
|
30
|
-
});
|
|
31
|
-
}, isEqual);
|
|
32
|
-
const { availableLabels, assignedLinks, selectedLabelIds, loading, mutating, setAssignedLinks, createLink, deleteLink, } = useCaseLabelLinks(salesforceAccountId, caseId);
|
|
33
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
34
|
-
const handleSelect = (_event, labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
if (!labelId || typeof labelId !== 'string')
|
|
36
|
-
return;
|
|
37
|
-
if (canEditCase.alert())
|
|
38
|
-
return;
|
|
39
|
-
const existingLink = assignedLinks.find((link) => link.labelId === labelId);
|
|
40
|
-
try {
|
|
41
|
-
if (existingLink) {
|
|
42
|
-
yield deleteLink(existingLink.linkId);
|
|
43
|
-
setAssignedLinks((prev) => prev.filter((link) => link.linkId !== existingLink.linkId));
|
|
44
|
-
ToastNotification.addSuccessMessage(t('Label has been removed'));
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
const newId = yield createLink(caseId, labelId);
|
|
48
|
-
if (newId) {
|
|
49
|
-
setAssignedLinks((prev) => [...prev, { linkId: newId, labelId }]);
|
|
50
|
-
}
|
|
51
|
-
ToastNotification.addSuccessMessage(t('Label has been added'));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (_a) {
|
|
55
|
-
ToastNotification.addDangerMessage(t('Failed to update labels'));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
const handleChipRemove = (labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
if (canEditCase.alert())
|
|
60
|
-
return;
|
|
61
|
-
const link = assignedLinks.find((l) => l.labelId === labelId);
|
|
62
|
-
if (!link)
|
|
63
|
-
return;
|
|
64
|
-
try {
|
|
65
|
-
yield deleteLink(link.linkId);
|
|
66
|
-
setAssignedLinks((prev) => prev.filter((l) => l.linkId !== link.linkId));
|
|
67
|
-
ToastNotification.addSuccessMessage(t('Label has been removed'));
|
|
68
|
-
}
|
|
69
|
-
catch (_a) {
|
|
70
|
-
ToastNotification.addDangerMessage(t('Failed to remove label'));
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const selectedLabels = availableLabels.filter((l) => selectedLabelIds.includes(l.id));
|
|
74
|
-
const haltEvent = (e) => e.stopPropagation();
|
|
75
|
-
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen((prev) => !prev), isExpanded: isOpen, isDisabled: loading ||
|
|
76
|
-
mutating ||
|
|
77
|
-
!caseId ||
|
|
78
|
-
(!isOrgAdmin && availableLabels.length === 0) ||
|
|
79
|
-
canEditCase.isCaseNotEditable, isFullWidth: true, style: { height: '36px' } }, loading || mutating ? (React.createElement(Spinner, { size: "md" })) : selectedLabels.length > 0 ? (React.createElement("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'nowrap' } },
|
|
80
|
-
selectedLabels.slice(0, NUM_VISIBLE_LABELS).map((label) => (React.createElement(Label, { key: label.id, variant: "outline", onClose: () => handleChipRemove(label.id), closeBtnAriaLabel: t('Remove label {{name}}', { name: label.name }), onClick: haltEvent }, label.name))),
|
|
81
|
-
selectedLabels.length > NUM_VISIBLE_LABELS && (React.createElement("span", { style: {
|
|
82
|
-
color: 'var(--pf-t--global--text--color--link--default)',
|
|
83
|
-
fontSize: '12px',
|
|
84
|
-
whiteSpace: 'nowrap',
|
|
85
|
-
cursor: 'pointer',
|
|
86
|
-
} }, t('{{count}} more', { count: selectedLabels.length - NUM_VISIBLE_LABELS }))))) : availableLabels.length === 0 ? (t('No label assigned')) : (t('Select labels'))));
|
|
87
|
-
if (!caseId)
|
|
88
|
-
return null;
|
|
89
|
-
return (React.createElement("div", { className: "form-group" },
|
|
90
|
-
React.createElement("label", { htmlFor: "case-labels" },
|
|
91
|
-
React.createElement(Trans, null, "Labels")),
|
|
92
|
-
React.createElement(Select, { id: "case-labels", "data-tracking-id": "case-labels", role: "menu", isOpen: isOpen, onSelect: handleSelect, onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
93
|
-
React.createElement(SelectList, { id: "case-labels-listbox" }, availableLabels.map((label) => (React.createElement(SelectOption, { key: label.id, value: label.id, hasCheckbox: true, isSelected: selectedLabelIds.includes(label.id) }, label.name))))),
|
|
94
|
-
!loading && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
95
|
-
React.createElement("strong", null, "No labels available:"),
|
|
96
|
-
" You haven't created any labels yet.",
|
|
97
|
-
' ',
|
|
98
|
-
React.createElement(Link, { to: "/manage/case-labels", style: { textDecoration: 'none' }, onClick: () => window.scrollTo(0, 0) }, "Create a label"),
|
|
99
|
-
' ',
|
|
100
|
-
"to start organizing your cases.")) : (React.createElement(Trans, null,
|
|
101
|
-
React.createElement("strong", null, "No labels available:"),
|
|
102
|
-
" Your organization admin hasn't created any labels yet. Contact them to add labels before you can select one."))))));
|
|
103
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseLabelsCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseLabelsCreate.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAYjF,wFAAwF;AACxF,MAAM,CAAC,OAAO,UAAU,gBAAgB,sBAgLvC"}
|
|
@@ -1,109 +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 } from '@apollo/client/react';
|
|
11
|
-
import { Label, MenuToggle, Select, SelectList, SelectOption, Spinner, } from '@patternfly/react-core';
|
|
12
|
-
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
|
-
import { GET_CASE_LABELS, } from '@rh-support/utils';
|
|
14
|
-
import isEqual from 'lodash/isEqual';
|
|
15
|
-
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
16
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
-
import { Link } from 'react-router-dom';
|
|
18
|
-
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
19
|
-
import { setCaseState } from '../../reducers/CaseReducer';
|
|
20
|
-
const NUM_VISIBLE_LABELS = 3;
|
|
21
|
-
/** Case creation Labels dropdown — selection is stored and linked after case create. */
|
|
22
|
-
export default function CaseLabelsCreate() {
|
|
23
|
-
const { t } = useTranslation();
|
|
24
|
-
const client = useApolloClient();
|
|
25
|
-
const caseDispatch = useCaseDispatch();
|
|
26
|
-
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
27
|
-
const isOrgAdmin = loggedInUser.data.isOrgAdmin;
|
|
28
|
-
const { salesforceAccountId, selectedLabelIds } = useCaseSelector((state) => {
|
|
29
|
-
var _a, _b, _c;
|
|
30
|
-
return ({
|
|
31
|
-
salesforceAccountId: (_b = (_a = state.selectedAccountDetails) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId,
|
|
32
|
-
selectedLabelIds: (_c = state.selectedLabelIds) !== null && _c !== void 0 ? _c : [],
|
|
33
|
-
});
|
|
34
|
-
}, isEqual);
|
|
35
|
-
const [availableLabels, setAvailableLabels] = useState([]);
|
|
36
|
-
const [loading, setLoading] = useState(false);
|
|
37
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
38
|
-
const updateSelectedLabelIds = (nextIds) => {
|
|
39
|
-
setCaseState(caseDispatch, { selectedLabelIds: nextIds });
|
|
40
|
-
};
|
|
41
|
-
const fetchLabels = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a, _b, _c, _d;
|
|
43
|
-
if (!salesforceAccountId) {
|
|
44
|
-
setAvailableLabels([]);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
setLoading(true);
|
|
48
|
-
try {
|
|
49
|
-
const { data } = yield client.query({
|
|
50
|
-
query: GET_CASE_LABELS,
|
|
51
|
-
variables: { where: { Account__c: { eq: salesforceAccountId } } },
|
|
52
|
-
fetchPolicy: 'cache-first',
|
|
53
|
-
});
|
|
54
|
-
const edges = (_d = (_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.RedHatSupportCaseLabel__c) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
55
|
-
setAvailableLabels(edges
|
|
56
|
-
.map(({ node }) => {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
return ({
|
|
59
|
-
id: node.Id,
|
|
60
|
-
name: (_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '',
|
|
61
|
-
});
|
|
62
|
-
})
|
|
63
|
-
.filter((label) => label.id && label.name));
|
|
64
|
-
}
|
|
65
|
-
catch (_e) {
|
|
66
|
-
setAvailableLabels([]);
|
|
67
|
-
}
|
|
68
|
-
finally {
|
|
69
|
-
setLoading(false);
|
|
70
|
-
}
|
|
71
|
-
}), [client, salesforceAccountId]);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
fetchLabels();
|
|
74
|
-
}, [fetchLabels]);
|
|
75
|
-
const handleSelect = (_event, labelId) => {
|
|
76
|
-
if (!labelId || typeof labelId !== 'string')
|
|
77
|
-
return;
|
|
78
|
-
updateSelectedLabelIds(selectedLabelIds.includes(labelId)
|
|
79
|
-
? selectedLabelIds.filter((id) => id !== labelId)
|
|
80
|
-
: [...selectedLabelIds, labelId]);
|
|
81
|
-
};
|
|
82
|
-
const handleChipRemove = (labelId) => {
|
|
83
|
-
updateSelectedLabelIds(selectedLabelIds.filter((id) => id !== labelId));
|
|
84
|
-
};
|
|
85
|
-
const selectedLabels = availableLabels.filter((label) => selectedLabelIds.includes(label.id));
|
|
86
|
-
const haltEvent = (e) => e.stopPropagation();
|
|
87
|
-
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen((prev) => !prev), isExpanded: isOpen, isDisabled: loading || (!isOrgAdmin && availableLabels.length === 0), isFullWidth: true, style: { height: '36px' } }, loading ? (React.createElement(Spinner, { size: "md" })) : selectedLabels.length > 0 ? (React.createElement("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'nowrap' } },
|
|
88
|
-
selectedLabels.slice(0, NUM_VISIBLE_LABELS).map((label) => (React.createElement(Label, { key: label.id, variant: "outline", onClose: () => handleChipRemove(label.id), closeBtnAriaLabel: t('Remove label {{name}}', { name: label.name }), onClick: haltEvent }, label.name))),
|
|
89
|
-
selectedLabels.length > NUM_VISIBLE_LABELS && (React.createElement("span", { style: {
|
|
90
|
-
color: 'var(--pf-t--global--text--color--link--default)',
|
|
91
|
-
fontSize: '12px',
|
|
92
|
-
whiteSpace: 'nowrap',
|
|
93
|
-
cursor: 'pointer',
|
|
94
|
-
} }, t('{{count}} more', { count: selectedLabels.length - NUM_VISIBLE_LABELS }))))) : availableLabels.length === 0 ? (t('No label assigned')) : (t('Select labels'))));
|
|
95
|
-
return (React.createElement("div", { className: "form-group" },
|
|
96
|
-
React.createElement("label", { htmlFor: "case-labels-create" },
|
|
97
|
-
React.createElement(Trans, null, "Labels")),
|
|
98
|
-
React.createElement(Select, { id: "case-labels-create", "data-tracking-id": "case-labels-create", role: "menu", isOpen: isOpen, onSelect: handleSelect, onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
99
|
-
React.createElement(SelectList, { id: "case-labels-create-listbox" }, availableLabels.map((label) => (React.createElement(SelectOption, { key: label.id, value: label.id, hasCheckbox: true, isSelected: selectedLabelIds.includes(label.id) }, label.name))))),
|
|
100
|
-
!loading && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
101
|
-
React.createElement("strong", null, "No labels available:"),
|
|
102
|
-
" You haven't created any labels yet.",
|
|
103
|
-
' ',
|
|
104
|
-
React.createElement(Link, { to: "/manage/case-labels", style: { textDecoration: 'none' }, onClick: () => window.scrollTo(0, 0) }, "Create a label"),
|
|
105
|
-
' ',
|
|
106
|
-
"to start organizing your cases.")) : (React.createElement(Trans, null,
|
|
107
|
-
React.createElement("strong", null, "No labels available:"),
|
|
108
|
-
" Your organization admin hasn't created any labels yet. Contact them to add labels before you can select one."))))));
|
|
109
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductNotEntitledWarning.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductNotEntitledWarning.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,wBAAgB,yBAAyB,sBAcxC"}
|