@rh-support/troubleshoot 2.2.51 → 2.2.52
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/ProductSelector/ProductSelector.js +1 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts +7 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +17 -4
- package/lib/esm/components/Recommendations/InsightsResults.js +2 -2
- package/lib/esm/components/Recommendations/Recommendations.d.ts +3 -0
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +18 -5
- package/lib/esm/components/Recommendations/ShowRank.d.ts +12 -0
- package/lib/esm/components/Recommendations/ShowRank.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/ShowRank.js +27 -0
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +10 -3
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts +7 -1
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +2 -2
- package/lib/esm/components/shared/useIsSectionValid.js +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +35 -4
- package/lib/esm/components/wizardLayout/WizardMain.js +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +5 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +4 -0
- package/lib/esm/reducers/CaseReducer.d.ts +1 -0
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -0
- package/lib/esm/reducers/RecommendationsReducer.d.ts +2 -1
- package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RecommendationsReducer.js +30 -2
- package/lib/esm/reducers/RouteConstNTypes.d.ts +1 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -52,5 +52,5 @@ export default function ProductSelector(props) {
|
|
|
52
52
|
React.createElement(EARuleWidget, null)),
|
|
53
53
|
React.createElement("div", { className: "suggestions-result-section" },
|
|
54
54
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
|
|
55
|
-
React.createElement(Recommendations,
|
|
55
|
+
React.createElement(Recommendations, { routeProps: props.routeProps })))))))));
|
|
56
56
|
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
3
|
+
interface IProps {
|
|
4
|
+
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
5
|
+
}
|
|
6
|
+
export declare function AsideResults(props: IProps): JSX.Element;
|
|
7
|
+
export {};
|
|
2
8
|
//# sourceMappingURL=AsideResults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUvD,OAAO,EAAE,eAAe,EAAsC,MAAM,iCAAiC,CAAC;AAWtG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,eAuOzC"}
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { pcm, search } from '@cee-eng/hydrajs';
|
|
11
11
|
import { useDebounce } from '@rh-support/components';
|
|
12
|
-
import {
|
|
12
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
|
+
import { computeRecommendationAbstract, computeRecommendationTitle, getConfigField, getSolrParams, getTrimmedSpecialCharacters, PCM_CONFIG_FIELD_TYPE, PreviousCaseTypes, replaceHighlightingData, } from '@rh-support/utils';
|
|
13
14
|
import isEmpty from 'lodash/isEmpty';
|
|
14
15
|
import isEqual from 'lodash/isEqual';
|
|
15
16
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
@@ -18,18 +19,22 @@ import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
|
18
19
|
import { RecommendationDispatchContext, RecommendationStateContext } from '../../context/RecommendationContext';
|
|
19
20
|
import { RouteContext } from '../../context/RouteContext';
|
|
20
21
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
22
|
+
import { WATSONX_DESCRIPTION_LIMIT, WATSONX_SUMMARY_LIMIT } from '../../reducers/CaseConstNTypes';
|
|
21
23
|
import { getDescriptionWOQues } from '../../reducers/CaseHelpers';
|
|
22
24
|
import { setCaseRecommendations } from '../../reducers/CaseReducer';
|
|
23
25
|
import { RecommendationsConstants } from '../../reducers/RecommendationsReducer';
|
|
24
26
|
import { showSidebarRecommendationsSections } from '../../reducers/RouteConstNTypes';
|
|
25
27
|
import { createOrUpdateSessionResources, getSessResFromRec, getSessResFromRecs, } from '../../reducers/SessionRestoreReducer';
|
|
26
28
|
import RouteUtils from '../../utils/routeUtils';
|
|
29
|
+
import { ShowRank } from './ShowRank';
|
|
27
30
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
28
|
-
export function AsideResults() {
|
|
31
|
+
export function AsideResults(props) {
|
|
29
32
|
/*
|
|
30
33
|
* Sidebar recommendation logic
|
|
31
34
|
*/
|
|
32
|
-
const {
|
|
35
|
+
const { globalMetadataState: { loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
36
|
+
const isRerankEnabled = getConfigField(pcmConfig.data, 'isRerankEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
37
|
+
const { isSelectedAccounntSecureSupport, product, version, caseResourceLinks, summary, issue, environment, periodicityOfIssue, timeFramesAndUrgency, caseType, isFetchingRecommendationsFromWatsonX, } = useCaseSelector((state) => ({
|
|
33
38
|
isSelectedAccounntSecureSupport: state.selectedAccountDetails.data.secureSupport,
|
|
34
39
|
product: state.caseDetails.product,
|
|
35
40
|
version: state.caseDetails.version,
|
|
@@ -40,6 +45,7 @@ export function AsideResults() {
|
|
|
40
45
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
41
46
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
42
47
|
caseType: state.caseDetails.caseType,
|
|
48
|
+
isFetchingRecommendationsFromWatsonX: state.isFetchingRecommendationsFromWatsonX,
|
|
43
49
|
}), isEqual);
|
|
44
50
|
const caseDispatch = useCaseDispatch();
|
|
45
51
|
// getting recommendation dispatch and state via context
|
|
@@ -75,7 +81,13 @@ export function AsideResults() {
|
|
|
75
81
|
const queryFilters = {
|
|
76
82
|
id: { values: recommendationState.insightsKcsIds, exclude: true },
|
|
77
83
|
};
|
|
78
|
-
const response =
|
|
84
|
+
const response = isFetchingRecommendationsFromWatsonX && !loggedInUsersAccount.data.secureSupport
|
|
85
|
+
? yield search.getWatsonXRecommendationsForCase(Object.assign(Object.assign(Object.assign(Object.assign({ product: product, version: version }, ((payload === null || payload === void 0 ? void 0 : payload.summary) && {
|
|
86
|
+
summary: getTrimmedSpecialCharacters(payload.summary, WATSONX_SUMMARY_LIMIT),
|
|
87
|
+
})), ((payload === null || payload === void 0 ? void 0 : payload.description) && {
|
|
88
|
+
description: getTrimmedSpecialCharacters(payload === null || payload === void 0 ? void 0 : payload.description, WATSONX_DESCRIPTION_LIMIT),
|
|
89
|
+
})), { rerank: isRerankEnabled }), getSolrParams(PAGE_SIZE, 129, queryFilters)), controllerRef.current.signal)
|
|
90
|
+
: yield search.getRecommendationsForCase(payload, getSolrParams(PAGE_SIZE, 129, queryFilters), controllerRef.current.signal);
|
|
79
91
|
const sideDocs = replaceHighlightingData(response.response.docs, response.highlighting);
|
|
80
92
|
recommendationDispatch({
|
|
81
93
|
type: RecommendationsConstants.receiveSidebarRecommendation,
|
|
@@ -136,6 +148,7 @@ export function AsideResults() {
|
|
|
136
148
|
return (React.createElement("li", { className: "result", key: doc.id },
|
|
137
149
|
React.createElement("header", { className: "result-header" },
|
|
138
150
|
React.createElement("a", { href: `${doc.view_uri}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[SessionResourceSource.RECOMMENDATIONS_ASIDE]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.RECOMMENDATIONS_ASIDE)}`, className: "se-recommended ts-result-aside", "data-tracking-id": `se-recommended-sidebar-recommendations-${index}`, rel: "noopener noreferrer", target: "_blank", onClick: onResourceClick(doc, index), dangerouslySetInnerHTML: computeRecommendationTitle(doc) })),
|
|
151
|
+
isFetchingRecommendationsFromWatsonX && (React.createElement(ShowRank, { index: index, originalRank: doc.original_rank, routeProps: props.routeProps })),
|
|
139
152
|
React.createElement("p", { className: "result-body", dangerouslySetInnerHTML: computeRecommendationAbstract(doc, 150) })));
|
|
140
153
|
})))));
|
|
141
154
|
}
|
|
@@ -87,7 +87,7 @@ function InsightsResults(props) {
|
|
|
87
87
|
payload: { isRuleModalVisible: isVisible },
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
|
-
function
|
|
90
|
+
function fetchFileRecommendations(localFile) {
|
|
91
91
|
var _a, _b, _c;
|
|
92
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
93
|
const analysisResults = (_a = localFile === null || localFile === void 0 ? void 0 : localFile.analysisMetadata) === null || _a === void 0 ? void 0 : _a.analysisResults;
|
|
@@ -190,7 +190,7 @@ function InsightsResults(props) {
|
|
|
190
190
|
!(insightResultsMap[localFile.attachmentId] || recommendedResultsMap[localFile.attachmentId]) &&
|
|
191
191
|
isAnalysisComplete(localFile.analysisMetadata.analysisStatus) &&
|
|
192
192
|
((_b = (_a = localFile.analysisMetadata.analysisResults) === null || _a === void 0 ? void 0 : _a.kcs_ids) !== null && _b !== void 0 ? _b : []).length > 0 &&
|
|
193
|
-
|
|
193
|
+
fetchFileRecommendations(localFile);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
1
3
|
interface IProps {
|
|
4
|
+
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
2
5
|
}
|
|
3
6
|
export default function Recommendations(props: IProps): JSX.Element;
|
|
4
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAelE,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAwQpD"}
|
|
@@ -2,7 +2,7 @@ import { pcm } from '@cee-eng/hydrajs';
|
|
|
2
2
|
import { Pagination, PaginationVariant } from '@patternfly/react-core';
|
|
3
3
|
import { LoadingDots, useDebounce, usePrevious } from '@rh-support/components';
|
|
4
4
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
5
|
-
import { computeRecommendationAbstract, computeRecommendationTitle, formatDate, scrollIntoView, } from '@rh-support/utils';
|
|
5
|
+
import { computeRecommendationAbstract, computeRecommendationTitle, formatDate, getConfigField, PCM_CONFIG_FIELD_TYPE, scrollIntoView, } from '@rh-support/utils';
|
|
6
6
|
import differenceBy from 'lodash/differenceBy';
|
|
7
7
|
import isEmpty from 'lodash/isEmpty';
|
|
8
8
|
import isEqual from 'lodash/isEqual';
|
|
@@ -16,10 +16,11 @@ import { RouteContext } from '../../context/RouteContext';
|
|
|
16
16
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
17
17
|
import { getRecommendationObject } from '../../reducers/CaseHelpers';
|
|
18
18
|
import { setCaseRecommendations } from '../../reducers/CaseReducer';
|
|
19
|
-
import { fetchRecommendations, RecommendationsConstants, setCurrentPage, setVisibleDocs, } from '../../reducers/RecommendationsReducer';
|
|
19
|
+
import { fetchRecommendations, fetchWatsonXRecommendations, RecommendationsConstants, setCurrentPage, setVisibleDocs, } from '../../reducers/RecommendationsReducer';
|
|
20
20
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
21
21
|
import { createOrUpdateSessionResources, getSessResFromRec, getSessResFromRecs, } from '../../reducers/SessionRestoreReducer';
|
|
22
22
|
import RouteUtils from '../../utils/routeUtils';
|
|
23
|
+
import { ShowRank } from './ShowRank';
|
|
23
24
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
24
25
|
export default function Recommendations(props) {
|
|
25
26
|
var _a, _b, _c;
|
|
@@ -33,7 +34,10 @@ export default function Recommendations(props) {
|
|
|
33
34
|
const caseDispatch = useCaseDispatch();
|
|
34
35
|
// Use Case Number
|
|
35
36
|
const { caseNumber } = useParams();
|
|
36
|
-
const { globalMetadataState: { navBarRef, loggedInUsersAccount }, } = useGlobalStateContext();
|
|
37
|
+
const { globalMetadataState: { navBarRef, loggedInUsersAccount, pcmConfig }, } = useGlobalStateContext();
|
|
38
|
+
const { isFetchingRecommendationsFromWatsonX } = useCaseSelector((state) => ({
|
|
39
|
+
isFetchingRecommendationsFromWatsonX: state.isFetchingRecommendationsFromWatsonX,
|
|
40
|
+
}), isEqual);
|
|
37
41
|
const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
|
|
38
42
|
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
39
43
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
@@ -42,7 +46,9 @@ export default function Recommendations(props) {
|
|
|
42
46
|
const [pageSize, setPageSize] = useState(null);
|
|
43
47
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
44
48
|
const prevMainRecommendations = usePrevious((_a = recommendationState === null || recommendationState === void 0 ? void 0 : recommendationState.visibleDocs) !== null && _a !== void 0 ? _a : []);
|
|
49
|
+
const prevIsFetchingRecommendationsFromWatsonX = usePrevious(isFetchingRecommendationsFromWatsonX);
|
|
45
50
|
const recommendationDispatch = useContext(RecommendationDispatchContext);
|
|
51
|
+
const isRerankEnabled = getConfigField(pcmConfig.data, 'isRerankEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
46
52
|
const DEFAULTPAGESIZE = 8;
|
|
47
53
|
const MAXROW = 24;
|
|
48
54
|
const recPageSize = pageSize !== null && pageSize !== void 0 ? pageSize : DEFAULTPAGESIZE;
|
|
@@ -65,7 +71,10 @@ export default function Recommendations(props) {
|
|
|
65
71
|
* Also, log the newly presented resources on the session
|
|
66
72
|
*/
|
|
67
73
|
useDebounce(() => {
|
|
68
|
-
if (activeSection !== AppRouteSections.SUMMARIZE ||
|
|
74
|
+
if (activeSection !== AppRouteSections.SUMMARIZE ||
|
|
75
|
+
!summary ||
|
|
76
|
+
(isRecSearchPayloadSame &&
|
|
77
|
+
prevIsFetchingRecommendationsFromWatsonX === isFetchingRecommendationsFromWatsonX)) {
|
|
69
78
|
return;
|
|
70
79
|
}
|
|
71
80
|
setCurrentPage(recommendationDispatch, 1);
|
|
@@ -79,7 +88,9 @@ export default function Recommendations(props) {
|
|
|
79
88
|
// recreate a new AbortController for each call
|
|
80
89
|
let controller = new AbortController();
|
|
81
90
|
abortControllerRef.current = controller;
|
|
82
|
-
|
|
91
|
+
isFetchingRecommendationsFromWatsonX && !loggedInUsersAccount.data.secureSupport
|
|
92
|
+
? fetchWatsonXRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, caseNumber, isSecureSupportAccount, queryFilters, controller.signal, isRerankEnabled)
|
|
93
|
+
: fetchRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, caseNumber, isSecureSupportAccount, queryFilters, controller.signal);
|
|
83
94
|
}, [
|
|
84
95
|
activeSection,
|
|
85
96
|
environment,
|
|
@@ -89,6 +100,7 @@ export default function Recommendations(props) {
|
|
|
89
100
|
summary,
|
|
90
101
|
version,
|
|
91
102
|
recommendationState.insightsKcsIds,
|
|
103
|
+
isFetchingRecommendationsFromWatsonX,
|
|
92
104
|
], 1000);
|
|
93
105
|
useEffect(() => {
|
|
94
106
|
const visibleRecs = [];
|
|
@@ -142,6 +154,7 @@ export default function Recommendations(props) {
|
|
|
142
154
|
React.createElement("span", { className: "meta" }, doc.documentKind),
|
|
143
155
|
React.createElement("span", { className: "list-separator" }, "\u2013"),
|
|
144
156
|
React.createElement("time", { className: "moment_date meta", title: doc.lastModifiedDate.toString() }, formatDate(doc.lastModifiedDate)))),
|
|
157
|
+
isFetchingRecommendationsFromWatsonX && (React.createElement(ShowRank, { index: i, originalRank: doc.original_rank, routeProps: props.routeProps, perPage: recPageSize, pageNo: recommendationState.currentPage })),
|
|
145
158
|
React.createElement("p", { className: "result-body", dangerouslySetInnerHTML: computeRecommendationAbstract(doc, 300) })));
|
|
146
159
|
})),
|
|
147
160
|
recommendationState.numFound !== 0 && recommendationState.numFound > DEFAULTPAGESIZE && (React.createElement("div", { className: "pagination-footer" },
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
3
|
+
interface IProps {
|
|
4
|
+
index: number;
|
|
5
|
+
originalRank: number;
|
|
6
|
+
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
7
|
+
perPage?: number;
|
|
8
|
+
pageNo?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function ShowRank(props: IProps): JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=ShowRank.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShowRank.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ShowRank.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eAuBrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import RouteUtils from '../../utils/routeUtils';
|
|
4
|
+
export function ShowRank(props) {
|
|
5
|
+
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
6
|
+
const urlQueryParams = RouteUtils.getQueryParams(props.routeProps);
|
|
7
|
+
const rerankingFromUrl = urlQueryParams.reranking;
|
|
8
|
+
const isShowRerankingForInternalUsers = rerankingFromUrl === 'true' || rerankingFromUrl === 'false';
|
|
9
|
+
const getCurrentRank = () => {
|
|
10
|
+
if (props.perPage && props.pageNo) {
|
|
11
|
+
return props.perPage * (props.pageNo - 1) + props.index + 1;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return props.index + 1;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
if (!loggedInUserRights.data.isInternal() || !isShowRerankingForInternalUsers)
|
|
18
|
+
return React.createElement(React.Fragment, null);
|
|
19
|
+
return (React.createElement("div", { className: "result-body" },
|
|
20
|
+
React.createElement("strong", null, "New rank:"),
|
|
21
|
+
" ",
|
|
22
|
+
getCurrentRank(),
|
|
23
|
+
" ",
|
|
24
|
+
React.createElement("strong", null, "Old rank:"),
|
|
25
|
+
" ",
|
|
26
|
+
props.originalRank));
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAgBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAgBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eA4U3C"}
|
|
@@ -35,12 +35,13 @@ export function SessionRestore(props) {
|
|
|
35
35
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
36
36
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
37
37
|
const { sessionRestore } = useContext(SessionRestoreStateContext);
|
|
38
|
-
const { selectedNotificationContacts, cepDetails, caseDetails, caseCreation500ErrorStatus } = useCaseSelector((state) => ({
|
|
38
|
+
const { selectedNotificationContacts, cepDetails, caseDetails, caseCreation500ErrorStatus, isFetchingRecommendationsFromWatsonX, } = useCaseSelector((state) => ({
|
|
39
39
|
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
40
40
|
cepDetails: state.cepDetails,
|
|
41
41
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
42
42
|
caseDetails: state.caseDetails,
|
|
43
43
|
caseCreation500ErrorStatus: state.caseCreation500ErrorStatus,
|
|
44
|
+
isFetchingRecommendationsFromWatsonX: state.isFetchingRecommendationsFromWatsonX, //use this here bool
|
|
44
45
|
}), isEqual);
|
|
45
46
|
const caseDispatch = useCaseDispatch();
|
|
46
47
|
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, referrerUrl }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -78,8 +79,9 @@ export function SessionRestore(props) {
|
|
|
78
79
|
const needsNewSessionId = hasProductVersionOrSummary && isEmpty(relevantSession);
|
|
79
80
|
if (needsNewSessionId) {
|
|
80
81
|
const userAgent = getUserAgentForCaseMode(isCaseCreate);
|
|
82
|
+
const userAgentAB = userAgent + (isFetchingRecommendationsFromWatsonX ? '-A-1' : '-B-1');
|
|
81
83
|
let session = {
|
|
82
|
-
userAgent,
|
|
84
|
+
userAgent: userAgentAB,
|
|
83
85
|
originatingSystem: userAgent,
|
|
84
86
|
referrerUrl: (caseDetails.referrer || referrerUrl).substring(0, SESSION_REFERRER_URL_LIMIT),
|
|
85
87
|
};
|
|
@@ -130,7 +132,12 @@ export function SessionRestore(props) {
|
|
|
130
132
|
: !isEmpty(existingUserAgent) && existingUserAgent !== userAgent
|
|
131
133
|
? existingUserAgent
|
|
132
134
|
: userAgent;
|
|
133
|
-
|
|
135
|
+
const userAgentAB = userAgent + (isFetchingRecommendationsFromWatsonX ? '-A-1' : '-B-1');
|
|
136
|
+
let session = {
|
|
137
|
+
userAgent: userAgentAB,
|
|
138
|
+
originatingSystem,
|
|
139
|
+
caseCreationError: caseCreation500ErrorStatus,
|
|
140
|
+
};
|
|
134
141
|
// PCM-12337 - Moved the session patch call to submit case function in CaseReducer.ts
|
|
135
142
|
const newSessionDetails = getSessionDetailsFromCase(caseDetails, selectedNotificationContacts);
|
|
136
143
|
if (isEqual(newSessionDetails, relevantSession.sessionDetails))
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
3
|
+
interface IProps {
|
|
4
|
+
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
5
|
+
}
|
|
6
|
+
export default function SubmitCase(props: IProps): JSX.Element;
|
|
7
|
+
export {};
|
|
2
8
|
//# sourceMappingURL=SubmitCase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAQ,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO7D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,eAyT/C"}
|
|
@@ -24,7 +24,7 @@ import FileUploader from '../shared/fileUpload/FileUploader';
|
|
|
24
24
|
import { isUploadingAttachment } from '../shared/fileUpload/reducer/AttachmentHelper';
|
|
25
25
|
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
26
26
|
import Suggestions from '../Suggestions/Suggestions';
|
|
27
|
-
export default function SubmitCase() {
|
|
27
|
+
export default function SubmitCase(props) {
|
|
28
28
|
var _a;
|
|
29
29
|
const { entitlementSla, severity, caseType, version, versionsDetails, addNotifiedUserError, isCreatingCase, caseCreationError, caseCreationErrorMessage, selectedAccountDetails, caseNoOfCreatedCase, product, screenSessionRequested, } = useCaseSelector((state) => ({
|
|
30
30
|
entitlementSla: state.caseDetails.entitlementSla,
|
|
@@ -145,6 +145,6 @@ export default function SubmitCase() {
|
|
|
145
145
|
React.createElement("div", { className: isIdea ? 'pf-v5-u-mt-lg' : '' },
|
|
146
146
|
React.createElement(InsightsResults, { isDisplayOnMain: true })),
|
|
147
147
|
React.createElement(ClusterRecommendations, { showClusterRecommendationsModal: false }))),
|
|
148
|
-
React.createElement("div", { className: "pf-v5-u-mt-lg" }, isIdea ? (React.createElement(AsideResults,
|
|
148
|
+
React.createElement("div", { className: "pf-v5-u-mt-lg" }, isIdea ? (React.createElement(AsideResults, { routeProps: props.routeProps })) : (!isEmpty(topContent.data) &&
|
|
149
149
|
isNotAnIdea && (React.createElement(Suggestions, { title: isIdea ? t('Search recommendations') : t('Product recommendations'), showTitleDescription: true, showMax: 6 })))))))));
|
|
150
150
|
}
|
|
@@ -60,7 +60,7 @@ export function useIsSectionValid(sectionName) {
|
|
|
60
60
|
!topContent.isFetching &&
|
|
61
61
|
!isEmpty(summary) &&
|
|
62
62
|
!recommendationState.isLoadingRecommendations &&
|
|
63
|
-
((_a = summary) === null || _a === void 0 ? void 0 : _a.length)
|
|
63
|
+
((_a = summary) === null || _a === void 0 ? void 0 : _a.length) <= SUMMARY_LENGTH_LIMIT);
|
|
64
64
|
};
|
|
65
65
|
const isCaseManagementSectionValid = () => {
|
|
66
66
|
const hasContactInfo24x7ValidLength = contactInfo24x7
|
|
@@ -32,7 +32,7 @@ function WizardAside(props) {
|
|
|
32
32
|
canshowEARuleWidget && React.createElement(EARuleWidget, null),
|
|
33
33
|
React.createElement(InsightsResults, null),
|
|
34
34
|
" ",
|
|
35
|
-
!(isIdea && activeSection === 'submit-case') && React.createElement(AsideResults,
|
|
35
|
+
!(isIdea && activeSection === 'submit-case') && React.createElement(AsideResults, { routeProps: props.routeProps }),
|
|
36
36
|
canShowFileRecommendationSectionsWidget && React.createElement(InsightsResults, { isDisplayOnMain: true }),
|
|
37
37
|
React.createElement(ClusterRecommendations, { showClusterRecommendationsList: canShowClusterIdReportWidget }),
|
|
38
38
|
canUseSessionManagement && !isCreatingCase && activeSection !== AppRouteSections.SUBMIT_CASE && (React.createElement(SessionRestore, { routeProps: props.routeProps })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,eA0LzC"}
|
|
@@ -11,15 +11,16 @@ import { Grid, GridItem } from '@patternfly/react-core';
|
|
|
11
11
|
import { SupportFeedbackForm } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
13
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { getVersionIfOnlyVersion, pendoTrackEvent, PreviousCaseTypes } from '@rh-support/utils';
|
|
14
|
+
import { getConfigField, getVersionIfOnlyVersion, PCM_CONFIG_FIELD_TYPE, pendoTrackEvent, PreviousCaseTypes, trafficSplit, } from '@rh-support/utils';
|
|
15
15
|
import findIndex from 'lodash/findIndex';
|
|
16
|
+
import isEmpty from 'lodash/isEmpty';
|
|
16
17
|
import isEqual from 'lodash/isEqual';
|
|
17
|
-
import React, { useContext, useRef, useState } from 'react';
|
|
18
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
18
19
|
import { Trans } from 'react-i18next';
|
|
19
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
20
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
21
22
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
22
|
-
import { submitCase } from '../../reducers/CaseReducer';
|
|
23
|
+
import { setFetchingRecommendationsFromWatsonXFlag, submitCase } from '../../reducers/CaseReducer';
|
|
23
24
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
24
25
|
import RouteUtils from '../../utils/routeUtils';
|
|
25
26
|
import PreCaseConfirmationModals, { PreCaseConfirmationModalsEnum, } from '../ConfirmationModals/PreCaseConfirmationModals';
|
|
@@ -36,12 +37,42 @@ export function WizardLayout(props) {
|
|
|
36
37
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
37
38
|
const caseDispatch = useCaseDispatch();
|
|
38
39
|
const { sessionRestore: { activeSessionId, previousSessions }, } = useContext(SessionRestoreStateContext);
|
|
39
|
-
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
40
|
+
const { globalMetadataState: { allProducts, loggedInUser, loggedInUserRights, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
40
41
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
41
42
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
42
43
|
const isAnyFileAttachedLocal = isAnyFileAttached(attachmentState.caseFiles.selectedLocalFiles);
|
|
43
44
|
const [confirmationModalType, setConfirmationModalType] = useState(null);
|
|
44
45
|
const viewedConfirmationModalsList = useRef([]);
|
|
46
|
+
const isWatsonXEnabled = getConfigField(pcmConfig.data, 'isWatsonxEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
47
|
+
const testVariationWeight = getConfigField(pcmConfig.data, 'testVariationWeightZeroToTen', PCM_CONFIG_FIELD_TYPE.NUMBER);
|
|
48
|
+
const urlQueryParams = RouteUtils.getQueryParams(props.routeProps);
|
|
49
|
+
const rerankingFromUrl = urlQueryParams.reranking;
|
|
50
|
+
const isShowRerankingForInternalUsers = (rerankingFromUrl === 'true' || rerankingFromUrl === 'false') && loggedInUserRights.data.isInternal();
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (isEmpty(activeSessionId) || !isWatsonXEnabled || !testVariationWeight)
|
|
53
|
+
return;
|
|
54
|
+
if (isShowRerankingForInternalUsers && rerankingFromUrl === 'true') {
|
|
55
|
+
setFetchingRecommendationsFromWatsonXFlag(caseDispatch, true);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (isShowRerankingForInternalUsers && rerankingFromUrl === 'false') {
|
|
59
|
+
setFetchingRecommendationsFromWatsonXFlag(caseDispatch, false);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const sessionItem = previousSessions.data[activeSessionId];
|
|
63
|
+
if (sessionItem && trafficSplit(testVariationWeight, sessionItem.session.createdDate) === 'A') {
|
|
64
|
+
setFetchingRecommendationsFromWatsonXFlag(caseDispatch, true);
|
|
65
|
+
}
|
|
66
|
+
}, [
|
|
67
|
+
caseDispatch,
|
|
68
|
+
isWatsonXEnabled,
|
|
69
|
+
activeSessionId,
|
|
70
|
+
previousSessions,
|
|
71
|
+
testVariationWeight,
|
|
72
|
+
isShowRerankingForInternalUsers,
|
|
73
|
+
rerankingFromUrl,
|
|
74
|
+
props.routeProps,
|
|
75
|
+
]);
|
|
45
76
|
const closeROCMProductModal = () => {
|
|
46
77
|
const productName = 'OpenShift Container Platform';
|
|
47
78
|
// if user click on Cancel then change product selection.
|
|
@@ -23,7 +23,7 @@ function WizardMain(props) {
|
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const renderSubmitCasePage = () => (React.createElement(MainSection, { section: AppRouteSections.SUBMIT_CASE, title: t('Case has been submitted'), isLoading: isCreatingCase, description: t("We'll be in contact with you shortly. Look for updates on this case."), className: "case-submit-page" },
|
|
25
25
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
26
|
-
React.createElement(SubmitCase,
|
|
26
|
+
React.createElement(SubmitCase, { routeProps: props.routeProps }))));
|
|
27
27
|
const onNext = (step) => {
|
|
28
28
|
RouteUtils.navigateToSection(props.routeProps, `${props.routeProps.location.pathname}/${step.id}`, false);
|
|
29
29
|
};
|
|
@@ -27,6 +27,8 @@ export declare const SESSION_REFERRER_URL_LIMIT = 1024;
|
|
|
27
27
|
export declare const SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT = 255;
|
|
28
28
|
export declare const SESSION_NO_CLUSTER_REASON_EXPLANATION_LENGTH_LIMIT = 255;
|
|
29
29
|
export declare const SESSION_PHONE_LENGTH_LIMIT = 23;
|
|
30
|
+
export declare const WATSONX_SUMMARY_LIMIT = 255;
|
|
31
|
+
export declare const WATSONX_DESCRIPTION_LIMIT = 4000;
|
|
30
32
|
export declare const CASE_DEATILS_ISSUE_LIMIT = 20000;
|
|
31
33
|
export declare const CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT = 4000;
|
|
32
34
|
export declare const CASE_DEATILS_ENVIRONMENT_LIMIT = 3000;
|
|
@@ -157,7 +159,8 @@ export declare enum CaseReducerConstants {
|
|
|
157
159
|
caseCreation500ErrorStatus = "caseCreation500ErrorStatus",
|
|
158
160
|
resetCaseNoOfCreatedCase = "resetCaseNoOfCreatedCase",
|
|
159
161
|
setIsPostingRemoteRequestCommentCompleted = "setIsPostingRemoteRequestCommentCompleted",
|
|
160
|
-
setIsPostingRemoteRequestCommentCompletedError = "setIsPostingRemoteRequestCommentCompletedError"
|
|
162
|
+
setIsPostingRemoteRequestCommentCompletedError = "setIsPostingRemoteRequestCommentCompletedError",
|
|
163
|
+
setFetchingRecommendationsFromWatsonXFlag = "setFetchingRecommendationsFromWatsonXFlag"
|
|
161
164
|
}
|
|
162
165
|
export declare const initialCaseState: ICaseState;
|
|
163
166
|
export interface ICaseState {
|
|
@@ -206,6 +209,7 @@ export interface ICaseState {
|
|
|
206
209
|
caseNoOfCreatedCase?: string;
|
|
207
210
|
isPostingRemoteRequestCommentCompleted?: boolean;
|
|
208
211
|
isPostingRemoteRequestCommentCompletedErrorMessage?: string | undefined;
|
|
212
|
+
isFetchingRecommendationsFromWatsonX: boolean;
|
|
209
213
|
}
|
|
210
214
|
export interface ICreateCasePayloadType extends ICaseState {
|
|
211
215
|
}
|
|
@@ -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,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACjH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MA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AACpF,oBAAY,uBAAuB,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAEhE,eAAO,MAAM,qCAAqC,+CAA+C,CAAC;AAClG,eAAO,MAAM,yCAAyC,+CAA+C,CAAC"}
|
|
@@ -19,6 +19,8 @@ export const SESSION_REFERRER_URL_LIMIT = 1024;
|
|
|
19
19
|
export const SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT = 255;
|
|
20
20
|
export const SESSION_NO_CLUSTER_REASON_EXPLANATION_LENGTH_LIMIT = 255;
|
|
21
21
|
export const SESSION_PHONE_LENGTH_LIMIT = 23;
|
|
22
|
+
export const WATSONX_SUMMARY_LIMIT = 255; // In the UI, we allow only 255 characters for the summary
|
|
23
|
+
export const WATSONX_DESCRIPTION_LIMIT = 4000;
|
|
22
24
|
//Case detail limits for each individual KT Question in order as they appear on troubleshoot/opencase
|
|
23
25
|
//We are totaling 31k here to allow for the backend to accept response when combined with question copy.
|
|
24
26
|
export const CASE_DEATILS_ISSUE_LIMIT = 20000; // 1st Q
|
|
@@ -108,6 +110,7 @@ export var CaseReducerConstants;
|
|
|
108
110
|
CaseReducerConstants["resetCaseNoOfCreatedCase"] = "resetCaseNoOfCreatedCase";
|
|
109
111
|
CaseReducerConstants["setIsPostingRemoteRequestCommentCompleted"] = "setIsPostingRemoteRequestCommentCompleted";
|
|
110
112
|
CaseReducerConstants["setIsPostingRemoteRequestCommentCompletedError"] = "setIsPostingRemoteRequestCommentCompletedError";
|
|
113
|
+
CaseReducerConstants["setFetchingRecommendationsFromWatsonXFlag"] = "setFetchingRecommendationsFromWatsonXFlag";
|
|
111
114
|
})(CaseReducerConstants || (CaseReducerConstants = {}));
|
|
112
115
|
export const initialCaseState = {
|
|
113
116
|
isCreatingCase: false,
|
|
@@ -200,6 +203,7 @@ export const initialCaseState = {
|
|
|
200
203
|
caseNoOfCreatedCase: '',
|
|
201
204
|
isPostingRemoteRequestCommentCompleted: false,
|
|
202
205
|
isPostingRemoteRequestCommentCompletedErrorMessage: '',
|
|
206
|
+
isFetchingRecommendationsFromWatsonX: false,
|
|
203
207
|
};
|
|
204
208
|
export const ORG_ADMIN_SEND_NOTIFCATION_KBASE_LINK = 'https://access.redhat.com/articles/5967811';
|
|
205
209
|
export const NON_ORG_ADMIN_SEND_NOTIFCATION_KBASE_LINK = 'https://access.redhat.com/articles/5967831';
|
|
@@ -12,6 +12,7 @@ export declare const caseReducer: (pState: ICaseState, action: any) => ICaseStat
|
|
|
12
12
|
export declare const setCaseDetails: (dispatch: CaseReducerDispatchType, caseState: Partial<ICasePayload>) => void;
|
|
13
13
|
export declare const setCaseState: (dispatch: CaseReducerDispatchType, caseState: Partial<ICaseState>) => void;
|
|
14
14
|
export declare const setNotifiedUser: (dispatch: CaseReducerDispatchType, selectedNotificationContacts: IContact[]) => void;
|
|
15
|
+
export declare const setFetchingRecommendationsFromWatsonXFlag: (dispatch: CaseReducerDispatchType, isFetchingRecommendationsFromWatsonX: boolean) => void;
|
|
15
16
|
export declare const submitCase: (dispatch: CaseReducerDispatchType, sessionRestoreDispatch: SessionReducerDispatchType, caseDetails: ICaseState, sessionItem: ISessionItem, isCaseCreate: boolean, errorMessage500: string | JSX.Element, loggedInUserSsoUsername: string, isSecureSupport: boolean, isResubmit: boolean) => Promise<void>;
|
|
16
17
|
/**
|
|
17
18
|
* Update case details if there is HTTP 500 error while submitting case
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseReducer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAEtH,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAA+B,MAAM,qCAAqC,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAA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AAE,MAAM,EACb,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC,EAC5E,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,0BAA0B,EAAE,QAO5D;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,iBAiB1F;AAED,eAAO,MAAM,kBAAkB,aAAc,uBAAuB,QAAQ,OAAO,SAKlF,CAAC"}
|
|
@@ -61,6 +61,9 @@ export const caseReducer = (pState, action) => {
|
|
|
61
61
|
case CaseReducerConstants.resetCaseNoOfCreatedCase: {
|
|
62
62
|
return Object.assign(Object.assign({}, pState), { caseNoOfCreatedCase: action.payload.caseNoOfCreatedCase });
|
|
63
63
|
}
|
|
64
|
+
case CaseReducerConstants.setFetchingRecommendationsFromWatsonXFlag: {
|
|
65
|
+
return Object.assign(Object.assign({}, pState), { isFetchingRecommendationsFromWatsonX: action.payload.isFetchingRecommendationsFromWatsonX });
|
|
66
|
+
}
|
|
64
67
|
case CaseReducerConstants.setCaseCreationError: {
|
|
65
68
|
return Object.assign(Object.assign({}, pState), { isCreatingCase: false, caseCreationError: true, caseCreationErrorMessage: action.payload.caseCreationErrorMessage });
|
|
66
69
|
}
|
|
@@ -159,6 +162,12 @@ export const setNotifiedUser = (dispatch, selectedNotificationContacts) => {
|
|
|
159
162
|
payload: { selectedNotificationContacts },
|
|
160
163
|
});
|
|
161
164
|
};
|
|
165
|
+
export const setFetchingRecommendationsFromWatsonXFlag = (dispatch, isFetchingRecommendationsFromWatsonX) => {
|
|
166
|
+
dispatch({
|
|
167
|
+
type: CaseReducerConstants.setFetchingRecommendationsFromWatsonXFlag,
|
|
168
|
+
payload: { isFetchingRecommendationsFromWatsonX: isFetchingRecommendationsFromWatsonX },
|
|
169
|
+
});
|
|
170
|
+
};
|
|
162
171
|
export const submitCase = (dispatch, sessionRestoreDispatch, caseDetails, sessionItem, isCaseCreate, errorMessage500, loggedInUserSsoUsername, isSecureSupport = false, isResubmit) => __awaiter(void 0, void 0, void 0, function* () {
|
|
163
172
|
var _a;
|
|
164
173
|
dispatch({ type: CaseReducerConstants.isCreatingCase });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRecommendationsPayload } from '@cee-eng/hydrajs/@types/api/search';
|
|
1
|
+
import { IRecommendationsPayload, ISearchWatsonXQuery } from '@cee-eng/hydrajs/@types/api/search';
|
|
2
2
|
import { Highlighting, ISolrRecommendation } from '@cee-eng/hydrajs/@types/models/solr/solr';
|
|
3
3
|
import { IAction } from '@rh-support/types/shared';
|
|
4
4
|
import { IRecommendationAdditionalFilters } from '@rh-support/utils';
|
|
@@ -32,6 +32,7 @@ export declare enum RecommendationsConstants {
|
|
|
32
32
|
}
|
|
33
33
|
export declare const recommandationsReducer: (state: IRecommendationsState, action: IActionType) => IRecommendationsState;
|
|
34
34
|
export declare const fetchRecommendations: (dispatch: RecommendationsReducerDispatchType, body: IRecommendationsPayload, max_rows: number, page_size: number, highlighted_fragment_size: number, seQueryFields: boolean, caseNumber: string, isSecureSupportAccount: boolean, additionalFilters?: IRecommendationAdditionalFilters, abortSignal?: AbortSignal) => Promise<void>;
|
|
35
|
+
export declare const fetchWatsonXRecommendations: (dispatch: RecommendationsReducerDispatchType, query: ISearchWatsonXQuery, max_rows: number, page_size: number, highlighted_fragment_size: number, seQueryFields: boolean, caseNumber: string, isSecureSupportAccount: boolean, additionalFilters?: IRecommendationAdditionalFilters, abortSignal?: AbortSignal, isRerankEnabled?: boolean) => Promise<void>;
|
|
35
36
|
export declare const setVisibleDocs: (dispatch: RecommendationsReducerDispatchType, visDocs: ISolrRecommendation[]) => void;
|
|
36
37
|
export declare const setCurrentPage: (dispatch: RecommendationsReducerDispatchType, pageNum: number) => void;
|
|
37
38
|
export declare const setInsighResultsKcsIds: (dispatch: RecommendationsReducerDispatchType, insightsKcsIds: string[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecommendationsReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RecommendationsReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"RecommendationsReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RecommendationsReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAiB,MAAM,0CAA0C,CAAC;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAGH,gCAAgC,EAEnC,MAAM,mBAAmB,CAAC;AAG3B,aAAK,WAAW,GAAG,OAAO,CAAC,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,oBAAY,kCAAkC,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAE9E,MAAM,WAAW,qBAAqB;IAClC,wBAAwB,EAAE,OAAO,CAAC;IAClC,6BAA6B,EAAE,OAAO,CAAC;IACvC,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,uBAAuB,EAAE,uBAAuB,CAAC;CACpD;AAED,eAAO,MAAM,2BAA2B,EAAE,qBAYzC,CAAC;AAEF,oBAAY,wBAAwB;IAChC,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,4BAA4B,iCAAiC;IAC7D,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,4BAA4B,iCAAiC;IAC7D,4BAA4B,iCAAiC;IAC7D,sBAAsB,2BAA2B;IACjD,2BAA2B,gCAAgC;IAC3D,oBAAoB,yBAAyB;CAChD;AAGD,eAAO,MAAM,sBAAsB,UAAW,qBAAqB,0BAAwB,qBAmD1F,CAAC;AAGF,eAAO,MAAM,oBAAoB,aACnB,kCAAkC,QACtC,uBAAuB,YACnB,MAAM,aACL,MAAM,6BACU,MAAM,sCAErB,MAAM,0BACM,OAAO,sBACX,gCAAgC,gBACtC,WAAW,kBAsC5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAC1B,kCAAkC,SACrC,mBAAmB,YAChB,MAAM,aACL,MAAM,6BACU,MAAM,sCAErB,MAAM,0BACM,OAAO,sBACX,gCAAgC,gBACtC,WAAW,oBACP,OAAO,kBAsC5B,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,kCAAkC,WAAW,mBAAmB,EAAE,SAE1G,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,kCAAkC,WAAW,MAAM,SAE3F,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,kCAAkC,kBAAkB,MAAM,EAAE,SAE5G,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,kCAAkC,SAEhF,CAAC"}
|
|
@@ -8,7 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { search } from '@cee-eng/hydrajs';
|
|
11
|
-
import { getSolrParams, replaceHighlightingData } from '@rh-support/utils';
|
|
11
|
+
import { getSolrParams, getTrimmedSpecialCharacters, replaceHighlightingData, } from '@rh-support/utils';
|
|
12
|
+
import { WATSONX_DESCRIPTION_LIMIT, WATSONX_SUMMARY_LIMIT } from './CaseConstNTypes';
|
|
12
13
|
export const initialRecommendationsState = {
|
|
13
14
|
isLoadingRecommendations: false,
|
|
14
15
|
isLoadingRecommendationsError: false,
|
|
@@ -85,7 +86,8 @@ export const fetchRecommendations = (dispatch, body, max_rows, page_size, highli
|
|
|
85
86
|
body.description = body.description && body.description.replace(/\?\?/g, '');
|
|
86
87
|
}
|
|
87
88
|
const searchParams = getSolrParams(max_rows, highlighted_fragment_size, additionalFilters, seQueryFields);
|
|
88
|
-
const response = yield search.getRecommendationsForCase(body, Object.assign(Object.assign({}, searchParams), { caseNumber,
|
|
89
|
+
const response = yield search.getRecommendationsForCase(body, Object.assign(Object.assign({}, searchParams), { caseNumber,
|
|
90
|
+
isSecureSupportAccount }), // Need to pass caseNumber and isSecureSupportAccount flag with SOLR parameter which will be used in service worker strategy.
|
|
89
91
|
abortSignal);
|
|
90
92
|
const docs = replaceHighlightingData(response.response.docs, response.highlighting);
|
|
91
93
|
dispatch({
|
|
@@ -101,6 +103,32 @@ export const fetchRecommendations = (dispatch, body, max_rows, page_size, highli
|
|
|
101
103
|
dispatch({ type: RecommendationsConstants.receivedRecommendationsError });
|
|
102
104
|
}
|
|
103
105
|
});
|
|
106
|
+
export const fetchWatsonXRecommendations = (dispatch, query, max_rows, page_size, highlighted_fragment_size, seQueryFields = false, caseNumber, isSecureSupportAccount, additionalFilters, abortSignal, isRerankEnabled) => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
|
+
dispatch({
|
|
108
|
+
type: RecommendationsConstants.requestRecommendations,
|
|
109
|
+
payload: { prevRecommendationsBody: Object.assign({}, query) },
|
|
110
|
+
});
|
|
111
|
+
try {
|
|
112
|
+
const watsonXQuery = Object.assign(Object.assign(Object.assign({ product: query === null || query === void 0 ? void 0 : query.product, version: query === null || query === void 0 ? void 0 : query.version }, ((query === null || query === void 0 ? void 0 : query.summary) && {
|
|
113
|
+
summary: getTrimmedSpecialCharacters(query.summary, WATSONX_SUMMARY_LIMIT),
|
|
114
|
+
})), ((query === null || query === void 0 ? void 0 : query.description) && {
|
|
115
|
+
description: getTrimmedSpecialCharacters(query.description, WATSONX_DESCRIPTION_LIMIT),
|
|
116
|
+
})), { rerank: isRerankEnabled });
|
|
117
|
+
const response = yield search.getWatsonXRecommendationsForCase(Object.assign(Object.assign({}, watsonXQuery), getSolrParams(max_rows, highlighted_fragment_size, additionalFilters, seQueryFields)), abortSignal);
|
|
118
|
+
const docs = replaceHighlightingData(response.response.docs, response.highlighting);
|
|
119
|
+
dispatch({
|
|
120
|
+
type: RecommendationsConstants.receivedRecommendations,
|
|
121
|
+
payload: {
|
|
122
|
+
allDocs: docs,
|
|
123
|
+
visibleDocs: docs.slice(0, page_size),
|
|
124
|
+
numFound: response.response.numFound,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
dispatch({ type: RecommendationsConstants.receivedRecommendationsError });
|
|
130
|
+
}
|
|
131
|
+
});
|
|
104
132
|
export const setVisibleDocs = (dispatch, visDocs) => {
|
|
105
133
|
dispatch({ type: RecommendationsConstants.setVisibleDocs, payload: { visibleDocs: visDocs } });
|
|
106
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteConstNTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"RouteConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteConstNTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACj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AAEF,eAAO,MAAM,kCAAkC,oBAO9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,oBAM3C,CAAC;AAEF,eAAO,MAAM,sCAAsC,oBAAyD,CAAC;AAE7G,eAAO,MAAM,qCAAqC,oBAAgE,CAAC;AAEnH,eAAO,MAAM,6BAA6B,oBAAiC,CAAC;AAE5E,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAKtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.52",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.16.
|
|
29
|
+
"@cee-eng/hydrajs": "4.16.43",
|
|
30
30
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
31
31
|
"@patternfly/patternfly": "5.1.0",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react-virtualized": "^9.21.2"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@cee-eng/hydrajs": "4.16.
|
|
58
|
+
"@cee-eng/hydrajs": "4.16.43",
|
|
59
59
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
60
60
|
"@patternfly/patternfly": "5.1.0",
|
|
61
61
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@patternfly/react-table": "^5.1.1",
|
|
67
67
|
"@progress/kendo-drawing": "^1.6.0",
|
|
68
68
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
69
|
-
"@rh-support/components": "2.1.
|
|
70
|
-
"@rh-support/react-context": "2.1.
|
|
69
|
+
"@rh-support/components": "2.1.30",
|
|
70
|
+
"@rh-support/react-context": "2.1.33",
|
|
71
71
|
"@rh-support/types": "2.0.2",
|
|
72
|
-
"@rh-support/user-permissions": "2.1.
|
|
73
|
-
"@rh-support/utils": "2.1.
|
|
72
|
+
"@rh-support/user-permissions": "2.1.21",
|
|
73
|
+
"@rh-support/utils": "2.1.14",
|
|
74
74
|
"@types/react-redux": "^7.1.12",
|
|
75
75
|
"@types/redux": "^3.6.0",
|
|
76
76
|
"dompurify": "^2.4.1",
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"defaults and supports es6-module",
|
|
133
133
|
"maintained node versions"
|
|
134
134
|
],
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "c5a573ae8bd924caf9689a0179fde2181038b4e9"
|
|
136
136
|
}
|