@rh-support/troubleshoot 2.5.4 → 2.5.5
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/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +13 -4
- package/lib/esm/components/shared/utils.d.ts +0 -1
- package/lib/esm/components/shared/utils.d.ts.map +1 -1
- package/lib/esm/components/shared/utils.js +0 -6
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +6 -3
- package/package.json +2 -2
|
@@ -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;AAkB1G,OAAO,KAAoE,MAAM,OAAO,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;AAkB1G,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,qBAyoBnD"}
|
|
@@ -29,7 +29,6 @@ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext,
|
|
|
29
29
|
import { clearReplyComment, discussionSortOrderConst, DiscussionType, setCommentText, setDiscussions, setFilter, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateCommentStateFeedback, updateDiscussionStateAttachments, updateDiscussionStateComments, } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
30
30
|
import { setCaseState } from '../../../../reducers/CaseReducer';
|
|
31
31
|
import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
32
|
-
import { removeSpecialChars } from '../../../shared/utils';
|
|
33
32
|
import { PDFContext } from '../../PDFContainer';
|
|
34
33
|
import CaseAttachment from './CaseAttachment';
|
|
35
34
|
import CaseChat from './CaseChat';
|
|
@@ -190,6 +189,15 @@ export default function CaseDiscussion(props) {
|
|
|
190
189
|
clearReplyComment(dispatchDiscussion);
|
|
191
190
|
setReplyingToPrivateComment(null);
|
|
192
191
|
};
|
|
192
|
+
const sanitizedSearchInput = (value) => {
|
|
193
|
+
if (!value)
|
|
194
|
+
return '';
|
|
195
|
+
const sanitizedValue = value.replace(/[^a-zA-Z0-9]/g, '');
|
|
196
|
+
// To escape HTML-like characters (e.g., <, >, &) in sanitizedValue
|
|
197
|
+
const div = document.createElement('div');
|
|
198
|
+
div.textContent = sanitizedValue;
|
|
199
|
+
return div.innerHTML;
|
|
200
|
+
};
|
|
193
201
|
const onCaseCommentSearch = (searchResult = [], searchV = '') => {
|
|
194
202
|
commentIndex !== -1 && setCommentIndex(-1);
|
|
195
203
|
shouldRenderRVComponent && setCanUpdateScrollTop(false);
|
|
@@ -201,11 +209,12 @@ export default function CaseDiscussion(props) {
|
|
|
201
209
|
const highlightSearchResults = (searchTerm) => {
|
|
202
210
|
setTimeout(() => {
|
|
203
211
|
// to mark attachment link button text
|
|
204
|
-
if (!isEmpty(
|
|
212
|
+
if (!isEmpty(sanitizedSearchInput(searchTerm))) {
|
|
213
|
+
const sanitizedSearchTerm = sanitizedSearchInput(searchTerm); // Sanitize the search term
|
|
205
214
|
document.querySelectorAll('button.attachment-download-btn').forEach((button) => {
|
|
206
215
|
var _a, _b;
|
|
207
|
-
if ((_a = button === null || button === void 0 ? void 0 : button.textContent) === null || _a === void 0 ? void 0 : _a.includes(
|
|
208
|
-
button.
|
|
216
|
+
if ((_a = button === null || button === void 0 ? void 0 : button.textContent) === null || _a === void 0 ? void 0 : _a.includes(sanitizedSearchTerm)) {
|
|
217
|
+
button.innerHTML = (_b = button.textContent) === null || _b === void 0 ? void 0 : _b.replace(new RegExp(sanitizedSearchTerm, 'gi'), (match) => `<mark>${match}</mark>`);
|
|
209
218
|
}
|
|
210
219
|
});
|
|
211
220
|
}
|
|
@@ -15,6 +15,5 @@ export declare const isPhoneValid: (countryCode: string, phoneLine: string) => b
|
|
|
15
15
|
export declare const trimAndReplacePlus: (value: string) => string;
|
|
16
16
|
export declare const removeAllSpaces: (value: string) => string;
|
|
17
17
|
export declare const removeAllChars: (value: string) => string;
|
|
18
|
-
export declare const removeSpecialChars: (value: string) => string;
|
|
19
18
|
export declare const getProductObj: (products: Partial<ISEProduct>[], product: string) => Partial<ISEProduct>;
|
|
20
19
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACpC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,iBAAiB,EAC3D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,GAAG,kBAErB,CAAC,iBAAiB,CAAC,uBAQ5C;AAED,eAAO,MAAM,YAAY,gBAAiB,MAAM,aAAa,MAAM,KAAG,OAarE,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,MAAM,WAG/C,CAAC;AAEF,eAAO,MAAM,eAAe,UAAW,MAAM,WAI5C,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,MAAM,WAI3C,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACpC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,iBAAiB,EAC3D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,GAAG,kBAErB,CAAC,iBAAiB,CAAC,uBAQ5C;AAED,eAAO,MAAM,YAAY,gBAAiB,MAAM,aAAa,MAAM,KAAG,OAarE,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,MAAM,WAG/C,CAAC;AAEF,eAAO,MAAM,eAAe,UAAW,MAAM,WAI5C,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,MAAM,WAI3C,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,OAAO,CAAC,UAAU,CAAC,EAAE,WAAW,MAAM,wBAG7E,CAAC"}
|
|
@@ -55,12 +55,6 @@ export const removeAllChars = (value) => {
|
|
|
55
55
|
// to remove all chars, brackets and have only digits
|
|
56
56
|
return value === null || value === void 0 ? void 0 : value.replace(/[^0-9]/g, '');
|
|
57
57
|
};
|
|
58
|
-
export const removeSpecialChars = (value) => {
|
|
59
|
-
if (!value)
|
|
60
|
-
return '';
|
|
61
|
-
// to allow only chars and digits
|
|
62
|
-
return value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z0-9]/g, '');
|
|
63
|
-
};
|
|
64
58
|
export const getProductObj = (products, product) => {
|
|
65
59
|
const productIndex = findIndex(products, (p) => p.product === product);
|
|
66
60
|
return productIndex === -1 ? {} : products[productIndex];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KA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C;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA6StC;kBA7SQ,gBAAgB;;;AA+SzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -195,7 +195,8 @@ function WizardNavigation(props) {
|
|
|
195
195
|
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
196
196
|
props.activeStep.nextButtonLabel === 'Troubleshoot' ||
|
|
197
197
|
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
198
|
-
noValidEntitlement
|
|
198
|
+
noValidEntitlement ||
|
|
199
|
+
recommendationState.isLoadingRecommendations;
|
|
199
200
|
return value;
|
|
200
201
|
}
|
|
201
202
|
else if (isATestvariation) {
|
|
@@ -204,7 +205,8 @@ function WizardNavigation(props) {
|
|
|
204
205
|
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
205
206
|
props.activeStep.nextButtonLabel === 'Troubleshoot' ||
|
|
206
207
|
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
207
|
-
noValidEntitlement
|
|
208
|
+
noValidEntitlement ||
|
|
209
|
+
recommendationState.isLoadingRecommendations;
|
|
208
210
|
return value;
|
|
209
211
|
}
|
|
210
212
|
else if (isATestvariation && !isCaseCreate) {
|
|
@@ -212,7 +214,8 @@ function WizardNavigation(props) {
|
|
|
212
214
|
isEmpty(issue) ||
|
|
213
215
|
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
214
216
|
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
215
|
-
noValidEntitlement
|
|
217
|
+
noValidEntitlement ||
|
|
218
|
+
recommendationState.isLoadingRecommendations;
|
|
216
219
|
return value;
|
|
217
220
|
}
|
|
218
221
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"defaults and supports es6-module",
|
|
136
136
|
"maintained node versions"
|
|
137
137
|
],
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "b95b2654a27a2208fcdf880f96643b158723d16a"
|
|
139
139
|
}
|