@rh-support/troubleshoot 2.6.287 → 2.6.295
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/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +42 -12
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +7 -5
- 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 +14 -10
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +24 -18
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +9 -6
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +7 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
- 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 +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/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/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +3 -2
- 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 -9
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +11 -12
- 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 +19 -53
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +16 -18
- 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.js +1 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +50 -64
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +106 -23
- 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/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/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +18 -11
- package/lib/esm/reducers/CaseConstNTypes.d.ts +86 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +5 -0
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +22 -5
- package/lib/esm/reducers/CaseHelpers.d.ts +2 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +34 -2
- 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 +27 -8
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +113 -29
- package/package.json +5 -5
|
@@ -7,11 +7,12 @@ 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';
|
|
10
11
|
import { Alert, AlertVariant, Button, ButtonVariant, ExpandableSection, Label, ModalVariant, } from '@patternfly/react-core';
|
|
11
12
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
12
13
|
import LockIcon from '@patternfly/react-icons/dist/js/icons/lock-icon';
|
|
13
14
|
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
14
|
-
import { CloseCaseModal, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
15
|
+
import { CloseCaseModal, fetchAllStatuses, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
15
16
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
16
17
|
import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct, PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, } from '@rh-support/utils';
|
|
17
18
|
import isEqual from 'lodash/isEqual';
|
|
@@ -22,8 +23,8 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
22
23
|
import { CaseOverviewDispatchContext, CaseOverviewStateContext } from '../../../context/CaseOverviewContext';
|
|
23
24
|
import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMessage';
|
|
24
25
|
import { SupportLevelDisplay } from '../../../reducers/CaseConstNTypes';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
26
|
+
import { fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
|
|
27
|
+
import { updateCaseDetailsGraphQL } from '../../../reducers/CaseReducer';
|
|
27
28
|
import Severity from '../../CaseInformation/Severity';
|
|
28
29
|
import { usePostComment } from '../../shared/usePostComment';
|
|
29
30
|
import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
|
|
@@ -49,14 +50,14 @@ export default function CaseOverview(props) {
|
|
|
49
50
|
const { isExportingPDF, exportPDFButton } = useContext(PDFContext);
|
|
50
51
|
const reopenStatusRef = useRef(null);
|
|
51
52
|
const { postComment, isPostingComment } = usePostComment({ caseNumber: props.caseNumber });
|
|
52
|
-
const { product, version, status, caseType, createdDate,
|
|
53
|
+
const { product, version, status, caseType, createdDate, createdByName, ownerId, caseNumber, entitlementSla, cep, accountNumber, isPrivate, isCaseUpdating, contactIsPartner, hotfixRequested, hotfixDelivered, selectedAccountDetails, firstCaseInactivityWarningSentAt, secondCaseInactivityWarningSentAt, } = useCaseSelector((state) => ({
|
|
53
54
|
product: state.caseDetails.product,
|
|
54
55
|
version: state.caseDetails.version,
|
|
55
56
|
status: state.caseDetails.status,
|
|
56
57
|
caseType: state.caseDetails.caseType,
|
|
57
58
|
caseSeverity: state.caseDetails.severity,
|
|
58
59
|
createdDate: state.caseDetails.createdDate,
|
|
59
|
-
|
|
60
|
+
createdByName: state.caseDetails.createdByName,
|
|
60
61
|
ownerId: state.caseDetails.ownerId,
|
|
61
62
|
caseNumber: state.caseDetails.caseNumber,
|
|
62
63
|
entitlementSla: state.caseDetails.entitlementSla,
|
|
@@ -74,7 +75,12 @@ export default function CaseOverview(props) {
|
|
|
74
75
|
const canEditCase = useCanEditCase();
|
|
75
76
|
const caseDispatch = useCaseDispatch();
|
|
76
77
|
const globalMetadataDispatchContext = useContext(GlobalMetadataDispatchContext);
|
|
77
|
-
const
|
|
78
|
+
const apolloClient = useApolloClient();
|
|
79
|
+
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
80
|
+
const updateOverviewCaseDetails = (payload) => updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, payload, false, {
|
|
81
|
+
existingCaseDetails,
|
|
82
|
+
});
|
|
83
|
+
const { globalMetadataState: { allCaseTypes, allCaseSeverities, allCaseStatuses, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
78
84
|
const canManageCase = loggedInUserRights.data.canManageCases();
|
|
79
85
|
const switchedCaseType = toNewCaseTypeSwitcher(caseType);
|
|
80
86
|
const updatingUser = loggedInUsersAccount.data.name;
|
|
@@ -89,24 +95,24 @@ export default function CaseOverview(props) {
|
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
97
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
92
|
-
fetchCaseSeverities(globalMetadataDispatchContext,
|
|
98
|
+
fetchCaseSeverities(globalMetadataDispatchContext, apolloClient);
|
|
93
99
|
}
|
|
94
100
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
95
|
-
fetchCaseTypes(globalMetadataDispatchContext,
|
|
101
|
+
fetchCaseTypes(globalMetadataDispatchContext, apolloClient);
|
|
96
102
|
}
|
|
97
|
-
if (haventLoadedMetadata(
|
|
98
|
-
fetchAllStatuses(
|
|
103
|
+
if (haventLoadedMetadata(allCaseStatuses)) {
|
|
104
|
+
fetchAllStatuses(globalMetadataDispatchContext, apolloClient);
|
|
99
105
|
}
|
|
100
106
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
101
107
|
}, [
|
|
102
108
|
globalMetadataDispatchContext,
|
|
109
|
+
apolloClient,
|
|
103
110
|
allCaseSeverities,
|
|
104
111
|
allCaseTypes,
|
|
105
|
-
|
|
112
|
+
allCaseStatuses,
|
|
106
113
|
caseOverviewState.caseDetailsHydra,
|
|
107
114
|
canSeeCaseOwnerInfo,
|
|
108
115
|
caseNumber,
|
|
109
|
-
loggedInUsersAccount.data.secureSupport,
|
|
110
116
|
]);
|
|
111
117
|
const onTypeChange = (type) => __awaiter(this, void 0, void 0, function* () {
|
|
112
118
|
if (canEditCase.alert())
|
|
@@ -117,7 +123,7 @@ export default function CaseOverview(props) {
|
|
|
117
123
|
if (type === PreviousCaseTypes.FEATURE_ENHANCEMENT) {
|
|
118
124
|
newCaseDetails = Object.assign(Object.assign({}, newCaseDetails), { fts: false });
|
|
119
125
|
}
|
|
120
|
-
yield
|
|
126
|
+
yield updateOverviewCaseDetails(newCaseDetails);
|
|
121
127
|
setTypeUpdating(caseOverviewDispatch, false);
|
|
122
128
|
ToastNotification.addSuccessMessage(t('Support type has been successfully updated'));
|
|
123
129
|
}
|
|
@@ -138,7 +144,7 @@ export default function CaseOverview(props) {
|
|
|
138
144
|
});
|
|
139
145
|
setSeverityUpdating(caseOverviewDispatch, true);
|
|
140
146
|
try {
|
|
141
|
-
yield
|
|
147
|
+
yield updateOverviewCaseDetails(payLoad);
|
|
142
148
|
setSeverityUpdating(caseOverviewDispatch, false);
|
|
143
149
|
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
144
150
|
}
|
|
@@ -157,7 +163,7 @@ export default function CaseOverview(props) {
|
|
|
157
163
|
reopenedReasonOther: reopenedReasonOther,
|
|
158
164
|
};
|
|
159
165
|
try {
|
|
160
|
-
yield
|
|
166
|
+
yield updateOverviewCaseDetails(updateStatusObj);
|
|
161
167
|
setStatusUpdating(caseOverviewDispatch, false);
|
|
162
168
|
onStatusUpdate && (yield onStatusUpdate());
|
|
163
169
|
ToastNotification.addSuccessMessage(t('Status has been successfully updated'));
|
|
@@ -289,13 +295,13 @@ export default function CaseOverview(props) {
|
|
|
289
295
|
React.createElement("div", { className: "created-by" },
|
|
290
296
|
React.createElement("h3", { className: "subheading subheading-sm" },
|
|
291
297
|
React.createElement(Trans, null, "Created by")),
|
|
292
|
-
React.createElement("div", null,
|
|
298
|
+
React.createElement("div", null, createdByName),
|
|
293
299
|
React.createElement("div", null, createdDate ? React.createElement(DateTime, { dateTimeString: createdDate }) : null)),
|
|
294
300
|
canSeeCaseOwnerInfo && (React.createElement(CaseOwnerInfo, { owner: ownerId, caseDetailsHydra: caseOverviewState.caseDetailsHydra }))),
|
|
295
301
|
React.createElement("div", { className: "case-overview-secondary card card-md card-light push-bottom" },
|
|
296
302
|
React.createElement("div", { className: "pf-v6-l-grid pf-m-gutter pf-m-all-4-col-on-lg" },
|
|
297
303
|
React.createElement("div", { className: "form-wrapper" },
|
|
298
|
-
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase ||
|
|
304
|
+
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || allCaseStatuses.isFetching, allStatuses: allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: allCaseStatuses.isError })),
|
|
299
305
|
React.createElement("div", { className: "form-wrapper" },
|
|
300
306
|
React.createElement(CaseType, { selectedType: switchedCaseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching || isCaseUpdating, allTypes: newCaseTypesArray, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
|
|
301
307
|
React.createElement("div", { className: "form-wrapper" },
|
|
@@ -318,5 +324,5 @@ export default function CaseOverview(props) {
|
|
|
318
324
|
setShowReopenCaseModal(false);
|
|
319
325
|
}), onClose: () => {
|
|
320
326
|
setShowReopenCaseModal(false);
|
|
321
|
-
}, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, allStatuses:
|
|
327
|
+
}, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, allStatuses: allCaseStatuses.data, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
|
|
322
328
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewEssTermsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NewEssTermsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAYnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACrB;AA4BD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA4Y7C"}
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
11
12
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
12
13
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
@@ -19,7 +20,7 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
19
20
|
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
20
21
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
21
22
|
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
22
|
-
import { checkForCaseStatusToggleOnAttachOrComment,
|
|
23
|
+
import { checkForCaseStatusToggleOnAttachOrComment, updateCaseDetailsGraphQL } from '../../../reducers/CaseReducer';
|
|
23
24
|
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
24
25
|
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
25
26
|
try {
|
|
@@ -49,8 +50,10 @@ export function NewEssTermsModal(props) {
|
|
|
49
50
|
remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
|
|
50
51
|
}), isEqual);
|
|
51
52
|
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
53
|
+
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
52
54
|
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
53
55
|
const caseDispatch = useCaseDispatch();
|
|
56
|
+
const apolloClient = useApolloClient();
|
|
54
57
|
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
55
58
|
id: '5001',
|
|
56
59
|
isDefault: false,
|
|
@@ -129,11 +132,10 @@ export function NewEssTermsModal(props) {
|
|
|
129
132
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
130
133
|
const requestComment = t(`\n**Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).**\n\nSubmitted a remote session request with following details:\n\n**Preferred Time and Expectations of remote session**\n${sessionExpectations}\n\n**Describe the impact to you or the business**\n${impact}\n\n${sessionLink ? `**Remote session link**\n${formatSessionLinks(sessionLink)}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
|
|
131
134
|
try {
|
|
132
|
-
yield
|
|
135
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
|
|
133
136
|
remoteSessionTermsAcked: true,
|
|
134
|
-
screenSessionRequested: true,
|
|
135
137
|
waitingOnCallback: true,
|
|
136
|
-
});
|
|
138
|
+
}, false, { existingCaseDetails });
|
|
137
139
|
try {
|
|
138
140
|
yield postCommentRequest({
|
|
139
141
|
caseNumber: props.caseNumber,
|
|
@@ -170,8 +172,9 @@ export function NewEssTermsModal(props) {
|
|
|
170
172
|
onCancel();
|
|
171
173
|
setAgreeLoading(false);
|
|
172
174
|
setIsTermsChecked(false);
|
|
173
|
-
yield
|
|
174
|
-
|
|
175
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
|
|
176
|
+
remoteSessionTermsAcked: false,
|
|
177
|
+
waitingOnCallback: false,
|
|
175
178
|
});
|
|
176
179
|
// ToastNotification.addDangerMessage(
|
|
177
180
|
// t('Could not submit a request for remote session'),
|
package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACrB;AA4BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBAqYxD"}
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
11
12
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
12
13
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
@@ -19,7 +20,7 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
19
20
|
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
20
21
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
21
22
|
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
22
|
-
import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag,
|
|
23
|
+
import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag, updateCaseDetailsGraphQL, } from '../../../reducers/CaseReducer';
|
|
23
24
|
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
24
25
|
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
25
26
|
try {
|
|
@@ -47,10 +48,12 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
47
48
|
const { t } = useTranslation();
|
|
48
49
|
const { remoteSessionTermsAcked } = useCaseSelector((state) => ({
|
|
49
50
|
remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
|
|
51
|
+
caseDetails: state.caseDetails,
|
|
50
52
|
}), isEqual);
|
|
51
53
|
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
52
54
|
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
53
55
|
const caseDispatch = useCaseDispatch();
|
|
56
|
+
const apolloClient = useApolloClient();
|
|
54
57
|
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
55
58
|
id: '5001',
|
|
56
59
|
isDefault: false,
|
|
@@ -115,14 +118,15 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
115
118
|
props.onClose && props.onClose();
|
|
116
119
|
};
|
|
117
120
|
const toggleRemoteSessionForm = () => setIsRemoteSessionForm(true);
|
|
121
|
+
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
118
122
|
// Function to ack remote session terms and post comment
|
|
119
123
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
120
124
|
const requestComment = t(`\n**Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).**\n\nSubmitted a remote session request with following details:\n\n**Preferred Time and Expectations of remote session**\n${sessionExpectations}\n\n**Describe the impact to you or the business**\n${impact}\n\n${sessionLink ? `**Remote session link**\n${formatSessionLinks(sessionLink)}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
|
|
121
125
|
try {
|
|
122
|
-
yield
|
|
126
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
|
|
123
127
|
remoteSessionTermsAcked: true,
|
|
124
128
|
waitingOnCallback: true,
|
|
125
|
-
});
|
|
129
|
+
}, false, { existingCaseDetails });
|
|
126
130
|
setRemoteRiderFlag(caseDispatch, true);
|
|
127
131
|
try {
|
|
128
132
|
yield postCommentRequest({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAwC/D,wBAAgB,sBAAsB,sBAyXrC"}
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
import { contacts } from '@cee-eng/hydrajs';
|
|
11
12
|
import { InputGroupText, ValidatedOptions } from '@patternfly/react-core';
|
|
12
13
|
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
|
|
@@ -14,6 +15,7 @@ import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon
|
|
|
14
15
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
15
16
|
import { getPhoneObj, PhoneInput, ToastNotification } from '@rh-support/components';
|
|
16
17
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
18
|
+
import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
17
19
|
import isEmpty from 'lodash/isEmpty';
|
|
18
20
|
import isEqual from 'lodash/isEqual';
|
|
19
21
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -26,13 +28,34 @@ import { setCaseState, updateCaseDetails } from '../../../../reducers/CaseReduce
|
|
|
26
28
|
import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
|
|
27
29
|
import { removeAllChars, trimAndReplacePlus } from '../../../shared/utils';
|
|
28
30
|
import { PDFContext } from '../../PDFContainer';
|
|
31
|
+
function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
34
|
+
const { data } = yield apolloClient.query({
|
|
35
|
+
query: GET_ACCOUNT_CONTACTS,
|
|
36
|
+
variables: {
|
|
37
|
+
accountNumber: { eq: accountNumber },
|
|
38
|
+
contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
|
|
39
|
+
first: 1,
|
|
40
|
+
},
|
|
41
|
+
fetchPolicy: 'network-only',
|
|
42
|
+
});
|
|
43
|
+
const response = data;
|
|
44
|
+
const contactNode = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Contacts) === null || _g === void 0 ? void 0 : _g.edges) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.node;
|
|
45
|
+
return {
|
|
46
|
+
phone: (_l = (_k = contactNode === null || contactNode === void 0 ? void 0 : contactNode.Phone) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : '',
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
29
50
|
export function CaseContactPhoneNumber() {
|
|
30
51
|
var _a;
|
|
31
|
-
const
|
|
52
|
+
const apolloClient = useApolloClient();
|
|
53
|
+
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, accountNumberRef, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
32
54
|
phoneCountryCode: state.caseDetails.phoneCountryCode || '',
|
|
33
55
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
34
56
|
caseNumber: state.caseDetails.caseNumber,
|
|
35
57
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
58
|
+
accountNumberRef: state.caseDetails.accountNumberRef,
|
|
36
59
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
37
60
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
38
61
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
@@ -180,29 +203,17 @@ export function CaseContactPhoneNumber() {
|
|
|
180
203
|
if (contactSSOName === loggedInUser.data.ssoUsername) {
|
|
181
204
|
try {
|
|
182
205
|
setIsFetchingSSO(true);
|
|
183
|
-
const loggedInUserContact = yield (
|
|
206
|
+
const loggedInUserContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
|
|
184
207
|
setIsFetchingSSO(false);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
|
|
197
|
-
const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
|
|
198
|
-
_phoneAreaCodePrefixLineNumber = phoneLine;
|
|
199
|
-
_phoneCountryCode = countryCode;
|
|
200
|
-
_suppliedPhoneNumberVerified =
|
|
201
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
202
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
203
|
-
? hasLoggedInUserConfirmedPhoneNumber
|
|
204
|
-
: 'False';
|
|
205
|
-
}
|
|
208
|
+
const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
|
|
209
|
+
const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
|
|
210
|
+
_phoneAreaCodePrefixLineNumber = phoneLine;
|
|
211
|
+
_phoneCountryCode = countryCode;
|
|
212
|
+
_suppliedPhoneNumberVerified =
|
|
213
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
214
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
215
|
+
? hasLoggedInUserConfirmedPhoneNumber
|
|
216
|
+
: 'False';
|
|
206
217
|
}
|
|
207
218
|
catch (_a) {
|
|
208
219
|
_phoneAreaCodePrefixLineNumber = '';
|
|
@@ -216,18 +227,11 @@ export function CaseContactPhoneNumber() {
|
|
|
216
227
|
// user is openning case for others (use is partner or red hatter)
|
|
217
228
|
try {
|
|
218
229
|
setIsFetchingSSO(true);
|
|
219
|
-
const selectedContact = yield
|
|
230
|
+
const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
|
|
220
231
|
setIsFetchingSSO(false);
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
_suppliedPhoneNumberVerified = 'Deferred';
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
228
|
-
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
229
|
-
_suppliedPhoneNumberVerified = 'Deferred';
|
|
230
|
-
}
|
|
232
|
+
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
233
|
+
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
234
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
231
235
|
}
|
|
232
236
|
catch (e) {
|
|
233
237
|
_phoneAreaCodePrefixLineNumber = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAkBvD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAkBvD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAqE1D"}
|
|
@@ -4,11 +4,11 @@ import isEqual from 'lodash/isEqual';
|
|
|
4
4
|
import React, { useContext, useState } from 'react';
|
|
5
5
|
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
6
6
|
import { OwnerSelector } from '../../../AccountInfo/OwnerSelector';
|
|
7
|
-
import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
7
|
+
// import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
8
8
|
import Fts from '../../../CaseInformation/Fts';
|
|
9
|
-
import { Cep } from '../../../CaseManagement/Cep';
|
|
10
|
-
import { RHAssociatesSelector } from '../../../CaseManagement/RHAssociatesSelector';
|
|
11
|
-
import CaseContactSelector from '../../../CaseManagement/SendNotifications/CaseContactSelector';
|
|
9
|
+
// import { Cep } from '../../../CaseManagement/Cep';
|
|
10
|
+
// import { RHAssociatesSelector } from '../../../CaseManagement/RHAssociatesSelector';
|
|
11
|
+
// import CaseContactSelector from '../../../CaseManagement/SendNotifications/CaseContactSelector';
|
|
12
12
|
import { PartnerCaseHelper } from '../../ShareCase/PartnerCaseHelper';
|
|
13
13
|
import { ShareWithPartner } from '../../ShareCase/PartnerShare';
|
|
14
14
|
import { CaseContactPhoneNumber } from './CaseContactPhoneNumber';
|
|
@@ -26,7 +26,11 @@ export default function CaseDetailsManagement(props) {
|
|
|
26
26
|
}), isEqual);
|
|
27
27
|
const accountNumber = caseState.caseDetails.accountNumber;
|
|
28
28
|
const ability = useContext(AbilityContext);
|
|
29
|
-
const canSeeEmailNotifications = ability.can(
|
|
29
|
+
// const canSeeEmailNotifications = ability.can(
|
|
30
|
+
// resourceActions.PATCH,
|
|
31
|
+
// resources.CASE_DETAILS,
|
|
32
|
+
// CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS
|
|
33
|
+
// );
|
|
30
34
|
const canSeeInternalStatus = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_INTERNAL_STATUS);
|
|
31
35
|
const canSeeSBRGroups = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SBR_GROUP);
|
|
32
36
|
return (React.createElement(React.Fragment, null,
|
|
@@ -41,12 +45,8 @@ export default function CaseDetailsManagement(props) {
|
|
|
41
45
|
React.createElement(CaseContactPhoneNumberAlert, { isConfirm: true }),
|
|
42
46
|
canSeeInternalStatus && React.createElement(CaseInternalStatus, null),
|
|
43
47
|
canSeeSBRGroups && React.createElement(CaseSbrGroups, null),
|
|
44
|
-
React.createElement(CaseGroup, null),
|
|
45
48
|
React.createElement(CaseReferenceNumber, null),
|
|
46
|
-
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
47
|
-
React.createElement(RHAssociatesSelector, null),
|
|
48
49
|
React.createElement(Fts, { inlineEditable: true }),
|
|
49
|
-
React.createElement(Cep, null),
|
|
50
50
|
React.createElement(SFDCUrl, null),
|
|
51
51
|
React.createElement(ShareWithPartner, { routeProps: props.routeProps, isUpdatingPartner: isUpdatingPartner, accountNumber: accountNumber })))));
|
|
52
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBAuUrC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -7,12 +7,12 @@ 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';
|
|
10
11
|
import { Alert, AlertVariant, Button, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
11
12
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
12
13
|
import { AlertMessage, AlertType, SingleSelectDropdown, ToastNotification, useSelectKeyboardNavigator, } from '@rh-support/components';
|
|
13
14
|
import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
14
|
-
import {
|
|
15
|
-
import filter from 'lodash/filter';
|
|
15
|
+
import { haventLoadedMetadata, toOption } from '@rh-support/utils';
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
17
17
|
import isEqual from 'lodash/isEqual';
|
|
18
18
|
import isUndefined from 'lodash/isUndefined';
|
|
@@ -21,7 +21,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
|
21
21
|
import { Trans, useTranslation } from 'react-i18next';
|
|
22
22
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
23
23
|
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
24
|
-
import {
|
|
24
|
+
import { getVersionsDetails, updateCaseDetailsGraphQL } from '../../../../reducers/CaseReducer';
|
|
25
25
|
import { getProductObj } from '../../../shared/utils';
|
|
26
26
|
import { PDFContext } from '../../PDFContainer';
|
|
27
27
|
function ProductNVersion(props) {
|
|
@@ -32,22 +32,22 @@ function ProductNVersion(props) {
|
|
|
32
32
|
const [isVersionUpdating, setIsVersionUpdating] = useState(false);
|
|
33
33
|
const [isOpen, setIsOpen] = useState(false);
|
|
34
34
|
const textInputRef = useRef();
|
|
35
|
-
const { product, version, caseNumber,
|
|
35
|
+
const { product, version, caseNumber, existingCaseDetails, versionsDetails, isCaseUpdating } = useCaseSelector((state) => ({
|
|
36
36
|
product: state.caseDetails.product,
|
|
37
37
|
version: state.caseDetails.version,
|
|
38
|
-
contactSSOName: state.caseDetails.contactSSOName,
|
|
39
38
|
caseNumber: state.caseDetails.caseNumber,
|
|
39
|
+
existingCaseDetails: state.caseDetails,
|
|
40
40
|
versionsDetails: state.versionsDetails,
|
|
41
41
|
isCaseUpdating: state.isCaseUpdating,
|
|
42
42
|
}), isEqual);
|
|
43
43
|
const caseDispatch = useCaseDispatch();
|
|
44
44
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
45
|
+
const apolloClient = useApolloClient();
|
|
45
46
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
46
47
|
const [isProductInvalid, setIsProductInvalid] = useState(false);
|
|
47
48
|
const [isVersionInvalid, setIsVersionInvalid] = useState(false);
|
|
48
49
|
const [selectedProductLocal, setSelectedProductLocal] = useState(product);
|
|
49
50
|
const [selectedVersionLocal, setSelectedVersionLocal] = useState(version);
|
|
50
|
-
const [isSEProductApiIsDown, setIsSEProductApiIsDown] = useState(false);
|
|
51
51
|
const [inputValue, setInputValue] = useState(product);
|
|
52
52
|
const [shouldFilter, setShouldFilter] = useState(false);
|
|
53
53
|
const onToggleClick = () => {
|
|
@@ -112,19 +112,10 @@ function ProductNVersion(props) {
|
|
|
112
112
|
}
|
|
113
113
|
setIsProductUpdating(true);
|
|
114
114
|
setIsVersionUpdating(true);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
yield fetchCaseEntitlements(caseDispatch, contactSSOName, selectedProduct, undefined, true, caseNumber);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
124
|
-
product: selectedProduct,
|
|
125
|
-
version: selectedVersion,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
115
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, caseNumber, {
|
|
116
|
+
product: selectedProduct,
|
|
117
|
+
version: selectedVersion,
|
|
118
|
+
}, false, { existingCaseDetails });
|
|
128
119
|
setIsProductUpdating(false);
|
|
129
120
|
setIsVersionUpdating(false);
|
|
130
121
|
if (onlyVersionChanged) {
|
|
@@ -150,60 +141,29 @@ function ProductNVersion(props) {
|
|
|
150
141
|
});
|
|
151
142
|
// To check if version in invalid
|
|
152
143
|
const checkIfVersionIsInvalid = isVersionInvalid && isEmpty(selectedVersionLocal);
|
|
153
|
-
// when user changes selected product, we need to get the versions
|
|
154
144
|
useEffect(() => {
|
|
155
145
|
if (!selectedProductLocal)
|
|
156
146
|
return;
|
|
157
|
-
const getVersions = () => __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
try {
|
|
159
|
-
yield getVersionsDetails(caseDispatch, selectedProductLocal);
|
|
160
|
-
}
|
|
161
|
-
catch (e) {
|
|
162
|
-
console.log(e);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
// call sfdc version api to get version flags that we only get from sfdc api
|
|
166
|
-
// flags are used in severity components
|
|
167
|
-
getVersions();
|
|
168
|
-
// populate versions with SE product api versions
|
|
169
147
|
const productObj = getProductObj(allProducts.data.productsResult, selectedProductLocal);
|
|
170
|
-
if (productObj.
|
|
171
|
-
|
|
172
|
-
? productObj.versions.sort()
|
|
173
|
-
: productObj.versions;
|
|
174
|
-
setVersions(productVersions);
|
|
175
|
-
if (productVersions.length === 1 && !selectedVersionLocal) {
|
|
176
|
-
setSelectedVersionLocal(productVersions[0]);
|
|
177
|
-
updateProductVerstion(selectedProductLocal, productVersions[0]);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
setIsSEProductApiIsDown(true);
|
|
148
|
+
if (productObj.productId) {
|
|
149
|
+
getVersionsDetails(caseDispatch, apolloClient, productObj.productId, productObj.name || selectedProductLocal);
|
|
182
150
|
}
|
|
183
151
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
152
|
}, [selectedProductLocal, caseDispatch, allProducts.data]);
|
|
185
|
-
// observe when fetched versions are available
|
|
186
153
|
useEffect(() => {
|
|
187
|
-
|
|
154
|
+
var _a;
|
|
155
|
+
if (versionsDetails.isFetching || !((_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.length))
|
|
188
156
|
return;
|
|
189
157
|
const fetchedVersions = versionsDetails.data.map(({ name }) => name);
|
|
158
|
+
setVersions(fetchedVersions);
|
|
190
159
|
if (fetchedVersions.length === 1 && !selectedVersionLocal) {
|
|
191
|
-
setVersions(fetchedVersions);
|
|
192
160
|
setSelectedVersionLocal(fetchedVersions[0]);
|
|
193
161
|
updateProductVerstion(selectedProductLocal, fetchedVersions[0]);
|
|
194
|
-
return;
|
|
195
162
|
}
|
|
196
|
-
const productObj = getProductObj(allProducts.data.productsResult, selectedProductLocal);
|
|
197
|
-
const sfdcVersions = getUniqueSortedVersions(fetchedVersions);
|
|
198
|
-
const versionsForSelectedProduct = productObj.versions ? productObj.versions : sfdcVersions;
|
|
199
|
-
const productVersions = (productObj === null || productObj === void 0 ? void 0 : productObj.hasComponentsInsteadOfVersions)
|
|
200
|
-
? versionsForSelectedProduct.sort()
|
|
201
|
-
: versionsForSelectedProduct;
|
|
202
|
-
setVersions(productVersions);
|
|
203
163
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
204
164
|
}, [versionsDetails.data]);
|
|
205
165
|
const computeDropdownList = () => {
|
|
206
|
-
const list =
|
|
166
|
+
const list = allProducts.data.productsResult;
|
|
207
167
|
if (!list)
|
|
208
168
|
return [];
|
|
209
169
|
const options = shouldFilter && !isUndefined(inputValue) && !isEmpty(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())
|
|
@@ -233,10 +193,10 @@ function ProductNVersion(props) {
|
|
|
233
193
|
};
|
|
234
194
|
useEffect(() => {
|
|
235
195
|
if (haventLoadedMetadata(allProducts, (data) => isEmpty(data.productsResult))) {
|
|
236
|
-
fetchProducts(dispatchToGlobalMetadataReducer,
|
|
196
|
+
fetchProducts(dispatchToGlobalMetadataReducer, apolloClient);
|
|
237
197
|
}
|
|
238
198
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
239
|
-
}, [allProducts, dispatchToGlobalMetadataReducer,
|
|
199
|
+
}, [allProducts, dispatchToGlobalMetadataReducer, apolloClient]);
|
|
240
200
|
return (React.createElement(React.Fragment, null,
|
|
241
201
|
React.createElement(AlertMessage, { show: !allProducts.isFetching && allProducts.isError, title: t('There was an error loading products.'), variant: AlertType.DANGER }),
|
|
242
202
|
isEmpty(selectedVersionLocal) && (selectedVersionLocal === null || selectedVersionLocal === void 0 ? void 0 : selectedVersionLocal.length) < 2 && (React.createElement(Alert, { isInline: true, className: "pf-v6-u-mb-md", variant: AlertVariant.danger, title: React.createElement(Trans, null, "Please clear the errors to change the product on your case") })),
|
|
@@ -253,6 +213,6 @@ function ProductNVersion(props) {
|
|
|
253
213
|
React.createElement(SingleSelectDropdown, { className: "open-case-version", id: "version-dropdown", placeholder: t(`Select a version`), selected: getVersionSelectedDropdownOption, options: getVersionDropdownOptions, isInvalid: checkIfVersionIsInvalid, isDisabled: isVersionUpdating ||
|
|
254
214
|
(allProducts.isFetching && !allProducts.isError) ||
|
|
255
215
|
isEmpty(selectedProductLocal) ||
|
|
256
|
-
isCaseUpdating, onSelect: onVersionChange, isLoading: isVersionUpdating ||
|
|
216
|
+
isCaseUpdating, onSelect: onVersionChange, isLoading: isVersionUpdating || versionsDetails.isFetching, dataTrackingId: "case-details-version-selector", isScrollable: true }))))));
|
|
257
217
|
}
|
|
258
218
|
export default ProductNVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/Summary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/Summary.tsx"],"names":[],"mappings":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD,iBAAS,OAAO,CAAC,KAAK,EAAE,MAAM,qBAiM7B;kBAjMQ,OAAO;;;AAoMhB,eAAe,OAAO,CAAC"}
|