@rh-support/troubleshoot 0.2.48 → 0.2.50

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.
@@ -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,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,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"}
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,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,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,4EAiThB,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -147,8 +147,9 @@ const CaseComments = React.forwardRef((props, ref) => {
147
147
  const parseCommentHtml = (commentText, contentType) => {
148
148
  let text = commentText;
149
149
  if (contentType === EditorMode.PLAIN) {
150
+ text = HTMLEntityChecker(commentText);
150
151
  // fix issue something like this <h1>ajhdjaj<d</h1>
151
- text = htmlEntitiesEncode(commentText);
152
+ text = htmlEntitiesEncode(text);
152
153
  text = encodeAngularBrackets(text);
153
154
  text = linkifyLinks(text);
154
155
  text = linkifyWithCaseIDs(text);
@@ -160,6 +161,7 @@ const CaseComments = React.forwardRef((props, ref) => {
160
161
  /* Purpose of this method is to break the default HTML Entity rendering on the UI when in plaintext mode.
161
162
  This is achieved by directly swapping the '&' in any html entity to `&amp` in e.g. &euro swaps to &ampeuro
162
163
  so it is rendered -> &euro on the UI instead of '€' */
164
+ //PCM-10968
163
165
  const HTMLEntityChecker = (comment) => {
164
166
  if (comment.includes('&')) {
165
167
  return comment.replace(/&/g, '&amp;');
@@ -170,13 +172,13 @@ const CaseComments = React.forwardRef((props, ref) => {
170
172
  const computeCommentText = (comment) => {
171
173
  const parseComment = parseCommentHtml(comment.commentBody, comment.contentType);
172
174
  if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.MARKDOWN) {
173
- return (React.createElement("div", { className: "push-top-narrow comment-markdown-text", dangerouslySetInnerHTML: commentMarkdown(parseComment) }));
175
+ return (React.createElement("div", { className: "push-top-narrow comment-markdown-text", dangerouslySetInnerHTML: commentMarkdown(comment.commentBody) }));
174
176
  }
175
177
  else if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.PLAIN) {
176
- return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(HTMLEntityChecker(parseComment)) }));
178
+ return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment) }));
177
179
  }
178
180
  else {
179
- return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(HTMLEntityChecker(comment.commentBody)) }));
181
+ return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment) }));
180
182
  }
181
183
  };
182
184
  if (!((_a = props.comment) === null || _a === void 0 ? void 0 : _a.isPublic) && !canSeePrivateComments)
@@ -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":"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();
@@ -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, isBordered: true },
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 })))))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.48",
3
+ "version": "0.2.50",
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.25",
78
+ "@rh-support/react-context": "0.2.28",
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.19",
81
+ "@rh-support/utils": "0.2.17",
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": "2631f851bb93e3c623df318a2062b2426c864a7e"
146
+ "gitHead": "2821a4eb373d262b83d3a512900eb68d1fa22d55"
146
147
  }