@rh-support/troubleshoot 0.2.30 → 0.2.34
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/CaseDetailsErrorMessage.js +2 -2
- package/lib/esm/components/CaseEditView/CaseSecureSupportAlert.js +2 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +1 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +12 -2
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +4 -4
- package/lib/esm/components/ImproveCase/FileEARule.d.ts.map +1 -1
- package/lib/esm/components/ImproveCase/FileEARule.js +1 -8
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +3 -3
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts +0 -1
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +7 -22
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +5 -17
- package/lib/esm/components/shared/Rule.d.ts +0 -2
- package/lib/esm/components/shared/Rule.d.ts.map +1 -1
- package/lib/esm/components/shared/Rule.js +4 -12
- package/lib/esm/components/wizardLayout/WizardProgress.js +2 -2
- package/lib/esm/hooks/useParseRuleMarkdown.d.ts +6 -1
- package/lib/esm/hooks/useParseRuleMarkdown.d.ts.map +1 -1
- package/lib/esm/hooks/useParseRuleMarkdown.js +18 -9
- package/lib/esm/reducers/CaseConstNTypes.js +1 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +6 -4
- package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RulesReducer.js +5 -8
- package/package.json +11 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AlertMessage, AlertType, errorMessageTitle, formattedApiErrorMessage } from '@rh-support/components';
|
|
2
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import {
|
|
3
|
+
import { getSFDCSecureSupportCaseLink } from '@rh-support/utils';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
6
|
export function CaseDetailsErrorMessage(props) {
|
|
@@ -18,7 +18,7 @@ export function CaseDetailsErrorMessage(props) {
|
|
|
18
18
|
loggedInUserRights.data.isSecureSupportTech() &&
|
|
19
19
|
status === 403 &&
|
|
20
20
|
message.includes('Account cannot be accessed via this endpoint')) {
|
|
21
|
-
const shCaseLink =
|
|
21
|
+
const shCaseLink = getSFDCSecureSupportCaseLink(props.caseNumber);
|
|
22
22
|
errorMessage403 = (React.createElement(React.Fragment, null,
|
|
23
23
|
"Secured Support Technicians should use",
|
|
24
24
|
' ',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AlertMessage, AlertType } from '@rh-support/components';
|
|
2
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import {
|
|
3
|
+
import { getSFDCSecureSupportCaseLink } from '@rh-support/utils';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { Trans } from 'react-i18next';
|
|
6
6
|
export function CaseSecureSupportAlert(props) {
|
|
@@ -8,7 +8,7 @@ export function CaseSecureSupportAlert(props) {
|
|
|
8
8
|
const isSecureSupportTechViewingSecureCase = loggedInUserRights.data.isSecureSupportTech() && props.selectedAccountDetails.secureSupport;
|
|
9
9
|
const getWarningMsg = () => {
|
|
10
10
|
if (isSecureSupportTechViewingSecureCase) {
|
|
11
|
-
const shCaseLink =
|
|
11
|
+
const shCaseLink = getSFDCSecureSupportCaseLink(props.caseNumber);
|
|
12
12
|
return (React.createElement(React.Fragment, null,
|
|
13
13
|
"Secured Support Technicians should use",
|
|
14
14
|
' ',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseAttachment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAaxE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAQ5D,UAAU,MAAM;IACZ,UAAU,EAAE,WAAW,CAAC;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,KAAK,IAAI,CAAC;IACzE,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"CaseAttachment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAaxE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAQ5D,UAAU,MAAM;IACZ,UAAU,EAAE,WAAW,CAAC;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,KAAK,IAAI,CAAC;IACzE,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,cAAc,4EAgOlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -34,9 +34,7 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
34
34
|
const { request: updateDescriptionRequest, isFetching: isUpdating } = useFetch(kase.updateAttachment);
|
|
35
35
|
const canEditCase = useCanEditCase();
|
|
36
36
|
const onDescriptionSave = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
const updatedAttachment = yield updateDescriptionRequest(props.attachment.caseNumber, props.attachment.uuid, [
|
|
38
|
-
{ path: 'description', op: 'update', value: attachmentDescription },
|
|
39
|
-
]);
|
|
37
|
+
const updatedAttachment = yield updateDescriptionRequest(props.attachment.caseNumber, props.attachment.uuid, [{ path: 'description', op: 'update', value: attachmentDescription }], loggedInUsersAccount.data.secureSupport);
|
|
40
38
|
props.onMetadataUpdate && props.onMetadataUpdate(props.attachment.uuid, updatedAttachment);
|
|
41
39
|
});
|
|
42
40
|
const onDescriptionChange = (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA6BvE,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAM;IACZ,UAAU,EAA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AAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,YAAY,4EA8ShB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -157,16 +157,26 @@ const CaseComments = React.forwardRef((props, ref) => {
|
|
|
157
157
|
}
|
|
158
158
|
return text;
|
|
159
159
|
};
|
|
160
|
+
/* Purpose of this method is to break the default HTML Entity rendering on the UI when in plaintext mode.
|
|
161
|
+
This is achieved by directly swapping the '&' in any html entity to `&` in e.g. &euro swaps to &euro
|
|
162
|
+
so it is rendered -> &euro on the UI instead of '€' */
|
|
163
|
+
const HTMLEntityChecker = (comment) => {
|
|
164
|
+
if (comment.includes('&')) {
|
|
165
|
+
return comment.replace(/&/g, '&');
|
|
166
|
+
}
|
|
167
|
+
else
|
|
168
|
+
return comment;
|
|
169
|
+
};
|
|
160
170
|
const computeCommentText = (comment) => {
|
|
161
171
|
const parseComment = parseCommentHtml(comment.commentBody, comment.contentType);
|
|
162
172
|
if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.MARKDOWN) {
|
|
163
173
|
return (React.createElement("div", { className: "push-top-narrow comment-markdown-text", dangerouslySetInnerHTML: commentMarkdown(parseComment) }));
|
|
164
174
|
}
|
|
165
175
|
else if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.PLAIN) {
|
|
166
|
-
return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment) }));
|
|
176
|
+
return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(HTMLEntityChecker(parseComment)) }));
|
|
167
177
|
}
|
|
168
178
|
else {
|
|
169
|
-
return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(comment.commentBody) }));
|
|
179
|
+
return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(HTMLEntityChecker(comment.commentBody)) }));
|
|
170
180
|
}
|
|
171
181
|
};
|
|
172
182
|
if (!((_a = props.comment) === null || _a === void 0 ? void 0 : _a.isPublic) && !canSeePrivateComments)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAKvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAKvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAsBrE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,OAAO,CAAC;CACjC;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,eA4N9B;kBA5NQ,QAAQ;;;AA8NjB,eAAe,QAAQ,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { Popover, PopoverPosition, Tooltip, TooltipPosition } from '@patternfly/
|
|
|
2
2
|
import WarningTriangleIcon from '@patternfly/react-icons/dist/js/icons/warning-triangle-icon';
|
|
3
3
|
import { Dropdown, ValueChangedIcon } from '@rh-support/components';
|
|
4
4
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
5
|
-
import { autoEnableFtsOnCaseViewEditPage, showFtsOnCreateCasePage, toOption, toOptions } from '@rh-support/utils';
|
|
5
|
+
import { autoEnableFtsOnCaseViewEditPage, severitySort, showFtsOnCreateCasePage, toOption, toOptions, } from '@rh-support/utils';
|
|
6
|
+
import { findLast } from 'lodash';
|
|
6
7
|
import find from 'lodash/find';
|
|
7
|
-
import findLast from 'lodash/findLast';
|
|
8
8
|
import includes from 'lodash/includes';
|
|
9
9
|
import isEmpty from 'lodash/isEmpty';
|
|
10
10
|
import isEqual from 'lodash/isEqual';
|
|
@@ -23,7 +23,7 @@ const defaultProps = {
|
|
|
23
23
|
};
|
|
24
24
|
function Severity(props) {
|
|
25
25
|
const { t } = useTranslation();
|
|
26
|
-
const { product, version, caseNumber, severity, entitlementSla, ownersEntitlements, versionsDetails
|
|
26
|
+
const { product, version, caseNumber, severity, entitlementSla, ownersEntitlements, versionsDetails } = useCaseSelector((state) => ({
|
|
27
27
|
product: state.caseDetails.product,
|
|
28
28
|
version: state.caseDetails.version,
|
|
29
29
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -128,7 +128,7 @@ function Severity(props) {
|
|
|
128
128
|
// we have no limit, we show all severity options
|
|
129
129
|
availableSeverities = (_c = allCaseSeverities.data) !== null && _c !== void 0 ? _c : [];
|
|
130
130
|
}
|
|
131
|
-
setSeveritiesOptions(availableSeverities);
|
|
131
|
+
setSeveritiesOptions(availableSeverities.sort((sevA, sevB) => severitySort(sevA, sevB)));
|
|
132
132
|
const shouldUpdateSeverityOnCaseCreate = !caseNumber && (!severity || !includes(availableSeverities, severity));
|
|
133
133
|
if (shouldUpdateSeverityOnCaseCreate) {
|
|
134
134
|
updateState(availableSeverities[0]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileEARule.d.ts","sourceRoot":"","sources":["../../../../src/components/ImproveCase/FileEARule.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileEARule.d.ts","sourceRoot":"","sources":["../../../../src/components/ImproveCase/FileEARule.tsx"],"names":[],"mappings":"AAOA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,uBAAuB,CAAC,KAAK,KAAA,SAE5C;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,eAc/C"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import { pcm } from '@cee-eng/hydrajs';
|
|
2
1
|
import filter from 'lodash/filter';
|
|
3
2
|
import map from 'lodash/map';
|
|
4
3
|
import React, { useContext } from 'react';
|
|
5
4
|
import { RulesStateContext } from '../../context/RulesContext';
|
|
6
|
-
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
7
5
|
import Rule from '../shared/Rule';
|
|
8
|
-
const { SessionResourceSource } = pcm.preCase.session;
|
|
9
6
|
export function getValidAttachmentRules(rules) {
|
|
10
7
|
return filter(rules, (r) => r.visible && r.rule_type === 'enrichment' && r.rule_sub_type === 'attachment');
|
|
11
8
|
}
|
|
12
9
|
export default function FileEARule(props) {
|
|
13
10
|
const { rulesState } = useContext(RulesStateContext);
|
|
14
|
-
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
15
11
|
const validAttachmentRules = getValidAttachmentRules(rulesState.EARules.rules);
|
|
16
12
|
const canShowFileEARule = validAttachmentRules.length > 0;
|
|
17
13
|
return (React.createElement(React.Fragment, null, canShowFileEARule &&
|
|
18
|
-
map(validAttachmentRules, (rule) => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
return (React.createElement(Rule, { description: rule.description, title: rule.title, link: rule.cta, key: rule.cta, seSessionId: activeSessionId, seResourceOriginID: (_b = (_a = sessionResourceTracking[SessionResourceSource.EDMOUND_ABOTT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '' }));
|
|
21
|
-
})));
|
|
14
|
+
map(validAttachmentRules, (rule) => (React.createElement(Rule, { description: rule.description, title: rule.title, link: rule.cta, key: rule.cta })))));
|
|
22
15
|
}
|
|
@@ -16,7 +16,7 @@ export function ClusterRecommendationItems(props) {
|
|
|
16
16
|
version: state.caseDetails.version,
|
|
17
17
|
product: state.caseDetails.product,
|
|
18
18
|
}), isEqual);
|
|
19
|
-
const {
|
|
19
|
+
const { parseDotMarkdownWithTracking } = useParseRuleMarkdown();
|
|
20
20
|
const onResourceClick = (e, rule) => {
|
|
21
21
|
if (e.target.tagName.toLowerCase() === 'a') {
|
|
22
22
|
const url = e.target.href.split('?')[0];
|
|
@@ -33,8 +33,8 @@ export function ClusterRecommendationItems(props) {
|
|
|
33
33
|
React.createElement("p", null, rule.details || ''),
|
|
34
34
|
rule.reason && (React.createElement(React.Fragment, null,
|
|
35
35
|
React.createElement("h3", { className: "subheading subheading-sm" }, "Reason: "),
|
|
36
|
-
React.createElement("p", { onClick: (e) => onResourceClick(e, rule), dangerouslySetInnerHTML:
|
|
36
|
+
React.createElement("p", { onClick: (e) => onResourceClick(e, rule), dangerouslySetInnerHTML: parseDotMarkdownWithTracking(rule.reason, rule.extra_data, SessionResourceSource.CLUSTER_RECOMMENDATION, 'ts-cluster-recommendation', 'se-cluster-recommendation-rule') }))),
|
|
37
37
|
rule.resolution && (React.createElement(React.Fragment, null,
|
|
38
38
|
React.createElement("h3", { className: "subheading subheading-sm" }, "Resolution: "),
|
|
39
|
-
React.createElement("p", { onClick: (e) => onResourceClick(e, rule), dangerouslySetInnerHTML:
|
|
39
|
+
React.createElement("p", { onClick: (e) => onResourceClick(e, rule), dangerouslySetInnerHTML: parseDotMarkdownWithTracking(rule.resolution, rule.extra_data, SessionResourceSource.CLUSTER_RECOMMENDATION, 'ts-cluster-recommendation', 'se-cluster-recommendation-rule') })))))))));
|
|
40
40
|
}
|
|
@@ -3,7 +3,6 @@ import { IExtendedRule } from '../../../reducers/RulesReducer';
|
|
|
3
3
|
interface IEARuleContext {
|
|
4
4
|
rule: IExtendedRule;
|
|
5
5
|
onCtaClick: (link: string) => (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
|
6
|
-
getLinkWithParams: (link: string) => string;
|
|
7
6
|
}
|
|
8
7
|
export declare const EARuleContext: React.Context<IEARuleContext>;
|
|
9
8
|
export declare function useEARuleContext(): IEARuleContext;
|
|
@@ -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":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,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,eAyBxC;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,eAgBnH;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
|
-
import { markdownToHTML } from '@cee-eng/ui-toolkit';
|
|
3
2
|
import React, { useContext } from 'react';
|
|
4
3
|
import { Trans } from 'react-i18next';
|
|
5
4
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../../context/SessionRestoreContext';
|
|
5
|
+
import { useParseRuleMarkdown } from '../../../hooks/useParseRuleMarkdown';
|
|
6
6
|
import { createOrUpdateSessionResources, getSessResFromEA } from '../../../reducers/SessionRestoreReducer';
|
|
7
|
-
import RouteUtils from '../../../utils/routeUtils';
|
|
8
7
|
const { SessionResourceVisibility, SessionResourceSource } = pcm.preCase.session;
|
|
9
8
|
export const EARuleContext = React.createContext({
|
|
10
9
|
rule: {},
|
|
11
10
|
onCtaClick: null,
|
|
12
|
-
getLinkWithParams: null,
|
|
13
11
|
});
|
|
14
12
|
export function useEARuleContext() {
|
|
15
13
|
const context = React.useContext(EARuleContext);
|
|
@@ -24,16 +22,9 @@ export function EARule({ children, rule }) {
|
|
|
24
22
|
const onCtaClick = (link) => (event) => {
|
|
25
23
|
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [getSessResFromEA(link, SessionResourceVisibility.VISITED, rule.rule_id)]);
|
|
26
24
|
};
|
|
27
|
-
const getLinkWithParams = (link) => {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
return link.includes('redhat.com/solutions') || link.includes('redhat.com/articles')
|
|
30
|
-
? `${link}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[SessionResourceSource.EDMOUND_ABOTT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.EDMOUND_ABOTT)}`
|
|
31
|
-
: link;
|
|
32
|
-
};
|
|
33
25
|
return (React.createElement(EARuleContext.Provider, { value: {
|
|
34
26
|
rule,
|
|
35
27
|
onCtaClick,
|
|
36
|
-
getLinkWithParams,
|
|
37
28
|
} }, children));
|
|
38
29
|
}
|
|
39
30
|
function EARuleTitle() {
|
|
@@ -43,28 +34,22 @@ function EARuleTitle() {
|
|
|
43
34
|
rule.title);
|
|
44
35
|
}
|
|
45
36
|
function EARuleDescription() {
|
|
46
|
-
const { rule, onCtaClick
|
|
37
|
+
const { rule, onCtaClick } = useEARuleContext();
|
|
38
|
+
const { parseMarkdownWithTracking } = useParseRuleMarkdown();
|
|
47
39
|
const onDescriptionClick = (ev) => {
|
|
48
40
|
const target = ev.target;
|
|
49
41
|
if (target.tagName.toLowerCase() === 'a') {
|
|
50
42
|
onCtaClick(target.href.split('?')[0])(ev);
|
|
51
43
|
}
|
|
52
44
|
};
|
|
53
|
-
|
|
54
|
-
const anchorHrefRegex = /href="(.*?)"/g;
|
|
55
|
-
return {
|
|
56
|
-
__html: markdownToHTML(markdown, { openLinksInNewTab: true })
|
|
57
|
-
.replace(anchorHrefRegex, `href="${getLinkWithParams('$1')}"`)
|
|
58
|
-
.replace('<a target="blank"', '<a target="blank" class="se-recommended ts-known-vuln" data-tracking-id="se-recommended-asa-rule"'),
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
return (React.createElement("div", { className: "ea-rule", onClick: onDescriptionClick, dangerouslySetInnerHTML: parseMarkdown(rule.description) }));
|
|
45
|
+
return (React.createElement("div", { className: "ea-rule", onClick: onDescriptionClick, dangerouslySetInnerHTML: parseMarkdownWithTracking(rule.description, SessionResourceSource.EDMOUND_ABOTT, 'ts-known-vuln', 'se-recommended-asa-rule') }));
|
|
62
46
|
}
|
|
63
47
|
function EARuleArticle({ linkTitle = 'Related Article', className = '' }) {
|
|
64
|
-
const { rule, onCtaClick
|
|
48
|
+
const { rule, onCtaClick } = useEARuleContext();
|
|
49
|
+
const { getTrackingULRWithQueryParams } = useParseRuleMarkdown();
|
|
65
50
|
if (!rule.cta)
|
|
66
51
|
return null;
|
|
67
|
-
return (React.createElement("a", { className: `se-recommended ts-known-vuln ${className}`, rel: "noopener noreferrer", target: "_blank", "data-tracking-id": "se-recommended-asa-rule", onClick: onCtaClick(rule.cta), href:
|
|
52
|
+
return (React.createElement("a", { className: `se-recommended ts-known-vuln ${className}`, rel: "noopener noreferrer", target: "_blank", "data-tracking-id": "se-recommended-asa-rule", onClick: onCtaClick(rule.cta), href: getTrackingULRWithQueryParams(rule.cta, SessionResourceSource.EDMOUND_ABOTT) },
|
|
68
53
|
React.createElement(Trans, null, linkTitle)));
|
|
69
54
|
}
|
|
70
55
|
export { EARuleTitle, EARuleDescription, EARuleArticle };
|
|
@@ -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":"AAaA,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,eAuJ1E"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
|
-
import { markdownToHTML } from '@cee-eng/ui-toolkit';
|
|
3
2
|
import { Accordion, AccordionContent, AccordionItem, AccordionToggle, Label, LabelGroup } from '@patternfly/react-core';
|
|
4
3
|
import BullseyeIcon from '@patternfly/react-icons/dist/js/icons/bullseye-icon';
|
|
5
4
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
6
|
-
import { getRuleReasonHtml
|
|
5
|
+
import { getRuleReasonHtml } from '@rh-support/utils';
|
|
7
6
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
8
7
|
import { Trans } from 'react-i18next';
|
|
9
8
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
9
|
+
import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
|
|
10
10
|
import { createOrUpdateSessionResources, getSessResFromInsights } from '../../reducers/SessionRestoreReducer';
|
|
11
|
-
import RouteUtils from '../../utils/routeUtils';
|
|
12
11
|
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
13
12
|
const { SessionResourceVisibility, SessionResourceSource } = pcm.preCase.session;
|
|
14
13
|
export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
@@ -20,6 +19,7 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
|
20
19
|
const [isAdditionalExpanded, setIsAdditionalExpanded] = useState(false);
|
|
21
20
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
22
21
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
22
|
+
const { parseDotMarkdownWithTracking, getTrackingULRWithQueryParams } = useParseRuleMarkdown();
|
|
23
23
|
const { attachmentState: { caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
const { analysisMetadata, name } = selectedLocalFiles.find((file) => file.attachmentId === doc.attachmentId);
|
|
@@ -37,20 +37,8 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
|
37
37
|
const onCtaClick = (link) => (event) => {
|
|
38
38
|
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, [getSessResFromInsights(link, SessionResourceVisibility.VISITED, ruleData.rule_id)]);
|
|
39
39
|
};
|
|
40
|
-
const getTrackingQueryParams = () => {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
return RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[SessionResourceSource.INSIGHTS]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.INSIGHTS);
|
|
43
|
-
};
|
|
44
40
|
const parseMoreInfo = (moreInfo, reportDetails) => {
|
|
45
|
-
|
|
46
|
-
const anchorHrefRegex = /href="(.*?)"/g;
|
|
47
|
-
return {
|
|
48
|
-
__html: markdownToHTML(markdown, {
|
|
49
|
-
openLinksInNewTab: true,
|
|
50
|
-
})
|
|
51
|
-
.replace(anchorHrefRegex, `href="$1?${getTrackingQueryParams()}"`)
|
|
52
|
-
.replace('<a target="blank"', '<a target="blank" class="se-recommended ts-result-insights" data-tracking-id="se-recommended-insights-rule"'),
|
|
53
|
-
};
|
|
41
|
+
return parseDotMarkdownWithTracking(moreInfo, reportDetails, SessionResourceSource.INSIGHTS, 'ts-result-insights', 'se-recommended-insights-rule');
|
|
54
42
|
};
|
|
55
43
|
const onAdditionalInfoElemClick = (ev) => {
|
|
56
44
|
const target = ev.target;
|
|
@@ -86,6 +74,6 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
|
|
|
86
74
|
React.createElement(Trans, null, "Additional info")),
|
|
87
75
|
React.createElement(AccordionContent, { isHidden: !isAdditionalExpanded },
|
|
88
76
|
React.createElement("p", { onClick: onAdditionalInfoElemClick, dangerouslySetInnerHTML: parseMoreInfo(ruleData === null || ruleData === void 0 ? void 0 : ruleData.more_info, (_g = insightsReport === null || insightsReport === void 0 ? void 0 : insightsReport.current) === null || _g === void 0 ? void 0 : _g.details) }))))),
|
|
89
|
-
React.createElement("a", { className: "se-recommended ts-result-insights cta-link", rel: "noopener noreferrer", target: "_blank", onClick: onCtaClick(doc.view_uri), "data-tracking-id": "se-recommended-insights-rule", href:
|
|
77
|
+
React.createElement("a", { className: "se-recommended ts-result-insights cta-link", rel: "noopener noreferrer", target: "_blank", onClick: onCtaClick(doc.view_uri), "data-tracking-id": "se-recommended-insights-rule", href: getTrackingULRWithQueryParams(doc.view_uri, SessionResourceSource.INSIGHTS) },
|
|
90
78
|
React.createElement(Trans, null, "Related article")))))));
|
|
91
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Rule.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Rule.tsx"],"names":[],"mappings":"AAQA,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eA2CzC"}
|
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
|
-
import { markdownToHTML } from '@cee-eng/ui-toolkit';
|
|
3
2
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
4
3
|
import isEmpty from 'lodash/isEmpty';
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import
|
|
5
|
+
import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
|
|
7
6
|
const { SessionResourceSource } = pcm.preCase.session;
|
|
8
7
|
export default function Rule(props) {
|
|
8
|
+
const { getTrackingULRWithQueryParams, parseMarkdown } = useParseRuleMarkdown();
|
|
9
9
|
const hide = () => {
|
|
10
10
|
var _a;
|
|
11
11
|
(_a = props.onHide) === null || _a === void 0 ? void 0 : _a.call(props, true);
|
|
12
12
|
};
|
|
13
|
-
const parseMarkdown = (markdown) => {
|
|
14
|
-
return { __html: markdownToHTML(markdown, { openLinksInNewTab: true }) };
|
|
15
|
-
};
|
|
16
|
-
const getLinkWithParams = (link) => {
|
|
17
|
-
return link.includes('redhat.com/solutions') || link.includes('redhat.com/articles')
|
|
18
|
-
? `${link}?${RouteUtils.getSEResourceQueryParams(props.seSessionId, props.seResourceOriginID, SessionResourceSource.EDMOUND_ABOTT)}`
|
|
19
|
-
: link;
|
|
20
|
-
};
|
|
21
13
|
const onCtaClick = (event) => {
|
|
22
14
|
props.onLinkClick && props.onLinkClick(props.link);
|
|
23
15
|
};
|
|
24
16
|
return (React.createElement("div", { className: "pf-c-alert ea-rule-alert", role: "alert" },
|
|
25
17
|
React.createElement("span", { className: "pf-c-alert__icon icon-info-circle", "aria-hidden": true }),
|
|
26
|
-
React.createElement("h3", { className: "pf-c-alert__title" }, !isEmpty(props.link) ? (React.createElement("a", { href:
|
|
27
|
-
React.createElement("div", { className: "pf-c-alert__description", dangerouslySetInnerHTML: parseMarkdown(props.description) }),
|
|
18
|
+
React.createElement("h3", { className: "pf-c-alert__title" }, !isEmpty(props.link) ? (React.createElement("a", { href: getTrackingULRWithQueryParams(props.link, SessionResourceSource.EDMOUND_ABOTT), target: "_blank", rel: "noopener noreferrer", className: "se-recommended ts-known-vuln", "data-tracking-id": "se-recommended-asa-rule", onClick: onCtaClick }, props.title)) : (props.title)),
|
|
19
|
+
React.createElement("div", { className: "pf-c-alert__description", dangerouslySetInnerHTML: { __html: parseMarkdown(props.description) } }),
|
|
28
20
|
props.onHide && (React.createElement("div", { className: "pf-c-alert__action" },
|
|
29
21
|
React.createElement("button", { className: "pf-c-button pf-m-plain", type: "button", "aria-label": "Close", onClick: hide },
|
|
30
22
|
React.createElement(TimesIcon, { "aria-hidden": "true" }))))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from '@patternfly/react-core';
|
|
2
2
|
import ArrowLeftIcon from '@patternfly/react-icons/dist/js/icons/arrow-left-icon';
|
|
3
3
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
4
|
-
import { getFieldInParts } from '@rh-support/utils';
|
|
4
|
+
import { getFieldInParts, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
|
|
5
5
|
import difference from 'lodash/difference';
|
|
6
6
|
import map from 'lodash/map';
|
|
7
7
|
import React, { useContext } from 'react';
|
|
@@ -63,7 +63,7 @@ function WizardProgress(props) {
|
|
|
63
63
|
const backToApp = () => {
|
|
64
64
|
window.location.href = document.referrer;
|
|
65
65
|
};
|
|
66
|
-
const appNames = (_a = getFieldInParts(pcmConfig.data, 'referrer_app_names',
|
|
66
|
+
const appNames = (_a = getFieldInParts(pcmConfig.data, 'referrer_app_names', PCM_CONFIG_FIELD_TYPE.JSON_HASHMAP)) !== null && _a !== void 0 ? _a : {};
|
|
67
67
|
return (React.createElement("div", { className: appRouteConfugurations[activeSection].disableOtherSections
|
|
68
68
|
? 'section-disabled grid-progress'
|
|
69
69
|
: 'grid-progress' },
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { SessionResourceSource } from '@cee-eng/hydrajs/@types/api/pcm/troubleshootSession';
|
|
2
2
|
export declare const useParseRuleMarkdown: () => {
|
|
3
|
-
|
|
3
|
+
parseDotMarkdownWithTracking: (dotString: string, reportDetails: any, source: SessionResourceSource, trackingClassName: string, trackingId: string) => {
|
|
4
4
|
__html: string;
|
|
5
5
|
};
|
|
6
|
+
parseMarkdown: (markdown: string) => string;
|
|
7
|
+
parseMarkdownWithTracking: (markdown: string, source: SessionResourceSource, trackingClassName: string, trackingId: string) => {
|
|
8
|
+
__html: string;
|
|
9
|
+
};
|
|
10
|
+
getTrackingULRWithQueryParams: (link: string, source: SessionResourceSource) => string;
|
|
6
11
|
};
|
|
7
12
|
//# sourceMappingURL=useParseRuleMarkdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useParseRuleMarkdown.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParseRuleMarkdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAQ5F,eAAO,MAAM,oBAAoB;
|
|
1
|
+
{"version":3,"file":"useParseRuleMarkdown.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParseRuleMarkdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAQ5F,eAAO,MAAM,oBAAoB;8CAgBd,MAAM,8BAET,qBAAqB,qBACV,MAAM,cACb,MAAM;;;8BAMW,MAAM;0CAOzB,MAAM,UACR,qBAAqB,qBACV,MAAM,cACb,MAAM;;;0CA/BuB,MAAM,UAAU,qBAAqB;CA6CrF,CAAC"}
|
|
@@ -5,20 +5,29 @@ import { SessionRestoreStateContext } from '../context/SessionRestoreContext';
|
|
|
5
5
|
import RouteUtils from '../utils/routeUtils';
|
|
6
6
|
export const useParseRuleMarkdown = () => {
|
|
7
7
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
8
|
-
const
|
|
8
|
+
const getTrackingULRWithQueryParams = (link, source) => {
|
|
9
9
|
var _a, _b;
|
|
10
|
-
|
|
10
|
+
if (!link.includes('redhat.com/solutions') && !link.includes('redhat.com/articles'))
|
|
11
|
+
return link;
|
|
12
|
+
return `${link}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[source]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', source, 'se')}`;
|
|
11
13
|
};
|
|
12
|
-
function
|
|
14
|
+
function parseDotMarkdownWithTracking(dotString, reportDetails, source, trackingClassName, trackingId) {
|
|
13
15
|
const markdown = parseDotTemplate(dotString, reportDetails);
|
|
16
|
+
return parseMarkdownWithTracking(markdown, source, trackingClassName, trackingId);
|
|
17
|
+
}
|
|
18
|
+
function parseMarkdown(markdown) {
|
|
19
|
+
return markdownToHTML(markdown, {
|
|
20
|
+
openLinksInNewTab: true,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function parseMarkdownWithTracking(markdown, source, trackingClassName, trackingId) {
|
|
14
24
|
const anchorHrefRegex = /href="(.*?)"/g;
|
|
25
|
+
const targetBlankRegex = new RegExp(`target="blank"`, 'g');
|
|
15
26
|
return {
|
|
16
|
-
__html:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.replace(anchorHrefRegex, `href="$1?${getTrackingQueryParams(source)}"`)
|
|
20
|
-
.replace('target="blank"', `target="blank" class="se-recommended ts-${trackingClassName} data-tracking-id="se-${trackingId}-rule"`),
|
|
27
|
+
__html: parseMarkdown(markdown)
|
|
28
|
+
.replace(anchorHrefRegex, `href="${getTrackingULRWithQueryParams('$1', source)}"`)
|
|
29
|
+
.replace(targetBlankRegex, `target="blank" class="se-recommended ${trackingClassName}" data-tracking-id="${trackingId}"`),
|
|
21
30
|
};
|
|
22
31
|
}
|
|
23
|
-
return {
|
|
32
|
+
return { parseDotMarkdownWithTracking, parseMarkdown, parseMarkdownWithTracking, getTrackingULRWithQueryParams };
|
|
24
33
|
};
|
|
@@ -171,7 +171,7 @@ export const initialCaseState = {
|
|
|
171
171
|
hasErrorSelectedNotificationContacts: false,
|
|
172
172
|
isFetchingSelectedNotificationContacts: true,
|
|
173
173
|
versionsDetails: getApiResourceObject([]),
|
|
174
|
-
v3ClusterName:
|
|
174
|
+
v3ClusterName: '',
|
|
175
175
|
};
|
|
176
176
|
export const ORG_ADMIN_SEND_NOTIFCATION_KBASE_LINK = 'https://access.redhat.com/articles/5967811';
|
|
177
177
|
export const NON_ORG_ADMIN_SEND_NOTIFCATION_KBASE_LINK = 'https://access.redhat.com/articles/5967831';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAW3D,OAAO,EAMH,UAAU,EAcb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,WAAW,KAAG,MAOrE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,mBAAmB,SAAS,MAAM,sBAyB9E,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAW3D,OAAO,EAMH,UAAU,EAcb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,M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F,CAAC"}
|
|
@@ -45,6 +45,7 @@ export const getRecommendationObject = (doc, index) => {
|
|
|
45
45
|
}
|
|
46
46
|
return rec;
|
|
47
47
|
};
|
|
48
|
+
// Responsible for the order of the questions in which they appear on case details
|
|
48
49
|
export const getUpdatedDescription = (issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName) => {
|
|
49
50
|
let description = issue;
|
|
50
51
|
if (!isEmpty(environment) ||
|
|
@@ -52,6 +53,9 @@ export const getUpdatedDescription = (issue, environment, periodicityOfIssue, ti
|
|
|
52
53
|
!isEmpty(timeFramesAndUrgency) ||
|
|
53
54
|
!isEmpty(v3ClusterName)) {
|
|
54
55
|
description = `${KtQuestionConstant.issue}\n${issue}`;
|
|
56
|
+
description += !isEmpty(timeFramesAndUrgency)
|
|
57
|
+
? `\n\n${KtQuestionConstant.timeFramesAndUrgency}\n${timeFramesAndUrgency}`
|
|
58
|
+
: '';
|
|
55
59
|
description +=
|
|
56
60
|
!isEmpty(environment) || !isEmpty(v3ClusterName)
|
|
57
61
|
? `\n\n${KtQuestionConstant.environment}\n${v3ClusterName ? `OpenShift Cluster Name: ${v3ClusterName} \n` : ''}${environment}`
|
|
@@ -59,18 +63,16 @@ export const getUpdatedDescription = (issue, environment, periodicityOfIssue, ti
|
|
|
59
63
|
description += !isEmpty(periodicityOfIssue)
|
|
60
64
|
? `\n\n${KtQuestionConstant.periodicityOfIssue}\n${periodicityOfIssue}`
|
|
61
65
|
: '';
|
|
62
|
-
description += !isEmpty(timeFramesAndUrgency)
|
|
63
|
-
? `\n\n${KtQuestionConstant.timeFramesAndUrgency}\n${timeFramesAndUrgency}`
|
|
64
|
-
: '';
|
|
65
66
|
}
|
|
66
67
|
return description;
|
|
67
68
|
};
|
|
69
|
+
// Gets the descriptions without questions
|
|
68
70
|
export const getDescriptionWOQues = (issue, environment, periodicityOfIssue, timeFramesAndUrgency) => {
|
|
69
71
|
let description = issue;
|
|
70
72
|
if (!isEmpty(environment) || !isEmpty(periodicityOfIssue) || !isEmpty(timeFramesAndUrgency)) {
|
|
73
|
+
description += !isEmpty(timeFramesAndUrgency) ? ` ${timeFramesAndUrgency}` : '';
|
|
71
74
|
description += !isEmpty(environment) ? ` ${environment}` : '';
|
|
72
75
|
description += !isEmpty(periodicityOfIssue) ? ` ${periodicityOfIssue}` : '';
|
|
73
|
-
description += !isEmpty(timeFramesAndUrgency) ? ` ${timeFramesAndUrgency}` : '';
|
|
74
76
|
}
|
|
75
77
|
return description;
|
|
76
78
|
};
|
|
@@ -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;CAC5C;AAED,MAAM,WAAW,SAAS;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B,EAAE,OAAO,CAAC;IACpC,+BAA+B,EAAE,OAAO,CAAC;IAEzC,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,aAAc,SAAQ,KAAK;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAC9C,IAAI,EAAE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AAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAC9C,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,aAAa,EAAE,CAAC;CAC1B;AACD,aAAK,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;AACnE,oBAAY,iBAAiB,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAE7D,MAAM,WAAW,MAAM;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;CAC3B;AAWD,eAAO,MAAM,iBAAiB,EAAE,SA0B/B,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,SAAS,0BAAwB,SAuEpE,CAAC;AAGF,eAAO,MAAM,sCAAsC,aAAc,iBAAiB,QAAQ,KAAK,SAE9F,CAAC;AACF,eAAO,MAAM,0BAA0B,aAAc,iBAAiB,QAAQ,KAAK,SAElF,CAAC;AACF,eAAO,MAAM,YAAY,aAAc,iBAAiB,SAEvD,CAAC;AACF,eAAO,MAAM,sBAAsB,aACrB,iBAAiB,QACrB,QAAQ,mBAAmB,CAAC,8BACN,KAAK,EAAE,KAAK,IAAI,kBAa/C,CAAC;AAEF,eAAO,MAAM,wBAAwB,aAAc,iBAAiB,yBAAyB,OAAO,SAKnG,CAAC;AACF,eAAO,MAAM,kBAAkB,aAAc,iBAAiB,QAAQ,KAAK,SAE1E,CAAC"}
|
|
@@ -76,20 +76,17 @@ export const rulesReducer = (state, action) => {
|
|
|
76
76
|
return Object.assign(Object.assign({}, state), { isLoadingEdmundAbbottRules: true, isLoadingEdmundAbbottRulesError: false });
|
|
77
77
|
}
|
|
78
78
|
case RulesReducerConstants.receivedEdmundAbbottRules: {
|
|
79
|
-
const difference = differenceBy((_a = action.payload) === null || _a === void 0 ? void 0 : _a.rules, (_b = state.EARules) === null || _b === void 0 ? void 0 : _b.rules, '
|
|
79
|
+
const difference = differenceBy((_a = action.payload) === null || _a === void 0 ? void 0 : _a.rules, (_b = state.EARules) === null || _b === void 0 ? void 0 : _b.rules, 'rule_id');
|
|
80
80
|
const prevRuleTitleInfoMap = ((_c = state.EARules) === null || _c === void 0 ? void 0 : _c.rules.reduce((acc, rule) => {
|
|
81
|
-
acc[rule.
|
|
81
|
+
acc[rule.rule_id] = rule;
|
|
82
82
|
return acc;
|
|
83
83
|
}, {})) || {};
|
|
84
84
|
// if user ignored a rule first and new rules contain the same rule, we need to ignore it again
|
|
85
85
|
const newRules = map(action.payload.rules, (rule) => {
|
|
86
|
-
const prevInfo = prevRuleTitleInfoMap[rule.
|
|
87
|
-
return Object.assign(Object.assign({},
|
|
86
|
+
const prevInfo = prevRuleTitleInfoMap[rule.rule_id];
|
|
87
|
+
return Object.assign(Object.assign({}, prevInfo), rule);
|
|
88
88
|
});
|
|
89
|
-
|
|
90
|
-
return Object.assign(Object.assign({}, state), { EARules: Object.assign(Object.assign({}, state.EARules), { rules: newRules }), isLoadingEdmundAbbottRules: false, isLoadingEdmundAbbottRulesError: false, isEARuleWidgetVisible: true });
|
|
91
|
-
}
|
|
92
|
-
return Object.assign(Object.assign({}, state), { EARules: Object.assign(Object.assign({}, state.EARules), { rules: newRules }), isLoadingEdmundAbbottRules: false, isLoadingEdmundAbbottRulesError: false });
|
|
89
|
+
return Object.assign(Object.assign({}, state), { EARules: Object.assign(Object.assign({}, state.EARules), { rules: newRules }), isLoadingEdmundAbbottRules: false, isLoadingEdmundAbbottRulesError: false, isEARuleWidgetVisible: difference.length > 0 ? true : state.isEARuleWidgetVisible });
|
|
93
90
|
}
|
|
94
91
|
// resetEARules is mainly used for reseting the rules when reseting on a new troubleshoot issue.
|
|
95
92
|
case RulesReducerConstants.resetEARules: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.
|
|
30
|
-
"@cee-eng/ui-toolkit": "1.1.
|
|
29
|
+
"@cee-eng/hydrajs": "4.7.3",
|
|
30
|
+
"@cee-eng/ui-toolkit": "1.1.4",
|
|
31
31
|
"@patternfly/patternfly": "4.102.2",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.1.0",
|
|
33
33
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"react-virtualized": "^9.21.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@cee-eng/hydrajs": "4.
|
|
67
|
-
"@cee-eng/ui-toolkit": "1.1.
|
|
66
|
+
"@cee-eng/hydrajs": "4.7.3",
|
|
67
|
+
"@cee-eng/ui-toolkit": "1.1.4",
|
|
68
68
|
"@patternfly/patternfly": "4.102.2",
|
|
69
69
|
"@patternfly/pfe-accordion": "1.1.0",
|
|
70
70
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"@patternfly/react-core": "4.128.2",
|
|
73
73
|
"@progress/kendo-drawing": "^1.6.0",
|
|
74
74
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
75
|
-
"@rh-support/api": "0.3.
|
|
76
|
-
"@rh-support/components": "1.1.
|
|
77
|
-
"@rh-support/react-context": "0.2.
|
|
75
|
+
"@rh-support/api": "0.3.9",
|
|
76
|
+
"@rh-support/components": "1.1.16",
|
|
77
|
+
"@rh-support/react-context": "0.2.18",
|
|
78
78
|
"@rh-support/types": "0.2.0",
|
|
79
|
-
"@rh-support/user-permissions": "0.2.
|
|
80
|
-
"@rh-support/utils": "0.2.
|
|
79
|
+
"@rh-support/user-permissions": "0.2.12",
|
|
80
|
+
"@rh-support/utils": "0.2.12",
|
|
81
81
|
"@types/react-redux": "^7.1.12",
|
|
82
82
|
"@types/redux": "^3.6.0",
|
|
83
83
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "52e20f580e4e077ecc84a1e40f8474795e013459"
|
|
146
146
|
}
|