@rh-support/troubleshoot 2.6.301 → 2.6.302
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 +28 -40
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +52 -14
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +51 -31
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +50 -18
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +25 -8
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +57 -34
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +43 -30
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +76 -30
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +3 -3
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +3 -4
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +13 -17
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +19 -43
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +17 -40
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +3 -0
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +22 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +44 -41
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +8 -7
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +38 -18
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +110 -148
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +5 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +15 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +19 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +49 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +6 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +147 -241
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +30 -52
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +68 -46
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
- 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 +4 -7
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +4 -7
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +19 -9
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +16 -11
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +13 -14
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +30 -50
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +9 -7
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +16 -16
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +5 -8
- package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +3 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +76 -4
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +50 -64
- package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
- package/lib/esm/components/shared/usePostComment.js +16 -28
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +120 -24
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
- package/lib/esm/context/CaseContext.d.ts.map +1 -1
- package/lib/esm/graphql/index.d.ts +4 -0
- package/lib/esm/graphql/index.d.ts.map +1 -0
- package/lib/esm/graphql/index.js +3 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
- package/lib/esm/graphql/mutations/index.d.ts +2 -0
- package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/index.js +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
- package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
- package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getParentId.js +16 -0
- package/lib/esm/graphql/queries/index.d.ts +3 -0
- package/lib/esm/graphql/queries/index.d.ts.map +1 -0
- package/lib/esm/graphql/queries/index.js +2 -0
- package/lib/esm/graphql/schemas/escalation.d.ts +84 -0
- package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/escalation.js +1 -0
- package/lib/esm/graphql/schemas/index.d.ts +2 -0
- package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/index.js +1 -0
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +4 -0
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +12 -0
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +55 -0
- package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
- package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/index.js +5 -0
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +66 -0
- package/lib/esm/hooks/useCaseComments/types.d.ts +80 -0
- package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/types.js +1 -0
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +16 -0
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +25 -0
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
- package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
- package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseHistory.js +98 -0
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +18 -11
- package/lib/esm/models/caseHistory.d.ts +80 -0
- package/lib/esm/models/caseHistory.d.ts.map +1 -0
- package/lib/esm/models/caseHistory.js +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +91 -3
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +20 -2
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -4
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +39 -23
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +3 -5
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +33 -46
- package/lib/esm/reducers/CaseHelpers.d.ts +3 -2
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +108 -41
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
- package/lib/esm/reducers/CaseReducer.d.ts +30 -8
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +192 -55
- package/lib/esm/utils/TimelineUtils.d.ts +41 -0
- package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
- package/lib/esm/utils/TimelineUtils.js +134 -0
- package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
- package/lib/esm/utils/caseHistoryUtils.js +165 -0
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
- package/package.json +7 -8
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { gql } from '@apollo/client/core';
|
|
2
|
+
export const GET_CASE_COMMENTS = gql `
|
|
3
|
+
query GetCaseComments(
|
|
4
|
+
$filter: SalesforceSupportCaseComment__c_Filter!
|
|
5
|
+
$orderBy: SalesforceSupportCaseComment__c_OrderBy
|
|
6
|
+
$first: Int
|
|
7
|
+
) {
|
|
8
|
+
salesforce_support_uiapi {
|
|
9
|
+
query {
|
|
10
|
+
SalesforceSupportCaseComment__c(where: $filter, orderBy: $orderBy, first: $first) {
|
|
11
|
+
edges {
|
|
12
|
+
node {
|
|
13
|
+
Id
|
|
14
|
+
Name {
|
|
15
|
+
value
|
|
16
|
+
}
|
|
17
|
+
Body__c {
|
|
18
|
+
value
|
|
19
|
+
}
|
|
20
|
+
CreatedBy {
|
|
21
|
+
Name {
|
|
22
|
+
value
|
|
23
|
+
}
|
|
24
|
+
IsPartner {
|
|
25
|
+
value
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
IsCustomer__c {
|
|
29
|
+
value
|
|
30
|
+
}
|
|
31
|
+
IsAssociate__c {
|
|
32
|
+
value
|
|
33
|
+
}
|
|
34
|
+
LastModifiedDate {
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
Visibility__c {
|
|
38
|
+
value
|
|
39
|
+
displayValue
|
|
40
|
+
}
|
|
41
|
+
LastModifiedBy {
|
|
42
|
+
Name {
|
|
43
|
+
value
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
CreatedDate {
|
|
47
|
+
value
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CREATE_CASE_COMMENT } from './caseCommentMutation';
|
|
2
|
+
export { GET_CASE_COMMENTS } from './caseCommentsQuery';
|
|
3
|
+
export { deriveCreatedByType, deriveIsPublic, mapCaseCommentNode, mapCaseCommentsResponse, mapVisibility, } from './mapCaseComment';
|
|
4
|
+
export type { ICaseCommentEdge, ICaseCommentNode, ICaseCommentsConnection, ICreateCaseCommentResponse, ICreateCaseCommentVariables, IGetCaseCommentsQueryResponse, IUseCaseCommentsOptions, } from './types';
|
|
5
|
+
export { useCaseComments } from './useCaseComments';
|
|
6
|
+
export { useCreateCaseComment } from './useCreateCaseComment';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACH,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACR,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CREATE_CASE_COMMENT } from './caseCommentMutation';
|
|
2
|
+
export { GET_CASE_COMMENTS } from './caseCommentsQuery';
|
|
3
|
+
export { deriveCreatedByType, deriveIsPublic, mapCaseCommentNode, mapCaseCommentsResponse, mapVisibility, } from './mapCaseComment';
|
|
4
|
+
export { useCaseComments } from './useCaseComments';
|
|
5
|
+
export { useCreateCaseComment } from './useCreateCaseComment';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
|
|
2
|
+
import { ICaseCommentNode, IGetCaseCommentsQueryResponse } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The GraphQL API HTML-encodes comment bodies on storage/retrieval
|
|
5
|
+
* (e.g. > becomes >, & becomes &). Two-pass decode
|
|
6
|
+
* handles both single- and double-encoded entities.
|
|
7
|
+
*
|
|
8
|
+
* TODO: The double-encoding is a backend bug in the Salesforce UIAPI — it encodes on both
|
|
9
|
+
* write and read. Once the backend is fixed, replace with a single `unescape(text)` call.
|
|
10
|
+
*/
|
|
11
|
+
export declare function decodeHtmlEntities(text: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Derives the comment author type with priority: Associate > Customer > Partner.
|
|
14
|
+
* Falls back to 'Customer' when no flags match.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deriveCreatedByType(isAssociate: boolean, isCustomer: boolean, isPartner: boolean): string;
|
|
17
|
+
export declare function deriveIsPublic(visibility: string | null | undefined): boolean;
|
|
18
|
+
export declare function mapVisibility(isPublic: boolean): string;
|
|
19
|
+
/**
|
|
20
|
+
* Converts a raw Salesforce CaseComment GraphQL node (with wrapped `{ value }` fields)
|
|
21
|
+
* into the flat ICaseComment interface expected by the discussion UI layer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function mapCaseCommentNode(node: ICaseCommentNode): ICaseComment;
|
|
24
|
+
export declare function mapCaseCommentsResponse(data: IGetCaseCommentsQueryResponse | undefined): ICaseComment[];
|
|
25
|
+
//# sourceMappingURL=mapCaseComment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCaseComment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/mapCaseComment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE1E;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAKzG;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG7E;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAuBvE;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,6BAA6B,GAAG,SAAS,GAAG,YAAY,EAAE,CAOvG"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { unescape } from 'lodash';
|
|
2
|
+
/**
|
|
3
|
+
* The GraphQL API HTML-encodes comment bodies on storage/retrieval
|
|
4
|
+
* (e.g. > becomes >, & becomes &). Two-pass decode
|
|
5
|
+
* handles both single- and double-encoded entities.
|
|
6
|
+
*
|
|
7
|
+
* TODO: The double-encoding is a backend bug in the Salesforce UIAPI — it encodes on both
|
|
8
|
+
* write and read. Once the backend is fixed, replace with a single `unescape(text)` call.
|
|
9
|
+
*/
|
|
10
|
+
export function decodeHtmlEntities(text) {
|
|
11
|
+
return unescape(unescape(text));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Derives the comment author type with priority: Associate > Customer > Partner.
|
|
15
|
+
* Falls back to 'Customer' when no flags match.
|
|
16
|
+
*/
|
|
17
|
+
export function deriveCreatedByType(isAssociate, isCustomer, isPartner) {
|
|
18
|
+
if (isAssociate)
|
|
19
|
+
return 'Associate';
|
|
20
|
+
if (isCustomer)
|
|
21
|
+
return 'Customer';
|
|
22
|
+
if (isPartner)
|
|
23
|
+
return 'Partner';
|
|
24
|
+
return 'Customer';
|
|
25
|
+
}
|
|
26
|
+
export function deriveIsPublic(visibility) {
|
|
27
|
+
if (!visibility)
|
|
28
|
+
return false;
|
|
29
|
+
return visibility === 'Public';
|
|
30
|
+
}
|
|
31
|
+
export function mapVisibility(isPublic) {
|
|
32
|
+
return isPublic ? 'Public' : 'Private';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Converts a raw Salesforce CaseComment GraphQL node (with wrapped `{ value }` fields)
|
|
36
|
+
* into the flat ICaseComment interface expected by the discussion UI layer.
|
|
37
|
+
*/
|
|
38
|
+
export function mapCaseCommentNode(node) {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
40
|
+
const rawBody = (_b = (_a = node.Body__c) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
41
|
+
const body = decodeHtmlEntities(rawBody);
|
|
42
|
+
const visibility = (_d = (_c = node.Visibility__c) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null;
|
|
43
|
+
return {
|
|
44
|
+
id: node.Id,
|
|
45
|
+
commentBody: body,
|
|
46
|
+
createdBy: (_g = (_f = (_e = node.CreatedBy) === null || _e === void 0 ? void 0 : _e.Name) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : '',
|
|
47
|
+
createdByType: deriveCreatedByType(!!((_h = node.IsAssociate__c) === null || _h === void 0 ? void 0 : _h.value), !!((_j = node.IsCustomer__c) === null || _j === void 0 ? void 0 : _j.value), !!((_l = (_k = node.CreatedBy) === null || _k === void 0 ? void 0 : _k.IsPartner) === null || _l === void 0 ? void 0 : _l.value)),
|
|
48
|
+
lastModifiedById: (_p = (_o = (_m = node.LastModifiedBy) === null || _m === void 0 ? void 0 : _m.Name) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : '',
|
|
49
|
+
lastModifiedDate: (_r = (_q = node.LastModifiedDate) === null || _q === void 0 ? void 0 : _q.value) !== null && _r !== void 0 ? _r : '',
|
|
50
|
+
createdDate: (_t = (_s = node.CreatedDate) === null || _s === void 0 ? void 0 : _s.value) !== null && _t !== void 0 ? _t : '',
|
|
51
|
+
visibility: visibility !== null && visibility !== void 0 ? visibility : undefined,
|
|
52
|
+
isPublic: deriveIsPublic(visibility),
|
|
53
|
+
contentType: 'plaintext',
|
|
54
|
+
isDraft: false,
|
|
55
|
+
publishedDate: '',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function mapCaseCommentsResponse(data) {
|
|
59
|
+
var _a, _b, _c;
|
|
60
|
+
if (!data)
|
|
61
|
+
return [];
|
|
62
|
+
const edges = (_c = (_b = (_a = data.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportCaseComment__c) === null || _c === void 0 ? void 0 : _c.edges;
|
|
63
|
+
if (!edges)
|
|
64
|
+
return [];
|
|
65
|
+
return edges.map((edge) => mapCaseCommentNode(edge.node));
|
|
66
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
IsPartner: ISalesforceBooleanField;
|
|
14
|
+
}
|
|
15
|
+
export interface ICaseCommentLastModifiedBy {
|
|
16
|
+
Name: ISalesforceStringField;
|
|
17
|
+
}
|
|
18
|
+
export interface ICaseCommentNode {
|
|
19
|
+
Id: string;
|
|
20
|
+
Name: ISalesforceStringField;
|
|
21
|
+
Body__c: ISalesforceStringField;
|
|
22
|
+
CreatedBy: ICaseCommentCreatedBy;
|
|
23
|
+
IsCustomer__c: ISalesforceBooleanField;
|
|
24
|
+
IsAssociate__c: ISalesforceBooleanField;
|
|
25
|
+
LastModifiedDate: ISalesforceStringField;
|
|
26
|
+
Visibility__c: ISalesforcePicklistField;
|
|
27
|
+
LastModifiedBy: ICaseCommentLastModifiedBy;
|
|
28
|
+
CreatedDate: ISalesforceStringField;
|
|
29
|
+
}
|
|
30
|
+
export interface ICaseCommentEdge {
|
|
31
|
+
node: ICaseCommentNode;
|
|
32
|
+
}
|
|
33
|
+
export interface ICaseCommentsConnection {
|
|
34
|
+
edges: ICaseCommentEdge[];
|
|
35
|
+
}
|
|
36
|
+
export interface IGetCaseCommentsQueryResponse {
|
|
37
|
+
salesforce_support_uiapi: {
|
|
38
|
+
query: {
|
|
39
|
+
SalesforceSupportCaseComment__c: ICaseCommentsConnection;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface ICaseCommentsVariables {
|
|
44
|
+
filter: {
|
|
45
|
+
Case__c: {
|
|
46
|
+
eq: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
orderBy?: Record<string, {
|
|
50
|
+
order: 'ASC' | 'DESC';
|
|
51
|
+
}>;
|
|
52
|
+
first?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface IUseCaseCommentsOptions {
|
|
55
|
+
caseId: string;
|
|
56
|
+
skip?: boolean;
|
|
57
|
+
orderBy?: Record<string, {
|
|
58
|
+
order: 'ASC' | 'DESC';
|
|
59
|
+
}>;
|
|
60
|
+
first?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ICreateCaseCommentInput {
|
|
63
|
+
Case__c: string;
|
|
64
|
+
Body__c: string;
|
|
65
|
+
Visibility__c: string;
|
|
66
|
+
IsAssociate__c?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface ICreateCaseCommentVariables {
|
|
69
|
+
commentInput: ICreateCaseCommentInput;
|
|
70
|
+
}
|
|
71
|
+
export interface ICreateCaseCommentResponse {
|
|
72
|
+
salesforce_support_uiapi: {
|
|
73
|
+
CaseComment__cCreate: {
|
|
74
|
+
SalesforceSupportRecord: {
|
|
75
|
+
Id: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,SAAS,EAAE,uBAAuB,CAAC;CACtC;AAED,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE,sBAAsB,CAAC;IAChC,SAAS,EAAE,qBAAqB,CAAC;IACjC,aAAa,EAAE,uBAAuB,CAAC;IACvC,cAAc,EAAE,uBAAuB,CAAC;IACxC,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,aAAa,EAAE,wBAAwB,CAAC;IACxC,cAAc,EAAE,0BAA0B,CAAC;IAC3C,WAAW,EAAE,sBAAsB,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC1C,wBAAwB,EAAE;QACtB,KAAK,EAAE;YACH,+BAA+B,EAAE,uBAAuB,CAAC;SAC5D,CAAC;KACL,CAAC;CACL;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE;QAAE,OAAO,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;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,wBAAwB,EAAE;QACtB,oBAAoB,EAAE;YAClB,uBAAuB,EAAE;gBACrB,EAAE,EAAE,MAAM,CAAC;aACd,CAAC;SACL,CAAC;KACL,CAAC;CACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
|
|
2
|
+
import { IUseCaseCommentsOptions } from './types';
|
|
3
|
+
interface IUseCaseCommentsReturn {
|
|
4
|
+
comments: ICaseComment[];
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: Error | undefined;
|
|
7
|
+
refetch: () => Promise<unknown>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Fetches case comments from the Salesforce GraphQL API for a given case ID.
|
|
11
|
+
* Supports custom sort ordering and pagination clamping (1–2000 records).
|
|
12
|
+
* Returns mapped ICaseComment[] along with loading, error, and refetch handles.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useCaseComments({ caseId, skip, orderBy, first }: IUseCaseCommentsOptions): IUseCaseCommentsReturn;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=useCaseComments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseComments.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/useCaseComments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAElD,UAAU,sBAAsB;IAC5B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACnC;AAKD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,sBAAsB,CAcjH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client/react';
|
|
2
|
+
import clamp from 'lodash/clamp';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { GET_CASE_COMMENTS } from './caseCommentsQuery';
|
|
5
|
+
import { mapCaseCommentsResponse } from './mapCaseComment';
|
|
6
|
+
const MAX_FIRST = 2000;
|
|
7
|
+
const MIN_FIRST = 1;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches case comments from the Salesforce GraphQL API for a given case ID.
|
|
10
|
+
* Supports custom sort ordering and pagination clamping (1–2000 records).
|
|
11
|
+
* Returns mapped ICaseComment[] along with loading, error, and refetch handles.
|
|
12
|
+
*/
|
|
13
|
+
export function useCaseComments({ caseId, skip, orderBy, first }) {
|
|
14
|
+
const { data, loading, error, refetch } = useQuery(GET_CASE_COMMENTS, {
|
|
15
|
+
variables: {
|
|
16
|
+
filter: { Case__c: { eq: caseId } },
|
|
17
|
+
orderBy: orderBy !== null && orderBy !== void 0 ? orderBy : { LastModifiedDate: { order: 'DESC' } },
|
|
18
|
+
first: clamp(first !== null && first !== void 0 ? first : MAX_FIRST, MIN_FIRST, MAX_FIRST),
|
|
19
|
+
},
|
|
20
|
+
skip: skip || !caseId,
|
|
21
|
+
fetchPolicy: 'cache-and-network',
|
|
22
|
+
});
|
|
23
|
+
const comments = useMemo(() => mapCaseCommentsResponse(data), [data]);
|
|
24
|
+
return { comments, loading, error, refetch };
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface ICreateCaseCommentOptions {
|
|
2
|
+
caseId: string;
|
|
3
|
+
body: string;
|
|
4
|
+
isPublic?: boolean;
|
|
5
|
+
isAssociate?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface IUseCreateCaseCommentReturn {
|
|
8
|
+
createComment: (options: ICreateCaseCommentOptions) => Promise<unknown>;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: Error | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Wraps the CREATE_CASE_COMMENT GraphQL mutation.
|
|
14
|
+
* Returns a `createComment` callback that accepts caseId, body, visibility,
|
|
15
|
+
* and associate flag, along with the mutation's loading and error state.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useCreateCaseComment(): IUseCreateCaseCommentReturn;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=useCreateCaseComment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateCaseComment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/useCreateCaseComment.ts"],"names":[],"mappings":"AAKA,UAAU,yBAAyB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,2BAA2B;IACjC,aAAa,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,2BAA2B,CAiBlE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { useMutation } from '@apollo/client/react';
|
|
11
|
+
import { CREATE_CASE_COMMENT } from './caseCommentMutation';
|
|
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: body,
|
|
26
|
+
Visibility__c: mapVisibility(isPublic),
|
|
27
|
+
IsAssociate__c: isAssociate,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return { createComment, loading, error };
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type TypedDocumentNode } from '@apollo/client';
|
|
2
|
+
import type { ICaseHistoryItem, IGetCaseHistoryData, IGetCaseHistoryVars } from '../models/caseHistory';
|
|
3
|
+
/**
|
|
4
|
+
* OldValue/NewValue use inline fragments with aliased fields (e.g. `stringValue: value`).
|
|
5
|
+
* These aliases produce the property names that `extractStringValue` checks against.
|
|
6
|
+
* Changing an alias here without updating `extractStringValue` will silently break
|
|
7
|
+
* value extraction.
|
|
8
|
+
*
|
|
9
|
+
* Supported value types (members of the Salesforce_Support_AnyType union):
|
|
10
|
+
* - SalesforceSupportStringValue → stringValue
|
|
11
|
+
* - SalesforceSupportBooleanValue → booleanValue
|
|
12
|
+
* - SalesforceSupportDoubleValue → doubleValue
|
|
13
|
+
* - SalesforceSupportDateTimeValue → dateTimeValue
|
|
14
|
+
*
|
|
15
|
+
* `first` defaults to 2000 — a practical cap that covers all observed real-world case
|
|
16
|
+
* histories while staying well within the SF API limit.
|
|
17
|
+
*/
|
|
18
|
+
export declare const GET_CASE_HISTORY: TypedDocumentNode<IGetCaseHistoryData, IGetCaseHistoryVars>;
|
|
19
|
+
interface UseCaseHistoryResult {
|
|
20
|
+
historyItems: ICaseHistoryItem[];
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: Error | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare function useCaseHistory(caseId: string | undefined, first?: number): UseCaseHistoryResult;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=useCaseHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseHistory.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAO,MAAM,gBAAgB,CAAC;AAI7D,OAAO,KAAK,EAER,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,mBAAmB,CA6DxF,CAAC;AAEF,UAAU,oBAAoB;IAC1B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,SAAO,GAAG,oBAAoB,CAgB7F"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useQuery } from '@apollo/client/react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { filterSfdcIdEntries, normalizeNodeToHistoryItem } from '../utils/caseHistoryUtils';
|
|
5
|
+
/**
|
|
6
|
+
* OldValue/NewValue use inline fragments with aliased fields (e.g. `stringValue: value`).
|
|
7
|
+
* These aliases produce the property names that `extractStringValue` checks against.
|
|
8
|
+
* Changing an alias here without updating `extractStringValue` will silently break
|
|
9
|
+
* value extraction.
|
|
10
|
+
*
|
|
11
|
+
* Supported value types (members of the Salesforce_Support_AnyType union):
|
|
12
|
+
* - SalesforceSupportStringValue → stringValue
|
|
13
|
+
* - SalesforceSupportBooleanValue → booleanValue
|
|
14
|
+
* - SalesforceSupportDoubleValue → doubleValue
|
|
15
|
+
* - SalesforceSupportDateTimeValue → dateTimeValue
|
|
16
|
+
*
|
|
17
|
+
* `first` defaults to 2000 — a practical cap that covers all observed real-world case
|
|
18
|
+
* histories while staying well within the SF API limit.
|
|
19
|
+
*/
|
|
20
|
+
export const GET_CASE_HISTORY = gql `
|
|
21
|
+
query GetCaseHistory($caseId: ID!, $first: Int = 2000) {
|
|
22
|
+
salesforce_support_uiapi {
|
|
23
|
+
query {
|
|
24
|
+
SalesforceSupportCaseHistory(first: $first, where: { CaseId: { eq: $caseId } }) {
|
|
25
|
+
edges {
|
|
26
|
+
node {
|
|
27
|
+
Id
|
|
28
|
+
SalesforceSupportField {
|
|
29
|
+
value
|
|
30
|
+
displayValue
|
|
31
|
+
label
|
|
32
|
+
}
|
|
33
|
+
OldValue {
|
|
34
|
+
... on SalesforceSupportStringValue {
|
|
35
|
+
stringValue: value
|
|
36
|
+
}
|
|
37
|
+
... on SalesforceSupportBooleanValue {
|
|
38
|
+
booleanValue: value
|
|
39
|
+
}
|
|
40
|
+
... on SalesforceSupportDoubleValue {
|
|
41
|
+
doubleValue: value
|
|
42
|
+
}
|
|
43
|
+
... on SalesforceSupportDateTimeValue {
|
|
44
|
+
dateTimeValue: value
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
NewValue {
|
|
48
|
+
... on SalesforceSupportStringValue {
|
|
49
|
+
stringValue: value
|
|
50
|
+
}
|
|
51
|
+
... on SalesforceSupportBooleanValue {
|
|
52
|
+
booleanValue: value
|
|
53
|
+
}
|
|
54
|
+
... on SalesforceSupportDoubleValue {
|
|
55
|
+
doubleValue: value
|
|
56
|
+
}
|
|
57
|
+
... on SalesforceSupportDateTimeValue {
|
|
58
|
+
dateTimeValue: value
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
CreatedBy {
|
|
62
|
+
Name {
|
|
63
|
+
value
|
|
64
|
+
}
|
|
65
|
+
UserType {
|
|
66
|
+
value
|
|
67
|
+
}
|
|
68
|
+
SmallPhotoUrl {
|
|
69
|
+
value
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
CreatedDate {
|
|
73
|
+
value
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
export function useCaseHistory(caseId, first = 2000) {
|
|
83
|
+
const { data, loading, error } = useQuery(GET_CASE_HISTORY, {
|
|
84
|
+
variables: { caseId: caseId || '', first },
|
|
85
|
+
// Empty string = no case selected; skip avoids a wasted network request.
|
|
86
|
+
skip: !caseId,
|
|
87
|
+
// Shows cached data immediately while revalidating, avoiding a loading flash on re-visits.
|
|
88
|
+
fetchPolicy: 'cache-and-network',
|
|
89
|
+
});
|
|
90
|
+
const historyItems = useMemo(() => {
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
const edges = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportCaseHistory) === null || _c === void 0 ? void 0 : _c.edges;
|
|
93
|
+
if (!edges)
|
|
94
|
+
return [];
|
|
95
|
+
return filterSfdcIdEntries(edges).map(normalizeNodeToHistoryItem);
|
|
96
|
+
}, [data]);
|
|
97
|
+
return { historyItems, loading, error };
|
|
98
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"AAcA,wBAAgB,kBAAkB;;EAsCjC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fetchLoggedInUser, fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
2
1
|
import { useContext } from 'react';
|
|
3
2
|
import { AttachmentDispatchContext, resetAttachment } from '../components/shared/fileUpload';
|
|
4
3
|
import { useCaseDispatch } from '../context/CaseContext';
|
|
@@ -7,7 +6,6 @@ import { useRecommendationDispatchContext } from '../context/RecommendationConte
|
|
|
7
6
|
import { RulesDispatchContext } from '../context/RulesContext';
|
|
8
7
|
import { TCDispatchContext } from '../context/TopContentContext';
|
|
9
8
|
import { CaseReducerConstants } from '../reducers/CaseConstNTypes';
|
|
10
|
-
import { setCaseAccountNumber, setCaseOwner } from '../reducers/CaseReducer';
|
|
11
9
|
import { resetClusterRecommendations } from '../reducers/ClusterRecommendationsReducer';
|
|
12
10
|
import { resetRecommendations } from '../reducers/RecommendationsReducer';
|
|
13
11
|
import { resetEARules } from '../reducers/RulesReducer';
|
|
@@ -17,22 +15,31 @@ export function useResetCaseCreate() {
|
|
|
17
15
|
const tcDispatch = useContext(TCDispatchContext);
|
|
18
16
|
const recommendationsDispatch = useRecommendationDispatchContext();
|
|
19
17
|
const caseDispatch = useCaseDispatch();
|
|
20
|
-
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
21
18
|
const rulesDispatch = useContext(RulesDispatchContext);
|
|
22
19
|
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
23
|
-
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
|
|
24
20
|
const resetCaseCreateState = () => {
|
|
25
|
-
//
|
|
26
|
-
fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, {});
|
|
21
|
+
// Commented out — don't refetch logged-in user contact details on case creation
|
|
22
|
+
// fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, {});
|
|
27
23
|
resetAttachment(dispatchToAttachmentReducer);
|
|
28
24
|
resetTopContent(tcDispatch);
|
|
29
25
|
resetRecommendations(recommendationsDispatch);
|
|
30
26
|
caseDispatch({ type: CaseReducerConstants.resetCaseState });
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
// Commented out — don't refetch account details or auto-populate account/owner on case creation
|
|
28
|
+
// fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
|
|
29
|
+
// setCaseAccountNumber(caseDispatch, loggedInUserRights.data.getAccountNumber(), true, loggedInUsersAccount.data);
|
|
30
|
+
// setCaseOwner(
|
|
31
|
+
// caseDispatch,
|
|
32
|
+
// loggedInUserRights.data.getHydraContactFromLoggedInUser(),
|
|
33
|
+
// '',
|
|
34
|
+
// undefined,
|
|
35
|
+
// undefined,
|
|
36
|
+
// true,
|
|
37
|
+
// undefined,
|
|
38
|
+
// true,
|
|
39
|
+
// undefined,
|
|
40
|
+
// undefined,
|
|
41
|
+
// loggedInUserRights.data.isInternal() ? loggedInUserRights.data.getAccountNumber() : undefined
|
|
42
|
+
// );
|
|
36
43
|
resetEARules(rulesDispatch);
|
|
37
44
|
resetClusterRecommendations(clusterRecommendationsDispatch);
|
|
38
45
|
};
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
SalesforceSupportField: {
|
|
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
|
+
salesforce_support_uiapi: {
|
|
43
|
+
query: {
|
|
44
|
+
SalesforceSupportCaseHistory: {
|
|
45
|
+
edges: ICaseHistoryEdge[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface IGetCaseHistoryVars {
|
|
51
|
+
caseId: string;
|
|
52
|
+
first?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Normalized representation of a single Salesforce case history entry.
|
|
56
|
+
*
|
|
57
|
+
* Discriminated on `type`:
|
|
58
|
+
* - `'Action'` — lifecycle events (created, closed, owner transfer) where no field
|
|
59
|
+
* value changed. `outputText` contains the human-readable sentence.
|
|
60
|
+
* - `'Change'` — field-value mutations. `outputText` is empty; the Timeline layer
|
|
61
|
+
* formats display text via `applyReplacements` / `handleFieldChange`.
|
|
62
|
+
*/
|
|
63
|
+
export interface ICaseHistoryItem {
|
|
64
|
+
id: string;
|
|
65
|
+
/** Raw Salesforce API field name (e.g. `Status`, `Case_Language__c`, `created`). */
|
|
66
|
+
fieldName: string;
|
|
67
|
+
/** Resolved human-readable label for the field (from FIELD_NAME_DISPLAY_MAP, SF label, or displayValue). */
|
|
68
|
+
displayName: string;
|
|
69
|
+
label: string | null;
|
|
70
|
+
oldValue: string | null;
|
|
71
|
+
newValue: string | null;
|
|
72
|
+
createdDate: string;
|
|
73
|
+
createdByUserName: string;
|
|
74
|
+
createdByCustomer: boolean;
|
|
75
|
+
photoUrl: string | null;
|
|
76
|
+
type: 'Action' | 'Change';
|
|
77
|
+
/** Pre-built sentence for Action items (e.g. "created the case"); empty for Change items. */
|
|
78
|
+
outputText: string;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=caseHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caseHistory.d.ts","sourceRoot":"","sources":["../../../src/models/caseHistory.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,GAAG,gBAAgB,GAAG,IAAI,CAAC;AAElG,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC7F,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE;QACP,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QACxB,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;QACnC,aAAa,EAAE;YAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,GAAG,IAAI,CAAC;KAClD,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,wBAAwB,EAAE;QACtB,KAAK,EAAE;YACH,4BAA4B,EAAE;gBAC1B,KAAK,EAAE,gBAAgB,EAAE,CAAC;aAC7B,CAAC;SACL,CAAC;KACL,CAAC;CACL;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,4GAA4G;IAC5G,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,6FAA6F;IAC7F,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|