@rh-support/troubleshoot 2.6.296 → 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 +12 -42
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +5 -7
- 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 +10 -14
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +18 -24
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +6 -9
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +3 -7
- 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/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/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +2 -3
- 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/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 +53 -19
- 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.js +1 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +64 -50
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +23 -106
- 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 +2 -86
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +0 -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/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 +29 -113
- package/package.json +6 -6
- 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
|
@@ -7,12 +7,11 @@ 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 { Alert, AlertVariant, Button, ButtonVariant, ExpandableSection, Label, ModalVariant, } from '@patternfly/react-core';
|
|
12
11
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
13
12
|
import LockIcon from '@patternfly/react-icons/dist/js/icons/lock-icon';
|
|
14
13
|
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
15
|
-
import { CloseCaseModal,
|
|
14
|
+
import { CloseCaseModal, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
16
15
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
17
16
|
import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct, PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, } from '@rh-support/utils';
|
|
18
17
|
import isEqual from 'lodash/isEqual';
|
|
@@ -23,8 +22,8 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
23
22
|
import { CaseOverviewDispatchContext, CaseOverviewStateContext } from '../../../context/CaseOverviewContext';
|
|
24
23
|
import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMessage';
|
|
25
24
|
import { SupportLevelDisplay } from '../../../reducers/CaseConstNTypes';
|
|
26
|
-
import { fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
|
|
27
|
-
import {
|
|
25
|
+
import { fetchAllStatuses, fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
|
|
26
|
+
import { updateCaseDetails } from '../../../reducers/CaseReducer';
|
|
28
27
|
import Severity from '../../CaseInformation/Severity';
|
|
29
28
|
import { usePostComment } from '../../shared/usePostComment';
|
|
30
29
|
import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
|
|
@@ -50,14 +49,14 @@ export default function CaseOverview(props) {
|
|
|
50
49
|
const { isExportingPDF, exportPDFButton } = useContext(PDFContext);
|
|
51
50
|
const reopenStatusRef = useRef(null);
|
|
52
51
|
const { postComment, isPostingComment } = usePostComment({ caseNumber: props.caseNumber });
|
|
53
|
-
const { product, version, status, caseType, createdDate,
|
|
52
|
+
const { product, version, status, caseType, createdDate, createdById, ownerId, caseNumber, entitlementSla, cep, accountNumber, isPrivate, isCaseUpdating, contactIsPartner, hotfixRequested, hotfixDelivered, selectedAccountDetails, firstCaseInactivityWarningSentAt, secondCaseInactivityWarningSentAt, } = useCaseSelector((state) => ({
|
|
54
53
|
product: state.caseDetails.product,
|
|
55
54
|
version: state.caseDetails.version,
|
|
56
55
|
status: state.caseDetails.status,
|
|
57
56
|
caseType: state.caseDetails.caseType,
|
|
58
57
|
caseSeverity: state.caseDetails.severity,
|
|
59
58
|
createdDate: state.caseDetails.createdDate,
|
|
60
|
-
|
|
59
|
+
createdById: state.caseDetails.createdById,
|
|
61
60
|
ownerId: state.caseDetails.ownerId,
|
|
62
61
|
caseNumber: state.caseDetails.caseNumber,
|
|
63
62
|
entitlementSla: state.caseDetails.entitlementSla,
|
|
@@ -75,12 +74,7 @@ export default function CaseOverview(props) {
|
|
|
75
74
|
const canEditCase = useCanEditCase();
|
|
76
75
|
const caseDispatch = useCaseDispatch();
|
|
77
76
|
const globalMetadataDispatchContext = useContext(GlobalMetadataDispatchContext);
|
|
78
|
-
const
|
|
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);
|
|
77
|
+
const { globalMetadataState: { allCaseTypes, allCaseSeverities, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
84
78
|
const canManageCase = loggedInUserRights.data.canManageCases();
|
|
85
79
|
const switchedCaseType = toNewCaseTypeSwitcher(caseType);
|
|
86
80
|
const updatingUser = loggedInUsersAccount.data.name;
|
|
@@ -95,24 +89,24 @@ export default function CaseOverview(props) {
|
|
|
95
89
|
}
|
|
96
90
|
}
|
|
97
91
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
98
|
-
fetchCaseSeverities(globalMetadataDispatchContext,
|
|
92
|
+
fetchCaseSeverities(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
|
|
99
93
|
}
|
|
100
94
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
101
|
-
fetchCaseTypes(globalMetadataDispatchContext,
|
|
95
|
+
fetchCaseTypes(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
|
|
102
96
|
}
|
|
103
|
-
if (haventLoadedMetadata(allCaseStatuses)) {
|
|
104
|
-
fetchAllStatuses(
|
|
97
|
+
if (haventLoadedMetadata(caseOverviewState.allCaseStatuses)) {
|
|
98
|
+
fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
|
|
105
99
|
}
|
|
106
100
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
101
|
}, [
|
|
108
102
|
globalMetadataDispatchContext,
|
|
109
|
-
apolloClient,
|
|
110
103
|
allCaseSeverities,
|
|
111
104
|
allCaseTypes,
|
|
112
|
-
allCaseStatuses,
|
|
105
|
+
caseOverviewState.allCaseStatuses,
|
|
113
106
|
caseOverviewState.caseDetailsHydra,
|
|
114
107
|
canSeeCaseOwnerInfo,
|
|
115
108
|
caseNumber,
|
|
109
|
+
loggedInUsersAccount.data.secureSupport,
|
|
116
110
|
]);
|
|
117
111
|
const onTypeChange = (type) => __awaiter(this, void 0, void 0, function* () {
|
|
118
112
|
if (canEditCase.alert())
|
|
@@ -123,7 +117,7 @@ export default function CaseOverview(props) {
|
|
|
123
117
|
if (type === PreviousCaseTypes.FEATURE_ENHANCEMENT) {
|
|
124
118
|
newCaseDetails = Object.assign(Object.assign({}, newCaseDetails), { fts: false });
|
|
125
119
|
}
|
|
126
|
-
yield
|
|
120
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, newCaseDetails);
|
|
127
121
|
setTypeUpdating(caseOverviewDispatch, false);
|
|
128
122
|
ToastNotification.addSuccessMessage(t('Support type has been successfully updated'));
|
|
129
123
|
}
|
|
@@ -144,7 +138,7 @@ export default function CaseOverview(props) {
|
|
|
144
138
|
});
|
|
145
139
|
setSeverityUpdating(caseOverviewDispatch, true);
|
|
146
140
|
try {
|
|
147
|
-
yield
|
|
141
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, payLoad);
|
|
148
142
|
setSeverityUpdating(caseOverviewDispatch, false);
|
|
149
143
|
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
150
144
|
}
|
|
@@ -163,7 +157,7 @@ export default function CaseOverview(props) {
|
|
|
163
157
|
reopenedReasonOther: reopenedReasonOther,
|
|
164
158
|
};
|
|
165
159
|
try {
|
|
166
|
-
yield
|
|
160
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, updateStatusObj);
|
|
167
161
|
setStatusUpdating(caseOverviewDispatch, false);
|
|
168
162
|
onStatusUpdate && (yield onStatusUpdate());
|
|
169
163
|
ToastNotification.addSuccessMessage(t('Status has been successfully updated'));
|
|
@@ -295,13 +289,13 @@ export default function CaseOverview(props) {
|
|
|
295
289
|
React.createElement("div", { className: "created-by" },
|
|
296
290
|
React.createElement("h3", { className: "subheading subheading-sm" },
|
|
297
291
|
React.createElement(Trans, null, "Created by")),
|
|
298
|
-
React.createElement("div", null,
|
|
292
|
+
React.createElement("div", null, createdById),
|
|
299
293
|
React.createElement("div", null, createdDate ? React.createElement(DateTime, { dateTimeString: createdDate }) : null)),
|
|
300
294
|
canSeeCaseOwnerInfo && (React.createElement(CaseOwnerInfo, { owner: ownerId, caseDetailsHydra: caseOverviewState.caseDetailsHydra }))),
|
|
301
295
|
React.createElement("div", { className: "case-overview-secondary card card-md card-light push-bottom" },
|
|
302
296
|
React.createElement("div", { className: "pf-v6-l-grid pf-m-gutter pf-m-all-4-col-on-lg" },
|
|
303
297
|
React.createElement("div", { className: "form-wrapper" },
|
|
304
|
-
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || allCaseStatuses.isFetching, allStatuses: allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: allCaseStatuses.isError })),
|
|
298
|
+
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || caseOverviewState.allCaseStatuses.isFetching, allStatuses: caseOverviewState.allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: caseOverviewState.allCaseStatuses.isError })),
|
|
305
299
|
React.createElement("div", { className: "form-wrapper" },
|
|
306
300
|
React.createElement(CaseType, { selectedType: switchedCaseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching || isCaseUpdating, allTypes: newCaseTypesArray, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
|
|
307
301
|
React.createElement("div", { className: "form-wrapper" },
|
|
@@ -324,5 +318,5 @@ export default function CaseOverview(props) {
|
|
|
324
318
|
setShowReopenCaseModal(false);
|
|
325
319
|
}), onClose: () => {
|
|
326
320
|
setShowReopenCaseModal(false);
|
|
327
|
-
}, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, allStatuses: allCaseStatuses.data, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
|
|
321
|
+
}, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, allStatuses: caseOverviewState.allCaseStatuses.data, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
|
|
328
322
|
}
|
|
@@ -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":"AAiBA,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,qBAmY7C"}
|
|
@@ -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 { publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
13
12
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
@@ -20,7 +19,7 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
20
19
|
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
21
20
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
22
21
|
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
23
|
-
import { checkForCaseStatusToggleOnAttachOrComment,
|
|
22
|
+
import { checkForCaseStatusToggleOnAttachOrComment, updateCaseDetails } from '../../../reducers/CaseReducer';
|
|
24
23
|
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
25
24
|
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
26
25
|
try {
|
|
@@ -50,10 +49,8 @@ export function NewEssTermsModal(props) {
|
|
|
50
49
|
remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
|
|
51
50
|
}), isEqual);
|
|
52
51
|
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
53
|
-
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
54
52
|
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
55
53
|
const caseDispatch = useCaseDispatch();
|
|
56
|
-
const apolloClient = useApolloClient();
|
|
57
54
|
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
58
55
|
id: '5001',
|
|
59
56
|
isDefault: false,
|
|
@@ -132,10 +129,11 @@ export function NewEssTermsModal(props) {
|
|
|
132
129
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
133
130
|
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.`);
|
|
134
131
|
try {
|
|
135
|
-
yield
|
|
132
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
136
133
|
remoteSessionTermsAcked: true,
|
|
134
|
+
screenSessionRequested: true,
|
|
137
135
|
waitingOnCallback: true,
|
|
138
|
-
}
|
|
136
|
+
});
|
|
139
137
|
try {
|
|
140
138
|
yield postCommentRequest({
|
|
141
139
|
caseNumber: props.caseNumber,
|
|
@@ -172,9 +170,8 @@ export function NewEssTermsModal(props) {
|
|
|
172
170
|
onCancel();
|
|
173
171
|
setAgreeLoading(false);
|
|
174
172
|
setIsTermsChecked(false);
|
|
175
|
-
yield
|
|
176
|
-
|
|
177
|
-
waitingOnCallback: false,
|
|
173
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
174
|
+
screenSessionRequested: false,
|
|
178
175
|
});
|
|
179
176
|
// ToastNotification.addDangerMessage(
|
|
180
177
|
// 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":"AAiBA,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,qBA0XxD"}
|
|
@@ -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 { publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
13
12
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
@@ -20,7 +19,7 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
20
19
|
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
21
20
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
22
21
|
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
23
|
-
import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag,
|
|
22
|
+
import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag, updateCaseDetails, } from '../../../reducers/CaseReducer';
|
|
24
23
|
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
25
24
|
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
26
25
|
try {
|
|
@@ -48,12 +47,10 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
48
47
|
const { t } = useTranslation();
|
|
49
48
|
const { remoteSessionTermsAcked } = useCaseSelector((state) => ({
|
|
50
49
|
remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
|
|
51
|
-
caseDetails: state.caseDetails,
|
|
52
50
|
}), isEqual);
|
|
53
51
|
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
54
52
|
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
55
53
|
const caseDispatch = useCaseDispatch();
|
|
56
|
-
const apolloClient = useApolloClient();
|
|
57
54
|
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
58
55
|
id: '5001',
|
|
59
56
|
isDefault: false,
|
|
@@ -118,15 +115,14 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
118
115
|
props.onClose && props.onClose();
|
|
119
116
|
};
|
|
120
117
|
const toggleRemoteSessionForm = () => setIsRemoteSessionForm(true);
|
|
121
|
-
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
122
118
|
// Function to ack remote session terms and post comment
|
|
123
119
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
124
120
|
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.`);
|
|
125
121
|
try {
|
|
126
|
-
yield
|
|
122
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
127
123
|
remoteSessionTermsAcked: true,
|
|
128
124
|
waitingOnCallback: true,
|
|
129
|
-
}
|
|
125
|
+
});
|
|
130
126
|
setRemoteRiderFlag(caseDispatch, true);
|
|
131
127
|
try {
|
|
132
128
|
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":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAgB/D,wBAAgB,sBAAsB,sBAoYrC"}
|
|
@@ -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 { contacts } from '@cee-eng/hydrajs';
|
|
12
11
|
import { InputGroupText, ValidatedOptions } from '@patternfly/react-core';
|
|
13
12
|
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
|
|
@@ -15,7 +14,6 @@ import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon
|
|
|
15
14
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
16
15
|
import { getPhoneObj, PhoneInput, ToastNotification } from '@rh-support/components';
|
|
17
16
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
18
|
-
import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
19
17
|
import isEmpty from 'lodash/isEmpty';
|
|
20
18
|
import isEqual from 'lodash/isEqual';
|
|
21
19
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -28,34 +26,13 @@ import { setCaseState, updateCaseDetails } from '../../../../reducers/CaseReduce
|
|
|
28
26
|
import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
|
|
29
27
|
import { removeAllChars, trimAndReplacePlus } from '../../../shared/utils';
|
|
30
28
|
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
|
-
}
|
|
50
29
|
export function CaseContactPhoneNumber() {
|
|
51
30
|
var _a;
|
|
52
|
-
const
|
|
53
|
-
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, accountNumberRef, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
31
|
+
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
54
32
|
phoneCountryCode: state.caseDetails.phoneCountryCode || '',
|
|
55
33
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
56
34
|
caseNumber: state.caseDetails.caseNumber,
|
|
57
35
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
58
|
-
accountNumberRef: state.caseDetails.accountNumberRef,
|
|
59
36
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
60
37
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
61
38
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
@@ -203,17 +180,29 @@ export function CaseContactPhoneNumber() {
|
|
|
203
180
|
if (contactSSOName === loggedInUser.data.ssoUsername) {
|
|
204
181
|
try {
|
|
205
182
|
setIsFetchingSSO(true);
|
|
206
|
-
const loggedInUserContact = yield
|
|
183
|
+
const loggedInUserContact = yield (contacts === null || contacts === void 0 ? void 0 : contacts.getSFDCContactBySso(contactSSOName));
|
|
207
184
|
setIsFetchingSSO(false);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
185
|
+
if (loggedInUserContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
186
|
+
// User has opened a case before and has phone and area code in her/his contact on SF
|
|
187
|
+
_phoneAreaCodePrefixLineNumber = loggedInUserContact.supportPhoneAreaCodePrefixLineNumber;
|
|
188
|
+
_phoneCountryCode = loggedInUserContact.supportPhoneCountryCode;
|
|
189
|
+
_suppliedPhoneNumberVerified =
|
|
190
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
191
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
192
|
+
? hasLoggedInUserConfirmedPhoneNumber
|
|
193
|
+
: 'False';
|
|
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
|
+
}
|
|
217
206
|
}
|
|
218
207
|
catch (_a) {
|
|
219
208
|
_phoneAreaCodePrefixLineNumber = '';
|
|
@@ -227,11 +216,18 @@ export function CaseContactPhoneNumber() {
|
|
|
227
216
|
// user is openning case for others (use is partner or red hatter)
|
|
228
217
|
try {
|
|
229
218
|
setIsFetchingSSO(true);
|
|
230
|
-
const selectedContact = yield
|
|
219
|
+
const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
|
|
231
220
|
setIsFetchingSSO(false);
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
221
|
+
if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
222
|
+
_phoneAreaCodePrefixLineNumber = selectedContact.supportPhoneAreaCodePrefixLineNumber;
|
|
223
|
+
_phoneCountryCode = selectedContact.supportPhoneCountryCode;
|
|
224
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
228
|
+
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
229
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
230
|
+
}
|
|
235
231
|
}
|
|
236
232
|
catch (e) {
|
|
237
233
|
_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,qBAgE1D"}
|
|
@@ -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
|
-
|
|
7
|
+
import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
8
8
|
import Fts from '../../../CaseInformation/Fts';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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,11 +26,7 @@ export default function CaseDetailsManagement(props) {
|
|
|
26
26
|
}), isEqual);
|
|
27
27
|
const accountNumber = caseState.caseDetails.accountNumber;
|
|
28
28
|
const ability = useContext(AbilityContext);
|
|
29
|
-
|
|
30
|
-
// resourceActions.PATCH,
|
|
31
|
-
// resources.CASE_DETAILS,
|
|
32
|
-
// CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS
|
|
33
|
-
// );
|
|
29
|
+
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
34
30
|
const canSeeInternalStatus = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_INTERNAL_STATUS);
|
|
35
31
|
const canSeeSBRGroups = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SBR_GROUP);
|
|
36
32
|
return (React.createElement(React.Fragment, null,
|
|
@@ -45,8 +41,12 @@ export default function CaseDetailsManagement(props) {
|
|
|
45
41
|
React.createElement(CaseContactPhoneNumberAlert, { isConfirm: true }),
|
|
46
42
|
canSeeInternalStatus && React.createElement(CaseInternalStatus, null),
|
|
47
43
|
canSeeSBRGroups && React.createElement(CaseSbrGroups, null),
|
|
44
|
+
React.createElement(CaseGroup, null),
|
|
48
45
|
React.createElement(CaseReferenceNumber, null),
|
|
46
|
+
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
47
|
+
React.createElement(RHAssociatesSelector, null),
|
|
49
48
|
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":"AAyCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA4WrC;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';
|
|
11
10
|
import { Alert, AlertVariant, Button, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
12
11
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
13
12
|
import { AlertMessage, AlertType, SingleSelectDropdown, ToastNotification, useSelectKeyboardNavigator, } from '@rh-support/components';
|
|
14
13
|
import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
15
|
-
import { haventLoadedMetadata, toOption } from '@rh-support/utils';
|
|
14
|
+
import { getUniqueSortedVersions, haventLoadedMetadata, toOption, } from '@rh-support/utils';
|
|
15
|
+
import filter from 'lodash/filter';
|
|
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 { getVersionsDetails,
|
|
24
|
+
import { fetchCaseEntitlements, getVersionsDetails, updateCaseDetails } 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, contactSSOName, versionsDetails, isCaseUpdating } = useCaseSelector((state) => ({
|
|
36
36
|
product: state.caseDetails.product,
|
|
37
37
|
version: state.caseDetails.version,
|
|
38
|
+
contactSSOName: state.caseDetails.contactSSOName,
|
|
38
39
|
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();
|
|
46
45
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
47
46
|
const [isProductInvalid, setIsProductInvalid] = useState(false);
|
|
48
47
|
const [isVersionInvalid, setIsVersionInvalid] = useState(false);
|
|
49
48
|
const [selectedProductLocal, setSelectedProductLocal] = useState(product);
|
|
50
49
|
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,10 +112,19 @@ function ProductNVersion(props) {
|
|
|
112
112
|
}
|
|
113
113
|
setIsProductUpdating(true);
|
|
114
114
|
setIsVersionUpdating(true);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
if (!onlyVersionChanged && contactSSOName && caseNumber) {
|
|
116
|
+
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
117
|
+
product: selectedProduct,
|
|
118
|
+
version: selectedVersion,
|
|
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
|
+
}
|
|
119
128
|
setIsProductUpdating(false);
|
|
120
129
|
setIsVersionUpdating(false);
|
|
121
130
|
if (onlyVersionChanged) {
|
|
@@ -141,29 +150,60 @@ function ProductNVersion(props) {
|
|
|
141
150
|
});
|
|
142
151
|
// To check if version in invalid
|
|
143
152
|
const checkIfVersionIsInvalid = isVersionInvalid && isEmpty(selectedVersionLocal);
|
|
153
|
+
// when user changes selected product, we need to get the versions
|
|
144
154
|
useEffect(() => {
|
|
145
155
|
if (!selectedProductLocal)
|
|
146
156
|
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
|
|
147
169
|
const productObj = getProductObj(allProducts.data.productsResult, selectedProductLocal);
|
|
148
|
-
if (productObj.
|
|
149
|
-
|
|
170
|
+
if (productObj.versions) {
|
|
171
|
+
const productVersions = productObj.hasComponentsInsteadOfVersions
|
|
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);
|
|
150
182
|
}
|
|
151
183
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
152
184
|
}, [selectedProductLocal, caseDispatch, allProducts.data]);
|
|
185
|
+
// observe when fetched versions are available
|
|
153
186
|
useEffect(() => {
|
|
154
|
-
|
|
155
|
-
if (versionsDetails.isFetching || !((_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.length))
|
|
187
|
+
if (!isSEProductApiIsDown)
|
|
156
188
|
return;
|
|
157
189
|
const fetchedVersions = versionsDetails.data.map(({ name }) => name);
|
|
158
|
-
setVersions(fetchedVersions);
|
|
159
190
|
if (fetchedVersions.length === 1 && !selectedVersionLocal) {
|
|
191
|
+
setVersions(fetchedVersions);
|
|
160
192
|
setSelectedVersionLocal(fetchedVersions[0]);
|
|
161
193
|
updateProductVerstion(selectedProductLocal, fetchedVersions[0]);
|
|
194
|
+
return;
|
|
162
195
|
}
|
|
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);
|
|
163
203
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
164
204
|
}, [versionsDetails.data]);
|
|
165
205
|
const computeDropdownList = () => {
|
|
166
|
-
const list = allProducts.data.productsResult;
|
|
206
|
+
const list = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
|
|
167
207
|
if (!list)
|
|
168
208
|
return [];
|
|
169
209
|
const options = shouldFilter && !isUndefined(inputValue) && !isEmpty(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())
|
|
@@ -193,10 +233,10 @@ function ProductNVersion(props) {
|
|
|
193
233
|
};
|
|
194
234
|
useEffect(() => {
|
|
195
235
|
if (haventLoadedMetadata(allProducts, (data) => isEmpty(data.productsResult))) {
|
|
196
|
-
fetchProducts(dispatchToGlobalMetadataReducer,
|
|
236
|
+
fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
|
|
197
237
|
}
|
|
198
238
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
199
|
-
}, [allProducts, dispatchToGlobalMetadataReducer,
|
|
239
|
+
}, [allProducts, dispatchToGlobalMetadataReducer, contactSSOName]);
|
|
200
240
|
return (React.createElement(React.Fragment, null,
|
|
201
241
|
React.createElement(AlertMessage, { show: !allProducts.isFetching && allProducts.isError, title: t('There was an error loading products.'), variant: AlertType.DANGER }),
|
|
202
242
|
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") })),
|
|
@@ -213,6 +253,6 @@ function ProductNVersion(props) {
|
|
|
213
253
|
React.createElement(SingleSelectDropdown, { className: "open-case-version", id: "version-dropdown", placeholder: t(`Select a version`), selected: getVersionSelectedDropdownOption, options: getVersionDropdownOptions, isInvalid: checkIfVersionIsInvalid, isDisabled: isVersionUpdating ||
|
|
214
254
|
(allProducts.isFetching && !allProducts.isError) ||
|
|
215
255
|
isEmpty(selectedProductLocal) ||
|
|
216
|
-
isCaseUpdating, onSelect: onVersionChange, isLoading: isVersionUpdating || versionsDetails.isFetching, dataTrackingId: "case-details-version-selector", isScrollable: true }))))));
|
|
256
|
+
isCaseUpdating, onSelect: onVersionChange, isLoading: isVersionUpdating || (isSEProductApiIsDown && versionsDetails.isFetching), dataTrackingId: "case-details-version-selector", isScrollable: true }))))));
|
|
217
257
|
}
|
|
218
258
|
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":"AAQA,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,qBA0L7B;kBA1LQ,OAAO;;;AA6LhB,eAAe,OAAO,CAAC"}
|