@rh-support/troubleshoot 2.6.299 → 2.6.300
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 +40 -28
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +19 -46
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +17 -49
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -25
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +17 -31
- 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 +28 -39
- 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 +4 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +7 -4
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -13
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +33 -11
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +34 -38
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +59 -19
- 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/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 +148 -110
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +2 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +241 -147
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -5
- 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/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 +9 -7
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +5 -7
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +24 -37
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +55 -32
- 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 +9 -4
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +7 -4
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +12 -11
- 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 -30
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +18 -16
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +8 -5
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +64 -50
- package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
- package/lib/esm/components/shared/usePostComment.js +10 -6
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +24 -105
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +7 -6
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -10
- package/lib/esm/context/CaseContext.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +11 -18
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -86
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +1 -5
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +1 -3
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +5 -22
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -0
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +28 -1
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -2
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +2 -34
- 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 +8 -27
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +33 -127
- package/package.json +6 -6
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -22
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -15
- 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 -19
- 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 -49
- 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 -24
- 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 -84
- 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/caseCommentMutation.d.ts +0 -4
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
- 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 -55
- 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 -66
- package/lib/esm/hooks/useCaseComments/types.d.ts +0 -80
- 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 -16
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -25
- 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/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 -134
- 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
|
@@ -1,16 +1,23 @@
|
|
|
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
|
+
};
|
|
1
10
|
import './Timeline.css';
|
|
11
|
+
import { caseHistory } from '@cee-eng/hydrajs';
|
|
2
12
|
import { Avatar, Button, DatePicker, EmptyState, EmptyStateBody, EmptyStateVariant, MenuToggle, Pagination, SearchInput, Select, SelectOption, Spinner, } from '@patternfly/react-core';
|
|
3
13
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
4
14
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
5
15
|
import { haltEvent } from '@rh-support/utils';
|
|
6
|
-
import { format, isSameDay, parse
|
|
16
|
+
import { format, fromUnixTime, isSameDay, parse } from 'date-fns';
|
|
7
17
|
import debounce from 'lodash/debounce';
|
|
8
18
|
import isEmpty from 'lodash/isEmpty';
|
|
9
19
|
import React, { useEffect, useRef, useState } from 'react';
|
|
10
20
|
import { Trans, useTranslation } from 'react-i18next';
|
|
11
|
-
import { useCaseHistory } from '../../../../hooks/useCaseHistory';
|
|
12
|
-
import { getFieldDisplayName } from '../../../../utils/caseHistoryUtils';
|
|
13
|
-
import { applyPostProcessing, handleFieldChange } from '../../../../utils/TimelineUtils';
|
|
14
21
|
const CustomHighlighter = ({ search, children, highlightDate, }) => {
|
|
15
22
|
const createHighlight = (text) => React.createElement("mark", { className: "timeline-highlight" }, text);
|
|
16
23
|
if (highlightDate) {
|
|
@@ -18,7 +25,7 @@ const CustomHighlighter = ({ search, children, highlightDate, }) => {
|
|
|
18
25
|
}
|
|
19
26
|
if (search) {
|
|
20
27
|
const escapedSearch = search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
21
|
-
const regex = new RegExp(`(${escapedSearch})`, '
|
|
28
|
+
const regex = new RegExp(`(${escapedSearch})`, 'gi');
|
|
22
29
|
const parts = children.split(regex);
|
|
23
30
|
return React.createElement(React.Fragment, null, parts.map((part, index) => (regex.test(part) ? createHighlight(part) : part)));
|
|
24
31
|
}
|
|
@@ -45,58 +52,193 @@ const TimelineEvent = ({ date, text, side, user, useAvatar, searchValue, highlig
|
|
|
45
52
|
text && (React.createElement("p", { className: `content-time-${side}-history` },
|
|
46
53
|
React.createElement(CustomHighlighter, { search: searchValue || '' }, text))))));
|
|
47
54
|
};
|
|
48
|
-
const
|
|
49
|
-
const TimelineNode = React.forwardRef(({ leftEvent, rightEvent, user, useAvatar, photoUrl, searchValue, highlightDate }, ref) => {
|
|
50
|
-
const [imgSrc, setImgSrc] = useState(photoUrl || DEFAULT_AVATAR_SRC);
|
|
55
|
+
const TimelineNode = React.forwardRef(({ leftEvent, rightEvent, user, useAvatar, searchValue, highlightDate }, ref) => {
|
|
51
56
|
return (React.createElement("div", { className: "timeline-node", role: "region", "aria-label": "Timeline node" },
|
|
52
57
|
leftEvent && (React.createElement(TimelineEvent, Object.assign({}, leftEvent, { side: "left", useAvatar: useAvatar, searchValue: searchValue, highlightDate: highlightDate }))),
|
|
53
|
-
React.createElement("div", { ref: ref, "aria-label": `${useAvatar ? 'User profile picture' : 'Timeline marker'}`, tabIndex: -1 }, useAvatar ? (React.createElement(Avatar, { src:
|
|
58
|
+
React.createElement("div", { ref: ref, "aria-label": `${useAvatar ? 'User profile picture' : 'Timeline marker'}`, tabIndex: -1 }, useAvatar ? (React.createElement(Avatar, { src: 'https://www.patternfly.org/images/668560cd.svg', className: `timeline-avatar timeline-avatar-${user}`, alt: `${user}'s avatar` })) : (React.createElement("div", { className: `timeline-marker timeline-${user}` }))),
|
|
54
59
|
rightEvent && React.createElement(TimelineEvent, Object.assign({}, rightEvent, { side: "right", searchValue: searchValue }))));
|
|
55
60
|
});
|
|
56
61
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} item - The item object to process.
|
|
64
|
+
* @returns {string} The formatted text string.
|
|
59
65
|
*/
|
|
60
|
-
|
|
61
|
-
var _a, _b;
|
|
66
|
+
const applyReplacements = (item) => {
|
|
62
67
|
if (!item || typeof item !== 'object')
|
|
63
68
|
return '';
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
// API field names to easy to read display names
|
|
70
|
+
const fieldNameMapping = {
|
|
71
|
+
ContactId: 'Contact',
|
|
72
|
+
RH_Product__c: 'Product',
|
|
73
|
+
RH_Version__c: 'Version',
|
|
74
|
+
EntitlementId: 'Entitlement',
|
|
75
|
+
AccountId: 'Account',
|
|
76
|
+
OwnerId: 'Owner',
|
|
77
|
+
BusinessHoursId: 'Business Hours',
|
|
78
|
+
FolderId__c: 'Case Group',
|
|
79
|
+
Status: 'Status',
|
|
80
|
+
Customer_Escalation__c: 'Customer Escalation',
|
|
81
|
+
SlaStartDate: 'SLA Start Date',
|
|
82
|
+
Case_Language__c: 'Case Language',
|
|
83
|
+
Alternate_Id__c: 'Personal reference number',
|
|
84
|
+
SBR_Group__c: 'SBR Group',
|
|
85
|
+
};
|
|
86
|
+
// https://help.salesforce.com/s/articleView?id=000384484&type=1
|
|
87
|
+
// adding in option for multiselect fields provided by salesforce.
|
|
88
|
+
// in future for more multiselect fields just add to below array.
|
|
89
|
+
const multiSelectFields = ['SBR_Group__c'];
|
|
90
|
+
// language codes to language names
|
|
91
|
+
const languageCodeMapping = {
|
|
92
|
+
de: 'German',
|
|
93
|
+
en: 'English',
|
|
94
|
+
es: 'Spanish',
|
|
95
|
+
fr: 'French',
|
|
96
|
+
it: 'Italian',
|
|
97
|
+
pt: 'Portuguese',
|
|
98
|
+
ko: 'Korean',
|
|
99
|
+
ja: 'Japanese',
|
|
100
|
+
zh: 'Chinese',
|
|
101
|
+
zh_CN: 'Chinese',
|
|
102
|
+
zh_HK: 'Chinese (Hong Kong)',
|
|
103
|
+
zh_TW: 'Chinese (Taiwan)',
|
|
104
|
+
ru: 'Russian',
|
|
105
|
+
};
|
|
106
|
+
// field display names to prefix keys used in item properties
|
|
107
|
+
const keyMap = {
|
|
108
|
+
Product: 'product',
|
|
109
|
+
Version: 'version',
|
|
110
|
+
Account: 'account',
|
|
111
|
+
Contact: 'contact',
|
|
112
|
+
Entitlement: 'entitlement',
|
|
113
|
+
'Business Hours': 'businessHours',
|
|
114
|
+
Owner: 'queueNameOwner',
|
|
115
|
+
'Customer Escalation': 'customerEscalation',
|
|
116
|
+
'Case Group': 'caseGroup',
|
|
117
|
+
'SLA Start Date': 'slaStartDate',
|
|
118
|
+
'Case Language': 'caseLanguage',
|
|
119
|
+
'Personal reference number': 'alternateId',
|
|
120
|
+
};
|
|
121
|
+
// get the mapped display name for a field
|
|
122
|
+
const getMappedFieldName = (fieldName) => fieldNameMapping[fieldName] || item.fieldLabel || fieldName || '';
|
|
123
|
+
// get the new or old value using the prefix
|
|
124
|
+
const getNameValue = (prefix) => item[`${keyMap[getMappedFieldName(item.fieldName)]}${prefix}Name`] ||
|
|
125
|
+
item[`${prefix}Value`] ||
|
|
126
|
+
item[`${prefix.toLowerCase()}Value`] ||
|
|
127
|
+
'';
|
|
128
|
+
// formatting functions
|
|
129
|
+
const formatLanguageChange = (fieldName, oldLanguage, newLanguage) => `changed ${fieldName} from ${oldLanguage} to ${newLanguage}`;
|
|
130
|
+
const formatSimpleChange = (fieldName, value) => `set ${fieldName} to ${value}`;
|
|
131
|
+
const formatBooleanChange = (fieldName, value) => `set ${fieldName} to ${value}`;
|
|
132
|
+
// get field name and values
|
|
133
|
+
const fieldName = getMappedFieldName(item.fieldName);
|
|
134
|
+
const newValue = getNameValue('New');
|
|
135
|
+
const oldValue = getNameValue('Old');
|
|
136
|
+
let newText = '';
|
|
137
|
+
// special field handling below, useful for future exposed case history fields etc / api changes
|
|
138
|
+
switch (item.fieldName) {
|
|
139
|
+
case 'Case_Language__c': {
|
|
140
|
+
const newLanguage = languageCodeMapping[item.newValue] || item.newValue;
|
|
141
|
+
const oldLanguage = languageCodeMapping[item.oldValue] || item.oldValue;
|
|
142
|
+
newText =
|
|
143
|
+
item.oldValue && item.newValue
|
|
144
|
+
? formatLanguageChange(fieldName, oldLanguage, newLanguage)
|
|
145
|
+
: formatSimpleChange(fieldName, newLanguage || 'empty');
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case 'OwnerId':
|
|
149
|
+
if (item.createdByUserName)
|
|
150
|
+
newText = formatSimpleChange(fieldName, item.createdByUserName);
|
|
151
|
+
break;
|
|
152
|
+
case 'Status':
|
|
153
|
+
newText =
|
|
154
|
+
item.oldValue && item.newValue
|
|
155
|
+
? `changed ${fieldName} from ${item.oldValue} to ${item.newValue}`
|
|
156
|
+
: formatSimpleChange(fieldName, item.newValue || 'empty');
|
|
157
|
+
break;
|
|
158
|
+
case 'Customer_Escalation__c':
|
|
159
|
+
if (item.createdByUserName)
|
|
160
|
+
newText = 'started Escalation for this ticket';
|
|
161
|
+
break;
|
|
162
|
+
case 'SlaStartDate':
|
|
163
|
+
if (item.newValue)
|
|
164
|
+
newText = formatSimpleChange(fieldName, item.newValue);
|
|
165
|
+
break;
|
|
166
|
+
case 'RemoteSessionTermsAckedBy__c':
|
|
167
|
+
newText = 'Acked Remote Rider terms';
|
|
168
|
+
break;
|
|
169
|
+
default:
|
|
170
|
+
if (oldValue && newValue) {
|
|
171
|
+
if (multiSelectFields.includes(item.fieldName)) {
|
|
172
|
+
// in salesforce multi-select picklist values are stored as a single string, with each value separated by a semicolon
|
|
173
|
+
const oldValues = oldValue.split(';').map((s) => s.trim());
|
|
174
|
+
const newValues = newValue.split(';').map((s) => s.trim());
|
|
175
|
+
const added = newValues.filter((nv) => !oldValues.includes(nv));
|
|
176
|
+
const removed = oldValues.filter((ov) => !newValues.includes(ov));
|
|
177
|
+
if (added.length > 0 && removed.length === 0) {
|
|
178
|
+
newText = `added ${added.join(', ')} to ${fieldName}`;
|
|
179
|
+
}
|
|
180
|
+
else if (removed.length > 0 && added.length === 0) {
|
|
181
|
+
newText = `removed ${removed.join(', ')} from ${fieldName}`;
|
|
182
|
+
}
|
|
183
|
+
else if (added.length > 0 && removed.length > 0) {
|
|
184
|
+
newText = `changed ${fieldName}, added ${added.join(', ')} and removed ${removed.join(', ')}`;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
newText = `changed ${fieldName} from ${oldValue} to ${newValue}`;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
newText = `changed ${fieldName} from ${oldValue} to ${newValue}`;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else if (newValue) {
|
|
195
|
+
newText = formatSimpleChange(fieldName, newValue);
|
|
196
|
+
}
|
|
197
|
+
else if (oldValue && (newValue === undefined || newValue === '')) {
|
|
198
|
+
newText = `removed ${fieldName}, was ${oldValue}`;
|
|
199
|
+
}
|
|
200
|
+
else if (item.newValue !== undefined) {
|
|
201
|
+
newText = formatSimpleChange(fieldName, item.newValue);
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
if (typeof item.newValue === 'boolean')
|
|
206
|
+
newText = formatBooleanChange(fieldName, item.newValue);
|
|
207
|
+
if (typeof newText === 'string')
|
|
208
|
+
newText = newText.replace(/Problem Statement/g, 'Title');
|
|
209
|
+
if (typeof newText === 'string')
|
|
210
|
+
newText = newText.replace(/Case Type/g, 'Support Type');
|
|
211
|
+
return newText;
|
|
69
212
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
* Applies a secondary filter (excludes `FolderId__c` and `OwnerId` whose resolved
|
|
74
|
-
* display names are unavailable), then maps each item to a left (date/time) and
|
|
75
|
-
* right (user action text) event pair. Avatar/date-header boundaries are computed
|
|
76
|
-
* sequentially: a new boundary is set on the first item, user change, or date change.
|
|
77
|
-
*/
|
|
78
|
-
export const transformApiResponseToTimelineData = (apiResponse) => {
|
|
213
|
+
// function to change the apiResponse
|
|
214
|
+
const transformApiResponseToTimelineData = (apiResponse) => {
|
|
79
215
|
let previousUser = null;
|
|
80
216
|
let previousDate = null;
|
|
81
217
|
const timelineEvents = apiResponse.historyItems
|
|
82
|
-
//
|
|
83
|
-
// FolderId__c (Case Group) and OwnerId are excluded because their resolved display
|
|
84
|
-
// names (queue name, owner name) are not available in the history payload.
|
|
218
|
+
// Filter out 'Case Group' and 'OwnerId' changes because we don't have decode of value
|
|
85
219
|
.filter((item) => item.fieldName !== 'FolderId__c' && item.fieldName !== 'OwnerId')
|
|
86
220
|
.map((item, index) => {
|
|
87
221
|
const currentUser = item.createdByUserName;
|
|
88
|
-
|
|
222
|
+
let eventDate;
|
|
223
|
+
if (typeof item.createdDate === 'string' && item.createdDate.includes('T')) {
|
|
224
|
+
eventDate = parse(item.createdDate, "yyyy-MM-dd'T'HH:mm:ss'Z'", new Date());
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
eventDate = fromUnixTime(item.createdDate / 1000);
|
|
228
|
+
}
|
|
89
229
|
const currentDate = format(eventDate, 'MMMM d, yyyy');
|
|
90
|
-
// Show avatar + date header when: (1) first item, (2) user changed from
|
|
91
|
-
// previous event, or (3) calendar date changed. After any list mutation
|
|
92
|
-
// (filter, sort, paginate) applyAvatarLogic must be re-run so boundaries
|
|
93
|
-
// remain correct.
|
|
94
230
|
const useAvatar = index === 0 ||
|
|
95
|
-
(previousUser
|
|
96
|
-
(previousDate
|
|
231
|
+
(!!previousUser && currentUser !== previousUser) ||
|
|
232
|
+
(!!previousDate && currentDate !== previousDate);
|
|
97
233
|
previousUser = currentUser;
|
|
98
234
|
previousDate = currentDate;
|
|
99
|
-
const user = item.createdByCustomer
|
|
235
|
+
const user = item.createdByCustomer !== undefined
|
|
236
|
+
? item.createdByCustomer
|
|
237
|
+
? 'customer'
|
|
238
|
+
: 'internal'
|
|
239
|
+
: currentUser === 'Case Diagnostics' || currentUser === 'GSS Tools'
|
|
240
|
+
? 'internal'
|
|
241
|
+
: 'customer';
|
|
100
242
|
const leftEvent = {
|
|
101
243
|
date: currentDate,
|
|
102
244
|
text: format(eventDate, 'h:mm a zzz'),
|
|
@@ -105,8 +247,11 @@ export const transformApiResponseToTimelineData = (apiResponse) => {
|
|
|
105
247
|
if (item.type === 'Change') {
|
|
106
248
|
outputText = applyReplacements(item);
|
|
107
249
|
}
|
|
250
|
+
else {
|
|
251
|
+
outputText = stripHTML(outputText);
|
|
252
|
+
}
|
|
108
253
|
const rightEvent = {
|
|
109
|
-
date:
|
|
254
|
+
date: `${item.createdByUserName} ${outputText}`,
|
|
110
255
|
text: '',
|
|
111
256
|
user: user,
|
|
112
257
|
useAvatar: useAvatar,
|
|
@@ -114,24 +259,27 @@ export const transformApiResponseToTimelineData = (apiResponse) => {
|
|
|
114
259
|
return {
|
|
115
260
|
left: leftEvent,
|
|
116
261
|
right: rightEvent,
|
|
117
|
-
photoUrl: item.photoUrl,
|
|
118
|
-
userName: currentUser,
|
|
119
262
|
};
|
|
120
263
|
});
|
|
121
264
|
return timelineEvents;
|
|
122
265
|
};
|
|
123
|
-
|
|
266
|
+
function stripHTML(htmlString) {
|
|
267
|
+
const anchorTagRegex = /<a[^>]*>(.*?)<\/a>/g;
|
|
268
|
+
// We are trying to return the text without having the info in the anchor.
|
|
269
|
+
return htmlString.replace(anchorTagRegex, '');
|
|
270
|
+
}
|
|
271
|
+
const Timeline = ({ caseNumber }) => {
|
|
124
272
|
const { t } = useTranslation();
|
|
125
273
|
const [timelineEvents, setTimelineEvents] = useState([]);
|
|
126
274
|
const [originalTimelineEvents, setOriginalTimelineEvents] = useState([]);
|
|
275
|
+
const [isFetchingData, setIsFetchingData] = useState();
|
|
127
276
|
const lastNodeRef = useRef(null);
|
|
128
|
-
const { historyItems, loading: isFetchingData, error } = useCaseHistory(sfdcCaseId);
|
|
129
|
-
const fetchError = error ? t('Unable to connect') : null;
|
|
130
277
|
const [dateValue, setDateValue] = useState('');
|
|
131
278
|
const [searchValue, setSearchValue] = useState('');
|
|
132
279
|
const [filteredEvents, setFilteredEvents] = useState([]);
|
|
133
280
|
const [isSelectOpen, setIsSelectOpen] = useState(false);
|
|
134
281
|
const [selectedOrder, setSelectedOrder] = useState('Newest to Oldest');
|
|
282
|
+
const [fetchError, setFetchError] = useState(null);
|
|
135
283
|
const [page, setPage] = useState(1);
|
|
136
284
|
const [perPage, setPerPage] = useState(20);
|
|
137
285
|
const onSetPage = (_, newPage) => {
|
|
@@ -159,34 +307,52 @@ const Timeline = ({ caseNumber, sfdcCaseId }) => {
|
|
|
159
307
|
}
|
|
160
308
|
setIsSelectOpen(false);
|
|
161
309
|
};
|
|
162
|
-
// "Newest to Oldest" is the native API order (SF returns history newest-first).
|
|
163
|
-
// "Oldest to Newest" reverses it. Avatar logic must be reapplied after reorder.
|
|
164
310
|
const reorderTimelineEvents = (order) => {
|
|
165
311
|
const events = order === 'Newest to Oldest' ? [...originalTimelineEvents] : [...originalTimelineEvents].reverse();
|
|
166
312
|
setTimelineEvents(applyAvatarLogic(events));
|
|
167
313
|
};
|
|
168
|
-
// Re-derives avatar/date-header boundaries after list mutations (filter, sort, paginate).
|
|
169
314
|
const applyAvatarLogic = (events) => {
|
|
170
315
|
let previousUser = null;
|
|
171
316
|
let previousDate = null;
|
|
172
317
|
return events.map((event, index) => {
|
|
173
|
-
const currentUser = event.
|
|
318
|
+
const currentUser = event.right.date.split(' ')[0];
|
|
174
319
|
const currentDate = event.left.date;
|
|
175
320
|
const useAvatar = index === 0 ||
|
|
176
|
-
(previousUser
|
|
177
|
-
(previousDate
|
|
321
|
+
(!!previousUser && currentUser !== previousUser) ||
|
|
322
|
+
(!!previousDate && currentDate !== previousDate);
|
|
178
323
|
previousUser = currentUser;
|
|
179
324
|
previousDate = currentDate;
|
|
180
325
|
return Object.assign(Object.assign({}, event), { right: Object.assign(Object.assign({}, event.right), { useAvatar: useAvatar }) });
|
|
181
326
|
});
|
|
182
327
|
};
|
|
183
328
|
useEffect(() => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
329
|
+
function fetchHistory() {
|
|
330
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
331
|
+
setIsFetchingData(true);
|
|
332
|
+
setFetchError(null);
|
|
333
|
+
const options = {
|
|
334
|
+
sortField: 'createdDate',
|
|
335
|
+
sortOrder: 'DESC',
|
|
336
|
+
showVerbose: true,
|
|
337
|
+
};
|
|
338
|
+
try {
|
|
339
|
+
const response = yield caseHistory.getHistoryv1(caseNumber, options);
|
|
340
|
+
const transformedData = transformApiResponseToTimelineData(response);
|
|
341
|
+
setTimelineEvents(transformedData);
|
|
342
|
+
setOriginalTimelineEvents(transformedData);
|
|
343
|
+
}
|
|
344
|
+
catch (error) {
|
|
345
|
+
console.error('Failed to fetch history:', error);
|
|
346
|
+
setFetchError(t('Unable to connect'));
|
|
347
|
+
}
|
|
348
|
+
finally {
|
|
349
|
+
setIsFetchingData(false);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
188
352
|
}
|
|
189
|
-
|
|
353
|
+
fetchHistory();
|
|
354
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
355
|
+
}, [caseNumber]);
|
|
190
356
|
const futureDateValidator = (date) => {
|
|
191
357
|
const today = new Date();
|
|
192
358
|
today.setHours(0, 0, 0, 0); // Normalize to midnight
|
|
@@ -195,9 +361,6 @@ const Timeline = ({ caseNumber, sfdcCaseId }) => {
|
|
|
195
361
|
}
|
|
196
362
|
return '';
|
|
197
363
|
};
|
|
198
|
-
// Measures the DOM to shorten the vertical timeline connector line so it does not
|
|
199
|
-
// extend past the last node. Sets the --timeline-bottom CSS variable, recomputed
|
|
200
|
-
// on resize and list changes via requestAnimationFrame.
|
|
201
364
|
const updateLineStyle = () => {
|
|
202
365
|
const timelineElement = document.querySelector('.timeline');
|
|
203
366
|
if (timelineElement) {
|
|
@@ -232,10 +395,7 @@ const Timeline = ({ caseNumber, sfdcCaseId }) => {
|
|
|
232
395
|
timelineElement.style.setProperty('--timeline-bottom', '0px');
|
|
233
396
|
}
|
|
234
397
|
}
|
|
235
|
-
return () =>
|
|
236
|
-
debouncedUpdateLineStyle.cancel();
|
|
237
|
-
window.removeEventListener('resize', debouncedUpdateLineStyle);
|
|
238
|
-
};
|
|
398
|
+
return () => window.removeEventListener('resize', debouncedUpdateLineStyle);
|
|
239
399
|
}, [isFetchingData, filteredEvents, page, perPage]);
|
|
240
400
|
const handleSearchChange = (_, value) => {
|
|
241
401
|
setSearchValue(value.trim());
|
|
@@ -274,6 +434,7 @@ const Timeline = ({ caseNumber, sfdcCaseId }) => {
|
|
|
274
434
|
}, [searchValue, dateValue, timelineEvents]);
|
|
275
435
|
const handleReload = (e) => {
|
|
276
436
|
e.preventDefault();
|
|
437
|
+
window.location.href = window.location.href;
|
|
277
438
|
window.location.reload();
|
|
278
439
|
};
|
|
279
440
|
const renderTimelineContent = () => {
|
|
@@ -291,7 +452,7 @@ const Timeline = ({ caseNumber, sfdcCaseId }) => {
|
|
|
291
452
|
React.createElement(Trans, null, "Try modifying your search query or changing the date range and try again."))));
|
|
292
453
|
}
|
|
293
454
|
const paginatedEvents = filteredEvents.slice((page - 1) * perPage, page * perPage);
|
|
294
|
-
return (React.createElement(React.Fragment, null, paginatedEvents.map((node, index) => (React.createElement(TimelineNode, { key: index, leftEvent: node.left, rightEvent: node.right, user: node.right.user, useAvatar: node.right.useAvatar,
|
|
455
|
+
return (React.createElement(React.Fragment, null, paginatedEvents.map((node, index) => (React.createElement(TimelineNode, { key: index, leftEvent: node.left, rightEvent: node.right, user: node.right.user, useAvatar: node.right.useAvatar, searchValue: searchValue, highlightDate: !!dateValue, ref: index === paginatedEvents.length - 1 ? lastNodeRef : null })))));
|
|
295
456
|
};
|
|
296
457
|
return (React.createElement(React.Fragment, null,
|
|
297
458
|
React.createElement("div", { className: "timelineMenu" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAuB3B,OAAO,KAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAuB3B,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,sBA0LxC,CAAC"}
|
|
@@ -22,7 +22,6 @@ import React, { useContext, useEffect, useState } from 'react';
|
|
|
22
22
|
import { Trans } from 'react-i18next';
|
|
23
23
|
import { CaseSummaryStates } from '../../../../constants/caseDetailsConstants';
|
|
24
24
|
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
25
|
-
import { useCaseComments } from '../../../../hooks/useCaseComments';
|
|
26
25
|
import { CaseSummaryErrorMessage } from './CaseSummaryErrorMessage';
|
|
27
26
|
export const CaseSummary = (props) => {
|
|
28
27
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -30,14 +29,10 @@ export const CaseSummary = (props) => {
|
|
|
30
29
|
const [caseSummaryData, setCaseSummaryData] = useState(getApiResourceObject(null, true));
|
|
31
30
|
const [caseSummaryState, setCaseSummaryState] = useState();
|
|
32
31
|
const [errorMessage, setErrorMessage] = useState('');
|
|
33
|
-
const {
|
|
32
|
+
const { caseComments, caseLanguage } = useCaseSelector((state) => ({
|
|
33
|
+
caseComments: state.caseDetails.comments,
|
|
34
34
|
caseLanguage: state.caseDetails.caseLanguage,
|
|
35
|
-
caseSalesforceId: state.caseDetails.id,
|
|
36
35
|
}), isEqual);
|
|
37
|
-
const { comments: caseComments } = useCaseComments({
|
|
38
|
-
caseId: caseSalesforceId,
|
|
39
|
-
skip: !caseSalesforceId,
|
|
40
|
-
});
|
|
41
36
|
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
42
37
|
const isInternal = (_b = (_a = loggedInUserRights === null || loggedInUserRights === void 0 ? void 0 : loggedInUserRights.data) === null || _a === void 0 ? void 0 : _a.isInternal) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
43
38
|
const onCloseFeedbackModal = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAe/F,OAAO,KAAsC,MAAM,OAAO,CAAC;AAiB3D,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,qBA8MtD"}
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
11
10
|
import { escalations, publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Button, ButtonVariant, Flex, FlexItem } from '@patternfly/react-core';
|
|
13
12
|
import { LoadingIndicator, PFTable, TableComponent, ToastNotification, useFetch, } from '@rh-support/components';
|
|
@@ -19,10 +18,11 @@ import isEqual from 'lodash/isEqual';
|
|
|
19
18
|
import React, { useEffect, useRef, useState } from 'react';
|
|
20
19
|
import { Trans, useTranslation } from 'react-i18next';
|
|
21
20
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
22
|
-
import { useCaseDetailsPageDispatchContext } from '../../../../context/CaseDetailsPageContext';
|
|
23
|
-
import {
|
|
21
|
+
import { useCaseDetailsPageDispatchContext, useCaseDetailsPageStateContext, } from '../../../../context/CaseDetailsPageContext';
|
|
22
|
+
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../../context/CaseDiscussionTabContext';
|
|
24
23
|
import { escalationStatus } from '../../../../models/escalation';
|
|
25
24
|
import { fetchCaseEscalations } from '../../../../reducers/CaseDetailsPageReducer';
|
|
25
|
+
import { updateDiscussionStateComments } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
26
26
|
import { checkForCaseStatusToggleOnAttachOrComment } from '../../../../reducers/CaseReducer';
|
|
27
27
|
const ESCALATION_MSG = 'Request Management Escalation:';
|
|
28
28
|
const UPDATE_ESCALATION_MSG = 'Escalation update requested. You will receive an update from a manager shortly.';
|
|
@@ -30,7 +30,6 @@ const REOPEN_ESCALATION_MSG = 'Escalation reopened. A manager will review your r
|
|
|
30
30
|
const CLOSURE_ESCALATION_MSG = 'Escalation closed.';
|
|
31
31
|
export default function RMEEscalationList(props) {
|
|
32
32
|
const { t } = useTranslation();
|
|
33
|
-
const apolloClient = useApolloClient();
|
|
34
33
|
const { request: updateEscalationRequest, isFetching: isUpdatingEscalation } = useFetch(escalations.updateEscalations, { propgateErrors: true });
|
|
35
34
|
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
36
35
|
propgateErrors: true,
|
|
@@ -38,7 +37,9 @@ export default function RMEEscalationList(props) {
|
|
|
38
37
|
const { request: updateCaseRequest, isFetching: isUpdatingCase } = useFetch(publicApi.kase.updateCase, {
|
|
39
38
|
propgateErrors: true,
|
|
40
39
|
});
|
|
41
|
-
const
|
|
40
|
+
const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
|
|
41
|
+
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
42
|
+
const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
|
|
42
43
|
const caseDetailsPageDispatch = useCaseDetailsPageDispatchContext();
|
|
43
44
|
const escalationUpdateInProgessIds = useRef([]);
|
|
44
45
|
const caseDispatch = useCaseDispatch();
|
|
@@ -60,13 +61,14 @@ export default function RMEEscalationList(props) {
|
|
|
60
61
|
});
|
|
61
62
|
const submitEscalationComment = (escalationNum, comment, message) => __awaiter(this, void 0, void 0, function* () {
|
|
62
63
|
try {
|
|
63
|
-
escalationNum &&
|
|
64
|
+
escalationNum &&
|
|
65
|
+
fetchCaseEscalations(caseDetailsPageDispatch, props.caseNumber, props.accountNumber, false);
|
|
64
66
|
yield postCommentRequest({
|
|
65
67
|
caseNumber: props.caseNumber,
|
|
66
68
|
commentBody: comment,
|
|
67
69
|
contentType: 'plaintext',
|
|
68
70
|
});
|
|
69
|
-
|
|
71
|
+
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
70
72
|
yield updateCaseRequest(props.caseNumber, { customerEscalation: true });
|
|
71
73
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.isInternal, props.caseStatus);
|
|
72
74
|
escalationNum && ToastNotification.addSuccessMessage(message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkHpD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
2
1
|
import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
|
|
3
2
|
import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
4
3
|
import { haventLoadedMetadata } from '@rh-support/utils';
|
|
@@ -8,14 +7,13 @@ import React, { useContext, useEffect } from 'react';
|
|
|
8
7
|
import { Trans, useTranslation } from 'react-i18next';
|
|
9
8
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
10
9
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
11
|
-
|
|
10
|
+
import { Hostname } from '../ImproveCase/Hostname';
|
|
12
11
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
13
12
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
14
13
|
export default function CaseInformation(props) {
|
|
15
14
|
const { t } = useTranslation();
|
|
16
15
|
const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
17
16
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
18
|
-
const apolloClient = useApolloClient();
|
|
19
17
|
const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
|
|
20
18
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
21
19
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
@@ -40,13 +38,13 @@ export default function CaseInformation(props) {
|
|
|
40
38
|
}
|
|
41
39
|
const allPromisses = [];
|
|
42
40
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
43
|
-
allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer,
|
|
41
|
+
allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
|
|
44
42
|
}
|
|
45
43
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
46
|
-
allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer,
|
|
44
|
+
allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
|
|
47
45
|
}
|
|
48
46
|
if (haventLoadedMetadata(caseLanguages)) {
|
|
49
|
-
allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer
|
|
47
|
+
allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
|
|
50
48
|
}
|
|
51
49
|
Promise.all(allPromisses);
|
|
52
50
|
}, [
|
|
@@ -58,7 +56,6 @@ export default function CaseInformation(props) {
|
|
|
58
56
|
loggedInUserJwtToken,
|
|
59
57
|
selectedAccountDetails,
|
|
60
58
|
loggedInUsersAccount.data.secureSupport,
|
|
61
|
-
apolloClient,
|
|
62
59
|
]);
|
|
63
60
|
return (React.createElement(React.Fragment, null,
|
|
64
61
|
React.createElement(LoadingIndicator, { show: isMetadataLoading(), size: "lg" }),
|
|
@@ -80,6 +77,7 @@ export default function CaseInformation(props) {
|
|
|
80
77
|
!isMetadataLoadingError() &&
|
|
81
78
|
loggedInUserRights.data.canManageCases() && (React.createElement(React.Fragment, null,
|
|
82
79
|
React.createElement("form", null,
|
|
80
|
+
React.createElement(Hostname, null),
|
|
83
81
|
React.createElement(OpenShiftClusterId, null),
|
|
84
82
|
React.createElement(ClusterRecommendations, { className: "push-bottom" }),
|
|
85
83
|
React.createElement(KtQuestions, null))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,wBAAgB,kBAAkB,sBAsVjC"}
|