@rh-support/troubleshoot 2.2.129 → 2.2.131-beta.1
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 +1 -77
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +8 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +13 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +13 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +37 -15
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +0 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +188 -41
- package/lib/esm/components/CaseInformation/ContactPhoneNumberAlert.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumberAlert.js +12 -15
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +5 -23
- package/lib/esm/components/CaseManagement/CaseManagement.js +4 -4
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +4 -4
- package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.js +11 -1
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +14 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts +2 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +4 -2
- package/lib/esm/components/Recommendations/Recommendations.js +1 -1
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +6 -13
- package/lib/esm/components/Review/Review.js +4 -4
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +27 -22
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +4 -24
- package/lib/esm/components/shared/utils.d.ts +2 -0
- package/lib/esm/components/shared/utils.d.ts.map +1 -1
- package/lib/esm/components/shared/utils.js +12 -0
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +0 -20
- package/lib/esm/constants/caseDetailsConstants.d.ts +1 -1
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +1 -1
- package/lib/esm/css/app.css +2 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +7 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +11 -3
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +4 -2
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -0
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +7 -1
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +8 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +2 -0
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +12 -3
- package/lib/esm/scss/_main.scss +5 -0
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAsTnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -28,14 +28,13 @@ import { getChangedValueTooltip } from '../shared/utils';
|
|
|
28
28
|
function OwnerSelector(props) {
|
|
29
29
|
const { t } = useTranslation();
|
|
30
30
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
31
|
-
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, isCaseOwnerUpdating,
|
|
31
|
+
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, } = useCaseSelector((state) => ({
|
|
32
32
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
33
33
|
caseNumber: state.caseDetails.caseNumber,
|
|
34
34
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
35
35
|
selectedOwner: state.selectedOwner,
|
|
36
36
|
selectedCaseGroupUsers: state.selectedCaseGroupUsers,
|
|
37
37
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
38
|
-
caseDetailes: state.caseDetails,
|
|
39
38
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
40
39
|
}), isEqual);
|
|
41
40
|
const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
@@ -52,60 +51,6 @@ function OwnerSelector(props) {
|
|
|
52
51
|
!isEmpty(pvalue.ssoUsername) &&
|
|
53
52
|
value.ssoUsername !== pvalue.ssoUsername;
|
|
54
53
|
const canEditCase = useCanEditCase();
|
|
55
|
-
// set owner on creating a case
|
|
56
|
-
const setContactPhoneNumber = (sso) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
// logged in user and case owner are the same
|
|
58
|
-
if (sso === loggedInUser.data.ssoUsername) {
|
|
59
|
-
if (loggedInUser.data.supportPhoneAreaCodePrefixLineNumber) {
|
|
60
|
-
setCaseDetails(caseDispatch, {
|
|
61
|
-
phoneAreaCodePrefixLineNumber: loggedInUser.data.supportPhoneAreaCodePrefixLineNumber,
|
|
62
|
-
phoneCountryCode: loggedInUser.data.supportPhoneCountryCode,
|
|
63
|
-
suppliedPhoneNumberVerified: isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') || //hasLoggedInUserConfirmedPhoneNumber: global verification phone state for contactSSOName === loggedInUser.data.ssoUsername
|
|
64
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
65
|
-
? hasLoggedInUserConfirmedPhoneNumber
|
|
66
|
-
: 'False',
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
const phoneLine = getPhoneObj(loggedInUser.data.phone).phoneLine || '';
|
|
71
|
-
const countryCode = getPhoneObj(loggedInUser.data.phone).countryCode;
|
|
72
|
-
setCaseDetails(caseDispatch, {
|
|
73
|
-
phoneAreaCodePrefixLineNumber: phoneLine,
|
|
74
|
-
phoneCountryCode: countryCode,
|
|
75
|
-
suppliedPhoneNumberVerified: isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
76
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
77
|
-
? hasLoggedInUserConfirmedPhoneNumber
|
|
78
|
-
: 'False',
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
try {
|
|
84
|
-
const selectedContact = yield contacts.getSFDCContactBySso(sso);
|
|
85
|
-
if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
86
|
-
setCaseDetails(caseDispatch, {
|
|
87
|
-
phoneAreaCodePrefixLineNumber: selectedContact.supportPhoneAreaCodePrefixLineNumber,
|
|
88
|
-
phoneCountryCode: selectedContact.supportPhoneCountryCode,
|
|
89
|
-
suppliedPhoneNumberVerified: 'Deferred',
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
setCaseDetails(caseDispatch, {
|
|
94
|
-
phoneAreaCodePrefixLineNumber: getPhoneObj(selectedContact.phone).phoneLine || '',
|
|
95
|
-
phoneCountryCode: getPhoneObj(selectedContact.phone).countryCode || '',
|
|
96
|
-
suppliedPhoneNumberVerified: 'Deferred',
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
setCaseDetails(caseDispatch, {
|
|
102
|
-
phoneAreaCodePrefixLineNumber: '',
|
|
103
|
-
phoneCountryCode: '',
|
|
104
|
-
suppliedPhoneNumberVerified: 'False',
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
54
|
const updatePhone = (phoneSetting) => __awaiter(this, void 0, void 0, function* () {
|
|
110
55
|
yield updateCaseDetails(caseDispatch, caseNumber, phoneSetting);
|
|
111
56
|
setCaseDetails(caseDispatch, Object.assign({}, phoneSetting));
|
|
@@ -190,7 +135,6 @@ function OwnerSelector(props) {
|
|
|
190
135
|
setLocalOwnerChange(true);
|
|
191
136
|
!isEmpty(selectedContact) &&
|
|
192
137
|
setNotifiedUser(dispatch, filter(notificationContacts, (c) => c.ssoUsername !== selectedContact.ssoUsername));
|
|
193
|
-
setContactPhoneNumber(selectedContact.ssoUsername);
|
|
194
138
|
});
|
|
195
139
|
/** Reset owner when selected account number changes */
|
|
196
140
|
useEffect(() => {
|
|
@@ -286,26 +230,6 @@ function OwnerSelector(props) {
|
|
|
286
230
|
users.length > 0 && setUsersWithGroupAccess(sortHydraContacts(users));
|
|
287
231
|
}
|
|
288
232
|
}, [selectedCaseGroupUsers, caseNumber]);
|
|
289
|
-
// to populate the phone number with the logged in user data
|
|
290
|
-
useEffect(() => {
|
|
291
|
-
if (caseDetailes.contactSSOName === loggedInUser.data.ssoUsername) {
|
|
292
|
-
if (loggedInUser.data.supportPhoneAreaCodePrefixLineNumber) {
|
|
293
|
-
setCaseDetails(caseDispatch, {
|
|
294
|
-
phoneAreaCodePrefixLineNumber: loggedInUser.data.supportPhoneAreaCodePrefixLineNumber,
|
|
295
|
-
phoneCountryCode: loggedInUser.data.supportPhoneCountryCode,
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
const phoneLine = getPhoneObj(loggedInUser.data.phone).phoneLine || '';
|
|
300
|
-
const countryCode = getPhoneObj(loggedInUser.data.phone).countryCode;
|
|
301
|
-
setCaseDetails(caseDispatch, {
|
|
302
|
-
phoneAreaCodePrefixLineNumber: phoneLine,
|
|
303
|
-
phoneCountryCode: countryCode,
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
308
|
-
}, []);
|
|
309
233
|
const showUsersWithSelectedGroupAccess = caseNumber &&
|
|
310
234
|
(selectedCaseGroupUsers.isFetching ||
|
|
311
235
|
(!selectedCaseGroupUsers.isFetching && (selectedCaseGroupUsers.data || []).length > 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAyBlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAyBlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAgO5C"}
|
|
@@ -104,15 +104,14 @@ export function CaseDetailsTabs(props) {
|
|
|
104
104
|
routePath: 'escalation',
|
|
105
105
|
component: (React.createElement(RMEEscalationList, { escalations: caseEscalations.data, caseNumber: caseNumber, caseStatus: status, accountNumber: loggedInUserRights.data.getAccountNumber(), isInternal: loggedInUserRights.data.isInternal() })),
|
|
106
106
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
107
|
+
tabsToRender.push({
|
|
108
|
+
'data-tracking-id': 'case-history-tab',
|
|
109
|
+
title: CaseDetailsTabsEnum.HISTORY,
|
|
110
|
+
key: 'history',
|
|
111
|
+
routePath: 'history',
|
|
112
|
+
ref: caseHistoryTabRef,
|
|
113
|
+
component: React.createElement(CaseHistory, { caseNumber: caseNumber }),
|
|
114
|
+
});
|
|
116
115
|
const getActiveTabKey = () => {
|
|
117
116
|
if (!activeTab)
|
|
118
117
|
return activeTabKey;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,sBA4TrC"}
|
|
@@ -27,7 +27,7 @@ import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhone
|
|
|
27
27
|
import { trimAndReplacePlus } from '../../../shared/utils';
|
|
28
28
|
import { PDFContext } from '../../PDFContainer';
|
|
29
29
|
export function CaseContactPhoneNumber() {
|
|
30
|
-
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating, phone, } = useCaseSelector((state) => ({
|
|
30
|
+
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating, phone, hasLoggedInUserConfirmedPhoneNumber, } = useCaseSelector((state) => ({
|
|
31
31
|
phoneCountryCode: state.caseDetails.phoneCountryCode || '',
|
|
32
32
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
33
33
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -35,6 +35,7 @@ export function CaseContactPhoneNumber() {
|
|
|
35
35
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
36
36
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
37
37
|
phone: state.caseDetails.phone,
|
|
38
|
+
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
38
39
|
}), isEqual);
|
|
39
40
|
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
40
41
|
const canEditCase = useCanEditCase();
|
|
@@ -101,8 +102,7 @@ export function CaseContactPhoneNumber() {
|
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
104
|
const onClear = () => __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
|
|
105
|
-
setLocalCountryCodeState('');
|
|
105
|
+
setIsEditting(false);
|
|
106
106
|
});
|
|
107
107
|
const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} digits.', {
|
|
108
108
|
limit: PHONE_LIMIT,
|
|
@@ -180,6 +180,16 @@ export function CaseContactPhoneNumber() {
|
|
|
180
180
|
hasLoggedInUserConfirmedPhoneNumber: suppliedPhoneNumberVerified,
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
+
else {
|
|
184
|
+
// when loggedInUser !== contactSSOName while opening a case, we need to save the verification deferred state globally
|
|
185
|
+
// so that when the owner is again changed back to loggedInUser, we show the phone review banner again
|
|
186
|
+
// if he has not previously responded to the banner
|
|
187
|
+
setCaseState(caseDispatch, {
|
|
188
|
+
hasLoggedInUserConfirmedPhoneNumber: !isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True')
|
|
189
|
+
? 'Deferred'
|
|
190
|
+
: 'True',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
183
193
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
194
|
}, [suppliedPhoneNumberVerified]);
|
|
185
195
|
return (React.createElement("div", { className: "form-group pf-v5-u-pb-md", style: { minWidth: '200px' } },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA8BvE,OAAO,
|
|
1
|
+
{"version":3,"file":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA8BvE,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,YAAY,4EA4UhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -22,7 +22,7 @@ import { AbilityContext, CaseDetailsFields, CaseDiscussionFields, resourceAction
|
|
|
22
22
|
import { formatDateTime, linkifyLinks } from '@rh-support/utils';
|
|
23
23
|
import DOMPurify from 'dompurify';
|
|
24
24
|
import isEmpty from 'lodash/isEmpty';
|
|
25
|
-
import React, { useContext, useState } from 'react';
|
|
25
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
26
26
|
import { Trans, useTranslation } from 'react-i18next';
|
|
27
27
|
import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
28
28
|
import { PDFContext } from '../../PDFContainer';
|
|
@@ -31,6 +31,7 @@ import { JumpAndCopyLink } from './JumpAndCopyLink';
|
|
|
31
31
|
const CaseComments = React.forwardRef((props, ref) => {
|
|
32
32
|
var _a;
|
|
33
33
|
const { caseNumber } = props;
|
|
34
|
+
const markdownRef = useRef(null);
|
|
34
35
|
const { t } = useTranslation();
|
|
35
36
|
const ability = useContext(AbilityContext);
|
|
36
37
|
const canSeePrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.VIEW_PRIVATE_COMMENT);
|
|
@@ -186,6 +187,16 @@ const CaseComments = React.forwardRef((props, ref) => {
|
|
|
186
187
|
return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment), style: { fontFamily: isExportingPDF ? 'DejaVu Sans' : '' } }));
|
|
187
188
|
}
|
|
188
189
|
};
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
if ((markdownRef === null || markdownRef === void 0 ? void 0 : markdownRef.current) && isExportingPDF) {
|
|
192
|
+
const preTags = markdownRef.current.querySelectorAll('pre');
|
|
193
|
+
preTags.forEach((pre) => {
|
|
194
|
+
pre.style.wordWrap = 'break-word';
|
|
195
|
+
pre.style.overflowWrap = 'break-word';
|
|
196
|
+
pre.style.fontFamily = 'DejaVu Sans';
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}, [props.comment, isExportingPDF]);
|
|
189
200
|
if (!((_a = props.comment) === null || _a === void 0 ? void 0 : _a.isPublic) && !canSeePrivateComments)
|
|
190
201
|
return React.createElement(React.Fragment, null);
|
|
191
202
|
return (React.createElement("section", { ref: ref, id: props.comment.id, className: `prevent-split ${computePrivateComment(props.comment)} support-comment ${computeDiscussionCardCalss(props.comment)} ${ref ? 'selected-case-comment' : ''}` },
|
|
@@ -200,7 +211,7 @@ const CaseComments = React.forwardRef((props, ref) => {
|
|
|
200
211
|
React.createElement(Trans, null, "Partner"),
|
|
201
212
|
")"))),
|
|
202
213
|
React.createElement("time", null, formatDateTime(props.comment.lastModifiedDate))),
|
|
203
|
-
React.createElement("div", { className: "comment-body", onClick: onCommentAreaClick }, computeCommentText(props.comment)),
|
|
214
|
+
React.createElement("div", { className: "comment-body", onClick: onCommentAreaClick, ref: markdownRef }, computeCommentText(props.comment)),
|
|
204
215
|
React.createElement("footer", null,
|
|
205
216
|
React.createElement("span", { className: "comment-note" }, computeCommentFooter(props.comment)),
|
|
206
217
|
canSeeFeedbackButtons && commentFeedbackButtons(props.comment, props.feedback),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAa1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAwmBnD"}
|
|
@@ -8,10 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { caseAttachments } from '@cee-eng/hydrajs';
|
|
11
|
-
import {
|
|
11
|
+
import { MenuToggle, Select, SelectList, SelectOption } from '@patternfly/react-core';
|
|
12
|
+
import { AlertMessage, AlertType, ErrorBoundary, LoadingIndicator, ToastNotification } from '@rh-support/components';
|
|
12
13
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
13
14
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { getDropdownBtnPlaceholder, getUrlParsedParams, scrollIntoView
|
|
15
|
+
import { getDropdownBtnPlaceholder, getUrlParsedParams, scrollIntoView } from '@rh-support/utils';
|
|
15
16
|
import cloneDeep from 'lodash/cloneDeep';
|
|
16
17
|
import filter from 'lodash/filter';
|
|
17
18
|
import findIndex from 'lodash/findIndex';
|
|
@@ -76,6 +77,10 @@ export default function CaseDiscussion(props) {
|
|
|
76
77
|
const [replyingToPrivateComment, setReplyingToPrivateComment] = useState(null);
|
|
77
78
|
// used for tracking comment section width changes
|
|
78
79
|
const [discussionSectionWidth, setDiscussionSectionWidth] = useState(null);
|
|
80
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
81
|
+
const [selectedFilterItems, setSelectedFilterItems] = useState([]);
|
|
82
|
+
const [isSortOpen, setIsSortOpen] = useState(false);
|
|
83
|
+
const [sortSelected, setSortSelected] = useState('Select a value');
|
|
79
84
|
if (props.isDiscussionTab) {
|
|
80
85
|
cellMeasureCache = new CellMeasurerCache({
|
|
81
86
|
fixedWidth: true,
|
|
@@ -156,14 +161,6 @@ export default function CaseDiscussion(props) {
|
|
|
156
161
|
}
|
|
157
162
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
158
163
|
}, [props.caseComments, caseAttachmentHydra, props.caseChats, caseFeedbacksHydra, caseExternalTrackersUpdate]);
|
|
159
|
-
const onSortChange = (selectedSort) => {
|
|
160
|
-
setSort(dispatchDiscussion, selectedSort.value, allDiscussions);
|
|
161
|
-
};
|
|
162
|
-
const onFilterChange = (selectedFilter) => {
|
|
163
|
-
selectedFilter = selectedFilter.map((item) => item.value.value);
|
|
164
|
-
setFilter(dispatchDiscussion, selectedFilter, discussionFiltersListState);
|
|
165
|
-
shouldRenderRVComponent && setCanUpdateScrollTop(false);
|
|
166
|
-
};
|
|
167
164
|
const onAttachmentRemove = (uuid_removed) => {
|
|
168
165
|
updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
|
|
169
166
|
};
|
|
@@ -326,6 +323,30 @@ export default function CaseDiscussion(props) {
|
|
|
326
323
|
}
|
|
327
324
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
328
325
|
}, [isPostingRemoteRequestCommentCompleted]);
|
|
326
|
+
const onToggleClick = () => {
|
|
327
|
+
setIsOpen(!isOpen);
|
|
328
|
+
};
|
|
329
|
+
const onSortToggleClick = () => {
|
|
330
|
+
setIsSortOpen(!isSortOpen);
|
|
331
|
+
};
|
|
332
|
+
const onFilterSelect = (_event, prevOption) => {
|
|
333
|
+
const isFilterSelected = !prevOption.isSelected; // to get updated state of changed filter
|
|
334
|
+
const prevSelectedFilters = list.filter((option) => option.isSelected && option.value !== prevOption.value); // to get previously selected filters
|
|
335
|
+
const prevSelectedFiltersValue = prevSelectedFilters.map((option) => option.value);
|
|
336
|
+
const newSelectedFilters = isFilterSelected // has all the selected values of filter with the updated selected filter state
|
|
337
|
+
? [...prevSelectedFiltersValue, prevOption.value]
|
|
338
|
+
: prevSelectedFiltersValue;
|
|
339
|
+
setFilter(dispatchDiscussion, newSelectedFilters, discussionFiltersListState);
|
|
340
|
+
shouldRenderRVComponent && setCanUpdateScrollTop(false);
|
|
341
|
+
setSelectedFilterItems(prevSelectedFiltersValue);
|
|
342
|
+
};
|
|
343
|
+
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true }, getDropdownBtnPlaceholder(t('Select a filter'), list.filter((i) => i.isSelected).map((i) => i.filterLabel), ' ', list.length, t('All comments'))));
|
|
344
|
+
const onSortSelect = (_event, selectedSort) => {
|
|
345
|
+
setSort(dispatchDiscussion, selectedSort, allDiscussions);
|
|
346
|
+
setSortSelected(selectedSort.value);
|
|
347
|
+
setIsSortOpen(false);
|
|
348
|
+
};
|
|
349
|
+
const onSortToggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onSortToggleClick, isExpanded: isSortOpen, isFullWidth: true }, sort.name));
|
|
329
350
|
return (React.createElement(React.Fragment, null,
|
|
330
351
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading post comment section') } },
|
|
331
352
|
React.createElement(AttachmentContextProvider, null,
|
|
@@ -346,12 +367,13 @@ export default function CaseDiscussion(props) {
|
|
|
346
367
|
React.createElement("div", { className: `pfe-l-grid pfe-m-all-6-col pfe-m-gutters push-bottom ${isExportingPDF ? 'hide-in-pdf' : ''}` },
|
|
347
368
|
React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions: computeFilteredComments || [], onCommentSearch: onCaseCommentSearch, isCommentSearchCleared: isCommentSearchCleared }))),
|
|
348
369
|
React.createElement("span", { className: "push-top-narrow" },
|
|
349
|
-
React.createElement(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}), list: toOptions(list, { labelKey: 'filterLabel', disabledKey: 'isDisabled' }) })),
|
|
370
|
+
React.createElement("label", { htmlFor: "case-list-comments-dropdown", className: "pf-v5-u-mb-sm" }, t('Filter by')),
|
|
371
|
+
React.createElement(Select, { "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", role: "menu", isOpen: isOpen, selected: selectedFilterItems, onSelect: onFilterSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
|
|
372
|
+
React.createElement(SelectList, null, list.map((option) => (React.createElement(SelectOption, { hasCheckbox: true, value: option, isSelected: option.isSelected, isDisabled: option.isDisabled }, option.filterLabel)))))),
|
|
353
373
|
React.createElement("span", { className: "push-top-narrow" },
|
|
354
|
-
React.createElement(
|
|
374
|
+
React.createElement("label", { htmlFor: "se-discussion-sort", className: "pf-v5-u-mb-sm" }, t('Sort by')),
|
|
375
|
+
React.createElement(Select, { id: "se-discussion-sort", "data-tracking-id": "discussions-sort-dropdown", isOpen: isSortOpen, selected: sortSelected, onSelect: onSortSelect, onOpenChange: (isSortOpen) => setIsSortOpen(isSortOpen), toggle: onSortToggle, shouldFocusToggleOnSelect: true, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
|
|
376
|
+
React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { value: option, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
|
|
355
377
|
React.createElement("div", { className: "support-comment-section" }, !shouldRenderRVComponent &&
|
|
356
378
|
!isSearchResultEmpty &&
|
|
357
379
|
comuteSearchedComments.map((discussion, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHistory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/CaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CaseHistory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/CaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,UAAW,MAAM,sBAMjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,wBAAgB,kBAAkB,sBA2UjC"}
|