@rh-support/troubleshoot 2.4.5-beta.7 → 2.4.5-beta.9
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/Cve/CveItem.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveItem.js +12 -7
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +30 -26
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts +2 -1
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +3 -3
- package/lib/esm/hooks/useFetchCVEData.js +1 -1
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +9 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CveItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CveItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveItem.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,UAAU,KAAK;IACX,GAAG,EAAE,0BAA0B,CAAC;CACnC;AAID,eAAO,MAAM,OAAO,UAAW,KAAK,sBA2InC,CAAC"}
|
|
@@ -5,13 +5,18 @@ import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
|
|
|
5
5
|
import { format } from 'date-fns';
|
|
6
6
|
import DOMPurify from 'dompurify';
|
|
7
7
|
import isEmpty from 'lodash/isEmpty';
|
|
8
|
+
import isEqual from 'lodash/isEqual';
|
|
8
9
|
import map from 'lodash/map';
|
|
9
10
|
import slice from 'lodash/slice';
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import { Trans } from 'react-i18next';
|
|
13
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
12
14
|
const sanitize = (html) => ({ __html: DOMPurify.sanitize(html) });
|
|
13
15
|
export const CveItem = (props) => {
|
|
14
16
|
const { cve } = props;
|
|
17
|
+
const { isCveModalOpened } = useCaseSelector((state) => ({
|
|
18
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
19
|
+
}), isEqual);
|
|
15
20
|
const renderDate = () => (React.createElement("div", { className: "pf-v5-u-disabled-color-100" },
|
|
16
21
|
React.createElement(Trans, null, "Public on"),
|
|
17
22
|
" - ",
|
|
@@ -37,20 +42,20 @@ export const CveItem = (props) => {
|
|
|
37
42
|
return (React.createElement(Table, { "aria-label": "Errata table", variant: 'compact' },
|
|
38
43
|
React.createElement(Thead, null,
|
|
39
44
|
React.createElement(Tr, null,
|
|
40
|
-
React.createElement(Th, { width: 30 },
|
|
41
|
-
React.createElement(Trans, null, "Errata link")),
|
|
42
45
|
React.createElement(Th, null,
|
|
43
|
-
React.createElement(Trans, null, "
|
|
46
|
+
React.createElement(Trans, null, "Errata link")),
|
|
44
47
|
React.createElement(Th, { width: 30 },
|
|
48
|
+
React.createElement(Trans, null, "Component")),
|
|
49
|
+
React.createElement(Th, null,
|
|
45
50
|
React.createElement(Trans, null, "Status")))),
|
|
46
|
-
React.createElement(Tbody, null, map(slice(cve.errataData, 0, 3), (errata, index) => {
|
|
51
|
+
React.createElement(Tbody, null, map(slice(cve.errataData, 0, isCveModalOpened ? 3 : 2), (errata, index) => {
|
|
47
52
|
var _a, _b, _c;
|
|
48
53
|
return (React.createElement(Tr, Object.assign({ key: (_a = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _a === void 0 ? void 0 : _a.name }, (index % 2 === 0 && { isStriped: true })),
|
|
49
54
|
React.createElement(Td, null,
|
|
50
55
|
React.createElement(Text, { component: TextVariants.a, href: (_b = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _b === void 0 ? void 0 : _b.url, target: "_blank", ouiaSafe: true, "data-tracking-id": "errata-link" }, (_c = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _c === void 0 ? void 0 :
|
|
51
56
|
_c.name,
|
|
52
57
|
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" }))),
|
|
53
|
-
React.createElement(Td,
|
|
58
|
+
React.createElement(Td, { modifier: "truncate" }, errata === null || errata === void 0 ? void 0 : errata.package),
|
|
54
59
|
React.createElement(Td, null,
|
|
55
60
|
React.createElement(Trans, null, errata === null || errata === void 0 ? void 0 : errata.state))));
|
|
56
61
|
}))));
|
|
@@ -60,7 +65,7 @@ export const CveItem = (props) => {
|
|
|
60
65
|
if (isEmpty(cve === null || cve === void 0 ? void 0 : cve.mitigation) && ((_a = cve === null || cve === void 0 ? void 0 : cve.errataData) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
61
66
|
return (React.createElement("p", { className: "pf-v5-u-mt-md" }, "for this CVE mitigation and fix is not available, for more details, go to CVE page."));
|
|
62
67
|
}
|
|
63
|
-
const MAX_DESCRIPTION_LENGTH = 300;
|
|
68
|
+
const MAX_DESCRIPTION_LENGTH = isCveModalOpened ? 300 : 120;
|
|
64
69
|
const description = !isEmpty(cve === null || cve === void 0 ? void 0 : cve.mitigation) ? cve === null || cve === void 0 ? void 0 : cve.mitigation : cve === null || cve === void 0 ? void 0 : cve.details;
|
|
65
70
|
if (!description)
|
|
66
71
|
return '';
|
|
@@ -75,7 +80,7 @@ export const CveItem = (props) => {
|
|
|
75
80
|
React.createElement(FlexItem, null, renderDate())),
|
|
76
81
|
displayErrataTable(),
|
|
77
82
|
displayDescription(),
|
|
78
|
-
(cve === null || cve === void 0 ? void 0 : cve.cveLink) && (React.createElement(Button, { variant: "primary", className:
|
|
83
|
+
(cve === null || cve === void 0 ? void 0 : cve.cveLink) && (React.createElement(Button, { variant: "primary", className: isCveModalOpened ? 'pf-v5-u-my-md' : '', "data-tracking-id": "go-to-CVE-button", component: "a", href: cve.cveLink, target: "_blank", rel: "noopener noreferrer" },
|
|
79
84
|
React.createElement(Trans, null, "Go to CVE"),
|
|
80
85
|
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })))));
|
|
81
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EA0JvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -8,8 +8,10 @@ import isEqual from 'lodash/isEqual';
|
|
|
8
8
|
import React, { forwardRef, useContext, useEffect, useState } from 'react';
|
|
9
9
|
import { Trans, useTranslation } from 'react-i18next';
|
|
10
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
11
12
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
12
13
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
14
|
+
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
13
15
|
import RouteUtils from '../../utils/routeUtils';
|
|
14
16
|
import OpenCaseIssue from '../CaseInformation/OpenCaseIssue';
|
|
15
17
|
import Suggestions from '../Suggestions/Suggestions';
|
|
@@ -31,11 +33,10 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
31
33
|
var _a, _b;
|
|
32
34
|
const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
33
35
|
const caseDispatch = useCaseDispatch();
|
|
34
|
-
const { product, version, contactSSOName
|
|
36
|
+
const { product, version, contactSSOName } = useCaseSelector((state) => ({
|
|
35
37
|
product: state.caseDetails.product,
|
|
36
38
|
version: state.caseDetails.version,
|
|
37
39
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
38
|
-
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
39
40
|
}), isEqual);
|
|
40
41
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
41
42
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
@@ -77,31 +78,34 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
77
78
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
78
79
|
}
|
|
79
80
|
const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
82
|
+
if ((activeSection === AppRouteSections.SUMMARIZE && !props.caseCreateExperience) ||
|
|
83
|
+
activeSection === AppRouteSections.GET_SUPPORT) {
|
|
84
|
+
return (React.createElement("div", { className: "form-group product-selector-wrapper" },
|
|
82
85
|
React.createElement("div", { className: "all-product-selector-dropdown" },
|
|
83
|
-
React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching }))))
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
React.createElement(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
React.createElement(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
React.createElement(
|
|
104
|
-
|
|
86
|
+
React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching }))));
|
|
87
|
+
// } else if (activeSection === AppRouteSections.SUMMARIZE && props.caseCreateExperience)
|
|
88
|
+
}
|
|
89
|
+
else
|
|
90
|
+
return (React.createElement(React.Fragment, null,
|
|
91
|
+
React.createElement("div", { className: "case-details-summary" },
|
|
92
|
+
React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage })),
|
|
93
|
+
React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
|
|
94
|
+
? 'You are'
|
|
95
|
+
: 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
|
|
96
|
+
showModalButton &&
|
|
97
|
+
!isEmpty(product) &&
|
|
98
|
+
!isEmpty(version) &&
|
|
99
|
+
!topContent.isFetching &&
|
|
100
|
+
topContent.data.length !== 0 && (React.createElement("button", { className: "btn btn-bordered-blue btn-slim pull-top-narrow push-bottom-narrow", "data-tracking-id": "suggested-fixes-trigger", onClick: toggleTCModal, type: "button" },
|
|
101
|
+
React.createElement(Trans, null, "Suggested fixes"))),
|
|
102
|
+
props.loadTCOnChange && !topContent.isFetching && topContent.data.length !== 0 && (React.createElement(Modal, { className: "feedback-modal", title: t('Suggested fixes'), description: t('There are new updates to suggested fixes after changing your product.'), "aria-describedby": "Feedback Form", isOpen: isModalOpen, variant: ModalVariant.large, onClose: toggleTCModal, actions: [
|
|
103
|
+
React.createElement("button", { key: "cancel", onClick: toggleTCModal, className: "btn btn-app btn-primary", type: "button" },
|
|
104
|
+
React.createElement(Trans, null, "Cancel")),
|
|
105
|
+
] },
|
|
106
|
+
React.createElement("span", null,
|
|
107
|
+
React.createElement(Trans, null, "Here are some common suggestions:")),
|
|
108
|
+
React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
|
|
105
109
|
});
|
|
106
110
|
AllProductsSelector.defaultProps = defaultProps;
|
|
107
111
|
export { AllProductsSelector };
|
|
@@ -3,10 +3,11 @@ import { RouteComponentProps } from 'react-router-dom';
|
|
|
3
3
|
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
|
-
userSeenRecommendations?: (value
|
|
6
|
+
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
7
|
userClickedNextonRecommendations?: boolean;
|
|
8
8
|
resultsRowRef?: React.MutableRefObject<HTMLDivElement | null>;
|
|
9
9
|
isOnGetSupportPage?: boolean;
|
|
10
|
+
caseCreateExperience?: boolean;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Responsible for:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOlE,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,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,aAAa,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAqGpD"}
|
|
@@ -40,10 +40,10 @@ export default function ProductSelector(props) {
|
|
|
40
40
|
return (React.createElement(React.Fragment, null,
|
|
41
41
|
!enableGetSupportProductVersion && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
|
|
42
42
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
43
|
-
|
|
43
|
+
allProducts.isFetching ? (React.createElement(ProductSelectorLoader, null)) : (!allProducts.isError && (React.createElement(React.Fragment, null,
|
|
44
44
|
React.createElement("form", null,
|
|
45
45
|
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
|
|
46
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage }),
|
|
46
|
+
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 }),
|
|
47
47
|
product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
|
|
48
48
|
' ',
|
|
49
49
|
"If you're having a subscription issue that doesn't relate to",
|
|
@@ -57,5 +57,5 @@ export default function ProductSelector(props) {
|
|
|
57
57
|
!enableGetSupportProductVersion && React.createElement(EARuleWidget, null)),
|
|
58
58
|
!(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
|
|
59
59
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
|
|
60
|
-
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef }))))))))));
|
|
60
|
+
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))))));
|
|
61
61
|
}
|
|
@@ -22,7 +22,7 @@ import { useCaseDispatch, useCaseSelector } from '../context/CaseContext';
|
|
|
22
22
|
import { RecommendationStateContext } from '../context/RecommendationContext';
|
|
23
23
|
import { setCaseState } from '../reducers/CaseReducer';
|
|
24
24
|
import { findCVEsInString } from '../utils/caseUtils';
|
|
25
|
-
// custom hook for CVE workflow data.
|
|
25
|
+
// custom hook for CVE workflow data .
|
|
26
26
|
export function useFetchCVEData() {
|
|
27
27
|
const caseDispatch = useCaseDispatch();
|
|
28
28
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AAmCA,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,GAAG,CAAC;IAChC,4BAA4B,EAAE,OAAO,CAAC;IACtC,6BAA6B,EAAE,OAAO,CAAC;IACvC,qCAAqC,EAAE,OAAO,CAAC;IAC/C,aAAa,EAAE,GAAG,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,UAAU,KAAA,EAAE,KAAK,CAAC,EAAE,MAAM;iCAmRb,OAAO;EAwC7C"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
|
|
2
|
+
import { ability } from '@rh-support/user-permissions/lib/esm/AuthFramework';
|
|
3
|
+
import { CaseListFields, resourceActions, resources } from '@rh-support/user-permissions/lib/esm/enums';
|
|
2
4
|
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
3
5
|
import isEmpty from 'lodash/isEmpty';
|
|
4
6
|
import isEqual from 'lodash/isEqual';
|
|
5
7
|
import React, { Suspense, useContext } from 'react';
|
|
6
8
|
import { Trans, useTranslation } from 'react-i18next';
|
|
9
|
+
import { AccountSelector } from '../components/AccountInfo/AccountSelector';
|
|
10
|
+
import { OwnerSelector } from '../components/AccountInfo/OwnerSelector';
|
|
7
11
|
import CaseInformation from '../components/CaseInformation/CaseInformation';
|
|
8
12
|
import CaseManagement from '../components/CaseManagement/CaseManagement';
|
|
9
13
|
import IdeaInformation from '../components/IdeaInformation/IdeaInformation';
|
|
@@ -52,6 +56,7 @@ export function useWizard(routeProps, props) {
|
|
|
52
56
|
let summarizeNextButtonLabelLogic = () => {
|
|
53
57
|
return props.userScrolledLabel;
|
|
54
58
|
};
|
|
59
|
+
const canChangeAccountInfo = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ACCOUNT_AND_OWNER);
|
|
55
60
|
// components that are used in wizard steps
|
|
56
61
|
const appRouteConfugurations = {
|
|
57
62
|
[AppRouteSections.GET_SUPPORT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.GET_SUPPORT, name: t('Get support'), component: (React.createElement(MainSection, { stepNumber: 1, totalSteps: 6, section: AppRouteSections.GET_SUPPORT, title: t('Why are you opening a case?'), description: t('Select the best category for your issue.') },
|
|
@@ -61,7 +66,10 @@ export function useWizard(routeProps, props) {
|
|
|
61
66
|
[AppRouteSections.SUMMARIZE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.SUMMARIZE, name: t('Summarize'), component: (React.createElement(MainSection, { stepNumber: 2, totalSteps: 6, section: AppRouteSections.SUMMARIZE, title: t('What are you having an issue with?') },
|
|
62
67
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
63
68
|
alertMessage(),
|
|
64
|
-
|
|
69
|
+
canChangeAccountInfo && !isCaseCreate && (React.createElement(React.Fragment, null,
|
|
70
|
+
React.createElement(AccountSelector, { "data-tracking-id": "get-support-account-selector" }),
|
|
71
|
+
React.createElement(OwnerSelector, { "data-tracking-id": "get-support-owner-selector" }))),
|
|
72
|
+
React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef, isOnGetSupportPage: false, caseCreateExperience: isCaseCreate })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel: (summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
|
|
65
73
|
!isEmpty(issue) // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
|
|
66
74
|
? t('Continue')
|
|
67
75
|
: t('See more options') }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestoreReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/SessionRestoreReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,IAAI,sBAAsB,EAC/C,yBAAyB,IAAI,0BAA0B,EAC1D,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkB1G,OAAO,EAAwB,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAWlF,MAAM,WAAW,aAAa;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EF,eAAO,MAAM,qBAAqB,gFAYjC,CAAC;AAGF,eAAO,MAAM,gBAAgB,QACpB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAIH,eAAO,MAAM,YAAY,eACT,mBAAmB,mBACd,mBAAmB,EAAE,YAC7B,mBAAmB,EAAE,uBAWjC,CAAC"}
|
|
@@ -390,7 +390,7 @@ export function getSessResFromRecs(recs, visibilityStatus, pageSize = 1, current
|
|
|
390
390
|
return toReturn;
|
|
391
391
|
}
|
|
392
392
|
// Recommendations Helper Function
|
|
393
|
-
export const getSessResFromRec = (rec, visibilityStatus, rank = 1) => (Object.assign(Object.assign({ visibilityStatus }, (rec.id && { resourceEntityId: rec.id })), { type: getResTypeFromUrl(rec.view_uri), url: rec.view_uri, rank }));
|
|
393
|
+
export const getSessResFromRec = (rec, visibilityStatus, rank = 1) => (Object.assign(Object.assign({ visibilityStatus }, (rec.id && { resourceEntityId: rec.id })), { type: getResTypeFromUrl(rec.view_uri), url: rec.view_uri, rank, reRankScore: rec.rerank_score }));
|
|
394
394
|
export const getSessResFromRules = (url, visibilityStatus, rank = 1, resourceEntityId) => (Object.assign(Object.assign({ visibilityStatus }, (resourceEntityId && { resourceEntityId })), { type: getResTypeFromUrl(url), url: url, rank }));
|
|
395
395
|
export const getRulesToSave = (visiterUrl, visitedRec, allPresentedRec) => {
|
|
396
396
|
return map(allPresentedRec, (rec, i) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.4.5-beta.
|
|
3
|
+
"version": "2.4.5-beta.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"defaults and supports es6-module",
|
|
135
135
|
"maintained node versions"
|
|
136
136
|
],
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "8647cd96a4c3daa8befc9b25a21ccf279dbdf06e"
|
|
138
138
|
}
|