@rh-support/troubleshoot 2.2.130 → 2.2.131-beta.2
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/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/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/CaseEditView/Tabs/CaseHistory/Timeline.css +47 -13
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +93 -50
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +18 -19
- 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/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +6 -13
- package/lib/esm/reducers/CaseConstNTypes.d.ts +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +1 -0
- 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/SessionRestoreReducer.d.ts +2 -0
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +12 -3
- package/package.json +9 -8
|
@@ -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":"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"}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
padding: 0 20px;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.timeline-empty::after {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
.timeline::after {
|
|
13
17
|
content: '';
|
|
14
18
|
position: absolute;
|
|
@@ -45,6 +49,36 @@
|
|
|
45
49
|
z-index: 1;
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
.timeline-controls {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
align-items: center;
|
|
56
|
+
padding: 0.5rem 1rem;
|
|
57
|
+
margin: 0 -0.8rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.timeline-pagination {
|
|
61
|
+
flex-grow: 1;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
#options-menu-top-pagination {
|
|
66
|
+
display: flex !important;
|
|
67
|
+
flex-wrap: nowrap !important;
|
|
68
|
+
}
|
|
69
|
+
.timeline-sort-order-select {
|
|
70
|
+
width: auto;
|
|
71
|
+
margin-left: 1rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.timeline-controls:last-of-type {
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.timeline-controls:last-of-type .timeline-pagination {
|
|
79
|
+
flex-grow: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
48
82
|
.timeline-node {
|
|
49
83
|
display: flex;
|
|
50
84
|
justify-content: space-between;
|
|
@@ -96,6 +130,7 @@
|
|
|
96
130
|
font-weight: 400;
|
|
97
131
|
text-align: right;
|
|
98
132
|
line-height: 30px;
|
|
133
|
+
padding-left: 1em;
|
|
99
134
|
}
|
|
100
135
|
|
|
101
136
|
.content-date-right-history {
|
|
@@ -125,25 +160,22 @@
|
|
|
125
160
|
|
|
126
161
|
.right-node::before {
|
|
127
162
|
content: ' ';
|
|
128
|
-
|
|
129
|
-
position: relative;
|
|
130
|
-
display: list-item;
|
|
163
|
+
position: absolute;
|
|
131
164
|
top: 22.5px;
|
|
132
165
|
width: 0;
|
|
133
|
-
|
|
134
|
-
left: -0.5%;
|
|
166
|
+
height: 0;
|
|
135
167
|
border: medium solid white;
|
|
136
|
-
border-width: 7px
|
|
137
|
-
border-color: transparent transparent transparent
|
|
138
|
-
transform:
|
|
168
|
+
border-width: 7px 7px 7px 0;
|
|
169
|
+
border-color: transparent white transparent transparent;
|
|
170
|
+
transform: translateX(-100%);
|
|
139
171
|
}
|
|
140
172
|
|
|
141
173
|
.internal.right-node::before {
|
|
142
|
-
border-color:
|
|
174
|
+
border-right-color: #ee0000;
|
|
143
175
|
}
|
|
144
176
|
|
|
145
177
|
.customer.right-node::before {
|
|
146
|
-
border-color:
|
|
178
|
+
border-right-color: #316dc1;
|
|
147
179
|
}
|
|
148
180
|
|
|
149
181
|
.timeline-internal {
|
|
@@ -168,7 +200,7 @@
|
|
|
168
200
|
|
|
169
201
|
.contentTimeline {
|
|
170
202
|
padding: 16px;
|
|
171
|
-
position: absolute;
|
|
203
|
+
/* position: absolute; */
|
|
172
204
|
border-radius: 3px;
|
|
173
205
|
margin-bottom: 32px;
|
|
174
206
|
}
|
|
@@ -179,8 +211,7 @@
|
|
|
179
211
|
border-left-style: solid !important;
|
|
180
212
|
border-radius: 3px;
|
|
181
213
|
border: 1px solid #d2d2d2;
|
|
182
|
-
width:
|
|
183
|
-
top: 0rem;
|
|
214
|
+
width: 100%;
|
|
184
215
|
}
|
|
185
216
|
|
|
186
217
|
.content-right-customer {
|
|
@@ -203,6 +234,9 @@ ul#case-history-paginated-timeline {
|
|
|
203
234
|
|
|
204
235
|
.timelineMenu {
|
|
205
236
|
display: flex;
|
|
237
|
+
justify-content: space-between;
|
|
238
|
+
align-items: center;
|
|
239
|
+
margin-bottom: 1rem;
|
|
206
240
|
}
|
|
207
241
|
|
|
208
242
|
.case-history-timeline-datepicker {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AA2BxB,OAAO,KAAuD,MAAM,OAAO,CAAC;AA2J5E,QAAA,MAAM,QAAQ;;uBAkSb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -9,9 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import './Timeline.css';
|
|
11
11
|
import { caseHistory } from '@cee-eng/hydrajs';
|
|
12
|
-
import { Avatar, Button, DatePicker, EmptyState, EmptyStateBody, EmptyStateHeader, EmptyStateIcon, EmptyStateVariant, MenuToggle, SearchInput, Select,
|
|
12
|
+
import { Avatar, Button, DatePicker, EmptyState, EmptyStateBody, EmptyStateHeader, EmptyStateIcon, EmptyStateVariant, MenuToggle, Pagination, SearchInput, Select,
|
|
13
|
+
// SelectList,
|
|
14
|
+
SelectOption, Spinner, } from '@patternfly/react-core';
|
|
15
|
+
import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
13
16
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
14
|
-
import
|
|
17
|
+
import globalDangerColor100 from '@patternfly/react-tokens/dist/js/global_danger_color_100';
|
|
18
|
+
import { format, fromUnixTime, isSameDay, parse } from 'date-fns';
|
|
15
19
|
import debounce from 'lodash/debounce';
|
|
16
20
|
import isEmpty from 'lodash/isEmpty';
|
|
17
21
|
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
@@ -37,9 +41,30 @@ const TimelineEvent = ({ date, text, side, user, useAvatar }) => {
|
|
|
37
41
|
const TimelineNode = React.forwardRef(({ leftEvent, rightEvent, user, useAvatar }, ref) => {
|
|
38
42
|
return (React.createElement("div", { className: "timeline-node", role: "region", "aria-label": "Timeline node" },
|
|
39
43
|
leftEvent && React.createElement(TimelineEvent, Object.assign({}, leftEvent, { side: "left", useAvatar: useAvatar })),
|
|
40
|
-
React.createElement("div", { ref: ref, "aria-label": `${useAvatar ? '
|
|
44
|
+
React.createElement("div", { ref: ref, "aria-label": `${useAvatar ? 'User profile picture' : 'Timeline marker'}`, tabIndex: 0 }, useAvatar ? (React.createElement(Avatar, { src: 'https://www.patternfly.org/images/668560cd.svg', className: `timeline-avatar timeline-avatar-${user}`, alt: `${user}'s avatar` })) : (React.createElement("div", { className: `timeline-marker timeline-${user}` }))),
|
|
41
45
|
rightEvent && React.createElement(TimelineEvent, Object.assign({}, rightEvent, { side: "right" }))));
|
|
42
46
|
});
|
|
47
|
+
// product, version ,owner, case group changes all require the special parse
|
|
48
|
+
/*
|
|
49
|
+
"fieldName" : "RH_Version__c", //version
|
|
50
|
+
"fieldName" : "RH_Product__c", //product
|
|
51
|
+
"fieldName" : "ContactId", //owner
|
|
52
|
+
"fieldName" : "FolderId__c", //case group
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
case group: { //we have a problem here, case group values are not populated properly
|
|
56
|
+
"newValue" : "a0H6R00000sAOw0UAG",
|
|
57
|
+
"oldValue" : "a0H6R000018fSgKUAU"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
contact ID: {
|
|
61
|
+
"newValue": "0032K00002NffXPQAZ",
|
|
62
|
+
"oldValue": "0036R00003bfVTVQA2"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
*/
|
|
43
68
|
const transformApiResponseToTimelineData = (apiResponse) => {
|
|
44
69
|
let previousUser = null;
|
|
45
70
|
const timelineEvents = apiResponse.historyItems.map((item, index) => {
|
|
@@ -48,14 +73,7 @@ const transformApiResponseToTimelineData = (apiResponse) => {
|
|
|
48
73
|
const useAvatar = index === 0 || (!!previousUser && currentUser !== previousUser);
|
|
49
74
|
// Update the previousUser for the next iteration
|
|
50
75
|
previousUser = currentUser;
|
|
51
|
-
const eventDate =
|
|
52
|
-
const date = eventDate.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });
|
|
53
|
-
const time = eventDate.toLocaleTimeString('en-US', {
|
|
54
|
-
hour: 'numeric',
|
|
55
|
-
minute: '2-digit',
|
|
56
|
-
hour12: true,
|
|
57
|
-
timeZoneName: 'short',
|
|
58
|
-
});
|
|
76
|
+
const eventDate = fromUnixTime(item.createdDate / 1000); // Convert UNIX ms to Date object
|
|
59
77
|
const user = item.createdByCustomer !== undefined
|
|
60
78
|
? item.createdByCustomer //using new case history field to determine this
|
|
61
79
|
? 'customer'
|
|
@@ -64,8 +82,8 @@ const transformApiResponseToTimelineData = (apiResponse) => {
|
|
|
64
82
|
? 'internal'
|
|
65
83
|
: 'customer';
|
|
66
84
|
const leftEvent = {
|
|
67
|
-
date:
|
|
68
|
-
text:
|
|
85
|
+
date: format(eventDate, 'MMMM d, yyyy'), // Format e.g. "June 9, 2021"
|
|
86
|
+
text: format(eventDate, 'h:mm a zzz'), // Format e.g. "10:04 PM EDT"
|
|
69
87
|
};
|
|
70
88
|
const rightEvent = {
|
|
71
89
|
date: `${item.createdByUserName} ${stripHTML(item.outputText)}`, //will change name later from date, for now date is title and text stays text due to initial set up mimicking same ITimelineEvent
|
|
@@ -89,13 +107,28 @@ const Timeline = ({ caseNumber }) => {
|
|
|
89
107
|
const { t } = useTranslation();
|
|
90
108
|
const [timelineEvents, setTimelineEvents] = useState([]);
|
|
91
109
|
const [isFetchingData, setIsFetchingData] = useState();
|
|
92
|
-
const [paginatedListLength, setPaginatedListLength] = useState();
|
|
93
110
|
const lastNodeRef = useRef(null);
|
|
94
111
|
const [dateValue, setDateValue] = React.useState('');
|
|
95
112
|
const [searchValue, setSearchValue] = useState('');
|
|
96
113
|
const [filteredEvents, setFilteredEvents] = useState([]);
|
|
97
114
|
const [isSelectOpen, setIsSelectOpen] = useState(false);
|
|
98
115
|
const [selectedOrder, setSelectedOrder] = useState('Newest to Oldest');
|
|
116
|
+
const [fetchError, setFetchError] = useState(null);
|
|
117
|
+
const [page, setPage] = useState(1);
|
|
118
|
+
const [perPage, setPerPage] = useState(20);
|
|
119
|
+
const onSetPage = (_, newPage) => {
|
|
120
|
+
setPage(newPage);
|
|
121
|
+
};
|
|
122
|
+
const onPerPageSelect = (_, newPerPage) => {
|
|
123
|
+
setPerPage(newPerPage);
|
|
124
|
+
setPage(1);
|
|
125
|
+
};
|
|
126
|
+
const renderPagination = () => (React.createElement(Pagination, { itemCount: filteredEvents.length, perPage: perPage, page: page, onSetPage: onSetPage, onPerPageSelect: onPerPageSelect, perPageOptions: [
|
|
127
|
+
{ title: '5', value: 5 },
|
|
128
|
+
{ title: '10', value: 10 },
|
|
129
|
+
{ title: '15', value: 15 },
|
|
130
|
+
{ title: '20', value: 20 },
|
|
131
|
+
], isCompact: true, variant: "top" }));
|
|
99
132
|
const handleSelectToggle = () => {
|
|
100
133
|
setIsSelectOpen(!isSelectOpen);
|
|
101
134
|
};
|
|
@@ -123,6 +156,7 @@ const Timeline = ({ caseNumber }) => {
|
|
|
123
156
|
function fetchHistory() {
|
|
124
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
158
|
setIsFetchingData(true);
|
|
159
|
+
setFetchError(null); // Reset error state before fetching
|
|
126
160
|
const options = {
|
|
127
161
|
sortField: 'createdDate',
|
|
128
162
|
sortOrder: 'DESC',
|
|
@@ -135,6 +169,7 @@ const Timeline = ({ caseNumber }) => {
|
|
|
135
169
|
}
|
|
136
170
|
catch (error) {
|
|
137
171
|
console.error('Failed to fetch history:', error);
|
|
172
|
+
setFetchError('Unable to connect');
|
|
138
173
|
}
|
|
139
174
|
finally {
|
|
140
175
|
setIsFetchingData(false);
|
|
@@ -161,7 +196,9 @@ const Timeline = ({ caseNumber }) => {
|
|
|
161
196
|
}
|
|
162
197
|
}, 100);
|
|
163
198
|
updateLineStyle();
|
|
164
|
-
|
|
199
|
+
window.addEventListener('resize', updateLineStyle); // workaround if the user zooms in and we need to recalculate the dynamic timeline length.
|
|
200
|
+
return () => window.removeEventListener('resize', updateLineStyle);
|
|
201
|
+
}, [timelineEvents, perPage, dateValue]);
|
|
165
202
|
const handleSearchChange = (value) => {
|
|
166
203
|
setSearchValue(value.target.value);
|
|
167
204
|
};
|
|
@@ -177,60 +214,66 @@ const Timeline = ({ caseNumber }) => {
|
|
|
177
214
|
const lowercasedFilter = searchValue.toLowerCase();
|
|
178
215
|
filteredBySearch = filteredBySearch.filter(({ left, right }) => {
|
|
179
216
|
const dateString = left.date.toLowerCase();
|
|
217
|
+
const timeString = left.text.toLowerCase();
|
|
180
218
|
return (dateString.includes(lowercasedFilter) ||
|
|
181
|
-
|
|
219
|
+
timeString.includes(lowercasedFilter) ||
|
|
182
220
|
right.date.toLowerCase().includes(lowercasedFilter));
|
|
183
221
|
});
|
|
184
222
|
}
|
|
185
223
|
let finalFilteredEvents = filteredBySearch;
|
|
186
224
|
if (dateValue) {
|
|
187
225
|
finalFilteredEvents = filteredBySearch.filter(({ left }) => {
|
|
188
|
-
//
|
|
189
|
-
const
|
|
190
|
-
//
|
|
191
|
-
|
|
226
|
+
// Parse the formatted date string back to a Date object
|
|
227
|
+
const eventDate = parse(left.date, 'MMMM d, yyyy', new Date());
|
|
228
|
+
// Parse the dateValue
|
|
229
|
+
const selectedDate = parse(dateValue, 'yyyy-MM-dd', new Date());
|
|
230
|
+
// Compare dates with date-fns
|
|
231
|
+
return isSameDay(eventDate, selectedDate);
|
|
192
232
|
});
|
|
193
233
|
}
|
|
194
234
|
setFilteredEvents(finalFilteredEvents);
|
|
195
235
|
}, [searchValue, dateValue, timelineEvents]);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
236
|
+
const handleReload = (e) => {
|
|
237
|
+
e.preventDefault();
|
|
238
|
+
// eslint-disable-next-line no-self-assign
|
|
239
|
+
window.location.href = window.location.href;
|
|
240
|
+
window.location.reload();
|
|
241
|
+
};
|
|
242
|
+
const renderTimelineContent = () => {
|
|
243
|
+
if (fetchError) {
|
|
244
|
+
return (React.createElement(EmptyState, { variant: EmptyStateVariant.full },
|
|
245
|
+
React.createElement(EmptyStateHeader, { titleText: "Unable to connect", icon: React.createElement(EmptyStateIcon, { icon: ExclamationCircleIcon, color: globalDangerColor100.value }), headingLevel: "h2" }),
|
|
246
|
+
React.createElement(EmptyStateBody, null,
|
|
247
|
+
React.createElement(Trans, null,
|
|
248
|
+
"Try ",
|
|
249
|
+
' ',
|
|
250
|
+
React.createElement("a", { href: "#", onClick: handleReload }, "reloading the page"),
|
|
251
|
+
' ',
|
|
252
|
+
"or check back later"))));
|
|
253
|
+
}
|
|
254
|
+
if (filteredEvents.length < 1) {
|
|
255
|
+
return (React.createElement(EmptyState, { variant: EmptyStateVariant.full },
|
|
209
256
|
React.createElement(EmptyStateHeader, { titleText: React.createElement(Trans, null, "No results found"), icon: React.createElement(EmptyStateIcon, { icon: SearchIcon }), headingLevel: "h2" }),
|
|
210
257
|
React.createElement(EmptyStateBody, null,
|
|
211
|
-
React.createElement(Trans, null, "Try modifying your search query or changing the date range and try again."))))
|
|
212
|
-
|
|
258
|
+
React.createElement(Trans, null, "Try modifying your search query or changing the date range and try again."))));
|
|
259
|
+
}
|
|
260
|
+
return (React.createElement(React.Fragment, null, filteredEvents.slice((page - 1) * perPage, page * perPage).map((node, index) => (React.createElement(TimelineNode, { key: index, leftEvent: node.left, rightEvent: node.right, user: node.right.user, useAvatar: node.right.useAvatar, ref: index === perPage - 1 ? lastNodeRef : null })))));
|
|
261
|
+
};
|
|
213
262
|
return (React.createElement(React.Fragment, null,
|
|
214
263
|
React.createElement("div", { className: "timelineMenu" },
|
|
215
|
-
React.createElement(SearchInput, { placeholder:
|
|
264
|
+
React.createElement(SearchInput, { placeholder: t('Search for a user, action, or keyword'), value: searchValue, onChange: handleSearchChange, onClear: handleClear, className: "case-history-timeline-search" }),
|
|
216
265
|
React.createElement("div", { className: "case-history-timeline-datepicker" },
|
|
217
266
|
React.createElement(DatePicker, { value: dateValue, onChange: (_event, value) => handleDateChange(value) }),
|
|
218
267
|
React.createElement(Button, { onClick: () => setDateValue(''), isDisabled: isEmpty(dateValue) }, "Reset"))),
|
|
219
|
-
React.createElement("div", { className: "timeline-
|
|
220
|
-
React.createElement(
|
|
221
|
-
|
|
268
|
+
React.createElement("div", { className: "timeline-controls" },
|
|
269
|
+
React.createElement("div", { className: "timeline-pagination" }, renderPagination()),
|
|
270
|
+
React.createElement("div", { className: "timeline-sort-order-select" },
|
|
271
|
+
React.createElement(Select, { id: "order-select", isOpen: isSelectOpen, selected: selectedOrder, onSelect: handleSelect, onOpenChange: (isOpen) => setIsSelectOpen(isOpen), toggle: (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: handleSelectToggle, isExpanded: isSelectOpen, style: { width: '200px' } }, selectedOrder)), shouldFocusToggleOnSelect: true },
|
|
222
272
|
React.createElement(SelectOption, { value: "Newest to Oldest" }, "Newest to Oldest"),
|
|
223
273
|
React.createElement(SelectOption, { value: "Oldest to Newest" }, "Oldest to Newest")))),
|
|
224
|
-
React.createElement("div", { className: "timeline" },
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
filteredEvents.map((node, index) => (React.createElement(TimelineNode, { key: index, leftEvent: node.left, rightEvent: node.right, user: node.right.user, useAvatar: node.right.useAvatar, ref: index === (paginatedListLength && paginatedListLength - 1) ? lastNodeRef : null //this ref is needed to perform calculations on the final node height
|
|
229
|
-
}))), perPage: 20, perPageOptions: [
|
|
230
|
-
{ title: '5', value: 5 },
|
|
231
|
-
{ title: '10', value: 10 },
|
|
232
|
-
{ title: '15', value: 15 },
|
|
233
|
-
{ title: '20', value: 20 },
|
|
234
|
-
], setPaginatedListLength: setPaginatedListLength })))));
|
|
274
|
+
isFetchingData ? (React.createElement("div", { className: "timeline-loading-spinner" },
|
|
275
|
+
React.createElement(Spinner, { size: "xl" }))) : (React.createElement("div", { className: `timeline ${filteredEvents.length === 0 ? 'timeline-empty' : ''}` }, renderTimelineContent())),
|
|
276
|
+
React.createElement("div", { className: "timeline-controls" },
|
|
277
|
+
React.createElement("div", { className: "timeline-pagination" }, renderPagination()))));
|
|
235
278
|
};
|
|
236
279
|
export default Timeline;
|
|
@@ -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"}
|
|
@@ -20,23 +20,23 @@ import { PHONE_INSTRUCTION, PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHON
|
|
|
20
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
22
22
|
import { PHONE_LIMIT } from '../../reducers/CaseConstNTypes';
|
|
23
|
-
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
23
|
+
import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
|
|
24
24
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
25
25
|
import { removeAllChars, trimAndReplacePlus } from '../shared/utils';
|
|
26
26
|
import { ContactPhoneNumberPopOver } from './ContactPhoneNumberPopOver';
|
|
27
27
|
import MandatoryPhonePopOver from './MandatoryPhonePopOver';
|
|
28
28
|
export function ContactPhoneNumber() {
|
|
29
|
-
const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, } = useCaseSelector((state) => ({
|
|
29
|
+
const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, shouldNotSetPhoneCountryCode, } = useCaseSelector((state) => ({
|
|
30
30
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
31
31
|
phoneCountryCode: state.caseDetails.phoneCountryCode,
|
|
32
32
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber,
|
|
33
33
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
34
34
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
35
|
+
shouldNotSetPhoneCountryCode: state.shouldNotSetPhoneCountryCode,
|
|
35
36
|
}), isEqual);
|
|
36
37
|
const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
37
38
|
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
38
39
|
const [invalid, setInvalid] = useState(false);
|
|
39
|
-
const [shouldNotSetCountryCode, setShouldNotSetCountryCode] = useState(false);
|
|
40
40
|
const [portalPhone, setPortalPhone] = useState('');
|
|
41
41
|
const [localFullPhone, setLocalFullPhone] = useState('');
|
|
42
42
|
const [isSettingLocalPhone, setIsSettingLocalPhone] = useState(false);
|
|
@@ -50,15 +50,15 @@ export function ContactPhoneNumber() {
|
|
|
50
50
|
return '';
|
|
51
51
|
}
|
|
52
52
|
else if (!isEmpty(_localFullPhone.trim()) && !_localFullPhone.trim().startsWith('+')) {
|
|
53
|
-
return '+' + _localFullPhone.
|
|
53
|
+
return '+' + _localFullPhone.trim();
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
return _localFullPhone;
|
|
56
|
+
return _localFullPhone.trim();
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
const onPhoneChange = (fullPhone) => {
|
|
60
60
|
setLocalFullPhone(checkingPlusInLocalFullPhone(fullPhone));
|
|
61
|
-
if (!
|
|
61
|
+
if (!shouldNotSetPhoneCountryCode) {
|
|
62
62
|
setCaseDetails(caseDispatch, {
|
|
63
63
|
phoneAreaCodePrefixLineNumber: getPhoneObj(fullPhone).phoneLine,
|
|
64
64
|
phoneCountryCode: getPhoneObj(fullPhone).countryCode,
|
|
@@ -66,7 +66,7 @@ export function ContactPhoneNumber() {
|
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
68
|
if (!isEmpty(fullPhone) && !isEqual(removeAllChars(portalPhone), removeAllChars(fullPhone))) {
|
|
69
|
-
|
|
69
|
+
setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: false });
|
|
70
70
|
}
|
|
71
71
|
setCaseDetails(caseDispatch, {
|
|
72
72
|
phoneAreaCodePrefixLineNumber: checkingPlusInLocalFullPhone(fullPhone),
|
|
@@ -100,8 +100,6 @@ export function ContactPhoneNumber() {
|
|
|
100
100
|
: invalid
|
|
101
101
|
? ValidatedOptions.error
|
|
102
102
|
: ValidatedOptions.default;
|
|
103
|
-
// Regular expression pattern to match hyphens and round brackets in phone
|
|
104
|
-
const pattern = /[-()]/g;
|
|
105
103
|
// This useEffect initialize phone number inputbox
|
|
106
104
|
// - User open case for first time for herself/himself -> show portal phone number
|
|
107
105
|
// - User open case for NOT first time for herself/himself -> show phone number that we have on user contact in SF
|
|
@@ -130,7 +128,7 @@ export function ContactPhoneNumber() {
|
|
|
130
128
|
}
|
|
131
129
|
else {
|
|
132
130
|
// User is openning a case for the first time
|
|
133
|
-
const phoneLength = trimAndReplacePlus(loggedInUser.data.phone)
|
|
131
|
+
const phoneLength = trimAndReplacePlus(removeAllChars(loggedInUser.data.phone)).length;
|
|
134
132
|
// For first time user whose phone is fetched from portal without country code
|
|
135
133
|
// For phone length less or equal to 10 country code shouldn't be fetched to avoid faulty phone population
|
|
136
134
|
if (phoneLength > 10) {
|
|
@@ -140,9 +138,11 @@ export function ContactPhoneNumber() {
|
|
|
140
138
|
_phoneCountryCode = countryCode;
|
|
141
139
|
}
|
|
142
140
|
else {
|
|
141
|
+
setCaseState(caseDispatch, {
|
|
142
|
+
shouldNotSetPhoneCountryCode: true,
|
|
143
|
+
});
|
|
143
144
|
_phoneAreaCodePrefixLineNumber = loggedInUser.data.phone;
|
|
144
145
|
_phoneCountryCode = '';
|
|
145
|
-
setShouldNotSetCountryCode(true);
|
|
146
146
|
setPortalPhone(loggedInUser.data.phone);
|
|
147
147
|
}
|
|
148
148
|
_suppliedPhoneNumberVerified =
|
|
@@ -166,7 +166,7 @@ export function ContactPhoneNumber() {
|
|
|
166
166
|
_suppliedPhoneNumberVerified = 'Deferred';
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
169
|
-
const phoneLength = trimAndReplacePlus(selectedContact.phone)
|
|
169
|
+
const phoneLength = trimAndReplacePlus(removeAllChars(selectedContact.phone)).length;
|
|
170
170
|
if (phoneLength > 10) {
|
|
171
171
|
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
172
172
|
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
@@ -174,7 +174,7 @@ export function ContactPhoneNumber() {
|
|
|
174
174
|
else {
|
|
175
175
|
_phoneAreaCodePrefixLineNumber = selectedContact.phone;
|
|
176
176
|
_phoneCountryCode = '';
|
|
177
|
-
|
|
177
|
+
setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
|
|
178
178
|
setPortalPhone(selectedContact.phone);
|
|
179
179
|
}
|
|
180
180
|
_suppliedPhoneNumberVerified = 'Deferred';
|
|
@@ -213,7 +213,7 @@ export function ContactPhoneNumber() {
|
|
|
213
213
|
if (isEmpty(selectedContact.supportPhoneAreaCodePrefixLineNumber) &&
|
|
214
214
|
!isEmpty(selectedContact.phone)) {
|
|
215
215
|
portalPhone = selectedContact.phone;
|
|
216
|
-
phoneLength = trimAndReplacePlus(portalPhone)
|
|
216
|
+
phoneLength = trimAndReplacePlus(removeAllChars(portalPhone)).length;
|
|
217
217
|
supportPhone = selectedContact.supportPhoneAreaCodePrefixLineNumber;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -228,7 +228,7 @@ export function ContactPhoneNumber() {
|
|
|
228
228
|
if (isEmpty(loggedInUser.data.supportPhoneAreaCodePrefixLineNumber) &&
|
|
229
229
|
!isEmpty(loggedInUser.data.phone)) {
|
|
230
230
|
portalPhone = loggedInUser.data.phone;
|
|
231
|
-
phoneLength = trimAndReplacePlus(portalPhone)
|
|
231
|
+
phoneLength = trimAndReplacePlus(removeAllChars(portalPhone)).length;
|
|
232
232
|
supportPhone = loggedInUser.data.supportPhoneAreaCodePrefixLineNumber;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -239,22 +239,21 @@ export function ContactPhoneNumber() {
|
|
|
239
239
|
if ((isUndefined(supportPhone) || isEmpty(supportPhone)) &&
|
|
240
240
|
isEqual(removeAllChars(portalPhone), removeAllChars(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber)) &&
|
|
241
241
|
phoneLength <= 10) {
|
|
242
|
-
setShouldNotSetCountryCode(true);
|
|
243
242
|
setPortalPhone(portalPhone);
|
|
244
243
|
}
|
|
245
|
-
setLocalFullPhone(checkingPlusInLocalFullPhone(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber));
|
|
244
|
+
setLocalFullPhone(checkingPlusInLocalFullPhone((phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber).trim()));
|
|
246
245
|
setIsSettingLocalPhone(false);
|
|
247
246
|
}
|
|
248
247
|
});
|
|
249
248
|
getPhoneInfo();
|
|
250
249
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
251
|
-
}, [contactSSOName]);
|
|
250
|
+
}, [contactSSOName, shouldNotSetPhoneCountryCode]);
|
|
252
251
|
return (React.createElement("div", { className: "form-group", style: { minWidth: '200px' } },
|
|
253
252
|
React.createElement("label", null,
|
|
254
253
|
React.createElement(Trans, null, "Case owner's phone number"),
|
|
255
254
|
React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
|
|
256
255
|
ContactPhoneNumberPopOver()),
|
|
257
|
-
React.createElement(PhoneInput, { phoneValue: localFullPhone, countryCode: phoneCountryCode, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, invalid: invalid, setInvalid: setInvalid, isLoading: isFetchingSso || isSettingLocalPhone, shouldNotSetCountryCode:
|
|
256
|
+
React.createElement(PhoneInput, { phoneValue: localFullPhone, countryCode: phoneCountryCode, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, invalid: invalid, setInvalid: setInvalid, isLoading: isFetchingSso || isSettingLocalPhone, shouldNotSetCountryCode: shouldNotSetPhoneCountryCode }),
|
|
258
257
|
React.createElement(MandatoryPhonePopOver, null),
|
|
259
258
|
!invalid &&
|
|
260
259
|
getPhone().length < PHONE_LIMIT &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EARuleInfoAccordion.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoAccordion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EARuleInfoAccordion.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoAccordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,UAAU,MAAM;IACZ,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AAID,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,MAAM,qBAiDrE"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
+
import { pcm } from '@cee-eng/hydrajs';
|
|
1
2
|
import { AccordionContent, AccordionItem, AccordionToggle, Label } from '@patternfly/react-core';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
+
import React, { useContext, useState } from 'react';
|
|
3
4
|
import { Trans } from 'react-i18next';
|
|
5
|
+
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../../context/SessionRestoreContext';
|
|
6
|
+
import { createOrUpdateSessionResources, getSessResFromRules } from '../../../reducers/SessionRestoreReducer';
|
|
4
7
|
import { EARule, EARuleArticle, EARuleDescription, EARuleTitle } from './EARule';
|
|
8
|
+
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
5
9
|
export function EARuleInfoAccordion({ rule, showNewTag, rank }) {
|
|
6
10
|
var _a;
|
|
7
11
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
12
|
+
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
13
|
+
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
8
14
|
return (React.createElement(EARule, { rule: rule, ruleRank: rank },
|
|
9
15
|
React.createElement(AccordionItem, null,
|
|
10
16
|
React.createElement(AccordionToggle, { isExpanded: isExpanded, id: "ea-rule-accordion-toggle", onClick: () => {
|
|
17
|
+
!isExpanded &&
|
|
18
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, [
|
|
19
|
+
getSessResFromRules(rule.cta, SessionResourceVisibility.PRESENTED_TAB, rank, rule.rule_id),
|
|
20
|
+
]);
|
|
11
21
|
setIsExpanded(!isExpanded);
|
|
12
22
|
} },
|
|
13
23
|
showNewTag && ((_a = rule === null || rule === void 0 ? void 0 : rule.isNew) !== null && _a !== void 0 ? _a : false) && (React.createElement(Label, { color: "green", className: "pf-v5-u-mr-md" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAO5D,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAO5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAmBvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA8QrC;kBA9QQ,eAAe;;;AAiRxB,eAAe,eAAe,CAAC"}
|
|
@@ -18,7 +18,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
|
-
import { search } from '@cee-eng/hydrajs';
|
|
21
|
+
import { pcm, search } from '@cee-eng/hydrajs';
|
|
22
22
|
import { Alert } from '@patternfly/react-core';
|
|
23
23
|
import { usePrevious } from '@rh-support/components';
|
|
24
24
|
import { getSolrParams, PreviousCaseTypes } from '@rh-support/utils';
|
|
@@ -32,9 +32,11 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
32
32
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
33
33
|
import { RecommendationDispatchContext } from '../../context/RecommendationContext';
|
|
34
34
|
import { RulesDispatchContext, RulesStateContext } from '../../context/RulesContext';
|
|
35
|
+
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
35
36
|
import { getDescriptionWOQues } from '../../reducers/CaseHelpers';
|
|
36
37
|
import { setInsighResultsKcsIds } from '../../reducers/RecommendationsReducer';
|
|
37
38
|
import { RulesReducerConstants } from '../../reducers/RulesReducer';
|
|
39
|
+
import { createOrUpdateSessionResources, getSessResFromRecs } from '../../reducers/SessionRestoreReducer';
|
|
38
40
|
import { isAnalysisComplete, isFileDeleted } from '../shared/fileUpload/reducer/AttachmentHelper';
|
|
39
41
|
import { updateAnalysisMetadata } from '../shared/fileUpload/reducer/AttachmentReducer';
|
|
40
42
|
import { AttachmentDispatchContext, AttachmentStateContext, } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
@@ -49,6 +51,9 @@ const defaultProps = {
|
|
|
49
51
|
function InsightsResults(props) {
|
|
50
52
|
const recommendationDispatch = useContext(RecommendationDispatchContext);
|
|
51
53
|
const { attachmentState: { includeAnalysisResults, caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
54
|
+
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
55
|
+
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
56
|
+
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
52
57
|
const { product, version, environment, summary, issue, periodicityOfIssue, timeFramesAndUrgency, caseType } = useCaseSelector((state) => ({
|
|
53
58
|
product: state.caseDetails.product,
|
|
54
59
|
version: state.caseDetails.version,
|
|
@@ -203,6 +208,14 @@ function InsightsResults(props) {
|
|
|
203
208
|
});
|
|
204
209
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
205
210
|
}, [allResults.length, includeAnalysisResults]);
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
if (allResults.length === 0)
|
|
213
|
+
return;
|
|
214
|
+
if (isRuleModalVisible || props.isDisplayOnMain) {
|
|
215
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, getSessResFromRecs(allResults, SessionResourceVisibility.PRESENTED));
|
|
216
|
+
}
|
|
217
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
218
|
+
}, [allResults, activeSessionId, isRuleModalVisible]);
|
|
206
219
|
function insightsModalToggle() {
|
|
207
220
|
setEAModalVisibility(!isRuleModalVisible);
|
|
208
221
|
selectedLocalFiles.map((file, index) => {
|
|
@@ -4,6 +4,7 @@ interface IProps {
|
|
|
4
4
|
doc: ISOSReportRecommendation;
|
|
5
5
|
showNewTag: boolean;
|
|
6
6
|
duplicateKeys: string[];
|
|
7
|
+
rank: number;
|
|
7
8
|
}
|
|
8
9
|
declare global {
|
|
9
10
|
namespace JSX {
|
|
@@ -12,6 +13,6 @@ declare global {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
export declare function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }: IProps): React.JSX.Element;
|
|
16
|
+
export declare function InsightsRuleInfo({ doc, showNewTag, duplicateKeys, rank }: IProps): React.JSX.Element;
|
|
16
17
|
export {};
|
|
17
18
|
//# sourceMappingURL=InsightsRuleInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsRuleInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsRuleInfo.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InsightsRuleInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsRuleInfo.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAWvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,GAAG,EAAE,wBAAwB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB;AAOD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,GAAG,CAAC;QACV,UAAU,iBAAiB;YACvB,SAAS,EAAE,GAAG,CAAC;SAClB;KACJ;CACJ;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,MAAM,qBA6KhF"}
|
|
@@ -9,10 +9,10 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
|
9
9
|
import { Trans } from 'react-i18next';
|
|
10
10
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
11
11
|
import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
|
|
12
|
-
import { createOrUpdateSessionResources, getSessResFromRules } from '../../reducers/SessionRestoreReducer';
|
|
12
|
+
import { createOrUpdateSessionResources, getSessResFromRec, getSessResFromRules, } from '../../reducers/SessionRestoreReducer';
|
|
13
13
|
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
14
14
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
15
|
-
export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
15
|
+
export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys, rank }) {
|
|
16
16
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
17
17
|
const [ruleData, setRuleData] = useState(null);
|
|
18
18
|
const insightsReport = useRef(null);
|
|
@@ -53,6 +53,8 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
|
53
53
|
};
|
|
54
54
|
return (React.createElement(React.Fragment, null, ruleData && (React.createElement(AccordionItem, null,
|
|
55
55
|
React.createElement(AccordionToggle, { isExpanded: isParentExpanded, id: doc.id + doc.attachmentId, onClick: () => {
|
|
56
|
+
!isParentExpanded &&
|
|
57
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, [getSessResFromRec(doc, SessionResourceVisibility.PRESENTED_TAB, rank)]);
|
|
56
58
|
setIsParentExpanded(!isParentExpanded);
|
|
57
59
|
} },
|
|
58
60
|
React.createElement("div", null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBA2M/C"}
|
|
@@ -14,16 +14,14 @@ import { getResTypeFromUrl } from '@rh-support/utils';
|
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
16
16
|
import { useCaseDispatch } from '../../context/CaseContext';
|
|
17
|
-
import {
|
|
17
|
+
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
18
18
|
import { setCaseState } from '../../reducers/CaseReducer';
|
|
19
|
-
import { createOrUpdateSessionResources, getSessResFromRecs } from '../../reducers/SessionRestoreReducer';
|
|
20
19
|
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
21
20
|
import { EARuleInfoAccordion } from './EARules/EARuleInfoAccordion';
|
|
22
21
|
import { InsightsRuleInfo } from './InsightsRuleInfo';
|
|
23
22
|
import { RecommendationFeedbackModal } from './RecommendationFeedbackModal';
|
|
24
23
|
export function InsightResultModal(props) {
|
|
25
24
|
const { t } = useTranslation();
|
|
26
|
-
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
27
25
|
const potentialDuplicate = {};
|
|
28
26
|
props.insightResults.map((value) => {
|
|
29
27
|
if (potentialDuplicate.hasOwnProperty(value.id)) {
|
|
@@ -38,7 +36,7 @@ export function InsightResultModal(props) {
|
|
|
38
36
|
});
|
|
39
37
|
const { attachmentState: { caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
40
38
|
const [canShowNewTag, setCanShowNewTag] = useState(false);
|
|
41
|
-
const { SessionResourceSource
|
|
39
|
+
const { SessionResourceSource } = pcm.preCase.session;
|
|
42
40
|
const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
|
|
43
41
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
44
42
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
@@ -67,11 +65,6 @@ export function InsightResultModal(props) {
|
|
|
67
65
|
const onExpand = (event, id) => {
|
|
68
66
|
setIsExpanded(!isExpanded);
|
|
69
67
|
};
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
props.isOpen &&
|
|
72
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, getSessResFromRecs(props.insightResults, SessionResourceVisibility.PRESENTED));
|
|
73
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
-
}, [props.insightResults, activeSessionId, props.isOpen]);
|
|
75
68
|
useEffect(() => {
|
|
76
69
|
let total = props.EARule.length;
|
|
77
70
|
let trueValues = 0;
|
|
@@ -108,9 +101,9 @@ export function InsightResultModal(props) {
|
|
|
108
101
|
React.createElement(CardExpandableContent, null,
|
|
109
102
|
React.createElement(CardBody, { className: "file-recommendation", "data-tracking-id": "file-recommendation-tracking-id" },
|
|
110
103
|
React.createElement(Accordion, { headingLevel: "h5", asDefinitionList: false, isBordered: true },
|
|
111
|
-
props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
|
|
104
|
+
props.insightResults.map((doc, index) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc, rank: index + 1 }))),
|
|
112
105
|
props.EARule.length > 0 &&
|
|
113
|
-
props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule, rank: index + 1 }))))))));
|
|
106
|
+
props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule, rank: index + props.insightResults.length + 1 }))))))));
|
|
114
107
|
}
|
|
115
108
|
return (React.createElement(React.Fragment, null,
|
|
116
109
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
@@ -122,7 +115,7 @@ export function InsightResultModal(props) {
|
|
|
122
115
|
React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
|
|
123
116
|
] },
|
|
124
117
|
React.createElement(Accordion, { className: "push-top-narrow rules-modal-items", headingLevel: "h2", asDefinitionList: false, isBordered: true },
|
|
125
|
-
props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
|
|
118
|
+
props.insightResults.map((doc, index) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc, rank: index + 1 }))),
|
|
126
119
|
props.EARule.length > 0 &&
|
|
127
|
-
props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule, rank: index + 1 })))))));
|
|
120
|
+
props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule, rank: index + props.insightResults.length + 1 })))))));
|
|
128
121
|
}
|
|
@@ -218,6 +218,7 @@ export interface ICaseState {
|
|
|
218
218
|
isPostingRemoteRequestCommentCompletedErrorMessage?: string | undefined;
|
|
219
219
|
isExistingPhoneNumber?: boolean;
|
|
220
220
|
hasLoggedInUserConfirmedPhoneNumber?: 'True' | 'False' | 'Deferred' | undefined;
|
|
221
|
+
shouldNotSetPhoneCountryCode?: boolean;
|
|
221
222
|
}
|
|
222
223
|
export interface ICreateCasePayloadType extends ICaseState {
|
|
223
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseConstNTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,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@@ export const initialCaseState = {
|
|
|
213
213
|
isPostingRemoteRequestCommentCompletedErrorMessage: '',
|
|
214
214
|
isExistingPhoneNumber: false,
|
|
215
215
|
hasLoggedInUserConfirmedPhoneNumber: 'False',
|
|
216
|
+
shouldNotSetPhoneCountryCode: false,
|
|
216
217
|
};
|
|
217
218
|
export const ORG_ADMIN_SEND_NOTIFCATION_KBASE_LINK = 'https://access.redhat.com/articles/5967811';
|
|
218
219
|
export const NON_ORG_ADMIN_SEND_NOTIFCATION_KBASE_LINK = 'https://access.redhat.com/articles/5967831';
|
|
@@ -43,7 +43,7 @@ export declare enum DiscussionsConstants {
|
|
|
43
43
|
}
|
|
44
44
|
export declare const discussionReducer: (state: IDiscussionState, action: IActionType) => IDiscussionState;
|
|
45
45
|
export declare const setSort: (dispatch: DiscussionsReducerDispatchType, sort: ISort, allDiscussions: IDiscussion[]) => void;
|
|
46
|
-
export declare const setFilter: (dispatch: DiscussionsReducerDispatchType, selected: string, discussionFiltersListState: IFilter[]) => void;
|
|
46
|
+
export declare const setFilter: (dispatch: DiscussionsReducerDispatchType, selected: string[], discussionFiltersListState: IFilter[]) => void;
|
|
47
47
|
export declare const setDiscussions: (dispatch: DiscussionsReducerDispatchType, comments: ICaseComment[], chats: ICaseChat[], attachments: IAttachment[], feedbacks: ICommentFeedback[], trackerUpdates: Partial<IExternalTrackerUpdate[]>, discussionFiltersListState: IFilter[], canSeeExternalTracker: boolean, canSeeChat: boolean, canSeeAttachments: boolean) => void;
|
|
48
48
|
export declare const updateAttacmentsAfterRemoval: (dispatch: DiscussionsReducerDispatchType, uuid_removed: string, allDiscussions: IDiscussion[], discussionFiltersListState: IFilter[]) => void;
|
|
49
49
|
export declare const updateCommentStateFeedback: (dispatch: DiscussionsReducerDispatchType, comment_id: string, newFeedback: any, allDiscussions: IDiscussion[]) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDiscussionTabReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseDiscussionTabReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseDiscussionTabReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseDiscussionTabReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAMnD,KAAK,WAAW,GAAG,OAAO,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;AACnE,MAAM,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAE1E,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,OAAO,CAAC,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,sBAAsB,CAAC,CAAC;IAC/E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oBAAY,cAAc;IACtB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,gBAAgB,oBAAoB;IACpC,GAAG,QAAQ;CACd;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK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B,QAClC,MAAM,sCAEI,WAAW,EAAE,SAUhC,CAAC;AAEF,eAAO,MAAM,6BAA6B,aAC5B,8BAA8B,cAC5B,MAAM,kBACF,WAAW,EAAE,QACvB,KAAK,aACA,gBAAgB,EAAE,8BACD,OAAO,EAAE,kBAkCxC,CAAC;AAEF,eAAO,MAAM,gCAAgC,aAC/B,8BAA8B,cAC5B,MAAM,kBACF,WAAW,EAAE,QACvB,KAAK,mBACM,OAAO,8BACI,OAAO,EAAE,kBA2BxC,CAAC;AAEF,eAAO,MAAM,cAAc,aACb,8BAA8B,oBACtB,MAAM,uBACH,MAAM,SAG9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAc,8BAA8B,SAKzE,CAAC"}
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { kase, publicApi } from '@cee-eng/hydrajs';
|
|
11
11
|
import filter from 'lodash/filter';
|
|
12
12
|
import findIndex from 'lodash/findIndex';
|
|
13
|
+
import isEqual from 'lodash/isEqual';
|
|
13
14
|
import orderBy from 'lodash/orderBy';
|
|
14
15
|
export var DiscussionType;
|
|
15
16
|
(function (DiscussionType) {
|
|
@@ -95,8 +96,9 @@ export const setSort = (dispatch, sort, allDiscussions) => {
|
|
|
95
96
|
});
|
|
96
97
|
};
|
|
97
98
|
export const setFilter = (dispatch, selected, discussionFiltersListState) => {
|
|
98
|
-
const
|
|
99
|
-
if (selected.length >
|
|
99
|
+
const prevSelectedListLength = discussionFiltersListState.filter((filter) => filter.isSelected).length;
|
|
100
|
+
if (selected.length > prevSelectedListLength &&
|
|
101
|
+
(isEqual(selected.length, 4) || selected[selected.length - 1] === DiscussionType.ALL)) {
|
|
100
102
|
// selected item is ALL
|
|
101
103
|
discussionFiltersListState.forEach((filter) => (filter.isSelected = true));
|
|
102
104
|
dispatch({ type: DiscussionsConstants.updateDiscussionState, payload: { discussionFiltersListState } });
|
|
@@ -15,6 +15,7 @@ export interface IResourceTracking {
|
|
|
15
15
|
isUpdating: boolean;
|
|
16
16
|
visitedResources: ISessionResource[];
|
|
17
17
|
presentedResources: ISessionResource[];
|
|
18
|
+
presentedTabResources: ISessionResource[];
|
|
18
19
|
}
|
|
19
20
|
export interface ISessionResourcesTracking {
|
|
20
21
|
[source: string]: IResourceTracking;
|
|
@@ -37,6 +38,7 @@ export interface ISessionRestorePayloadType extends ISessionRestoreState {
|
|
|
37
38
|
payload: string;
|
|
38
39
|
visitedResources: ISessionResource[];
|
|
39
40
|
presentedResources: ISessionResource[];
|
|
41
|
+
presentedTabResources: ISessionResource[];
|
|
40
42
|
}
|
|
41
43
|
type IActionType = IAction<SessionRestoreConstants, ISessionRestorePayloadType>;
|
|
42
44
|
export type SessionReducerDispatchType = (value: IActionType) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestoreReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/SessionRestoreReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,IAAI,sBAAsB,EAC/C,yBAAyB,IAAI,0BAA0B,EAC1D,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkB1G,OAAO,EAAwB,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAWlF,MAAM,WAAW,aAAa;IAC1B,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,M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MAAM,oBAAoB,eACjB,eAAe,oBACT,0BAA0B,SACtC,MAAM,KACb,gBAAgB,EAIlB,CAAC;AAEF,eAAO,MAAM,YAAY,OACjB,WAAW,oBACG,0BAA0B,SACtC,MAAM,KACb,gBAMD,CAAC;AAEH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,mBAAmB,EAAE,EAC3B,gBAAgB,EAAE,0BAA0B,EAC5C,QAAQ,GAAE,MAAU,EACpB,WAAW,GAAE,MAAU,GACxB,gBAAgB,EAAE,CAMpB;AAGD,eAAO,MAAM,iBAAiB,QACrB,mBAAmB,oBACN,0BAA0B,SACtC,MAAM,KACb,gBAMD,CAAC;AAEH,eAAO,MAAM,mBAAmB,QACvB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAEH,eAAO,MAAM,cAAc,gFAY1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,gFAYjC,CAAC;AAGF,eAAO,MAAM,gBAAgB,QACpB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAIH,eAAO,MAAM,YAAY,eACT,mBAAmB,mBACd,mBAAmB,EAAE,YAC7B,mBAAmB,EAAE,uBAWjC,CAAC"}
|
|
@@ -45,7 +45,7 @@ export const initialSessionRestoreState = {
|
|
|
45
45
|
};
|
|
46
46
|
// Reducers
|
|
47
47
|
export const sessionRestoreReducer = (state, action) => {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f;
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
49
49
|
switch (action.type) {
|
|
50
50
|
case SessionRestoreConstants.getSessions: {
|
|
51
51
|
return Object.assign(Object.assign({}, state), { previousSessions: action.payload.previousSessions, hasFetchedPreviousSessions: action.payload.hasFetchedPreviousSessions });
|
|
@@ -103,6 +103,7 @@ export const sessionRestoreReducer = (state, action) => {
|
|
|
103
103
|
resTemp.payload = action.payload.hasOwnProperty('payload') ? action.payload.payload : resTemp.payload;
|
|
104
104
|
resTemp.visitedResources = uniqBy([...((_a = resTemp.visitedResources) !== null && _a !== void 0 ? _a : []), ...((_c = (_b = action.payload) === null || _b === void 0 ? void 0 : _b.visitedResources) !== null && _c !== void 0 ? _c : [])], 'resourceEntityId');
|
|
105
105
|
resTemp.presentedResources = uniqBy([...((_d = resTemp.presentedResources) !== null && _d !== void 0 ? _d : []), ...((_f = (_e = action.payload) === null || _e === void 0 ? void 0 : _e.presentedResources) !== null && _f !== void 0 ? _f : [])], 'resourceEntityId');
|
|
106
|
+
resTemp.presentedTabResources = uniqBy([...((_g = resTemp.presentedTabResources) !== null && _g !== void 0 ? _g : []), ...((_j = (_h = action.payload) === null || _h === void 0 ? void 0 : _h.presentedTabResources) !== null && _j !== void 0 ? _j : [])], 'resourceEntityId');
|
|
106
107
|
return Object.assign(Object.assign({}, state), { sessionResourceTracking: Object.assign(Object.assign({}, state.sessionResourceTracking), { [action.payload.resourceSource]: resTemp }) });
|
|
107
108
|
}
|
|
108
109
|
case SessionRestoreConstants.updatePreviousSessions: {
|
|
@@ -319,6 +320,7 @@ export function createSessionResourcesLocal(dispatch, activeSessionId, currentSe
|
|
|
319
320
|
payload,
|
|
320
321
|
visitedResources: filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.VISITED),
|
|
321
322
|
presentedResources: filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.PRESENTED),
|
|
323
|
+
presentedTabResources: filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.PRESENTED_TAB),
|
|
322
324
|
},
|
|
323
325
|
});
|
|
324
326
|
const response = yield createSessionResources(activeSessionId, { source, payload }, resources);
|
|
@@ -335,7 +337,7 @@ export function createSessionResourcesLocal(dispatch, activeSessionId, currentSe
|
|
|
335
337
|
}
|
|
336
338
|
// Update Session Resource Helper
|
|
337
339
|
export function updateSessionResourcesLocal(dispatch, activeSessionId, currentSessionResourceTracking, source, resources) {
|
|
338
|
-
var _a, _b;
|
|
340
|
+
var _a, _b, _c;
|
|
339
341
|
return __awaiter(this, void 0, void 0, function* () {
|
|
340
342
|
if (isEmpty(activeSessionId) || isEmpty(source) || isEmpty(resources))
|
|
341
343
|
return;
|
|
@@ -344,22 +346,29 @@ export function updateSessionResourcesLocal(dispatch, activeSessionId, currentSe
|
|
|
344
346
|
return;
|
|
345
347
|
const newlyVisitedResources = filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.VISITED);
|
|
346
348
|
const newlyPresentedResources = filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.PRESENTED);
|
|
349
|
+
const newlyPresentedTabResources = filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.PRESENTED_TAB);
|
|
347
350
|
const previouslyVisitedResources = (_a = resourceTracking === null || resourceTracking === void 0 ? void 0 : resourceTracking.visitedResources) !== null && _a !== void 0 ? _a : [];
|
|
348
351
|
const previouslyPresentedResources = (_b = resourceTracking === null || resourceTracking === void 0 ? void 0 : resourceTracking.presentedResources) !== null && _b !== void 0 ? _b : [];
|
|
352
|
+
const previouslyPresentedTabResources = (_c = resourceTracking === null || resourceTracking === void 0 ? void 0 : resourceTracking.presentedTabResources) !== null && _c !== void 0 ? _c : [];
|
|
349
353
|
const nonPreviouslyVisitedResources = differenceBy(newlyVisitedResources, previouslyVisitedResources, 'resourceEntityId');
|
|
350
354
|
const nonPreviouslyPresentedResources = differenceBy(newlyPresentedResources, previouslyPresentedResources, 'resourceEntityId');
|
|
351
|
-
|
|
355
|
+
const nonPreviouslyPresentedTabResources = differenceBy(newlyPresentedTabResources, previouslyPresentedTabResources, 'resourceEntityId');
|
|
356
|
+
if (!nonPreviouslyVisitedResources.length &&
|
|
357
|
+
!nonPreviouslyPresentedResources.length &&
|
|
358
|
+
!nonPreviouslyPresentedTabResources.length)
|
|
352
359
|
return;
|
|
353
360
|
try {
|
|
354
361
|
yield updateSessionResources(activeSessionId, { id: resourceTracking.resourceOriginId }, [
|
|
355
362
|
...nonPreviouslyVisitedResources,
|
|
356
363
|
...nonPreviouslyPresentedResources,
|
|
364
|
+
...nonPreviouslyPresentedTabResources,
|
|
357
365
|
]);
|
|
358
366
|
const payloadToDispatch = {
|
|
359
367
|
resourceSource: source,
|
|
360
368
|
sessionResourceTracking: {},
|
|
361
369
|
visitedResources: previouslyVisitedResources.concat(nonPreviouslyVisitedResources),
|
|
362
370
|
presentedResources: previouslyPresentedResources.concat(nonPreviouslyPresentedResources),
|
|
371
|
+
presentedTabResources: previouslyPresentedTabResources.concat(nonPreviouslyPresentedTabResources),
|
|
363
372
|
};
|
|
364
373
|
dispatch({ type: SessionRestoreConstants.updateSessionResourceTracking, payload: payloadToDispatch });
|
|
365
374
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.131-beta.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lib/**/*"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@cee-eng/hydrajs": "4.17.
|
|
28
|
+
"@cee-eng/hydrajs": "4.17.21",
|
|
29
29
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
30
30
|
"@patternfly/patternfly": "5.1.0",
|
|
31
31
|
"@patternfly/react-core": "5.1.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-virtualized": "^9.22.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@cee-eng/hydrajs": "4.17.
|
|
54
|
+
"@cee-eng/hydrajs": "4.17.21",
|
|
55
55
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
56
56
|
"@patternfly/patternfly": "5.1.0",
|
|
57
57
|
"@patternfly/react-core": "5.1.1",
|
|
@@ -60,13 +60,14 @@
|
|
|
60
60
|
"@progress/kendo-licensing": "1.3.5",
|
|
61
61
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
62
62
|
"@redux-devtools/extension": "^3.3.0",
|
|
63
|
-
"@rh-support/components": "2.1.
|
|
64
|
-
"@rh-support/react-context": "2.1.
|
|
63
|
+
"@rh-support/components": "2.1.63",
|
|
64
|
+
"@rh-support/react-context": "2.1.71",
|
|
65
65
|
"@rh-support/types": "2.0.4",
|
|
66
|
-
"@rh-support/user-permissions": "2.1.
|
|
67
|
-
"@rh-support/utils": "2.1.
|
|
66
|
+
"@rh-support/user-permissions": "2.1.46",
|
|
67
|
+
"@rh-support/utils": "2.1.35",
|
|
68
68
|
"@types/react-redux": "^7.1.33",
|
|
69
69
|
"@types/redux": "^3.6.0",
|
|
70
|
+
"date-fns": "^3.6.0",
|
|
70
71
|
"dompurify": "^2.2.6",
|
|
71
72
|
"downshift": "^6.0.5",
|
|
72
73
|
"i18next": "^19.0.1",
|
|
@@ -131,5 +132,5 @@
|
|
|
131
132
|
"defaults and supports es6-module",
|
|
132
133
|
"maintained node versions"
|
|
133
134
|
],
|
|
134
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "e4cfe31b84443da4fe8ff80dce2bfb95ceeecc78"
|
|
135
136
|
}
|