@rh-support/troubleshoot 0.2.49 → 0.2.53
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/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +18 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts +9 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +111 -0
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +5 -2
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +4 -2
- package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +6 -3
- package/lib/esm/components/shared/Constants.d.ts +8 -4
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +8 -4
- package/lib/esm/components/shared/CustomIcons/CriticalIcon.d.ts +3 -0
- package/lib/esm/components/shared/CustomIcons/CriticalIcon.d.ts.map +1 -0
- package/lib/esm/components/shared/CustomIcons/CriticalIcon.js +5 -0
- package/lib/esm/scss/_main.scss +12 -0
- package/lib/esm/scss/_pf4-overrides.scss +6 -0
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAqB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,eA2bxC"}
|
|
@@ -30,6 +30,7 @@ import { AttachmentDispatchContext, AttachmentStateContext, hasSomeSelectedFiles
|
|
|
30
30
|
import FileSelectorButton from '../../../shared/fileUpload/fileSelectors/FileSelectorButton';
|
|
31
31
|
import FileUpload from '../../../shared/fileUpload/FileUpload';
|
|
32
32
|
import { useMarkdownFileUploader } from './PostComment/useMarkdownFileUploader';
|
|
33
|
+
import { VerifyCaseStatusModal } from './VerifyCaseStatusModal/VerifyCaseStatusModal';
|
|
33
34
|
export function PostComment(props) {
|
|
34
35
|
const { t } = useTranslation();
|
|
35
36
|
let { caseNumber } = props;
|
|
@@ -49,6 +50,7 @@ export function PostComment(props) {
|
|
|
49
50
|
const hasSomeUnUploadedFiles = hasSomeUnUploadedAttachments(attachmentState.caseFiles.selectedLocalFiles);
|
|
50
51
|
const hasSomeSelectedFilesLocal = hasSomeSelectedFiles(attachmentState.caseFiles.selectedLocalFiles);
|
|
51
52
|
const [commentType, setCommentType] = useState(EditorMode.PLAIN);
|
|
53
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
52
54
|
const [isProcessing, setIsProcessing] = useState(isPostingComment || isUploadingAttachments);
|
|
53
55
|
const { globalMetadataState: { loggedInUser, loggedInUserRights, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
54
56
|
const allowInlineImagesInMarkdown = getConfigField(pcmConfig.data, 'allowInlineImagesInMarkdown', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
@@ -146,6 +148,7 @@ export function PostComment(props) {
|
|
|
146
148
|
useEffect(() => {
|
|
147
149
|
isPublicRef.current = isPublic;
|
|
148
150
|
}, [isPublic]);
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
149
152
|
const onPostComment = () => __awaiter(this, void 0, void 0, function* () {
|
|
150
153
|
if (canEditCase.alert())
|
|
151
154
|
return;
|
|
@@ -248,6 +251,19 @@ export function PostComment(props) {
|
|
|
248
251
|
pendoTrackEvent(markdownFilePasteEvent);
|
|
249
252
|
onFileAttach(files, isPublicRef.current);
|
|
250
253
|
};
|
|
254
|
+
const onCancel = () => {
|
|
255
|
+
setIsModalOpen(false);
|
|
256
|
+
};
|
|
257
|
+
const isNotInternalConfirm = () => {
|
|
258
|
+
onPostComment();
|
|
259
|
+
};
|
|
260
|
+
const onConfirm = (commentText) => __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
yield setIsModalOpen(false);
|
|
262
|
+
isNotInternalConfirm();
|
|
263
|
+
});
|
|
264
|
+
const onBtnClick = () => {
|
|
265
|
+
setIsModalOpen(true);
|
|
266
|
+
};
|
|
251
267
|
return (React.createElement("div", { className: "pf-u-mb-md hide-in-pdf", ref: componentRef },
|
|
252
268
|
React.createElement(MarkdownEditor, { className: `${!isPublic ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", showMarkdownPlainTextToggle: true, editorMode: commentType, onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, rows: isTextAreaFocused ? 12 : 4, bindTextArea: textAreaRef, onCommentExceedCharsLimit: onCommentExceedCharsLimit, mdPlaceholder: isPublic ? 'Add a comment using markdown' : 'Add a comment or attach a file privately', plainTextPlaceholder: isPublic ? 'Add a comment to this case' : 'Add a comment or attach a file privately', fileSelectorProps: {
|
|
253
269
|
showFileSelectorInToolbar: allowInlineImagesInMarkdown && !loggedInUsersAccount.data.secureSupport,
|
|
@@ -260,7 +276,8 @@ export function PostComment(props) {
|
|
|
260
276
|
onClipboardPaste,
|
|
261
277
|
} }),
|
|
262
278
|
isProcessing ? (React.createElement(LoadingIndicator, { isInline: true, size: "sm" })) : (React.createElement("div", { className: "pf-l-flex post-comment-btn-group push-top-narrow" },
|
|
263
|
-
React.createElement(
|
|
279
|
+
isModalOpen && loggedInUser.data.isInternal && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
|
|
280
|
+
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal ? onBtnClick : isNotInternalConfirm, isDisabled: isPostCommentDisabled, className: "postcomment-submit" },
|
|
264
281
|
React.createElement(Trans, null, "Submit")),
|
|
265
282
|
canAddAttachments &&
|
|
266
283
|
(isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
onConfirm: (commentBody?: string) => void;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
caseNumber?: string;
|
|
5
|
+
isUpdating: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function VerifyCaseStatusModal(props: IProps): JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=VerifyCaseStatusModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,eA8IlD"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Button, ButtonVariant, Modal, ModalVariant, Select, SelectOption } from '@patternfly/react-core';
|
|
11
|
+
import { ToastNotification } from '@rh-support/components';
|
|
12
|
+
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
|
+
import { ability, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
+
import isEqual from 'lodash/isEqual';
|
|
15
|
+
import React, { useContext, useEffect, useReducer, useRef, useState } from 'react';
|
|
16
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
+
import { CaseStatusEnum } from '../../../../../constants/caseDetailsConstants';
|
|
18
|
+
import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
|
|
19
|
+
import { caseOverviewReducer, fetchAllStatuses, initialCaseViewState, setStatusUpdating, } from '../../../../../reducers/CaseOverviewReducer';
|
|
20
|
+
import { updateCaseDetails } from '../../../../../reducers/CaseReducer';
|
|
21
|
+
export function VerifyCaseStatusModal(props) {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const [caseOverviewState, caseOverviewDispatch] = useReducer(caseOverviewReducer, initialCaseViewState);
|
|
24
|
+
const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
|
|
25
|
+
const [showDropdown, setShowDropdown] = useState(false);
|
|
26
|
+
const onDropdownToggle = (toggle) => setShowDropdown(toggle);
|
|
27
|
+
const caseState = useCaseSelector((state) => ({
|
|
28
|
+
caseDetails: {
|
|
29
|
+
product: state.caseDetails.product,
|
|
30
|
+
version: state.caseDetails.version,
|
|
31
|
+
status: state.caseDetails.status,
|
|
32
|
+
caseType: state.caseDetails.caseType,
|
|
33
|
+
createdDate: state.caseDetails.createdDate,
|
|
34
|
+
createdById: state.caseDetails.createdById,
|
|
35
|
+
ownerId: state.caseDetails.ownerId,
|
|
36
|
+
caseNumber: state.caseDetails.caseNumber,
|
|
37
|
+
entitlementSla: state.caseDetails.entitlementSla,
|
|
38
|
+
cep: state.caseDetails.cep,
|
|
39
|
+
accountNumber: state.caseDetails.accountNumberRef,
|
|
40
|
+
firstCaseInactivityWarningSentAt: state.caseDetails.firstCaseInactivityWarningSentAt,
|
|
41
|
+
secondCaseInactivityWarningSentAt: state.caseDetails.secondCaseInactivityWarningSentAt,
|
|
42
|
+
},
|
|
43
|
+
isCaseUpdating: state.isCaseUpdating,
|
|
44
|
+
contactIsPartner: state.contactIsPartner,
|
|
45
|
+
hotfixRequested: state.hotfixRequested,
|
|
46
|
+
hotfixDelivered: state.hotfixDelivered,
|
|
47
|
+
selectedAccountDetails: state.selectedAccountDetails,
|
|
48
|
+
}), isEqual);
|
|
49
|
+
const { status } = caseState.caseDetails;
|
|
50
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
|
|
53
|
+
}, [caseOverviewDispatch, loggedInUsersAccount.data.secureSupport]);
|
|
54
|
+
console.log(caseOverviewState.allCaseStatuses.data);
|
|
55
|
+
const { isCaseUpdating } = caseState;
|
|
56
|
+
const reopenStatusRef = useRef(null);
|
|
57
|
+
const canEditCase = useCanEditCase();
|
|
58
|
+
const caseDispatch = useCaseDispatch();
|
|
59
|
+
const [statusChange, setStatusChange] = useState();
|
|
60
|
+
const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
props.onConfirm();
|
|
62
|
+
yield updateStatusState(statusChange);
|
|
63
|
+
});
|
|
64
|
+
const updateStatusState = (statusVal, onStatusUpdate = null) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
setStatusUpdating(caseOverviewDispatch, true);
|
|
66
|
+
try {
|
|
67
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, { status: statusVal });
|
|
68
|
+
setStatusUpdating(caseOverviewDispatch, false);
|
|
69
|
+
onStatusUpdate && (yield onStatusUpdate());
|
|
70
|
+
ToastNotification.addSuccessMessage(t('Status has been successfully updated'));
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
setStatusUpdating(caseOverviewDispatch, false);
|
|
74
|
+
ToastNotification.addDangerMessage(t('Status failed to update'));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const onStatusChange = (event, newStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
if (canEditCase.alert())
|
|
79
|
+
return;
|
|
80
|
+
if (status === CaseStatusEnum.CLOSED && newStatus !== CaseStatusEnum.CLOSED) {
|
|
81
|
+
onCaseReopen(newStatus);
|
|
82
|
+
}
|
|
83
|
+
else if (newStatus === CaseStatusEnum.CLOSED) {
|
|
84
|
+
onCaseClose();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
setStatusChange(newStatus);
|
|
88
|
+
onDropdownToggle(false);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const onCaseClose = () => __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
props.onClose();
|
|
93
|
+
});
|
|
94
|
+
const onCaseReopen = (selectedStatus = null) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
reopenStatusRef.current = selectedStatus;
|
|
96
|
+
props.onClose();
|
|
97
|
+
});
|
|
98
|
+
return (React.createElement(Modal, { id: "case-close-modal", title: t(`Please verify this case's status`), description: t(`Consider whether or not you're ready to nudge the customer`), "aria-describedby": "case-close-modal", isOpen: true, onClose: props.onClose, showClose: true, actions: [
|
|
99
|
+
React.createElement(Button, { key: "submit-description", variant: ButtonVariant.primary, onClick: onSubmit, isLoading: props.isUpdating, isDisabled: props.isUpdating, "data-tracking-id": "close-case-description-modal-submit" },
|
|
100
|
+
React.createElement(Trans, null, "Continue")),
|
|
101
|
+
React.createElement(Button, { key: "close-modal", variant: ButtonVariant.link, onClick: props.onClose, isDisabled: props.isUpdating, "data-tracking-id": "close-case-description-modal-cancel" },
|
|
102
|
+
React.createElement(Trans, null, "Cancel")),
|
|
103
|
+
], variant: ModalVariant.medium },
|
|
104
|
+
React.createElement("h3", { className: "subheading subheading-sm" },
|
|
105
|
+
React.createElement(Trans, null, "Status"),
|
|
106
|
+
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
107
|
+
React.createElement(Select, { "aria-label": t(status), id: "verify-case-status", selections: status, onSelect: onStatusChange, isOpen: showDropdown, isDisabled: !canManageCase ||
|
|
108
|
+
caseOverviewState.allCaseStatuses.isFetching ||
|
|
109
|
+
(caseOverviewState.caseStatusUpdating && isCaseUpdating), menuAppendTo: document.body, validated: !status ? 'error' : 'default', placeholderText: t(status), onToggle: onDropdownToggle }, caseOverviewState.allCaseStatuses.data.map((option, index) => (React.createElement(SelectOption, { key: index, value: option },
|
|
110
|
+
React.createElement(Trans, null, option)))))));
|
|
111
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationItems.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationItems.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAW5F,UAAU,MAAM;IACZ,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;CACpD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ClusterRecommendationItems.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationItems.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAW5F,UAAU,MAAM;IACZ,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;CACpD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,eAoFvD"}
|
|
@@ -28,7 +28,7 @@ export function ClusterRecommendationItems(props) {
|
|
|
28
28
|
React.createElement("h3", null, rule.description)),
|
|
29
29
|
React.createElement("pfe-accordion-panel", null,
|
|
30
30
|
React.createElement("p", null,
|
|
31
|
-
React.createElement(Label, {
|
|
31
|
+
React.createElement(Label, { icon: riskLabels[rule.total_risk].icon, className: riskLabels[rule.total_risk].className },
|
|
32
32
|
React.createElement(Trans, null, riskLabels[rule.total_risk].label))),
|
|
33
33
|
React.createElement("p", null, rule.details || ''),
|
|
34
34
|
rule.reason && (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":"AAgBA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eA8ExD"}
|
|
@@ -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 { getResTypeFromUrl } from '@rh-support/utils';
|
|
13
14
|
import React, { useContext, useState } from 'react';
|
|
14
15
|
import { useTranslation } from 'react-i18next';
|
|
15
16
|
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
@@ -26,12 +27,14 @@ export function ClusterRecommendationsModal(props) {
|
|
|
26
27
|
const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
|
|
27
28
|
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
28
29
|
const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a, _b;
|
|
30
|
+
var _a, _b, _c, _d;
|
|
30
31
|
try {
|
|
31
32
|
yield resolveSessionRequest(activeSessionId, {
|
|
32
33
|
sessionId: activeSessionId,
|
|
33
34
|
sessionResourceOriginId: (_b = (_a = sessionResourceTracking[SessionResourceSource.CLUSTER_RECOMMENDATION]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '',
|
|
34
|
-
type:
|
|
35
|
+
type: getResTypeFromUrl(''),
|
|
36
|
+
source: SessionResourceSource.CLUSTER_RECOMMENDATION,
|
|
37
|
+
resourceEntityId: (_d = (_c = sessionResourceTracking[SessionResourceSource.CLUSTER_RECOMMENDATION]) === null || _c === void 0 ? void 0 : _c.resourceEntityId) !== null && _d !== void 0 ? _d : '',
|
|
35
38
|
url: '',
|
|
36
39
|
});
|
|
37
40
|
setIsModalVisible(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EARuleInfoInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoInline.tsx"],"names":[],"mappings":"AAaA,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,
|
|
1
|
+
{"version":3,"file":"EARuleInfoInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoInline.tsx"],"names":[],"mappings":"AAaA,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,eAyHxD"}
|
|
@@ -13,7 +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 { getStyleVariantColor, StyleVariants } from '@rh-support/utils';
|
|
16
|
+
import { getResTypeFromUrl, getStyleVariantColor, StyleVariants } from '@rh-support/utils';
|
|
17
17
|
import some from 'lodash/some';
|
|
18
18
|
import React, { useContext, useEffect, useState } from 'react';
|
|
19
19
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -52,7 +52,9 @@ export function EARuleInfoInline({ eaRules = [] }) {
|
|
|
52
52
|
yield resolveSessionRequest(activeSessionId, {
|
|
53
53
|
sessionId: activeSessionId,
|
|
54
54
|
sessionResourceOriginId: (_b = (_a = sessionResourceTracking[SessionResourceSource.EDMOUND_ABOTT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '',
|
|
55
|
-
type:
|
|
55
|
+
type: getResTypeFromUrl(resolvedRule.cta),
|
|
56
|
+
source: SessionResourceSource.EDMOUND_ABOTT,
|
|
57
|
+
resourceEntityId: resolvedRule.rule_id,
|
|
56
58
|
url: resolvedRule.cta || '',
|
|
57
59
|
});
|
|
58
60
|
markEARuleResolved(rulesDispatch, resolvedRule);
|
|
@@ -130,7 +130,7 @@ function InsightsResults(props) {
|
|
|
130
130
|
var _a, _b;
|
|
131
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
132
|
try {
|
|
133
|
-
const _c = getSolrParams(
|
|
133
|
+
const _c = getSolrParams(200, 256, { id: kcsIds }), { start, rows, q } = _c, expression = __rest(_c, ["start", "rows", "q"]);
|
|
134
134
|
const res = yield search.solrSearchV2({ start, rows, q }, 'kcs', expression);
|
|
135
135
|
const docs = (_b = (_a = res === null || res === void 0 ? void 0 : res.response) === null || _a === void 0 ? void 0 : _a.docs) !== null && _b !== void 0 ? _b : [];
|
|
136
136
|
const attachmentId = localFile.attachmentId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"
|
|
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,eAgI/C"}
|
|
@@ -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 { Accordion, Button, Modal } from '@patternfly/react-core';
|
|
12
12
|
import { useFetch } from '@rh-support/components';
|
|
13
|
+
import { getResTypeFromUrl } from '@rh-support/utils';
|
|
13
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
14
15
|
import { useTranslation } from 'react-i18next';
|
|
15
16
|
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
@@ -38,12 +39,14 @@ export function InsightResultModal(props) {
|
|
|
38
39
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
39
40
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
40
41
|
const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
var _a, _b;
|
|
42
|
+
var _a, _b, _c, _d;
|
|
42
43
|
try {
|
|
43
44
|
yield resolveSessionRequest(activeSessionId, {
|
|
44
45
|
sessionId: activeSessionId,
|
|
45
46
|
sessionResourceOriginId: (_b = (_a = sessionResourceTracking[SessionResourceSource.INSIGHTS]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '',
|
|
46
|
-
type:
|
|
47
|
+
type: getResTypeFromUrl(''),
|
|
48
|
+
source: SessionResourceSource.INSIGHTS,
|
|
49
|
+
resourceEntityId: (_d = (_c = sessionResourceTracking[SessionResourceSource.INSIGHTS]) === null || _c === void 0 ? void 0 : _c.resourceEntityId) !== null && _d !== void 0 ? _d : '',
|
|
47
50
|
url: '',
|
|
48
51
|
});
|
|
49
52
|
props.onModalToggle();
|
|
@@ -81,7 +84,7 @@ export function InsightResultModal(props) {
|
|
|
81
84
|
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')),
|
|
82
85
|
React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
|
|
83
86
|
] },
|
|
84
|
-
React.createElement(Accordion, { className: "push-top-narrow", headingLevel: "h2", asDefinitionList: false
|
|
87
|
+
React.createElement(Accordion, { className: "push-top-narrow", headingLevel: "h2", asDefinitionList: false },
|
|
85
88
|
props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
|
|
86
89
|
props.EARule.length > 0 &&
|
|
87
90
|
props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule })))))));
|
|
@@ -52,20 +52,24 @@ export declare const markdownInlineFileSelectEvent = "PCM-Next > Markdown-toolba
|
|
|
52
52
|
export declare const markdownFilePasteEvent = "PCM-Next > Markdown-toolbar-file-paste";
|
|
53
53
|
export declare const riskLabels: {
|
|
54
54
|
1: {
|
|
55
|
+
icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
|
|
55
56
|
label: string;
|
|
56
|
-
|
|
57
|
+
className: string;
|
|
57
58
|
};
|
|
58
59
|
2: {
|
|
60
|
+
icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
|
|
59
61
|
label: string;
|
|
60
|
-
|
|
62
|
+
className: string;
|
|
61
63
|
};
|
|
62
64
|
3: {
|
|
65
|
+
icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
|
|
63
66
|
label: string;
|
|
64
|
-
|
|
67
|
+
className: string;
|
|
65
68
|
};
|
|
66
69
|
4: {
|
|
70
|
+
icon: () => JSX.Element;
|
|
67
71
|
label: string;
|
|
68
|
-
|
|
72
|
+
className: string;
|
|
69
73
|
};
|
|
70
74
|
};
|
|
71
75
|
//# sourceMappingURL=Constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBA+BE;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,cAAc;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,sBAAsB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;CAC9C;AAED,eAAO,MAAM,8BAA8B,oDAAoD,CAAC;AAEhG,eAAO,MAAM,oCAAoC,wDAAwD,CAAC;AAC1G,eAAO,MAAM,6BAA6B,4CAA4C,CAAC;AACvF,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAE/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAKtB,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import AngleDoubleDownIcon from '@patternfly/react-icons/dist/js/icons/angle-double-down-icon';
|
|
2
|
+
import AngleDoubleUpIcon from '@patternfly/react-icons/dist/js/icons/angle-double-up-icon';
|
|
3
|
+
import EqualsIcon from '@patternfly/react-icons/dist/js/icons/equals-icon';
|
|
4
|
+
import CriticalIcon from './CustomIcons/CriticalIcon';
|
|
1
5
|
export default {
|
|
2
6
|
languagesMap: {
|
|
3
7
|
en: 'English',
|
|
@@ -51,8 +55,8 @@ export const recsViewedFromNoAttachmentModalEvent = 'PCM-Next > No-Attachment-mo
|
|
|
51
55
|
export const markdownInlineFileSelectEvent = 'PCM-Next > Markdown-toolbar-file-select';
|
|
52
56
|
export const markdownFilePasteEvent = 'PCM-Next > Markdown-toolbar-file-paste';
|
|
53
57
|
export const riskLabels = {
|
|
54
|
-
1: { label: 'Low',
|
|
55
|
-
2: { label: 'Moderate',
|
|
56
|
-
3: { label: 'Important',
|
|
57
|
-
4: { label: 'Critical',
|
|
58
|
+
1: { icon: AngleDoubleDownIcon, label: 'Low', className: 'risk-label-low' },
|
|
59
|
+
2: { icon: EqualsIcon, label: 'Moderate', className: 'risk-label-moderate' },
|
|
60
|
+
3: { icon: AngleDoubleUpIcon, label: 'Important', className: 'risk-label-important' },
|
|
61
|
+
4: { icon: CriticalIcon, label: 'Critical', className: 'risk-label-critical' },
|
|
58
62
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CriticalIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/CustomIcons/CriticalIcon.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY,mBAcjB,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const CriticalIcon = () => (React.createElement("svg", { fill: "currentColor", height: "1em", width: "1em", viewBox: "0 0 320 512", "aria-hidden": "true", role: "img", style: { verticalAlign: '-0.125em' } },
|
|
3
|
+
React.createElement("svg", { viewBox: "0 0 10 10" },
|
|
4
|
+
React.createElement("polygon", { points: "10 10, 10 3, 5 0, 0 3, 0 10, 5 8" }))));
|
|
5
|
+
export default CriticalIcon;
|
package/lib/esm/scss/_main.scss
CHANGED
|
@@ -921,3 +921,15 @@ div.pf-c-alert.ea-rule-alert > div.pf-c-alert__description > p {
|
|
|
921
921
|
#case-details-aside-content[pfe-expanded] {
|
|
922
922
|
overflow: visible;
|
|
923
923
|
}
|
|
924
|
+
.risk-label-low {
|
|
925
|
+
background-color: var(--pf-global--palette--blue-300);
|
|
926
|
+
}
|
|
927
|
+
.risk-label-moderate {
|
|
928
|
+
background-color: var(--pf-global--palette--gold-400);
|
|
929
|
+
}
|
|
930
|
+
.risk-label-important {
|
|
931
|
+
background-color: var(--pf-global--palette--orange-300);
|
|
932
|
+
}
|
|
933
|
+
.risk-label-critical {
|
|
934
|
+
background-color: var(--pf-global--palette--red-200);
|
|
935
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.53",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
76
|
"@rh-support/api": "0.3.10",
|
|
77
|
-
"@rh-support/components": "1.1.
|
|
78
|
-
"@rh-support/react-context": "0.2.
|
|
77
|
+
"@rh-support/components": "1.1.27",
|
|
78
|
+
"@rh-support/react-context": "0.2.30",
|
|
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.21",
|
|
81
|
+
"@rh-support/utils": "0.2.19",
|
|
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": "2cf344190779d4ddb83084c2aa0664c6856c02d7"
|
|
147
147
|
}
|