@rh-support/troubleshoot 0.2.49-alpha.0 → 0.2.52

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.
Files changed (22) hide show
  1. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  2. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +18 -1
  3. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts +9 -0
  4. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -0
  5. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +111 -0
  6. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
  7. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
  8. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
  9. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +5 -2
  10. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
  11. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +4 -2
  12. package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
  13. package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
  14. package/lib/esm/components/Recommendations/RulesModal.js +5 -2
  15. package/lib/esm/components/shared/Constants.d.ts +8 -4
  16. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  17. package/lib/esm/components/shared/Constants.js +8 -4
  18. package/lib/esm/components/shared/CustomIcons/CriticalIcon.d.ts +3 -0
  19. package/lib/esm/components/shared/CustomIcons/CriticalIcon.d.ts.map +1 -0
  20. package/lib/esm/components/shared/CustomIcons/CriticalIcon.js +5 -0
  21. package/lib/esm/scss/_main.scss +12 -0
  22. package/package.json +20 -19
@@ -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;AAoB5F,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,eAgaxC"}
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(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: onPostComment, isDisabled: isPostCommentDisabled, className: "postcomment-submit" },
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,eAiFvD"}
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, { color: riskLabels[rule.total_risk].color },
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":"AAeA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eA2ExD"}
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: SessionResourceSource.CLUSTER_RECOMMENDATION,
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,eAuHxD"}
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: SessionResourceSource.EDMOUND_ABOTT,
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(10, 256, { id: kcsIds }), { start, rows, q } = _c, expression = __rest(_c, ["start", "rows", "q"]);
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":"AAOA,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,eA8H/C"}
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: SessionResourceSource.INSIGHTS,
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();
@@ -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
- color: string;
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
- color: string;
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
- color: string;
67
+ className: string;
65
68
  };
66
69
  4: {
70
+ icon: () => JSX.Element;
67
71
  label: string;
68
- color: string;
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,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
+ {"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', color: 'blue' },
55
- 2: { label: 'Moderate', color: 'orange' },
56
- 3: { label: 'Important', color: 'red' },
57
- 4: { label: 'Critical', color: 'red' },
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,3 @@
1
+ declare const CriticalIcon: () => JSX.Element;
2
+ export default CriticalIcon;
3
+ //# sourceMappingURL=CriticalIcon.d.ts.map
@@ -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;
@@ -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.49-alpha.0",
3
+ "version": "0.2.52",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,13 +26,13 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.7.3",
29
+ "@cee-eng/hydrajs": "4.7.20",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
- "@patternfly/patternfly": "4.102.2",
32
- "@patternfly/pfe-accordion": "1.1.0",
33
- "@patternfly/pfe-collapse": "1.1.0",
34
- "@patternfly/pfe-tabs": "1.1.0",
35
- "@patternfly/react-core": "4.128.2",
31
+ "@patternfly/patternfly": "4.176.2",
32
+ "@patternfly/pfe-accordion": "1.12.3",
33
+ "@patternfly/pfe-collapse": "1.12.3",
34
+ "@patternfly/pfe-tabs": "1.12.3",
35
+ "@patternfly/react-core": "4.194.0",
36
36
  "@rh-support/api": "0.3.9",
37
37
  "@rh-support/components": "^0.1.3",
38
38
  "@rh-support/react-context": "^0.1.3",
@@ -63,21 +63,22 @@
63
63
  "react-virtualized": "^9.21.2"
64
64
  },
65
65
  "dependencies": {
66
- "@cee-eng/hydrajs": "4.7.3",
66
+ "@cee-eng/hydrajs": "4.7.20",
67
67
  "@cee-eng/ui-toolkit": "1.1.6",
68
- "@patternfly/patternfly": "4.102.2",
69
- "@patternfly/pfe-accordion": "1.1.0",
70
- "@patternfly/pfe-collapse": "1.1.0",
71
- "@patternfly/pfe-tabs": "1.1.0",
72
- "@patternfly/react-core": "4.128.2",
68
+ "@patternfly/patternfly": "4.176.2",
69
+ "@patternfly/pfe-accordion": "1.12.3",
70
+ "@patternfly/pfe-collapse": "1.12.3",
71
+ "@patternfly/pfe-icon": "^1.12.3",
72
+ "@patternfly/pfe-tabs": "1.12.3",
73
+ "@patternfly/react-core": "4.194.0",
73
74
  "@progress/kendo-drawing": "^1.6.0",
74
75
  "@progress/kendo-react-pdf": "^3.12.0",
75
- "@rh-support/api": "0.3.9",
76
- "@rh-support/components": "1.1.23",
77
- "@rh-support/react-context": "0.2.26",
76
+ "@rh-support/api": "0.3.10",
77
+ "@rh-support/components": "1.1.27",
78
+ "@rh-support/react-context": "0.2.30",
78
79
  "@rh-support/types": "0.2.0",
79
- "@rh-support/user-permissions": "0.2.17",
80
- "@rh-support/utils": "0.2.15",
80
+ "@rh-support/user-permissions": "0.2.21",
81
+ "@rh-support/utils": "0.2.19",
81
82
  "@types/react-redux": "^7.1.12",
82
83
  "@types/redux": "^3.6.0",
83
84
  "@webcomponents/webcomponentsjs": "^2.2.10",
@@ -142,5 +143,5 @@
142
143
  "not ie <= 11",
143
144
  "not op_mini all"
144
145
  ],
145
- "gitHead": "23944a283d785859c0a72beb4baac0d13732490f"
146
+ "gitHead": "230218b05ecdb08d048db04a7f8fcb6646b4fa35"
146
147
  }