@rh-support/troubleshoot 2.6.339 → 2.6.341
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/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +58 -25
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +5 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +2 -5
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +3 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +3 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +5 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +46 -17
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +28 -15
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +17 -11
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +0 -6
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +4 -6
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +2 -4
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +13 -37
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +16 -4
- package/lib/esm/reducers/CaseConstNTypes.d.ts +15 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +3 -0
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +13 -21
- package/lib/esm/reducers/CaseReducer.d.ts +6 -0
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -0
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +6 -0
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +1 -0
- package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +26 -0
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAoBxE,UAAU,MAAM;CAAG;AAMnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAyanC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -22,7 +22,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
22
22
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
23
23
|
import { RouteContext } from '../../context/RouteContext';
|
|
24
24
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
25
|
-
import { fetchCaseGroupsForContactGraphQL, setCaseDetails, setCaseOwner, setCaseState, setNotifiedUser,
|
|
25
|
+
import { fetchCaseGroupsForContactGraphQL, setCaseDetails, setCaseOwner, setCaseState, setNotifiedUser, setSelectedCaseGroupUsers,
|
|
26
26
|
// updateCaseDetails,
|
|
27
27
|
updateCaseDetailsGraphQL, } from '../../reducers/CaseReducer';
|
|
28
28
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
@@ -34,13 +34,14 @@ function getOwnerDropdownOptions(contacts) {
|
|
|
34
34
|
function OwnerSelector(props) {
|
|
35
35
|
const { t } = useTranslation();
|
|
36
36
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
37
|
-
const { accountNumber, caseNumber, contactSsoUsername, existingCaseDetails, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, isCaseOwnerUpdating, isCasePhoneUpdating, groupNumber, } = useCaseSelector((state) => ({
|
|
37
|
+
const { accountNumber, caseNumber, contactSsoUsername, existingCaseDetails, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, selectedAccountDetails, isCaseOwnerUpdating, isCasePhoneUpdating, groupNumber, } = useCaseSelector((state) => ({
|
|
38
38
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
39
39
|
caseNumber: state.caseDetails.caseNumber,
|
|
40
40
|
existingCaseDetails: state.caseDetails,
|
|
41
41
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
42
42
|
selectedOwner: state.selectedOwner,
|
|
43
43
|
selectedCaseGroupUsers: state.selectedCaseGroupUsers,
|
|
44
|
+
selectedAccountDetails: state.selectedAccountDetails,
|
|
44
45
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
45
46
|
isCasePhoneUpdating: state.isCasePhoneUpdating,
|
|
46
47
|
contactSsoUsername: state.caseDetails.contactSSOName,
|
|
@@ -71,6 +72,7 @@ function OwnerSelector(props) {
|
|
|
71
72
|
const onOwnerChange = (selectedContact, prevCaseOwner, notificationContacts, dispatch, abortSignalCaseGroup, abortSignalEntitlements) => __awaiter(this, void 0, void 0, function* () {
|
|
72
73
|
if (prevCaseOwner === selectedContact.ssoUsername || isEmpty(selectedContact.ssoUsername))
|
|
73
74
|
return;
|
|
75
|
+
setCaseDetails(caseDispatch, { groupNumber: null, groupName: '' });
|
|
74
76
|
yield setCaseOwner(dispatch, selectedContact, '', abortSignalCaseGroup, abortSignalEntitlements, true, undefined, true, undefined, undefined, loggedInUserRights.data.isInternal() ? accountNumber : undefined);
|
|
75
77
|
setLocalOwnerChange(true);
|
|
76
78
|
!isEmpty(selectedContact) &&
|
|
@@ -120,26 +122,11 @@ function OwnerSelector(props) {
|
|
|
120
122
|
});
|
|
121
123
|
};
|
|
122
124
|
const onCaseOwnerUpdate = (newOwner) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
// const caseDetails: Partial<ICasePayload> = { contactSSOName: newOwner.ssoUsername };
|
|
124
|
-
// if (!newOwner.id) {
|
|
125
|
-
// caseUpdateError.showError(new Error('Contact id is required'), t(`Owner failed to update`));
|
|
126
|
-
// return;
|
|
127
|
-
// }
|
|
128
125
|
var _a;
|
|
129
|
-
setCaseState(caseDispatch, { isCaseOwnerUpdating: true });
|
|
130
126
|
const ownerPhoneCaseUpdate = getOwnerPhoneCaseUpdate(newOwner);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
// When the picklist contact has no phone, clear fields so CaseContactPhoneNumber re-fetches it.
|
|
135
|
-
if (!ownerPhoneCaseUpdate) {
|
|
136
|
-
setCaseDetails(caseDispatch, {
|
|
137
|
-
contactSSOName: newOwner.ssoUsername,
|
|
138
|
-
phoneCountryCode: '',
|
|
139
|
-
phoneAreaCodePrefixLineNumber: '',
|
|
140
|
-
phone: '',
|
|
141
|
-
});
|
|
142
|
-
}
|
|
127
|
+
const defaultCaseGroup = newOwner.defaultCaseGroup || null;
|
|
128
|
+
const shouldDeferOwnerUpdate = selectedAccountDetails.data.requireCGroupOnCreate && isEmpty(defaultCaseGroup);
|
|
129
|
+
const syncLocalCaseOwner = () => __awaiter(this, void 0, void 0, function* () {
|
|
143
130
|
const abortSignal = new AbortController().signal;
|
|
144
131
|
yield setCaseOwner(caseDispatch, {
|
|
145
132
|
ssoUsername: newOwner.ssoUsername,
|
|
@@ -149,13 +136,59 @@ function OwnerSelector(props) {
|
|
|
149
136
|
manageSupportCases: newOwner.manageSupportCases,
|
|
150
137
|
id: newOwner.id,
|
|
151
138
|
}, '', abortSignal, abortSignal, false, '', true, true, caseNumber, loggedInUserRights.data.isInternal() ? accountNumber : undefined);
|
|
139
|
+
});
|
|
140
|
+
const applyOwnerPhoneToCaseDetails = () => {
|
|
141
|
+
if (!ownerPhoneCaseUpdate) {
|
|
142
|
+
setCaseDetails(caseDispatch, {
|
|
143
|
+
contactSSOName: newOwner.ssoUsername,
|
|
144
|
+
phoneCountryCode: '',
|
|
145
|
+
phoneAreaCodePrefixLineNumber: '',
|
|
146
|
+
phone: '',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
setCaseDetails(caseDispatch, Object.assign({ contactSSOName: newOwner.ssoUsername }, ownerPhoneCaseUpdate));
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const reloadOwnerCaseGroups = (defaultGroup) => {
|
|
154
|
+
var _a;
|
|
155
|
+
if (!newOwner.id || !accountNumber)
|
|
156
|
+
return;
|
|
157
|
+
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, newOwner.id, accountNumber, defaultGroup, (_a = newOwner.isOrgAdmin) !== null && _a !== void 0 ? _a : false, defaultGroup ? null : '');
|
|
158
|
+
};
|
|
159
|
+
if (shouldDeferOwnerUpdate) {
|
|
160
|
+
setCaseDetails(caseDispatch, { groupNumber: '', groupName: '' });
|
|
161
|
+
applyOwnerPhoneToCaseDetails();
|
|
162
|
+
yield syncLocalCaseOwner();
|
|
163
|
+
setCaseState(caseDispatch, {
|
|
164
|
+
pendingCaseOwnerUpdate: {
|
|
165
|
+
contactId: newOwner.id,
|
|
166
|
+
contactSSOName: (_a = newOwner.ssoUsername) !== null && _a !== void 0 ? _a : '',
|
|
167
|
+
phoneCaseUpdate: ownerPhoneCaseUpdate,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
setSelectedCaseGroupUsers(caseDispatch, accountNumber, '', loggedInUserRights.data);
|
|
171
|
+
setLocalOwnerChange(true);
|
|
172
|
+
updateNotifyUsersList(newOwner);
|
|
173
|
+
reloadOwnerCaseGroups(null);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
setCaseState(caseDispatch, { isCaseOwnerUpdating: true, pendingCaseOwnerUpdate: null });
|
|
177
|
+
if (!defaultCaseGroup) {
|
|
178
|
+
setCaseDetails(caseDispatch, { groupNumber: '', groupName: '' });
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, caseNumber, Object.assign({ contactId: newOwner.id, contactSSOName: newOwner.ssoUsername, groupNumber: defaultCaseGroup !== null && defaultCaseGroup !== void 0 ? defaultCaseGroup : '' }, (ownerPhoneCaseUpdate !== null && ownerPhoneCaseUpdate !== void 0 ? ownerPhoneCaseUpdate : {})), false, { existingCaseDetails });
|
|
182
|
+
setSelectedCaseGroupUsers(caseDispatch, accountNumber, defaultCaseGroup !== null && defaultCaseGroup !== void 0 ? defaultCaseGroup : '', loggedInUserRights.data);
|
|
183
|
+
if (!ownerPhoneCaseUpdate) {
|
|
184
|
+
applyOwnerPhoneToCaseDetails();
|
|
185
|
+
}
|
|
186
|
+
yield syncLocalCaseOwner();
|
|
152
187
|
setLocalOwnerChange(true);
|
|
153
188
|
updateNotifyUsersList(newOwner);
|
|
154
189
|
ToastNotification.addSuccessMessage(t(`Owner has been successfully updated`));
|
|
155
190
|
setCaseState(caseDispatch, { isCaseOwnerUpdating: false });
|
|
156
|
-
|
|
157
|
-
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, newOwner.id, accountNumber, newOwner === null || newOwner === void 0 ? void 0 : newOwner.defaultCaseGroup, (_a = newOwner.isOrgAdmin) !== null && _a !== void 0 ? _a : false, null);
|
|
158
|
-
}
|
|
191
|
+
reloadOwnerCaseGroups(defaultCaseGroup);
|
|
159
192
|
}
|
|
160
193
|
catch (e) {
|
|
161
194
|
setCaseState(caseDispatch, { isCaseOwnerUpdating: false });
|
|
@@ -244,12 +277,12 @@ function OwnerSelector(props) {
|
|
|
244
277
|
isCaseOwnerUpdating ||
|
|
245
278
|
isCasePhoneUpdating ||
|
|
246
279
|
canEditCase.isCaseNotEditable, onSelect: onCustomerContactSelect, onClearQuery: onClearQuery, onQueryUpdated: onQueryUpdated, options: ownerDropdownOptions, status: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data) ? 'danger' : undefined })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, onContactEnriched: (contact) => {
|
|
247
|
-
var _a;
|
|
280
|
+
var _a, _b;
|
|
248
281
|
setCaseState(caseDispatch, {
|
|
249
282
|
selectedOwner: { data: contact, isFetching: false, isError: false, errorMessage: '' },
|
|
250
283
|
});
|
|
251
284
|
if (contact.id && accountNumber) {
|
|
252
|
-
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, contact.id, accountNumber,
|
|
285
|
+
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, contact.id, accountNumber, (_a = contact.defaultCaseGroup) !== null && _a !== void 0 ? _a : null, (_b = contact.isOrgAdmin) !== null && _b !== void 0 ? _b : false, caseNumber ? groupNumber : null);
|
|
253
286
|
}
|
|
254
287
|
}, placeholder: t(`Search by name or username`), clearButton: true, id: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data), isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating || canEditCase.isCaseNotEditable }))));
|
|
255
288
|
}
|
package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveCustomerEscalation.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"ActiveCustomerEscalation.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,+EAwJnC,CAAC"}
|
package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js
CHANGED
|
@@ -62,5 +62,9 @@ export const ActiveCustomerEscalation = forwardRef((props, ref) => {
|
|
|
62
62
|
React.createElement(Button, { variant: ButtonVariant.secondary, onClick: toggleModal, "data-tracking-id": "request-rme-trigger", "aria-label": t('Request an escalation'), isDisabled: canEditCase.isCaseNotEditable }, t('Request an escalation'))))));
|
|
63
63
|
return (React.createElement(React.Fragment, null,
|
|
64
64
|
React.createElement(RequestEscalationModal, { caseNumber: props.caseNumber, severity: props.caseSeverity, caseStatus: props.caseStatus, show: openRequestEscalationModal, onClose: toggleModal }),
|
|
65
|
-
React.createElement(Can, { do: resourceActions.CREATE, on: resources.ICE_ESCALATION, passThrough: true }, (canCreateICE) =>
|
|
65
|
+
React.createElement(Can, { do: resourceActions.CREATE, on: resources.ICE_ESCALATION, passThrough: true }, (canCreateICE) => (React.createElement(Can, { do: resourceActions.CREATE, on: resources.RME_ESCALATION, passThrough: true }, (canCreateRME) => canCreateICE || isInternal
|
|
66
|
+
? isInternalElements
|
|
67
|
+
: canCreateRME && isCreateRMEVisible
|
|
68
|
+
? isNotInternalElements
|
|
69
|
+
: null)))));
|
|
66
70
|
});
|
|
@@ -119,7 +119,7 @@ export function RequestEscalationModal(props) {
|
|
|
119
119
|
},
|
|
120
120
|
});
|
|
121
121
|
const createdCaseNumber = (_d = (_c = (_b = (_a = escalationData === null || escalationData === void 0 ? void 0 : escalationData.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.CaseCreate) === null || _b === void 0 ? void 0 : _b.RedHatSupportRecord) === null || _c === void 0 ? void 0 : _c.CaseNumber) === null || _d === void 0 ? void 0 : _d.value;
|
|
122
|
-
const fullComment = t('
|
|
122
|
+
const fullComment = t('<h3>Request Management Escalation:</h3><p><strong>Subject</strong></p><p>{{subject}}</p><p><strong>Category</strong></p><p>{{rmeCategory}}</p><p><strong>Description</strong></p><p>{{description}}</p><p><strong>Expectations</strong></p><p>{{expectations}}</p><p><strong>Business Impact</strong></p><p>{{businessImpactDescription}}</p>', {
|
|
123
123
|
category: formState.rmeCategory,
|
|
124
124
|
subject: formState.subject,
|
|
125
125
|
description: formState.description,
|
|
@@ -144,7 +144,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
|
|
|
144
144
|
// TODO: KCS linking disabled -- PCM-15276 -- restore when linking is re-enabled
|
|
145
145
|
// const hasLink = some(recommendations, (p) => p.isLinked);
|
|
146
146
|
const getCommentBody = () => {
|
|
147
|
-
return
|
|
147
|
+
return `<p><strong>Reason for closing case:</strong></p><p>Other. Found a pinned article that perfectly resolved the issue. Closing this case now.</p>`;
|
|
148
148
|
};
|
|
149
149
|
const handleCaseClose = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
150
150
|
setStatusUpdating(caseOverviewDispatch, true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,iBAAiB,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA,EAAE,mBAAmB,CAAC,KAAA,KAAK,IAAI,CAAC;IACpH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,iBAAiB,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA,EAAE,mBAAmB,CAAC,KAAA,KAAK,IAAI,CAAC;IACpH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAmN5C"}
|
|
@@ -42,12 +42,9 @@ export function ReopenCaseModal(props) {
|
|
|
42
42
|
return isValid;
|
|
43
43
|
};
|
|
44
44
|
const getCommentBody = () => {
|
|
45
|
-
return
|
|
45
|
+
return `<p><strong>Reason for reopening case:</strong></p><p>${selectedReason}${reasonWithDescription.includes(selectedReason) || props.isInternal
|
|
46
46
|
? `${props.isInternal ? '' : '. '}${reopenDescription}`
|
|
47
|
-
: ''}
|
|
48
|
-
\n **Reopened date:** \n${formatDateTime(Date())}
|
|
49
|
-
\n**Reopened by:** \n${props.whoIsUpdating}
|
|
50
|
-
\n**Reopened reason other description:**\n${reopenDescription}`;
|
|
47
|
+
: ''}</p><p><strong>Reopened date:</strong></p><p>${formatDateTime(Date())}</p><p><strong>Reopened by:</strong></p><p>${props.whoIsUpdating}</p><p><strong>Reopened reason other description:</strong></p><p>${reopenDescription}</p>`;
|
|
51
48
|
};
|
|
52
49
|
const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
|
|
53
50
|
if (!checkForRequiredFields())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewEssTermsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.tsx"],"names":[],"mappings":"AAsBA,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;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NewEssTermsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.tsx"],"names":[],"mappings":"AAsBA,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;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAwb7C"}
|
|
@@ -123,7 +123,9 @@ export function NewEssTermsModal(props) {
|
|
|
123
123
|
};
|
|
124
124
|
// Function to ack remote session terms and post comment
|
|
125
125
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
const requestComment = t(
|
|
126
|
+
const requestComment = t(`<p><strong>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).</strong></p><p>Submitted a remote session request with following details:</p><p><strong>Preferred Time and Expectations of remote session</strong></p><p>${sessionExpectations}</p><p><strong>Describe the impact to you or the business</strong></p><p>${impact}</p>${sessionLink
|
|
127
|
+
? `<p><strong>Remote session link</strong></p><p>${formatSessionLinks(sessionLink)}</p>`
|
|
128
|
+
: ''}<p>This action does not initiate a remote session. A Red Hat Associate will get back to you soon.</p>`);
|
|
127
129
|
try {
|
|
128
130
|
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
|
|
129
131
|
remoteSessionTermsAcked: true,
|
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":"AAsBA,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;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAsBA,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;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBAibxD"}
|
|
@@ -114,7 +114,9 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
114
114
|
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
115
115
|
// Function to ack remote session terms and post comment
|
|
116
116
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
const requestComment = t(
|
|
117
|
+
const requestComment = t(`<p><strong>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).</strong></p><p>Submitted a remote session request with following details:</p><p><strong>Preferred Time and Expectations of remote session</strong></p><p>${sessionExpectations}</p><p><strong>Describe the impact to you or the business</strong></p><p>${impact}</p>${sessionLink
|
|
118
|
+
? `<p><strong>Remote session link</strong></p><p>${formatSessionLinks(sessionLink)}</p>`
|
|
119
|
+
: ''}<p>This action does not initiate a remote session. A Red Hat Associate will get back to you soon.</p>`);
|
|
118
120
|
try {
|
|
119
121
|
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
|
|
120
122
|
remoteSessionTermsAcked: true,
|
|
@@ -19,5 +19,5 @@ export const formatSessionLinks = (sessionLink) => {
|
|
|
19
19
|
.split(/[;,| \n\r\t]+/)
|
|
20
20
|
.map((link) => link.trim())
|
|
21
21
|
.filter(Boolean);
|
|
22
|
-
return links.map((link) =>
|
|
22
|
+
return links.map((link) => `<a href="${link}">${link}</a>`).join('<br>');
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAoBvD,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,qBAqF1D"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
|
+
import { AlertMessage, AlertType } from '@rh-support/components';
|
|
2
3
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
3
4
|
import isEqual from 'lodash/isEqual';
|
|
4
5
|
import React, { useContext, useState } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
5
7
|
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
6
8
|
import { OwnerSelector } from '../../../AccountInfo/OwnerSelector';
|
|
7
9
|
import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
@@ -20,11 +22,13 @@ import CaseReferenceNumber from './CaseReferenceNumber';
|
|
|
20
22
|
import CaseSbrGroups from './CaseSbrGroups';
|
|
21
23
|
import SFDCUrl from './SFDCUrl';
|
|
22
24
|
export default function CaseDetailsManagement(props) {
|
|
25
|
+
const { t } = useTranslation();
|
|
23
26
|
const [isUpdatingPartner, setIsUpdatingPartner] = useState(false);
|
|
24
27
|
const caseState = useCaseSelector((state) => ({
|
|
25
28
|
caseDetails: {
|
|
26
29
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
27
30
|
},
|
|
31
|
+
showMandatoryCaseGroupValidationError: state.showMandatoryCaseGroupValidationError,
|
|
28
32
|
}), isEqual);
|
|
29
33
|
const accountNumber = caseState.caseDetails.accountNumber;
|
|
30
34
|
const ability = useContext(AbilityContext);
|
|
@@ -38,6 +42,7 @@ export default function CaseDetailsManagement(props) {
|
|
|
38
42
|
return (React.createElement(React.Fragment, null,
|
|
39
43
|
React.createElement(PartnerCaseHelper, { setIsUpdatingPartners: setIsUpdatingPartner, caseNumber: props.caseNumber, routeProps: props.routeProps }),
|
|
40
44
|
React.createElement("section", { className: "card card-white" },
|
|
45
|
+
React.createElement(AlertMessage, { show: !!caseState.showMandatoryCaseGroupValidationError, variant: AlertType.DANGER, isInline: true, title: t('Please address the errors to proceed'), className: "pf-v6-u-mb-lg", "data-tracking-id": "proceed-address-errors" }),
|
|
41
46
|
React.createElement("form", null,
|
|
42
47
|
React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
|
|
43
48
|
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
@@ -321,7 +321,7 @@ export function CaseOpenshiftClusterId() {
|
|
|
321
321
|
clusterDropdownId === 'dont-have-id' ||
|
|
322
322
|
clusterDropdownId === 'v3-cluster'
|
|
323
323
|
? false
|
|
324
|
-
: isClusterIdInvalid, clusterIdDropdownFormInstructions: !isExportingPDF ? clusterIdDropdownFormInstructions() : undefined, onClusterClear: resetClusterData, isV3: product
|
|
324
|
+
: isClusterIdInvalid, clusterIdDropdownFormInstructions: !isExportingPDF ? clusterIdDropdownFormInstructions() : undefined, onClusterClear: resetClusterData, isV3: product === 'OpenShift Container Platform', isDisabled: isClusterIdUpdating || isCaseReadOnly, noClusterIdReasonExplanation: resolvedNoClusterIdReasonExplanation || '' }),
|
|
325
325
|
shouldShowNoClusterReasonSelector && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: resolvedNoClusterIdReasonExplanation || '', noClusterIdReason: resolvedNoClusterIdReason || '', onReasonInputBoxBlur: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating || isCaseReadOnly })),
|
|
326
326
|
React.createElement(LoadingIndicator, { show: isClusterIdUpdating, size: "xs" })));
|
|
327
327
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAiB5E,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,qBAyb/B;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
20
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
22
22
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
23
|
-
import { fetchCaseGroupsForContactGraphQL, setCaseDetails, setSelectedCaseGroupUsers, updateCaseDetailsGraphQL, } from '../../reducers/CaseReducer';
|
|
23
|
+
import { fetchCaseGroupsForContactGraphQL, setCaseDetails, setCaseState, setSelectedCaseGroupUsers, updateCaseDetailsGraphQL, } from '../../reducers/CaseReducer';
|
|
24
24
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
25
25
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
26
26
|
import { getChangedValueTooltip } from '../shared/utils';
|
|
@@ -35,7 +35,7 @@ const emptyCaseGroup = {
|
|
|
35
35
|
function CaseGroup(props) {
|
|
36
36
|
const { t } = useTranslation();
|
|
37
37
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
38
|
-
const { groupNumber, caseNumber, caseId, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName, isCaseOwnerUpdating, contactSSOName, selectedOwnerContactId, selectedOwnerIsOrgAdmin, } = useCaseSelector((state) => {
|
|
38
|
+
const { groupNumber, caseNumber, caseId, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName, isCaseOwnerUpdating, contactSSOName, selectedOwnerContactId, selectedOwnerIsOrgAdmin, pendingCaseOwnerUpdate, existingCaseDetails, } = useCaseSelector((state) => {
|
|
39
39
|
var _a, _b, _c, _d, _e;
|
|
40
40
|
return ({
|
|
41
41
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -49,6 +49,8 @@ function CaseGroup(props) {
|
|
|
49
49
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
50
50
|
selectedOwnerContactId: (_b = (_a = state.selectedOwner) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.id,
|
|
51
51
|
selectedOwnerIsOrgAdmin: (_e = (_d = (_c = state.selectedOwner) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.isOrgAdmin) !== null && _e !== void 0 ? _e : false,
|
|
52
|
+
pendingCaseOwnerUpdate: state.pendingCaseOwnerUpdate,
|
|
53
|
+
existingCaseDetails: state.caseDetails,
|
|
52
54
|
});
|
|
53
55
|
}, isEqual);
|
|
54
56
|
const caseDispatch = useCaseDispatch();
|
|
@@ -61,7 +63,7 @@ function CaseGroup(props) {
|
|
|
61
63
|
return;
|
|
62
64
|
if (isEmpty(selectedOwnerContactId) || isEmpty(accountNumber))
|
|
63
65
|
return;
|
|
64
|
-
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, selectedOwnerContactId, accountNumber,
|
|
66
|
+
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, selectedOwnerContactId, accountNumber, null, selectedOwnerIsOrgAdmin, groupNumber !== null && groupNumber !== void 0 ? groupNumber : '');
|
|
65
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
68
|
}, [selectedOwnerContactId, accountNumber, selectedOwnerIsOrgAdmin]);
|
|
67
69
|
const [selectedCaseGroup, setSelectedCaseGroup] = useState(isGroupMandatory ? undefined : emptyCaseGroup);
|
|
@@ -85,13 +87,23 @@ function CaseGroup(props) {
|
|
|
85
87
|
return isInValidGroup;
|
|
86
88
|
};
|
|
87
89
|
const onCaseGroupUpdate = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
var _a;
|
|
88
91
|
if (canEditCase.alert())
|
|
89
92
|
return;
|
|
90
93
|
setCaseGroupUpdating(true);
|
|
91
94
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
const pendingOwnerUpdate = pendingCaseOwnerUpdate;
|
|
96
|
+
const updatePayload = pendingOwnerUpdate
|
|
97
|
+
? Object.assign({ contactId: pendingOwnerUpdate.contactId, contactSSOName: pendingOwnerUpdate.contactSSOName, groupNumber: caseDetails.groupNumber }, ((_a = pendingOwnerUpdate.phoneCaseUpdate) !== null && _a !== void 0 ? _a : {})) : { groupNumber: caseDetails.groupNumber };
|
|
98
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, caseNumber, updatePayload, false, pendingOwnerUpdate
|
|
99
|
+
? { existingCaseDetails }
|
|
100
|
+
: { salesforceCaseId: caseId });
|
|
101
|
+
if (pendingOwnerUpdate) {
|
|
102
|
+
setCaseState(caseDispatch, { pendingCaseOwnerUpdate: null });
|
|
103
|
+
setSelectedCaseGroupUsers(caseDispatch, accountNumber, caseDetails.groupNumber, loggedInUserRights.data);
|
|
104
|
+
}
|
|
94
105
|
ToastNotification.addSuccessMessage(t(`Group has been successfully updated`));
|
|
106
|
+
setCaseGroupUpdating(false);
|
|
95
107
|
}
|
|
96
108
|
catch (e) {
|
|
97
109
|
setCaseGroupUpdating(false);
|
|
@@ -161,6 +173,11 @@ function CaseGroup(props) {
|
|
|
161
173
|
setInputValue(groupName);
|
|
162
174
|
setSelected(groupName);
|
|
163
175
|
}
|
|
176
|
+
else if (!groupNumber) {
|
|
177
|
+
setSelectedCaseGroup(isGroupMandatory ? undefined : emptyCaseGroup);
|
|
178
|
+
setInputValue('');
|
|
179
|
+
setSelected('');
|
|
180
|
+
}
|
|
164
181
|
return;
|
|
165
182
|
}
|
|
166
183
|
const selectedGroup = find(ownersCaseGroups.data, (g) => g.groupNum === groupNumber);
|
|
@@ -186,11 +203,17 @@ function CaseGroup(props) {
|
|
|
186
203
|
setInputValue(groupName);
|
|
187
204
|
setSelected(groupName);
|
|
188
205
|
}
|
|
206
|
+
else if (!groupNumber) {
|
|
207
|
+
setSelectedCaseGroup(isGroupMandatory ? undefined : emptyCaseGroup);
|
|
208
|
+
setInputValue('');
|
|
209
|
+
setSelected('');
|
|
210
|
+
setCaseGroupInvalid(!!isGroupMandatory);
|
|
211
|
+
}
|
|
189
212
|
else {
|
|
190
213
|
setCaseGroupInvalid(true);
|
|
191
214
|
}
|
|
192
215
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
193
|
-
}, [ownersCaseGroups, caseNumber, isGroupMandatory]);
|
|
216
|
+
}, [ownersCaseGroups, caseNumber, isGroupMandatory, groupNumber, groupName]);
|
|
194
217
|
const onCaseGroupClear = () => __awaiter(this, void 0, void 0, function* () {
|
|
195
218
|
if (canEditCase.alert())
|
|
196
219
|
return;
|
|
@@ -224,11 +247,21 @@ function CaseGroup(props) {
|
|
|
224
247
|
setSelected('');
|
|
225
248
|
setIsOpen(false);
|
|
226
249
|
});
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
250
|
+
const caseGroupRequiredErrorMessage = caseNumber
|
|
251
|
+
? t('Users are not allowed to update case if on account level caseGroupRequired is set to true')
|
|
252
|
+
: t('Users are not allowed to create case if on account level caseGroupRequired is set to true');
|
|
253
|
+
const showMandatoryGroupValidationError = isGroupMandatory &&
|
|
254
|
+
!isExportingPDF &&
|
|
255
|
+
(isCaseGroupInvalid || isSelectedUngroupedInvalid || !!pendingCaseOwnerUpdate) &&
|
|
256
|
+
isEmpty(groupNumber) &&
|
|
257
|
+
(!!caseNumber || isNextBtnClickedToShowValidationError || isEmpty(groupNumber));
|
|
258
|
+
const showHelperText = !showMandatoryGroupValidationError;
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
setCaseState(caseDispatch, { showMandatoryCaseGroupValidationError: !!showMandatoryGroupValidationError });
|
|
261
|
+
return () => {
|
|
262
|
+
setCaseState(caseDispatch, { showMandatoryCaseGroupValidationError: false });
|
|
263
|
+
};
|
|
264
|
+
}, [caseDispatch, showMandatoryGroupValidationError]);
|
|
232
265
|
const canNotChangeGroup = () => !loggedInUserRights.data.isInternal() &&
|
|
233
266
|
!loggedInUser.data.isOrgAdmin &&
|
|
234
267
|
loggedInUser.data.ssoUsername !== contactSSOName &&
|
|
@@ -258,9 +291,7 @@ function CaseGroup(props) {
|
|
|
258
291
|
isCaseGroupUpdating ||
|
|
259
292
|
isCaseOwnerUpdating ||
|
|
260
293
|
canNotChangeGroup() ||
|
|
261
|
-
canEditCase.isCaseNotEditable, status: ownersCaseGroups.isError ||
|
|
262
|
-
? 'danger'
|
|
263
|
-
: undefined, isFullWidth: true },
|
|
294
|
+
canEditCase.isCaseNotEditable, status: ownersCaseGroups.isError || showMandatoryGroupValidationError ? 'danger' : undefined, isFullWidth: true },
|
|
264
295
|
React.createElement(TextInputGroup, { isPlain: true },
|
|
265
296
|
React.createElement(TextInputGroupMain, { value: inputValue, onClick: onToggleClick, onChange: onInputQueryChange, onKeyDown: onInputKeyDown, onBlur: () => {
|
|
266
297
|
if (selected) {
|
|
@@ -278,9 +309,7 @@ function CaseGroup(props) {
|
|
|
278
309
|
isGroupMandatory && !isExportingPDF && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
|
|
279
310
|
React.createElement(Select, { id: "get-support-group", "data-tracking-id": "get-support-group", isOpen: isOpen, selected: selected, onSelect: (event, val) => onCaseGroupChange(val), onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, onBlur: () => onOuterClickGroupCheck, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
280
311
|
React.createElement(SelectList, null, computeDropdownList().map((option, index) => (React.createElement(SelectOption, { key: option.name, isFocused: focusedItemIndex === index, value: option, isSelected: option.name === selected }, option.name))))),
|
|
281
|
-
|
|
282
|
-
React.createElement(Trans, null, "'Ungrouped Case' cannot be selected. Please select a group."))),
|
|
283
|
-
showEmptyValidationError && isGroupMandatory && !isExportingPDF && (React.createElement("p", { className: "form-instructions form-invalid" }, t('User are not allowed to create case if on account level caseGroupRequired is set to true'))),
|
|
312
|
+
showMandatoryGroupValidationError && (React.createElement("p", { className: "form-instructions form-invalid" }, caseGroupRequiredErrorMessage)),
|
|
284
313
|
showHelperText && (React.createElement("p", { className: "form-instructions" },
|
|
285
314
|
React.createElement(Trans, null, "Organization administrators have the permission to manage groups.")))));
|
|
286
315
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,GAAG,CAAC,KAAK,EAAE,MAAM,qBA8PzB;kBA9PQ,GAAG;;;AAiQZ,eAAe,GAAG,CAAC"}
|
|
@@ -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 { InlineEdit, LoadingIndicator, TextAreaAutosize, ToastNotification, usePrevious } from '@rh-support/components';
|
|
11
12
|
import { useCanEditCase } from '@rh-support/react-context';
|
|
12
13
|
import { isFtsEditableOnEditPage, PreviousCaseTypes, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage, } from '@rh-support/utils';
|
|
@@ -17,7 +18,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
17
18
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
18
19
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
19
20
|
import { CONTACT_INFO_24X7_LIMIT } from '../../reducers/CaseConstNTypes';
|
|
20
|
-
import { setCaseDetails, setCaseState,
|
|
21
|
+
import { setCaseDetails, setCaseState, updateCaseSeverityAndFtsGraphQL } from '../../reducers/CaseReducer';
|
|
21
22
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
22
23
|
const defaultProps = {
|
|
23
24
|
inlineEditable: false,
|
|
@@ -27,17 +28,24 @@ const defaultProps = {
|
|
|
27
28
|
function Fts(props) {
|
|
28
29
|
const { t } = useTranslation();
|
|
29
30
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
const apolloClient = useApolloClient();
|
|
32
|
+
const { fts, contactInfo24x7, caseNumber, severity, entitlementSla, caseType, phoneCountryCode, phoneAreaCodePrefixLineNumber, ftsContactSameAsOwner, existingCaseDetails, accountHasPremiumSla, hasMultipleSlas, } = useCaseSelector((state) => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
return ({
|
|
35
|
+
fts: state.caseDetails.fts,
|
|
36
|
+
caseNumber: state.caseDetails.caseNumber,
|
|
37
|
+
contactInfo24x7: state.caseDetails.contactInfo24x7,
|
|
38
|
+
severity: state.caseDetails.severity,
|
|
39
|
+
entitlementSla: state.caseDetails.entitlementSla,
|
|
40
|
+
caseType: state.caseDetails.caseType,
|
|
41
|
+
phoneCountryCode: state.caseDetails.phoneCountryCode,
|
|
42
|
+
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
43
|
+
ftsContactSameAsOwner: state.ftsContactSameAsOwner,
|
|
44
|
+
existingCaseDetails: state.caseDetails,
|
|
45
|
+
accountHasPremiumSla: state.accountHasPremiumSla,
|
|
46
|
+
hasMultipleSlas: !!state.productServiceLevel && ((_b = (_a = state.otherServiceLevels) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0,
|
|
47
|
+
});
|
|
48
|
+
}, isEqual);
|
|
41
49
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
42
50
|
const { isExportingPDF } = useContext(PDFContext);
|
|
43
51
|
const caseDispatch = useCaseDispatch();
|
|
@@ -52,7 +60,9 @@ function Fts(props) {
|
|
|
52
60
|
const onCaseFtsContactUpdate = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
53
61
|
setFtsContactUpdating(true);
|
|
54
62
|
try {
|
|
55
|
-
yield
|
|
63
|
+
yield updateCaseSeverityAndFtsGraphQL(caseDispatch, apolloClient, caseNumber, caseDetails, severity, {
|
|
64
|
+
existingCaseDetails,
|
|
65
|
+
});
|
|
56
66
|
setFtsContactUpdating(false);
|
|
57
67
|
ToastNotification.addSuccessMessage(t(`Case has been successfully updated`));
|
|
58
68
|
}
|
|
@@ -64,7 +74,9 @@ function Fts(props) {
|
|
|
64
74
|
const onCaseFtsUpdate = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
65
75
|
setFtsUpdating(true);
|
|
66
76
|
try {
|
|
67
|
-
yield
|
|
77
|
+
yield updateCaseSeverityAndFtsGraphQL(caseDispatch, apolloClient, caseNumber, caseDetails, severity, {
|
|
78
|
+
existingCaseDetails,
|
|
79
|
+
});
|
|
68
80
|
setFtsUpdating(false);
|
|
69
81
|
ToastNotification.addSuccessMessage(t(`Case has been successfully updated`));
|
|
70
82
|
}
|
|
@@ -155,7 +167,8 @@ function Fts(props) {
|
|
|
155
167
|
const maxLengthErrorMessage = t('Contact information cannot be more than {{limit}} characters.', {
|
|
156
168
|
limit: CONTACT_INFO_24X7_LIMIT,
|
|
157
169
|
});
|
|
158
|
-
|
|
170
|
+
const ftsCreateOptions = { accountHasPremiumSla, hasMultipleSlas };
|
|
171
|
+
if (isEmpty(caseNumber) && (!showFtsOnCreateCasePage(entitlementSla, severity, ftsCreateOptions) || isIdea))
|
|
159
172
|
return React.createElement(React.Fragment, null);
|
|
160
173
|
if (!isEmpty(caseNumber) && (isIdea || !showFtsOnCaseViewEditPage(entitlementSla, severity)))
|
|
161
174
|
return React.createElement(React.Fragment, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAc5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAChE,oBAAoB,EAAE,OAAO,CAAC;CACjC;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,qBA8Q9B;kBA9QQ,QAAQ;;;AAgRjB,eAAe,QAAQ,CAAC"}
|
|
@@ -27,16 +27,21 @@ const defaultProps = {
|
|
|
27
27
|
};
|
|
28
28
|
function Severity(props) {
|
|
29
29
|
const { t } = useTranslation();
|
|
30
|
-
const { product, version, caseNumber, severity, entitlementSla, ownersEntitlements, versionsDetails, caseType } = useCaseSelector((state) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
const { product, version, caseNumber, severity, entitlementSla, ownersEntitlements, versionsDetails, caseType, accountHasPremiumSla, hasMultipleSlas } = useCaseSelector((state) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return ({
|
|
33
|
+
product: state.caseDetails.product,
|
|
34
|
+
version: state.caseDetails.version,
|
|
35
|
+
caseNumber: state.caseDetails.caseNumber,
|
|
36
|
+
severity: state.caseDetails.severity,
|
|
37
|
+
entitlementSla: state.caseDetails.entitlementSla,
|
|
38
|
+
ownersEntitlements: state.ownersEntitlements,
|
|
39
|
+
versionsDetails: state.versionsDetails,
|
|
40
|
+
caseType: state.caseDetails.caseType,
|
|
41
|
+
accountHasPremiumSla: state.accountHasPremiumSla,
|
|
42
|
+
hasMultipleSlas: !!state.productServiceLevel && ((_b = (_a = state.otherServiceLevels) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0,
|
|
43
|
+
});
|
|
44
|
+
}, isEqual);
|
|
40
45
|
const { globalMetadataState: { allCaseSeverities, allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
41
46
|
const { isExportingPDF } = useContext(PDFContext);
|
|
42
47
|
const [isSeverityInValid, setIsSeverityInValid] = useState(false);
|
|
@@ -46,12 +51,13 @@ function Severity(props) {
|
|
|
46
51
|
const caseDispatch = useCaseDispatch();
|
|
47
52
|
const isOnCaseDetailsPage = !isEmpty(caseNumber);
|
|
48
53
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
54
|
+
const ftsCreateOptions = { accountHasPremiumSla, hasMultipleSlas };
|
|
49
55
|
const updateState = (value) => {
|
|
50
56
|
const casePayload = {
|
|
51
57
|
severity: value,
|
|
52
58
|
};
|
|
53
59
|
// .. change fts on sev change only while creating case or when we change to sev1
|
|
54
|
-
!isOnCaseDetailsPage && (casePayload.fts = showFtsOnCreateCasePage(entitlementSla, value));
|
|
60
|
+
!isOnCaseDetailsPage && (casePayload.fts = showFtsOnCreateCasePage(entitlementSla, value, ftsCreateOptions));
|
|
55
61
|
isOnCaseDetailsPage && autoEnableFtsOnCaseViewEditPage(entitlementSla, value) && (casePayload.fts = true);
|
|
56
62
|
casePayload.fts = casePayload.fts && !isIdea;
|
|
57
63
|
if (isOnCaseDetailsPage) {
|