@rh-support/troubleshoot 0.2.73 → 0.2.83
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/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +14 -3
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +4 -4
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +9 -1
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +5 -3
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +12 -7
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +4 -0
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +5 -3
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +3 -0
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +12 -3
- package/lib/esm/reducers/RulesReducer.d.ts +10 -3
- package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RulesReducer.js +11 -8
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +4 -4
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +33 -15
- package/package.json +9 -9
|
@@ -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,EAAW,MAAM,0BAA0B,CAAC;
|
|
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,EAAW,MAAM,0BAA0B,CAAC;AAIrE,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;IACvD,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,OAAO,EAAE,MAAM,CAAC;CACnB;AAOD,QAAA,MAAM,8BAA8B,wEAqIlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { Dropdown } from '@rh-support/components';
|
|
2
2
|
import { toOption, toOptions } from '@rh-support/utils';
|
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
|
4
|
-
import
|
|
4
|
+
import isEqual from 'lodash/isEqual';
|
|
5
|
+
import React, { forwardRef, useContext, useEffect, useMemo, useState } from 'react';
|
|
5
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
7
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
6
8
|
import { RouteContext } from '../../context/RouteContext';
|
|
7
9
|
const defaultProps = {
|
|
8
10
|
disabled: false,
|
|
9
11
|
htmlForId: '',
|
|
10
12
|
};
|
|
11
13
|
const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
12
|
-
var _a;
|
|
13
14
|
const { t } = useTranslation();
|
|
14
15
|
const [isProductInValid, setIsProductInValid] = useState(true);
|
|
15
16
|
const [isVersionInValid, setIsVersionInValid] = useState(false);
|
|
16
17
|
const [isProductBlured, setIsProductBlured] = useState(false);
|
|
17
18
|
const [isVersionBlured, setIsVersionBlured] = useState(false);
|
|
18
19
|
const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
|
|
20
|
+
const versionsDetails = useCaseSelector((state) => state.versionsDetails, isEqual);
|
|
21
|
+
const productVenisons = useMemo(() => versionsDetails.data.map(({ name }) => name),
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
+
[props.selectedProduct.name, versionsDetails.data]);
|
|
24
|
+
// Here we are conditionally checking if selected product is having version and if not fallback to fetched version list ].
|
|
25
|
+
const selectedProductVersion = isEmpty(props.selectedProduct.versions)
|
|
26
|
+
? productVenisons
|
|
27
|
+
: props.selectedProduct.versions;
|
|
28
|
+
// On the basis of which version source we are using we need to use loading status of it.
|
|
29
|
+
const isLoadingList = isEmpty(props.selectedProduct.versions) ? versionsDetails.isFetching : props.isLoading;
|
|
19
30
|
const onProductChange = (option) => {
|
|
20
31
|
props.onProductChange(option.value);
|
|
21
32
|
validateProduct(option);
|
|
@@ -72,7 +83,7 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
|
72
83
|
React.createElement(Trans, null, "Version"),
|
|
73
84
|
' ',
|
|
74
85
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
|
|
75
|
-
React.createElement(Dropdown, { selectedItem: toOption(props.version), list:
|
|
86
|
+
React.createElement(Dropdown, { selectedItem: toOption(props.version), list: toOptions(selectedProductVersion !== null && selectedProductVersion !== void 0 ? selectedProductVersion : []), id: "version-selector-dropdown", placeholder: t('Select a version'), isLoadingList: isLoadingList, title: `Versions for ${props.selectedProduct.product}`, disabled: props.disabled || isEmpty(selectedProductVersion), isInValid: !props.disabled &&
|
|
76
87
|
isVersionInValid &&
|
|
77
88
|
showValidationErrorAlert &&
|
|
78
89
|
props.selectedProduct.product &&
|
|
@@ -6,12 +6,12 @@ import { Trans } from 'react-i18next';
|
|
|
6
6
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
7
7
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
8
8
|
import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
|
|
9
|
-
import { createOrUpdateSessionResources,
|
|
9
|
+
import { createOrUpdateSessionResources, getRulesToSave } from '../../reducers/SessionRestoreReducer';
|
|
10
10
|
import { riskLabels } from '../shared/Constants';
|
|
11
11
|
export function ClusterRecommendationItems(props) {
|
|
12
12
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
13
13
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
14
|
-
const { SessionResourceSource
|
|
14
|
+
const { SessionResourceSource } = pcm.preCase.session;
|
|
15
15
|
const { version, product } = useCaseSelector((state) => ({
|
|
16
16
|
version: state.caseDetails.version,
|
|
17
17
|
product: state.caseDetails.product,
|
|
@@ -19,8 +19,8 @@ export function ClusterRecommendationItems(props) {
|
|
|
19
19
|
const { parseDotMarkdownWithTracking } = useParseRuleMarkdown();
|
|
20
20
|
const onResourceClick = (e, rule) => {
|
|
21
21
|
if (e.target.tagName.toLowerCase() === 'a') {
|
|
22
|
-
const
|
|
23
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.CLUSTER_RECOMMENDATION,
|
|
22
|
+
const visitedUrl = e.target.href.split('?')[0];
|
|
23
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.CLUSTER_RECOMMENDATION, getRulesToSave(visitedUrl, rule, props.clusterRecommendations), JSON.stringify({ product, version }));
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
return (React.createElement("pfe-accordion", null, props.clusterRecommendations.map((rule) => (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationsModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClusterRecommendationsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationsModal.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eAwFxD"}
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { pcm } from '@cee-eng/hydrajs';
|
|
11
11
|
import { Button, Modal } from '@patternfly/react-core';
|
|
12
12
|
import { useFetch } from '@rh-support/components';
|
|
13
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
14
|
import { getResTypeFromUrl } from '@rh-support/utils';
|
|
14
15
|
import React, { useContext, useState } from 'react';
|
|
15
16
|
import { useTranslation } from 'react-i18next';
|
|
@@ -24,6 +25,8 @@ export function ClusterRecommendationsModal(props) {
|
|
|
24
25
|
const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
|
|
25
26
|
const { SessionResourceSource } = pcm.preCase.session;
|
|
26
27
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
28
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
29
|
+
const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
|
|
27
30
|
const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
|
|
28
31
|
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
29
32
|
const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -51,7 +54,12 @@ export function ClusterRecommendationsModal(props) {
|
|
|
51
54
|
return (React.createElement(React.Fragment, null,
|
|
52
55
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
53
56
|
React.createElement(Modal, { className: "critical-solutions-modal", title: t('Cluster recommendations'), description: t('Recommendations have been triggered for your cluster.'), "data-tracking-id": "cluster-recommendations-modal-body", onClose: onModalClose, isOpen: isClusterRecommendationsModalOpen, actions: [
|
|
54
|
-
|
|
57
|
+
// for secure support users, we don't have session api, so we need to hide this button
|
|
58
|
+
...(!isSecureSupportAccount
|
|
59
|
+
? [
|
|
60
|
+
React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "cluster-recommendations-solutions-modal" }, t('I solved my issue')),
|
|
61
|
+
]
|
|
62
|
+
: []),
|
|
55
63
|
React.createElement(Button, { onClick: onModalClose, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-cluster-recommendations-modal" }, t('Cancel')),
|
|
56
64
|
] },
|
|
57
65
|
React.createElement(ClusterRecommendationItems, { clusterRecommendations: clusterRecommendations.data }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EARule.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARule.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EARule.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARule.tsx"],"names":[],"mappings":"AAGA,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,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAClG;AAGD,eAAO,MAAM,aAAa,+BAGxB,CAAC;AAEH,wBAAgB,gBAAgB,mBAM/B;AACD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;;CAAA,eA0BxC;AAED,iBAAS,WAAW,gBAGnB;AAED,iBAAS,iBAAiB,gBAsBzB;AAED,iBAAS,aAAa,CAAC,EAAE,SAA6B,EAAE,SAAc,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,eA4BnH;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -3,10 +3,11 @@ import { pcm } from '@cee-eng/hydrajs';
|
|
|
3
3
|
import CaretRightIcon from '@patternfly/react-icons/dist/js/icons/caret-right-icon';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { Trans } from 'react-i18next';
|
|
6
|
+
import { RulesStateContext } from '../../../context/RulesContext';
|
|
6
7
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../../context/SessionRestoreContext';
|
|
7
8
|
import { useParseRuleMarkdown } from '../../../hooks/useParseRuleMarkdown';
|
|
8
|
-
import { createOrUpdateSessionResources,
|
|
9
|
-
const {
|
|
9
|
+
import { createOrUpdateSessionResources, getRulesToSave } from '../../../reducers/SessionRestoreReducer';
|
|
10
|
+
const { SessionResourceSource } = pcm.preCase.session;
|
|
10
11
|
export const EARuleContext = React.createContext({
|
|
11
12
|
rule: {},
|
|
12
13
|
onCtaClick: null,
|
|
@@ -21,8 +22,9 @@ export function useEARuleContext() {
|
|
|
21
22
|
export function EARule({ children, rule }) {
|
|
22
23
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
23
24
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
25
|
+
const { rulesState } = useContext(RulesStateContext);
|
|
24
26
|
const onCtaClick = (link) => (event) => {
|
|
25
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT,
|
|
27
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, getRulesToSave(link, rule, rulesState.EARules.rules));
|
|
26
28
|
};
|
|
27
29
|
return (React.createElement(EARuleContext.Provider, { value: {
|
|
28
30
|
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":"AAcA,OAAO,EAAE,aAAa,EAAkD,MAAM,gCAAgC,CAAC;AAM/G,UAAU,MAAM;IACZ,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AACD,wBAAgB,gBAAgB,CAAC,EAAE,OAAY,EAAE,EAAE,MAAM,eAiIxD"}
|
|
@@ -13,6 +13,7 @@ import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-
|
|
|
13
13
|
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
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
16
17
|
import { getResTypeFromUrl, getStyleVariantColor, StyleVariants } from '@rh-support/utils';
|
|
17
18
|
import some from 'lodash/some';
|
|
18
19
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -30,6 +31,8 @@ export function EARuleInfoInline({ eaRules = [] }) {
|
|
|
30
31
|
const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
|
|
31
32
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
32
33
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
34
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
35
|
+
const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
|
|
33
36
|
const validEARulesLength = eaRules.length;
|
|
34
37
|
const isAnyRuleResolved = some(eaRules, (item) => item.resolved);
|
|
35
38
|
// if user ignores a rule on last page, we need to handle the scenario
|
|
@@ -65,6 +68,14 @@ export function EARuleInfoInline({ eaRules = [] }) {
|
|
|
65
68
|
const onModalToggle = () => {
|
|
66
69
|
setIsModalVisible((visible) => !visible);
|
|
67
70
|
};
|
|
71
|
+
// for secure support users, we don't have session api, so we need to hide this section
|
|
72
|
+
const resolvedMyIssue = () => visibleRule.resolved ? (React.createElement("span", { style: {
|
|
73
|
+
color: getStyleVariantColor(StyleVariants.SUCCESS),
|
|
74
|
+
lineHeight: 2.4,
|
|
75
|
+
} },
|
|
76
|
+
React.createElement(CheckCircleIcon, null),
|
|
77
|
+
" ",
|
|
78
|
+
React.createElement(Trans, null, "Resolved"))) : isAnyRuleResolved ? null : (React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, className: "se-recommended ts-known-vuln", variant: ButtonVariant.link, isInline: true, "data-tracking-id": "se-recommended-asa-resolve", type: "button", onClick: onResolveClick }, isFetching ? null : React.createElement(Trans, null, "This resolved my issue")));
|
|
68
79
|
if (validEARulesLength < 1)
|
|
69
80
|
return null;
|
|
70
81
|
const visibleRule = eaRules[currentPage > validEARulesLength ? validEARulesLength - 1 : currentPage - 1];
|
|
@@ -83,12 +94,6 @@ export function EARuleInfoInline({ eaRules = [] }) {
|
|
|
83
94
|
React.createElement(EARuleDescription, null)),
|
|
84
95
|
React.createElement("div", { className: "pf-c-alert__action-group pf-u-display-flex" },
|
|
85
96
|
React.createElement(EARuleArticle, { className: "pf-u-align-self-center pf-u-mr-sm", linkTitle: "View details" }),
|
|
86
|
-
|
|
87
|
-
color: getStyleVariantColor(StyleVariants.SUCCESS),
|
|
88
|
-
lineHeight: 2.4,
|
|
89
|
-
} },
|
|
90
|
-
React.createElement(CheckCircleIcon, null),
|
|
91
|
-
" ",
|
|
92
|
-
React.createElement(Trans, null, "Resolved"))) : isAnyRuleResolved ? null : (React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, className: "se-recommended ts-known-vuln", variant: ButtonVariant.link, isInline: true, "data-tracking-id": "se-recommended-asa-resolve", type: "button", onClick: onResolveClick }, isFetching ? null : React.createElement(Trans, null, "This resolved my issue"))),
|
|
97
|
+
!isSecureSupportAccount && resolvedMyIssue(),
|
|
93
98
|
validEARulesLength > 1 && (React.createElement(PaginationCompact, { maxPage: validEARulesLength, onPageChange: onPaginationChange, dataTrackingId: 'se-recommended-asa-widget' })))))));
|
|
94
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAmPrC;kBAnPQ,eAAe;;;AAsPxB,eAAe,eAAe,CAAC"}
|
|
@@ -196,6 +196,10 @@ function InsightsResults(props) {
|
|
|
196
196
|
}, [selectedLocalFiles]);
|
|
197
197
|
useEffect(() => {
|
|
198
198
|
setInsighResultsKcsIds(recommendationDispatch, includeAnalysisResults ? allResults.map((result) => result.id) : []);
|
|
199
|
+
rulesDispatch({
|
|
200
|
+
type: RulesReducerConstants.setInsightRules,
|
|
201
|
+
payload: { rules: allResults },
|
|
202
|
+
});
|
|
199
203
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
200
204
|
}, [allResults.length, includeAnalysisResults]);
|
|
201
205
|
function insightsModalToggle() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsRuleInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsRuleInfo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InsightsRuleInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsRuleInfo.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,GAAG,EAAE,wBAAwB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,MAAM,eA8J1E"}
|
|
@@ -6,11 +6,12 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-ic
|
|
|
6
6
|
import { getRuleReasonHtml } from '@rh-support/utils';
|
|
7
7
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
8
8
|
import { Trans } from 'react-i18next';
|
|
9
|
+
import { RulesStateContext } from '../../context/RulesContext';
|
|
9
10
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
10
11
|
import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
|
|
11
|
-
import { createOrUpdateSessionResources,
|
|
12
|
+
import { createOrUpdateSessionResources, getInsightRulesToSave } from '../../reducers/SessionRestoreReducer';
|
|
12
13
|
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
13
|
-
const {
|
|
14
|
+
const { SessionResourceSource } = pcm.preCase.session;
|
|
14
15
|
export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
15
16
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
16
17
|
const [ruleData, setRuleData] = useState(null);
|
|
@@ -19,6 +20,7 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
|
19
20
|
const [isIssueExpanded, setIsIssueExpanded] = useState(true);
|
|
20
21
|
const [isAdditionalExpanded, setIsAdditionalExpanded] = useState(false);
|
|
21
22
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
23
|
+
const { rulesState: { insightRules }, } = useContext(RulesStateContext);
|
|
22
24
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
23
25
|
const { parseDotMarkdownWithTracking, getTrackingULRWithQueryParams } = useParseRuleMarkdown();
|
|
24
26
|
const { attachmentState: { caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
@@ -36,7 +38,7 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
|
36
38
|
setRuleData(rules[ruleId]);
|
|
37
39
|
}, [setRuleData, doc.attachmentId, doc.id, selectedLocalFiles, duplicateKeys]);
|
|
38
40
|
const onCtaClick = (link) => (event) => {
|
|
39
|
-
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS,
|
|
41
|
+
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, getInsightRulesToSave(link, doc, insightRules.rules));
|
|
40
42
|
};
|
|
41
43
|
const parseMoreInfo = (moreInfo, reportDetails) => {
|
|
42
44
|
return parseDotMarkdownWithTracking(moreInfo, reportDetails, SessionResourceSource.INSIGHTS, 'ts-result-insights', 'se-recommended-insights-rule');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAmI/C"}
|
|
@@ -81,6 +81,9 @@ export function InsightResultModal(props) {
|
|
|
81
81
|
return (React.createElement(React.Fragment, null,
|
|
82
82
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
83
83
|
React.createElement(Modal, { className: "critical-solutions-modal", title: t('Critical solutions for your system'), description: t('Solutions have been triggered for you based on file upload or common issues that currently have high visibility.'), "data-tracking-id": "critical-solutions-modal-body", onClose: props.onModalToggle, isOpen: props.isOpen, actions: [
|
|
84
|
+
// at this moment, for secure support users, we don't show insight rules
|
|
85
|
+
// in future if we show the rules, we need to hide this button because
|
|
86
|
+
// we don't have session api for secure support users
|
|
84
87
|
React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "solved-my-issue-critical-solutions-modal" }, t('I solved my issue')),
|
|
85
88
|
React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
|
|
86
89
|
] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eA2XtD"}
|
|
@@ -50,6 +50,11 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
50
50
|
language: state.caseDetails.caseLanguage,
|
|
51
51
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
52
52
|
}), isEqual);
|
|
53
|
+
const versionsDetails = useCaseSelector((state) => {
|
|
54
|
+
if (isEmpty(state.versionsDetails.data))
|
|
55
|
+
return [];
|
|
56
|
+
return state.versionsDetails.data.map(({ name }) => name);
|
|
57
|
+
}, isEqual);
|
|
53
58
|
const caseDispatch = useCaseDispatch();
|
|
54
59
|
const isCaseCreate = RouteUtils.getQueryParams(props.routeProps).caseCreate === 'true';
|
|
55
60
|
const urlQueryParams = RouteUtils.getQueryParams(props.routeProps);
|
|
@@ -84,9 +89,13 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
84
89
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
85
90
|
}
|
|
86
91
|
else {
|
|
92
|
+
// Check if product information it self is having version list or fallback to version list from different source.
|
|
93
|
+
const productVersions = isEmpty(allProducts.data.productsResult[index].versions)
|
|
94
|
+
? versionsDetails
|
|
95
|
+
: allProducts.data.productsResult[index].versions;
|
|
87
96
|
// product in url is valid
|
|
88
|
-
const isVersionFromURLValid = !isEmpty(versionFromUrl) && includes(
|
|
89
|
-
const isMultiVersionProduct = !isOnlyVersion(
|
|
97
|
+
const isVersionFromURLValid = !isEmpty(versionFromUrl) && includes(productVersions, versionFromUrl);
|
|
98
|
+
const isMultiVersionProduct = !isOnlyVersion(productVersions);
|
|
90
99
|
if (isVersionFromURLValid || isMultiVersionProduct) {
|
|
91
100
|
// version is also valid
|
|
92
101
|
const versionToSet = isVersionFromURLValid ? versionFromUrl : undefined;
|
|
@@ -96,7 +105,7 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
96
105
|
}
|
|
97
106
|
else if (!isMultiVersionProduct) {
|
|
98
107
|
// no version or invalid version and there is only 1 version we set default version in url that will trigger the flow with valid version this time
|
|
99
|
-
const defaultVersion = getVersionIfOnlyVersion(
|
|
108
|
+
const defaultVersion = getVersionIfOnlyVersion(productVersions);
|
|
100
109
|
const newParams = { product: productFromUrl, version: defaultVersion };
|
|
101
110
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
102
111
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IEdmundAbbottBodyV2, IRule } from '@cee-eng/hydrajs/@types/api/pcm/edmundAbbott';
|
|
2
|
+
import { ISolrRecommendation } from '@cee-eng/hydrajs/@types/models/solr/solr';
|
|
2
3
|
import { IAction } from '@rh-support/types/shared';
|
|
3
4
|
export declare enum RulesReducerConstants {
|
|
4
5
|
CustomerPortalRuleVisibilityChanged = "CustomerPortalRuleVisibilityChanged",
|
|
@@ -10,11 +11,13 @@ export declare enum RulesReducerConstants {
|
|
|
10
11
|
triggerEARulesModalVisibiltyChange = "triggerEARulesModalVisibiltyChange",
|
|
11
12
|
resetEARules = "resetEARules",
|
|
12
13
|
setIsEARuleWidgetVisible = "setIsEARuleWidgetVisible",
|
|
13
|
-
EARuleMarkResolved = "EARuleMarkResolved"
|
|
14
|
+
EARuleMarkResolved = "EARuleMarkResolved",
|
|
15
|
+
setInsightRules = "setInsightRules"
|
|
14
16
|
}
|
|
15
17
|
export interface IAllRules {
|
|
16
18
|
customerPortalRules: IRules;
|
|
17
19
|
EARules: IRules;
|
|
20
|
+
insightRules: IRules;
|
|
18
21
|
isLoadingEdmundAbbottRules: boolean;
|
|
19
22
|
isLoadingEdmundAbbottRulesError: boolean;
|
|
20
23
|
triggerRuleNotification: boolean;
|
|
@@ -25,9 +28,12 @@ export interface IExtendedRule extends IRule {
|
|
|
25
28
|
isNew?: boolean;
|
|
26
29
|
resolved?: boolean;
|
|
27
30
|
}
|
|
31
|
+
export interface IExtendedSolrRecommendation extends ISolrRecommendation {
|
|
32
|
+
cta?: string;
|
|
33
|
+
}
|
|
28
34
|
export interface IRuleayloadType extends IAllRules {
|
|
29
|
-
rule: IExtendedRule;
|
|
30
|
-
rules: IExtendedRule[];
|
|
35
|
+
rule: IExtendedRule | IExtendedSolrRecommendation;
|
|
36
|
+
rules: IExtendedRule[] | IExtendedSolrRecommendation[];
|
|
31
37
|
}
|
|
32
38
|
declare type IActionType = IAction<RulesReducerConstants, IRuleayloadType>;
|
|
33
39
|
export declare type RulesDispatchType = (value: IActionType) => void;
|
|
@@ -44,5 +50,6 @@ export declare const resetEARules: (dispatch: RulesDispatchType) => void;
|
|
|
44
50
|
export declare const fetchEdmundAbbottRules: (dispatch: RulesDispatchType, body: Partial<IEdmundAbbottBodyV2>, onEARuleLoad?: (eaResponse: IRule[]) => void) => Promise<void>;
|
|
45
51
|
export declare const setIsEARuleWidgetVisible: (dispatch: RulesDispatchType, isEARuleWidgetVisible: boolean) => void;
|
|
46
52
|
export declare const markEARuleResolved: (dispatch: RulesDispatchType, rule: IRule) => void;
|
|
53
|
+
export declare const setInsightRules: (dispatch: RulesDispatchType, recResponse: IExtendedSolrRecommendation[]) => void;
|
|
47
54
|
export {};
|
|
48
55
|
//# sourceMappingURL=RulesReducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RulesReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAMnD,oBAAY,qBAAqB;IAC7B,mCAAmC,wCAAwC;IAC3E,uBAAuB,4BAA4B;IACnD,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,8BAA8B,mCAAmC;IACjE,uBAAuB,4BAA4B;IACnD,kCAAkC,uCAAuC;IACzE,YAAY,iBAAiB;IAC7B,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;
|
|
1
|
+
{"version":3,"file":"RulesReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RulesReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAMnD,oBAAY,qBAAqB;IAC7B,mCAAmC,wCAAwC;IAC3E,uBAAuB,4BAA4B;IACnD,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,8BAA8B,mCAAmC;IACjE,uBAAuB,4BAA4B;IACnD,kCAAkC,uCAAuC;IACzE,YAAY,iBAAiB;IAC7B,wBAAwB,6BAA6B;IACrD,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;CACtC;AAED,MAAM,WAAW,SAAS;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B,EAAE,OAAO,CAAC;IACpC,+BAA+B,EAAE,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,MAAM,kBAAkB,aAAc,iBAAiB,QAAQ,KAAK,SAE1E,CAAC;AACF,eAAO,MAAM,eAAe,aAAc,iBAAiB,eAAe,2BAA2B,EAAE,SAEtG,CAAC"}
|
|
@@ -23,15 +23,8 @@ export var RulesReducerConstants;
|
|
|
23
23
|
RulesReducerConstants["resetEARules"] = "resetEARules";
|
|
24
24
|
RulesReducerConstants["setIsEARuleWidgetVisible"] = "setIsEARuleWidgetVisible";
|
|
25
25
|
RulesReducerConstants["EARuleMarkResolved"] = "EARuleMarkResolved";
|
|
26
|
+
RulesReducerConstants["setInsightRules"] = "setInsightRules";
|
|
26
27
|
})(RulesReducerConstants || (RulesReducerConstants = {}));
|
|
27
|
-
// export interface IRule {
|
|
28
|
-
// rule_type?: string;
|
|
29
|
-
// rule_sub_type?: string;
|
|
30
|
-
// title?: string;
|
|
31
|
-
// cta?: string;
|
|
32
|
-
// description?: string;
|
|
33
|
-
// visible?: boolean;
|
|
34
|
-
// }
|
|
35
28
|
export const initialRulesState = {
|
|
36
29
|
customerPortalRules: {
|
|
37
30
|
sidebarSections: [AppRouteSections.PRODUCT_SELECTOR],
|
|
@@ -44,6 +37,10 @@ export const initialRulesState = {
|
|
|
44
37
|
},
|
|
45
38
|
],
|
|
46
39
|
},
|
|
40
|
+
insightRules: {
|
|
41
|
+
sidebarSections: [],
|
|
42
|
+
rules: [],
|
|
43
|
+
},
|
|
47
44
|
EARules: {
|
|
48
45
|
sidebarSections: [
|
|
49
46
|
AppRouteSections.RECOMMENDATIONS,
|
|
@@ -109,6 +106,9 @@ export const rulesReducer = (state, action) => {
|
|
|
109
106
|
const newRules = map(EARules, (rule) => rule.cta === action.payload.rule.cta ? Object.assign(Object.assign({}, rule), { resolved: true }) : rule);
|
|
110
107
|
return Object.assign(Object.assign({}, state), { EARules: Object.assign(Object.assign({}, state.EARules), { rules: newRules }) });
|
|
111
108
|
}
|
|
109
|
+
case RulesReducerConstants.setInsightRules: {
|
|
110
|
+
return Object.assign(Object.assign({}, state), { insightRules: Object.assign(Object.assign({}, state.insightRules), { rules: action.payload.rules }) });
|
|
111
|
+
}
|
|
112
112
|
default: {
|
|
113
113
|
return state;
|
|
114
114
|
}
|
|
@@ -147,3 +147,6 @@ export const setIsEARuleWidgetVisible = (dispatch, isEARuleWidgetVisible) => {
|
|
|
147
147
|
export const markEARuleResolved = (dispatch, rule) => {
|
|
148
148
|
dispatch({ type: RulesReducerConstants.EARuleMarkResolved, payload: { rule } });
|
|
149
149
|
};
|
|
150
|
+
export const setInsightRules = (dispatch, recResponse) => {
|
|
151
|
+
dispatch({ type: RulesReducerConstants.setInsightRules, payload: { rules: recResponse } });
|
|
152
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IRule } from '@cee-eng/hydrajs/@types/api/pcm/edmundAbbott';
|
|
2
1
|
import { ISession, ISessionDetails, ISessionItem, ISessionResource, SessionResourceSource as ISessionResourceSource, SessionResourceVisibility as ISessionResourceVisibility } from '@cee-eng/hydrajs/@types/api/pcm/troubleshootSession';
|
|
3
2
|
import { ICasePayload } from '@cee-eng/hydrajs/@types/api/public/case';
|
|
4
3
|
import { ISolrRecommendation } from '@cee-eng/hydrajs/@types/models/solr/solr';
|
|
@@ -63,11 +62,12 @@ export declare function createSessionResourcesLocal(dispatch: SessionReducerDisp
|
|
|
63
62
|
export declare function updateSessionResourcesLocal(dispatch: SessionReducerDispatchType, activeSessionId: string, currentSessionResourceTracking: ISessionResourcesTracking, source: ISessionResourceSource, resources: ISessionResource[]): Promise<void>;
|
|
64
63
|
export declare function getSessResFromTCCategories(tcCategories: ITopContentList[], visibilityStatus: ISessionResourceVisibility): ISessionResource[];
|
|
65
64
|
export declare const getSessResTCCategory: (tcCategory: ITopContentList, visibilityStatus: ISessionResourceVisibility) => ISessionResource[];
|
|
66
|
-
export declare const getSessResTC: (tc: ITopContent, visibilityStatus: ISessionResourceVisibility, resourceEntityId?:
|
|
65
|
+
export declare const getSessResTC: (tc: ITopContent, visibilityStatus: ISessionResourceVisibility, resourceEntityId?: number, rank?: number) => ISessionResource;
|
|
67
66
|
export declare function getSessResFromRecs(recs: ISolrRecommendation[], visibilityStatus: ISessionResourceVisibility): ISessionResource[];
|
|
68
67
|
export declare const getSessResFromRec: (rec: ISolrRecommendation, visibilityStatus: ISessionResourceVisibility, rank?: number) => ISessionResource;
|
|
69
|
-
export declare const
|
|
70
|
-
export declare const
|
|
68
|
+
export declare const getSessResFromRules: (url: string, visibilityStatus: ISessionResourceVisibility, resourceEntityId?: any, rank?: number) => ISessionResource;
|
|
69
|
+
export declare const getRulesToSave: (visiterUrl: any, visitedRec: any, allPresentedRec: any) => ISessionResource[];
|
|
70
|
+
export declare const getInsightRulesToSave: (visiterUrl: any, visitedRec: any, allPresentedRec: any) => ISessionResource[];
|
|
71
71
|
export declare const getSessResFromEA: (cta: string, visibilityStatus: ISessionResourceVisibility, resourceEntityId?: any) => ISessionResource;
|
|
72
72
|
export declare const getSessResFromClusterRecommendation: (cta: string, visibilityStatus: ISessionResourceVisibility, resourceEntityId?: any) => ISessionResource;
|
|
73
73
|
export declare const getRecToSave: (visitedRec: ISolrRecommendation, allPresentedRec: ISolrRecommendation[], allDocs?: ISolrRecommendation[]) => ISessionResource[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestoreReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/SessionRestoreReducer.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
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,0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C"}
|
|
@@ -336,25 +336,20 @@ export function updateSessionResourcesLocal(dispatch, activeSessionId, currentSe
|
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
-
// Session Resource Helper Functions
|
|
340
|
-
// Top Content Category Helper Function
|
|
341
339
|
export function getSessResFromTCCategories(tcCategories, visibilityStatus) {
|
|
342
340
|
const toReturn = [];
|
|
343
341
|
forEach(tcCategories, (tcCategory) => toReturn.push(...getSessResTCCategory(tcCategory, visibilityStatus)));
|
|
344
342
|
return toReturn;
|
|
345
343
|
}
|
|
346
|
-
// Top Content Helper Function Call
|
|
347
344
|
export const getSessResTCCategory = (tcCategory, visibilityStatus) => {
|
|
348
345
|
const toReturn = [];
|
|
349
346
|
forEach(tcCategory.content, (tc) => toReturn.push(getSessResTC(tc, visibilityStatus)));
|
|
350
347
|
return toReturn;
|
|
351
348
|
};
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return (Object.assign(Object.assign({ visibilityStatus }, ((tc === null || tc === void 0 ? void 0 : tc.topContentId) && { resourceEntityId: `${(_a = tc === null || tc === void 0 ? void 0 : tc.topContentId) !== null && _a !== void 0 ? _a : null}` })), { type: getResTypeFromUrl((_b = tc === null || tc === void 0 ? void 0 : tc.contentUrl) !== null && _b !== void 0 ? _b : ''), url: (_c = tc === null || tc === void 0 ? void 0 : tc.contentUrl) !== null && _c !== void 0 ? _c : '', rank: (_d = tc === null || tc === void 0 ? void 0 : tc.contentRank) !== null && _d !== void 0 ? _d : 0 }));
|
|
349
|
+
export const getSessResTC = (tc, visibilityStatus, resourceEntityId, rank) => {
|
|
350
|
+
var _a, _b, _c;
|
|
351
|
+
return (Object.assign(Object.assign({ visibilityStatus }, ((tc === null || tc === void 0 ? void 0 : tc.topContentId) && { resourceEntityId: `${(_a = tc === null || tc === void 0 ? void 0 : tc.topContentId) !== null && _a !== void 0 ? _a : null}` })), { type: getResTypeFromUrl((_b = tc === null || tc === void 0 ? void 0 : tc.contentUrl) !== null && _b !== void 0 ? _b : ''), url: (_c = tc === null || tc === void 0 ? void 0 : tc.contentUrl) !== null && _c !== void 0 ? _c : '', rank: rank || 0 }));
|
|
356
352
|
};
|
|
357
|
-
// Recommendations Helper Function Call
|
|
358
353
|
export function getSessResFromRecs(recs, visibilityStatus) {
|
|
359
354
|
const toReturn = [];
|
|
360
355
|
forEach(recs, (rec) => toReturn.push(getSessResFromRec(rec, visibilityStatus)));
|
|
@@ -362,13 +357,36 @@ export function getSessResFromRecs(recs, visibilityStatus) {
|
|
|
362
357
|
}
|
|
363
358
|
// Recommendations Helper Function
|
|
364
359
|
export const getSessResFromRec = (rec, visibilityStatus, rank) => (Object.assign(Object.assign({ visibilityStatus }, (rec.id && { resourceEntityId: rec.id })), { type: getResTypeFromUrl(rec.view_uri), url: rec.view_uri, rank }));
|
|
365
|
-
|
|
366
|
-
export const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
360
|
+
export const getSessResFromRules = (url, visibilityStatus, resourceEntityId, rank) => (Object.assign(Object.assign({ visibilityStatus }, (resourceEntityId && { resourceEntityId })), { type: getResTypeFromUrl(url), url: url, rank: rank || 0 }));
|
|
361
|
+
export const getRulesToSave = (visiterUrl, visitedRec, allPresentedRec) => {
|
|
362
|
+
return map(allPresentedRec, (rec, i) => {
|
|
363
|
+
let visStatus, url;
|
|
364
|
+
if (rec.rule_id === visitedRec.rule_id) {
|
|
365
|
+
url = visiterUrl;
|
|
366
|
+
visStatus = SessionResourceVisibility.VISITED;
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
visStatus = SessionResourceVisibility.PRESENTED;
|
|
370
|
+
url = null;
|
|
371
|
+
}
|
|
372
|
+
const rank = i + 1;
|
|
373
|
+
return getSessResFromRules(url, visStatus, rec.rule_id, rank);
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
export const getInsightRulesToSave = (visiterUrl, visitedRec, allPresentedRec) => {
|
|
377
|
+
return map(allPresentedRec, (rec, i) => {
|
|
378
|
+
let visStatus, url;
|
|
379
|
+
if (rec.id === visitedRec.id) {
|
|
380
|
+
url = visiterUrl;
|
|
381
|
+
visStatus = SessionResourceVisibility.VISITED;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
visStatus = SessionResourceVisibility.PRESENTED;
|
|
385
|
+
url = null;
|
|
386
|
+
}
|
|
387
|
+
const rank = i + 1;
|
|
388
|
+
return getSessResFromRules(url, visStatus, rec.id, rank);
|
|
389
|
+
});
|
|
372
390
|
};
|
|
373
391
|
// EARules Helper Function
|
|
374
392
|
export const getSessResFromEA = (cta, visibilityStatus, resourceEntityId) => (Object.assign(Object.assign({ visibilityStatus }, (resourceEntityId && { resourceEntityId })), { type: getResTypeFromUrl(`${window.location.origin}${cta}`), url: cta.startsWith('http') ? cta : `${window.location.origin}/${cta}` }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.83",
|
|
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.7.
|
|
29
|
+
"@cee-eng/hydrajs": "4.7.22",
|
|
30
30
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
31
31
|
"@patternfly/patternfly": "4.176.2",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-virtualized": "^9.21.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@cee-eng/hydrajs": "4.7.
|
|
66
|
+
"@cee-eng/hydrajs": "4.7.22",
|
|
67
67
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
68
68
|
"@patternfly/patternfly": "4.176.2",
|
|
69
69
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"@patternfly/react-core": "4.194.0",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
|
-
"@rh-support/api": "0.3.
|
|
77
|
-
"@rh-support/components": "1.1.
|
|
78
|
-
"@rh-support/react-context": "0.2.
|
|
76
|
+
"@rh-support/api": "0.3.13",
|
|
77
|
+
"@rh-support/components": "1.1.52",
|
|
78
|
+
"@rh-support/react-context": "0.2.52",
|
|
79
79
|
"@rh-support/types": "0.2.0",
|
|
80
|
-
"@rh-support/user-permissions": "0.2.
|
|
81
|
-
"@rh-support/utils": "0.2.
|
|
80
|
+
"@rh-support/user-permissions": "0.2.42",
|
|
81
|
+
"@rh-support/utils": "0.2.32",
|
|
82
82
|
"@types/react-redux": "^7.1.12",
|
|
83
83
|
"@types/redux": "^3.6.0",
|
|
84
84
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"not ie <= 11",
|
|
144
144
|
"not op_mini all"
|
|
145
145
|
],
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "3d97efe5cebb4e398f73d61326cad31e087aa63f"
|
|
147
147
|
}
|