@rh-support/troubleshoot 2.4.5-beta.1 → 2.4.5-beta.11
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.js +2 -2
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +4 -18
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +1 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +4 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +2 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +21 -95
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +137 -269
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +20 -16
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +5 -6
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +2 -3
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -11
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +5 -11
- package/lib/esm/components/Cve/CveItem.d.ts +8 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveItem.js +96 -0
- package/lib/esm/components/Cve/CveModal.d.ts +3 -0
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveModal.js +41 -0
- package/lib/esm/components/Cve/CvePanel.d.ts +7 -0
- package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -0
- package/lib/esm/components/Cve/CvePanel.js +23 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts +3 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveSidebar.js +23 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts +3 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +8 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +3 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +33 -21
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +2 -2
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts +4 -2
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +8 -7
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +3 -5
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +2 -0
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +2 -2
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +5 -6
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +55 -27
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts +3 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.js +11 -0
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +3 -3
- package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/TopContent.js +4 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts +2 -2
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +1 -10
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +14 -7
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +11 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +1 -4
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +0 -5
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +3 -7
- package/lib/esm/css/results.css +6 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts +5 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -0
- package/lib/esm/hooks/useFetchCVEData.js +136 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +10 -2
- package/lib/esm/models/caseCreationWorkflows.d.ts +25 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -0
- package/lib/esm/models/caseCreationWorkflows.js +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +4 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +3 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts +0 -1
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +0 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +1 -1
- package/lib/esm/scss/_main.scss +20 -2
- package/lib/esm/scss/_pf-overrides.scss +0 -6
- package/lib/esm/utils/caseUtils.d.ts +18 -0
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +42 -0
- package/package.json +11 -11
|
@@ -22,9 +22,10 @@ import { ProductSelectorLoader } from './ProductSelectorLoader';
|
|
|
22
22
|
export default function ProductSelector(props) {
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
25
|
-
const { product, version } = useCaseSelector((state) => ({
|
|
25
|
+
const { product, version, enableGetSupportProductVersion } = useCaseSelector((state) => ({
|
|
26
26
|
product: state.caseDetails.product,
|
|
27
27
|
version: state.caseDetails.version,
|
|
28
|
+
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
28
29
|
}), isEqual);
|
|
29
30
|
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
30
31
|
/**
|
|
@@ -34,11 +35,11 @@ export default function ProductSelector(props) {
|
|
|
34
35
|
*/
|
|
35
36
|
const productSelectorRef = useRef(null);
|
|
36
37
|
return (React.createElement(React.Fragment, null,
|
|
37
|
-
allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
|
|
38
|
+
!enableGetSupportProductVersion && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
|
|
38
39
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
39
|
-
|
|
40
|
+
allProducts.isFetching ? (React.createElement(ProductSelectorLoader, null)) : (!allProducts.isError && (React.createElement(React.Fragment, null,
|
|
40
41
|
React.createElement("form", null,
|
|
41
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true }),
|
|
42
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage, caseCreateExperience: props.caseCreateExperience }),
|
|
42
43
|
product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
|
|
43
44
|
' ',
|
|
44
45
|
"If you're having a subscription issue that doesn't relate to",
|
|
@@ -49,8 +50,8 @@ export default function ProductSelector(props) {
|
|
|
49
50
|
React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
|
|
50
51
|
' ',
|
|
51
52
|
"for help.") })),
|
|
52
|
-
React.createElement(EARuleWidget, null)),
|
|
53
|
-
React.createElement("div", { className: "suggestions-result-section" },
|
|
53
|
+
!enableGetSupportProductVersion && React.createElement(EARuleWidget, null)),
|
|
54
|
+
!(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
|
|
54
55
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
|
|
55
|
-
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))));
|
|
56
|
+
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))))));
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAOtD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAOtD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,wEAwClC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -16,7 +16,7 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
|
16
16
|
React.createElement(Trans, null, "Product"),
|
|
17
17
|
' ',
|
|
18
18
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
19
|
-
React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage })),
|
|
19
|
+
React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage, isLoading: props.isLoading })),
|
|
20
20
|
React.createElement("div", { className: "version-selector-wrapper" },
|
|
21
21
|
React.createElement("label", { htmlFor: "version-selector-dropdown-toggle" },
|
|
22
22
|
React.createElement(Trans, null, "Version"),
|
|
@@ -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":"AAeA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AASvD,OAAO,EAAE,eAAe,EAAsC,MAAM,iCAAiC,CAAC;AAUtG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBAyLzC"}
|
|
@@ -9,7 +9,7 @@ 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 { computeRecommendationAbstract, computeRecommendationTitle, convertObjToEncodedQueryParams,
|
|
12
|
+
import { computeRecommendationAbstract, computeRecommendationTitle, convertObjToEncodedQueryParams, getSolrParams, getTrimmedCharacters, PreviousCaseTypes, replaceHighlightingData, } from '@rh-support/utils';
|
|
13
13
|
import isEmpty from 'lodash/isEmpty';
|
|
14
14
|
import isEqual from 'lodash/isEqual';
|
|
15
15
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
@@ -117,21 +117,19 @@ export function AsideResults(props) {
|
|
|
117
117
|
const onResourceClick = (doc, index) => (event) => {
|
|
118
118
|
if (isSelectedAccounntSecureSupport)
|
|
119
119
|
return;
|
|
120
|
-
const rank = index + 1 + PAGE_SIZE * ((recommendationState.currentPage || 1) - 1);
|
|
121
120
|
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, [getSessResFromRec(doc, SessionResourceVisibility.VISITED, index + 1)], payload);
|
|
122
|
-
dtmTrackEventRecommendationListingItemClicked(window.location.href, activeSection, 'middle', doc.id, rank, doc.allTitle, doc.view_uri, 'Recommendation Aside', 'Live troubleshooting powered by OpenShift AI');
|
|
123
121
|
};
|
|
124
122
|
useEffect(() => {
|
|
125
123
|
if (isSelectedAccounntSecureSupport)
|
|
126
124
|
return;
|
|
127
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), JSON.stringify(payload));
|
|
125
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), typeof payload === 'string' ? payload : JSON.stringify(payload));
|
|
128
126
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
129
127
|
}, [recommendationState.sideRecommendation, activeSessionId, activeSection]);
|
|
130
128
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
131
129
|
if (!canShowSideRecommendations())
|
|
132
130
|
return React.createElement(React.Fragment, null);
|
|
133
131
|
return (React.createElement("div", { className: `card card-white card-support top-recommendations ${props.className ? props.className : ''}` },
|
|
134
|
-
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" }, isIdea ?
|
|
132
|
+
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" }, isIdea ? React.createElement(Trans, null, "Search recommendations") : React.createElement(Trans, null, "Articles recommended by OpenShift AI")),
|
|
135
133
|
React.createElement("div", { className: "card-body" },
|
|
136
134
|
React.createElement("ul", { className: "list-flat" }, recommendationState.sideRecommendation.map((doc, index) => {
|
|
137
135
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EARule.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARule.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EARule.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARule.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,UAAU,cAAc;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAGD,eAAO,MAAM,aAAa,+BAGxB,CAAC;AAEH,wBAAgB,gBAAgB,mBAM/B;AACD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;;;;CAAA,qBAqClD;AAED,iBAAS,WAAW,sBAGnB;AAED,iBAAS,iBAAiB,sBA0BzB;AAED,iBAAS,aAAa,CAAC,EAAE,SAA6B,EAAE,SAAc,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,qBA2BnH;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { pcm } from '@cee-eng/hydrajs';
|
|
3
|
+
import { dtmTrackEventCaseStartStopped } from '@rh-support/utils';
|
|
3
4
|
import DOMPurify from 'dompurify';
|
|
4
5
|
import isEqual from 'lodash/isEqual';
|
|
5
6
|
import React, { useContext } from 'react';
|
|
@@ -30,6 +31,7 @@ export function EARule({ children, rule, ruleRank }) {
|
|
|
30
31
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
31
32
|
const onCtaClick = (link, title) => () => {
|
|
32
33
|
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [getSessResFromEA(link, SessionResourceVisibility.VISITED, ruleRank, rule.rule_id)], JSON.stringify({ product, version, summary }));
|
|
34
|
+
dtmTrackEventCaseStartStopped(`insight rule button click: ${title}`, undefined, `${product}|${version}`);
|
|
33
35
|
};
|
|
34
36
|
return (React.createElement(EARuleContext.Provider, { value: {
|
|
35
37
|
rule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EARuleInfoInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoInline.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EARuleInfoInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoInline.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,OAAO,EAAE,aAAa,EAAkD,MAAM,gCAAgC,CAAC;AAO/G,UAAU,MAAM;IACZ,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAY,EAAE,EAAE,MAAM,qBAiKxD"}
|
|
@@ -14,7 +14,7 @@ import CloseIcon from '@patternfly/react-icons/dist/js/icons/close-icon';
|
|
|
14
14
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
15
15
|
import { PaginationCompact, useFetch } from '@rh-support/components';
|
|
16
16
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
17
|
-
import { getResTypeFromUrl, getStyleVariantColor, StyleVariants } from '@rh-support/utils';
|
|
17
|
+
import { dtmTrackEventCaseStartStopped, getResTypeFromUrl, getStyleVariantColor, StyleVariants, } from '@rh-support/utils';
|
|
18
18
|
import isEqual from 'lodash/isEqual';
|
|
19
19
|
import some from 'lodash/some';
|
|
20
20
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -102,7 +102,7 @@ export function EARuleInfoInline({ eaRules = [] }) {
|
|
|
102
102
|
React.createElement(EARuleTitle, null))),
|
|
103
103
|
React.createElement("div", { className: "pf-v5-c-alert__action" },
|
|
104
104
|
React.createElement(Button, { style: { fontSize: 15 }, variant: ButtonVariant.link, "data-tracking-id": "se-recommended-asa-ignore", type: "button", onClick: onIgnoreBtnClick }, validEARulesLength > 1 ? React.createElement(Trans, null, "Skip") : React.createElement(CloseIcon, null))),
|
|
105
|
-
React.createElement("div", { className: "pf-v5-c-alert__description" },
|
|
105
|
+
React.createElement("div", { className: "pf-v5-c-alert__description", onClick: () => dtmTrackEventCaseStartStopped('insight rule description click', undefined, `${product}|${version}`) },
|
|
106
106
|
React.createElement(EARuleDescription, null)),
|
|
107
107
|
React.createElement("div", { className: "pf-v5-c-alert__action-group pf-v5-u-display-flex" },
|
|
108
108
|
React.createElement(EARuleArticle, { className: "pf-v5-u-align-self-center pf-v5-u-mr-sm", linkTitle: "View details" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EARuleWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"EARuleWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,wBAAgB,YAAY,sBAmD3B"}
|
|
@@ -14,11 +14,10 @@ export function EARuleWidget() {
|
|
|
14
14
|
const { rulesState: { isEARuleWidgetVisible, EARules }, } = useContext(RulesStateContext);
|
|
15
15
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
16
16
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
17
|
-
const { product, version, summary
|
|
17
|
+
const { product, version, summary } = useCaseSelector((state) => ({
|
|
18
18
|
product: state.caseDetails.product,
|
|
19
19
|
version: state.caseDetails.version,
|
|
20
20
|
summary: state.caseDetails.summary,
|
|
21
|
-
issue: state.caseDetails.issue,
|
|
22
21
|
}), isEqual);
|
|
23
22
|
const validEARules = filter(EARules.rules, (r) => r.visible && r.rule_sub_type !== 'attachment');
|
|
24
23
|
useEffect(() => {
|
|
@@ -28,10 +27,10 @@ export function EARuleWidget() {
|
|
|
28
27
|
if (visibleValidEARules &&
|
|
29
28
|
differenceBy([visibleValidEARules === null || visibleValidEARules === void 0 ? void 0 : visibleValidEARules.rule_id], presentedIds).length > 0 &&
|
|
30
29
|
!isEmpty(activeSessionId)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [
|
|
31
|
+
getSessResFromRules(visibleValidEARules.cta, SessionResourceVisibility.PRESENTED, 1, visibleValidEARules.rule_id),
|
|
32
|
+
], JSON.stringify({ product, version, summary }) // To trigger EA rules, we don't pass KT questions
|
|
33
|
+
);
|
|
35
34
|
}
|
|
36
35
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
36
|
}, [validEARules, activeSessionId]);
|
|
@@ -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":"AAoBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAelE,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBA0WpD"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
|
-
import { Label, Pagination, PaginationVariant } from '@patternfly/react-core';
|
|
2
|
+
import { Label, Pagination, PaginationVariant, Popover, Spinner } from '@patternfly/react-core';
|
|
3
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
4
|
+
import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
|
|
3
5
|
import { LoadingDots, useDebounce, usePrevious } from '@rh-support/components';
|
|
4
6
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
5
|
-
import { computeRecommendationAbstract, computeRecommendationTitle,
|
|
7
|
+
import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, } from '@rh-support/utils';
|
|
6
8
|
import differenceBy from 'lodash/differenceBy';
|
|
7
9
|
import isEmpty from 'lodash/isEmpty';
|
|
8
10
|
import isEqual from 'lodash/isEqual';
|
|
@@ -20,17 +22,19 @@ import { fetchRecommendations, fetchWatsonXRecommendations, RecommendationsConst
|
|
|
20
22
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
21
23
|
import { createOrUpdateSessionResources, getSessResFromRec, getSessResFromRecs, } from '../../reducers/SessionRestoreReducer';
|
|
22
24
|
import RouteUtils from '../../utils/routeUtils';
|
|
25
|
+
import { RecommendationsLoader } from './RecommendationsLoader';
|
|
23
26
|
import { WatsonxAiIcon } from './WatsonxAiIcon';
|
|
24
27
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
25
28
|
export default function Recommendations(props) {
|
|
26
29
|
var _a, _b, _c;
|
|
27
|
-
const { product, version, environment, summary, caseResourceLinks, issue } = useCaseSelector((state) => ({
|
|
30
|
+
const { product, version, environment, summary, caseResourceLinks, issue, enableGetSupportProductVersion } = useCaseSelector((state) => ({
|
|
28
31
|
product: state.caseDetails.product,
|
|
29
32
|
version: state.caseDetails.version,
|
|
30
33
|
environment: state.caseDetails.environment,
|
|
31
34
|
summary: state.caseDetails.summary,
|
|
32
35
|
issue: state.caseDetails.issue,
|
|
33
36
|
caseResourceLinks: state.caseDetails.caseResourceLinks,
|
|
37
|
+
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
34
38
|
}), isEqual);
|
|
35
39
|
const caseDispatch = useCaseDispatch();
|
|
36
40
|
// Use Case Number
|
|
@@ -59,6 +63,9 @@ export default function Recommendations(props) {
|
|
|
59
63
|
// currently due to the debounce we use after the page load leads to some delay in the disbaling of next button
|
|
60
64
|
// since the state of the next button depends on the loading rec flag so we force the flag to be true every time the
|
|
61
65
|
// rec section is rendered for the first time except the case when we won't make a new search since there was no change in the rec payload.
|
|
66
|
+
if (activeSection !== AppRouteSections.SUMMARIZE || !summary || isRecSearchPayloadSame) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
62
69
|
!isRecSearchPayloadSame &&
|
|
63
70
|
recommendationDispatch({
|
|
64
71
|
type: RecommendationsConstants.setIsLoadingRecommendations,
|
|
@@ -120,19 +127,7 @@ export default function Recommendations(props) {
|
|
|
120
127
|
if (newRecommendations.length > 0) {
|
|
121
128
|
setCaseRecommendations(caseDispatch, recommendationState.visibleDocs, caseResourceLinks);
|
|
122
129
|
}
|
|
123
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS, getSessResFromRecs(recommendationState.visibleDocs, SessionResourceVisibility.PRESENTED, pageSize || DEFAULTPAGESIZE, recommendationState.currentPage || 1), JSON.stringify(payload));
|
|
124
|
-
const listing = recommendationState.visibleDocs.map((doc, i) => ({
|
|
125
|
-
content: {
|
|
126
|
-
contentID: doc.id,
|
|
127
|
-
contentPosition: i + 1,
|
|
128
|
-
contentTitle: doc.publishedTitle,
|
|
129
|
-
contentUrl: doc.view_uri,
|
|
130
|
-
displayFeature: 'Troubleshooting',
|
|
131
|
-
displayFeatureTitle: '',
|
|
132
|
-
},
|
|
133
|
-
isDisplayed: true,
|
|
134
|
-
}));
|
|
135
|
-
dtmTrackEventRecommendationListingDisplayed('middle', activeSection, listing, recommendationState.numFound);
|
|
130
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS, getSessResFromRecs(recommendationState.visibleDocs, SessionResourceVisibility.PRESENTED, pageSize || DEFAULTPAGESIZE, recommendationState.currentPage || 1), typeof payload === 'string' ? payload : JSON.stringify(payload));
|
|
136
131
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
132
|
}, [caseDispatch, recommendationState.visibleDocs, activeSessionId]);
|
|
138
133
|
useEffect(() => {
|
|
@@ -157,30 +152,63 @@ export default function Recommendations(props) {
|
|
|
157
152
|
setCurrentPage(recommendationDispatch, 1);
|
|
158
153
|
};
|
|
159
154
|
const onResourceClick = (doc, index) => (event) => {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS, [
|
|
156
|
+
getSessResFromRec(doc, SessionResourceVisibility.VISITED, index + 1 + (pageSize || DEFAULTPAGESIZE) * ((recommendationState.currentPage || 1) - 1)),
|
|
157
|
+
], typeof payload === 'string' ? payload : JSON.stringify(payload));
|
|
158
|
+
dtmTrackEventCaseStartStopped('recommendation click', caseNumber, `${product}|${version}`);
|
|
159
|
+
};
|
|
160
|
+
const infoPopover = (React.createElement(Popover, { triggerAction: "hover", "aria-label": "Hoverable popover", headerContent: React.createElement("div", null,
|
|
161
|
+
React.createElement(Trans, null, "Powered by Openshift AI")), bodyContent: React.createElement("div", null,
|
|
162
|
+
React.createElement(Trans, null, "These articles have been selected based on the information provided."),
|
|
163
|
+
React.createElement("br", null),
|
|
164
|
+
React.createElement("a", { href: "#" }, "Learn more")) },
|
|
165
|
+
React.createElement(InfoCircleIcon, { color: "white" })));
|
|
166
|
+
function getRankPercentage(decimal) {
|
|
167
|
+
return Math.round(decimal * 100);
|
|
168
|
+
}
|
|
169
|
+
const computeLabel = (doc) => {
|
|
170
|
+
const percentage = getRankPercentage(doc.rerank_score);
|
|
171
|
+
return (React.createElement(React.Fragment, null,
|
|
172
|
+
percentage > 80 && (React.createElement(Label, { color: "green", className: "match-label", icon: React.createElement(StarIcon, null) }, "Best Match")),
|
|
173
|
+
React.createElement(Label, { className: "match-label", color: "purple" },
|
|
174
|
+
percentage,
|
|
175
|
+
"% Match")));
|
|
163
176
|
};
|
|
164
177
|
return (React.createElement(React.Fragment, null,
|
|
165
|
-
React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) }),
|
|
166
|
-
React.createElement("div", { className: "recommendation-list
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
178
|
+
!enableGetSupportProductVersion && (React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) })),
|
|
179
|
+
React.createElement("div", { className: "recommendation-list", ref: props.resultsRowRef },
|
|
180
|
+
enableGetSupportProductVersion
|
|
181
|
+
? (recommendationState.visibleDocs.length !== 0 ||
|
|
182
|
+
recommendationState.isLoadingRecommendations) && (React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" }, recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
|
|
183
|
+
React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
|
|
184
|
+
' ',
|
|
185
|
+
React.createElement(Trans, null, "Recommending articles using OpenShift AI"),
|
|
186
|
+
' ',
|
|
187
|
+
React.createElement(InfoCircleIcon, { color: "white" }))) : (React.createElement(React.Fragment, null,
|
|
188
|
+
React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
|
|
189
|
+
' ',
|
|
190
|
+
React.createElement(Trans, null, "Articles recommended by OpenShift AI"),
|
|
191
|
+
" ",
|
|
192
|
+
infoPopover))))
|
|
193
|
+
: recommendationState.visibleDocs.length !== 0 && (React.createElement(Label, { color: "purple", className: "pf-v5-u-mb-md" },
|
|
194
|
+
React.createElement(WatsonxAiIcon, { fillColor: "#6753ac", className: "pf-v5-u-mr-xs" }),
|
|
195
|
+
React.createElement(Trans, null, "Live search results powered by OpenShift AI"))),
|
|
196
|
+
enableGetSupportProductVersion && recommendationState.isLoadingRecommendations ? ( // as much as it pains me to add these <br /> the pf docs has it this way
|
|
197
|
+
React.createElement(RecommendationsLoader, null)) : (React.createElement("ul", { className: "list-flat" }, map(recommendationState.visibleDocs, (doc, i) => {
|
|
171
198
|
var _a, _b;
|
|
172
199
|
return (React.createElement("li", { className: "result", key: doc.id },
|
|
173
200
|
React.createElement("header", { className: "result-header" },
|
|
174
201
|
React.createElement("a", { href: `${doc.view_uri}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[SessionResourceSource.RECOMMENDATIONS]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.RECOMMENDATIONS)}`, className: "se-recommended ts-result", "data-tracking-id": `se-recommended-main-recommendations-${i}`, rel: "noopener noreferrer", target: "_blank", onClick: onResourceClick(doc, i), dangerouslySetInnerHTML: computeRecommendationTitle(doc) }),
|
|
175
202
|
React.createElement("div", { className: "header-meta" },
|
|
203
|
+
enableGetSupportProductVersion && computeLabel(doc),
|
|
176
204
|
doc.kcsState === 'verified' && (React.createElement(React.Fragment, null,
|
|
177
|
-
React.createElement("span", { className: "status-verified" }, "verified"),
|
|
205
|
+
React.createElement("span", { className: "status-verified pf-v5-u-font-weight-bold pf-v5-u-success-color-100" }, "verified"),
|
|
178
206
|
React.createElement("span", { className: "list-separator" }, "\u2013"))),
|
|
179
207
|
React.createElement("span", { className: "meta" }, doc.documentKind),
|
|
180
208
|
React.createElement("span", { className: "list-separator" }, "\u2013"),
|
|
181
209
|
React.createElement("time", { className: "moment_date meta", title: doc.lastModifiedDate.toString() }, formatDate(doc.lastModifiedDate)))),
|
|
182
210
|
React.createElement("p", { className: "result-body", dangerouslySetInnerHTML: computeRecommendationAbstract(doc, 300) })));
|
|
183
|
-
})),
|
|
211
|
+
}))),
|
|
184
212
|
recommendationState.numFound !== 0 && recommendationState.numFound > DEFAULTPAGESIZE && (React.createElement("div", { className: "pagination-footer" },
|
|
185
213
|
React.createElement(Pagination, { className: "push-top", itemCount: (_c = (_b = recommendationState.allDocs) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0, perPage: recPageSize, page: recommendationState.currentPage, variant: PaginationVariant.bottom, onSetPage: pageChanged, dropDirection: "up", onPerPageSelect: onPageSizeChanged })))),
|
|
186
214
|
recommendationState.visibleDocs.length === 0 &&
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecommendationsLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationsLoader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,qBAAqB,yBAejC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Skeleton } from '@patternfly/react-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export const RecommendationsLoader = () => {
|
|
4
|
+
return (React.createElement("div", { className: "pf-v5-u-mt-md" }, [...Array(5)].map((_, i) => (React.createElement(React.Fragment, { key: `recommendation-loading-${i}` },
|
|
5
|
+
React.createElement(Skeleton, { height: "20px", width: "100%" }),
|
|
6
|
+
React.createElement("br", null),
|
|
7
|
+
React.createElement(Skeleton, { height: "45px", width: "100%" }),
|
|
8
|
+
React.createElement("br", null),
|
|
9
|
+
React.createElement("br", null),
|
|
10
|
+
React.createElement("br", null))))));
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,qBA8E3C"}
|
|
@@ -48,7 +48,7 @@ export default function Review(props) {
|
|
|
48
48
|
React.createElement("form", { className: "review-form card card-light push-bottom" },
|
|
49
49
|
React.createElement(AccountSelector, null),
|
|
50
50
|
React.createElement(OwnerSelector, null),
|
|
51
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, checkEntitledProduct: true }),
|
|
51
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, checkEntitledProduct: true, isOnReviewPage: true }),
|
|
52
52
|
React.createElement(OpenShiftClusterId, null),
|
|
53
53
|
React.createElement(Hostname, null),
|
|
54
54
|
React.createElement(KtQuestions, { inlineEditable: true, hideSaveCancel: true }),
|
|
@@ -298,7 +298,7 @@ export function SessionRestore(props) {
|
|
|
298
298
|
], 1000);
|
|
299
299
|
if (!sessionRestoreCardSections.includes(activeSection))
|
|
300
300
|
return React.createElement(React.Fragment, null);
|
|
301
|
-
return (React.createElement(
|
|
301
|
+
return (React.createElement("div", { className: "pf-v5-u-mb-md pf-v5-u-mt-0" },
|
|
302
302
|
' ',
|
|
303
303
|
React.createElement(SessionRestoreCard, { onRestore: restoreSession, previousSessions: previousSessions, onCardDismiss: onSessionRestoreCardDismiss }),
|
|
304
304
|
React.createElement(RestoreLastSessionModal, { onRestore: restoreSession, errorSession: sessionRestore.sessionOfCaseCreationError })));
|
|
@@ -168,11 +168,11 @@ export default function SubmitCase(props) {
|
|
|
168
168
|
React.createElement("div", { className: "submit-case-header-container" },
|
|
169
169
|
React.createElement("p", { className: "kicker kicker-sm pf-v5-u-mb-sm" }, !isEmpty(RouteUtils.seBasePath) &&
|
|
170
170
|
!isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles) ? (React.createElement(React.Fragment, null,
|
|
171
|
-
React.createElement("div", { className: "submit-page-title pf-v5-u-mb-lg" },
|
|
171
|
+
React.createElement("div", { role: "alert", className: "submit-page-title pf-v5-u-mb-lg" },
|
|
172
172
|
React.createElement(Icon, { className: "submit-case-check-icon pf-v5-u-mt-sm", size: "lg" },
|
|
173
173
|
React.createElement(CheckCircleIcon, null)),
|
|
174
174
|
' ',
|
|
175
|
-
React.createElement(Text, {
|
|
175
|
+
React.createElement(Text, { className: "pf-v5-u-mb-0", component: TextVariants.h1 },
|
|
176
176
|
React.createElement(Trans, null, "We've added your case to our queue"))),
|
|
177
177
|
React.createElement("div", { className: "pf-v5-u-mt-sm" },
|
|
178
178
|
React.createElement(Trans, null, "Case number:"),
|
|
@@ -184,7 +184,7 @@ export default function SubmitCase(props) {
|
|
|
184
184
|
React.createElement(Icon, { size: "lg", className: "submit-case-check-icon" },
|
|
185
185
|
React.createElement(CheckCircleIcon, null)),
|
|
186
186
|
' ',
|
|
187
|
-
React.createElement(Text, {
|
|
187
|
+
React.createElement(Text, { component: TextVariants.h1 },
|
|
188
188
|
React.createElement(Trans, null, "We\u2019ve added your case to our queue"))),
|
|
189
189
|
React.createElement(React.Fragment, null,
|
|
190
190
|
React.createElement(Trans, null, "Case number: "),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/TopContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"TopContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/TopContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAKxF,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,UAAU,MAAM;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,qBAiJ/C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
2
|
import { Accordion, AccordionContent, AccordionItem, AccordionToggle, Tooltip } from '@patternfly/react-core';
|
|
3
|
+
import { dtmTrackEventCaseStartStopped } from '@rh-support/utils';
|
|
3
4
|
import isEqual from 'lodash/isEqual';
|
|
4
5
|
import map from 'lodash/map';
|
|
5
6
|
import React, { useState } from 'react';
|
|
@@ -13,7 +14,7 @@ export default function TopContent(props) {
|
|
|
13
14
|
const sessionRestoreDispatch = React.useContext(SessionRestoreDispatchContext);
|
|
14
15
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = React.useContext(SessionRestoreStateContext);
|
|
15
16
|
const [expanded, setExpanded] = useState('');
|
|
16
|
-
const { product, version, summary, issue, environment, periodicityOfIssue, timeFramesAndUrgency } = useCaseSelector((state) => ({
|
|
17
|
+
const { product, version, summary, issue, environment, periodicityOfIssue, timeFramesAndUrgency, caseNumber } = useCaseSelector((state) => ({
|
|
17
18
|
product: state.caseDetails.product,
|
|
18
19
|
version: state.caseDetails.version,
|
|
19
20
|
summary: state.caseDetails.summary,
|
|
@@ -21,9 +22,11 @@ export default function TopContent(props) {
|
|
|
21
22
|
environment: state.caseDetails.environment,
|
|
22
23
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
23
24
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
25
|
+
caseNumber: state.caseDetails.caseNumber,
|
|
24
26
|
}), isEqual);
|
|
25
27
|
const onLinkClick = (item) => (event) => {
|
|
26
28
|
props.onResourceClick && props.onResourceClick(item);
|
|
29
|
+
dtmTrackEventCaseStartStopped('top content click', caseNumber, `${product}|${version}`);
|
|
27
30
|
};
|
|
28
31
|
const onToggle = (id) => {
|
|
29
32
|
if (id === expanded) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDClassNameProps } from '@rh-support/types/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
interface IProps extends IDClassNameProps {
|
|
4
4
|
isSessionId: boolean;
|
|
5
5
|
isPrivate: boolean;
|
|
6
6
|
isIdea?: boolean;
|
|
@@ -9,6 +9,6 @@ export interface IWidgetFileSelectorProps extends IDClassNameProps {
|
|
|
9
9
|
fileName: string[];
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
declare function WidgetFileSelector({ id, className, isSessionId, isPrivate, isIdea, showFileExceed, }:
|
|
12
|
+
declare function WidgetFileSelector({ id, className, isSessionId, isPrivate, isIdea, showFileExceed, }: IProps): React.JSX.Element;
|
|
13
13
|
export default WidgetFileSelector;
|
|
14
14
|
//# sourceMappingURL=WidgetFileSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFileSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/fileSelectors/WidgetFileSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetFileSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/fileSelectors/WidgetFileSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,UAAU,MAAO,SAAQ,gBAAgB;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE;QACb,IAAI,EAAE,OAAO,CAAC;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACL;AAED,iBAAS,kBAAkB,CAAC,EACxB,EAAO,EACP,SAAc,EACd,WAAW,EACX,SAAiB,EACjB,MAAc,EACd,cAA8C,GACjD,EAAE,MAAM,qBAmER;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import isEqual from 'lodash/isEqual';
|
|
1
|
+
import { humanizeSize } from '@rh-support/utils';
|
|
3
2
|
import React, { useContext } from 'react';
|
|
4
3
|
import { useDropzone } from 'react-dropzone';
|
|
5
4
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
|
-
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
7
|
-
import { RouteContext } from '../../../../context/RouteContext';
|
|
8
5
|
import { onDrop } from '../reducer/AttachmentHelper';
|
|
9
6
|
import { AttachmentDispatchContext } from '../reducer/AttachmentReducerContext';
|
|
10
7
|
function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate = false, isIdea = false, showFileExceed = { show: false, fileName: [] }, }) {
|
|
11
8
|
const { t } = useTranslation();
|
|
12
|
-
const { caseDetails } = useCaseSelector((state) => ({
|
|
13
|
-
caseDetails: state.caseDetails,
|
|
14
|
-
}), isEqual);
|
|
15
|
-
const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
|
|
16
9
|
const MAX_SIZE = isIdea ? 5242880 : undefined;
|
|
17
10
|
// Attachment Reducer Related
|
|
18
11
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
@@ -30,8 +23,6 @@ function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate =
|
|
|
30
23
|
// react-dropzone doesn't get triggered. So we need to manually clear the input value
|
|
31
24
|
// so that user can attach the same file twice
|
|
32
25
|
inputRef.current.value = null;
|
|
33
|
-
// Call a dtm track even whenever the file uploader is clicked
|
|
34
|
-
dtmTrackEventUploadFileToAnalyze(isCaseCreate, activeSection, caseDetails.caseType, caseDetails.product, caseDetails.version);
|
|
35
26
|
};
|
|
36
27
|
return (React.createElement(React.Fragment, null,
|
|
37
28
|
React.createElement("label", Object.assign({ className: "file-diag-dragndrop", htmlFor: "file-diag-selector" }, getRootProps({ onClick: onLabelClick }), { "data-tracking-id": "file-selector-widget-main" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAuB1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;
|
|
1
|
+
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAuB1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EA+M9D"}
|
|
@@ -14,7 +14,7 @@ import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
|
14
14
|
import { AttachmentStateContext } from './fileUpload/reducer/AttachmentReducerContext';
|
|
15
15
|
export function useIsSectionValid(sectionName) {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, } = useCaseSelector((state) => ({
|
|
17
|
+
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, enableGetSupportProductVersion, } = useCaseSelector((state) => ({
|
|
18
18
|
caseState: state,
|
|
19
19
|
caseType: state.caseDetails.caseType,
|
|
20
20
|
product: state.caseDetails.product,
|
|
@@ -30,6 +30,7 @@ export function useIsSectionValid(sectionName) {
|
|
|
30
30
|
environment: state.caseDetails.environment,
|
|
31
31
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
32
32
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
33
|
+
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
33
34
|
}), isEqual);
|
|
34
35
|
const { globalMetadataState: { allProducts, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
|
|
35
36
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
@@ -49,22 +50,28 @@ export function useIsSectionValid(sectionName) {
|
|
|
49
50
|
return !hasUnallowedFiles && !hasOversizeFiles; // we want it false to trigger the error if its true
|
|
50
51
|
};
|
|
51
52
|
const isGetSupportSectionValidLocal = () => {
|
|
52
|
-
|
|
53
|
+
let isValid = !isEmpty(caseType) &&
|
|
53
54
|
!isEmpty(accountNumber) &&
|
|
54
55
|
!isEmpty(contactSSOName) &&
|
|
55
|
-
!selectedAccountDetails.data.subscriptionAbuse
|
|
56
|
+
!selectedAccountDetails.data.subscriptionAbuse;
|
|
57
|
+
if (enableGetSupportProductVersion) {
|
|
58
|
+
isValid = isValid && !isEmpty(product) && !isEmpty(version);
|
|
59
|
+
}
|
|
60
|
+
return isValid;
|
|
56
61
|
};
|
|
57
62
|
const isSummarizeSectionValid = () => {
|
|
58
|
-
|
|
59
|
-
!isEmpty(version) &&
|
|
60
|
-
!allProducts.isFetching &&
|
|
63
|
+
let isValid = !allProducts.isFetching &&
|
|
61
64
|
!allProducts.isError &&
|
|
62
65
|
!topContent.isFetching &&
|
|
63
66
|
!isEmpty(summary) &&
|
|
64
67
|
!isEmpty(issue) &&
|
|
65
68
|
!recommendationState.isLoadingRecommendations &&
|
|
66
69
|
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
67
|
-
(issue === null || issue === void 0 ? void 0 : issue.length) <= ISSUE_SUMMARY_LENGTH_LIMIT
|
|
70
|
+
(issue === null || issue === void 0 ? void 0 : issue.length) <= ISSUE_SUMMARY_LENGTH_LIMIT;
|
|
71
|
+
if (!enableGetSupportProductVersion) {
|
|
72
|
+
isValid = isValid && !isEmpty(product) && !isEmpty(version);
|
|
73
|
+
}
|
|
74
|
+
return isValid;
|
|
68
75
|
};
|
|
69
76
|
const isCaseManagementSectionValid = () => {
|
|
70
77
|
const hasContactInfo24x7ValidLength = contactInfo24x7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAGH,eAAe,
|
|
1
|
+
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAGH,eAAe,EAIlB,MAAM,iCAAiC,CAAC;AASzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;CACxC;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,qBAwDjC;kBAxDQ,WAAW;;;AA0DpB,eAAe,WAAW,CAAC"}
|