@rh-support/troubleshoot 0.2.53 → 0.2.56

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.
@@ -276,8 +276,8 @@ export function PostComment(props) {
276
276
  onClipboardPaste,
277
277
  } }),
278
278
  isProcessing ? (React.createElement(LoadingIndicator, { isInline: true, size: "sm" })) : (React.createElement("div", { className: "pf-l-flex post-comment-btn-group push-top-narrow" },
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" },
279
+ isModalOpen && loggedInUser.data.isInternal && isPublic && (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 && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isPostCommentDisabled, className: "postcomment-submit" },
281
281
  React.createElement(Trans, null, "Submit")),
282
282
  canAddAttachments &&
283
283
  (isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
@@ -1 +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"}
1
+ {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAiBA,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,eAiIlD"}
@@ -12,9 +12,8 @@ import { ToastNotification } from '@rh-support/components';
12
12
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
13
13
  import { ability, resourceActions, resources } from '@rh-support/user-permissions';
14
14
  import isEqual from 'lodash/isEqual';
15
- import React, { useContext, useEffect, useReducer, useRef, useState } from 'react';
15
+ import React, { useContext, useEffect, useReducer, useState } from 'react';
16
16
  import { Trans, useTranslation } from 'react-i18next';
17
- import { CaseStatusEnum } from '../../../../../constants/caseDetailsConstants';
18
17
  import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
19
18
  import { caseOverviewReducer, fetchAllStatuses, initialCaseViewState, setStatusUpdating, } from '../../../../../reducers/CaseOverviewReducer';
20
19
  import { updateCaseDetails } from '../../../../../reducers/CaseReducer';
@@ -51,15 +50,15 @@ export function VerifyCaseStatusModal(props) {
51
50
  useEffect(() => {
52
51
  fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
53
52
  }, [caseOverviewDispatch, loggedInUsersAccount.data.secureSupport]);
54
- console.log(caseOverviewState.allCaseStatuses.data);
55
53
  const { isCaseUpdating } = caseState;
56
- const reopenStatusRef = useRef(null);
57
54
  const canEditCase = useCanEditCase();
58
55
  const caseDispatch = useCaseDispatch();
59
56
  const [statusChange, setStatusChange] = useState();
57
+ const [isVerifyCaseStatusLoading, setIsVerifyCaseStatusLoading] = useState(false);
60
58
  const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
61
- props.onConfirm();
62
59
  yield updateStatusState(statusChange);
60
+ setIsVerifyCaseStatusLoading(true);
61
+ props.onConfirm();
63
62
  });
64
63
  const updateStatusState = (statusVal, onStatusUpdate = null) => __awaiter(this, void 0, void 0, function* () {
65
64
  setStatusUpdating(caseOverviewDispatch, true);
@@ -77,26 +76,11 @@ export function VerifyCaseStatusModal(props) {
77
76
  const onStatusChange = (event, newStatus) => __awaiter(this, void 0, void 0, function* () {
78
77
  if (canEditCase.alert())
79
78
  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();
79
+ setStatusChange(newStatus);
80
+ onDropdownToggle(false);
97
81
  });
98
82
  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" },
83
+ React.createElement(Button, { key: "submit-description", variant: ButtonVariant.primary, onClick: onSubmit, isLoading: isVerifyCaseStatusLoading, isDisabled: props.isUpdating, "data-tracking-id": "close-case-description-modal-submit" },
100
84
  React.createElement(Trans, null, "Continue")),
101
85
  React.createElement(Button, { key: "close-modal", variant: ButtonVariant.link, onClick: props.onClose, isDisabled: props.isUpdating, "data-tracking-id": "close-case-description-modal-cancel" },
102
86
  React.createElement(Trans, null, "Cancel")),
@@ -104,7 +88,7 @@ export function VerifyCaseStatusModal(props) {
104
88
  React.createElement("h3", { className: "subheading subheading-sm" },
105
89
  React.createElement(Trans, null, "Status"),
106
90
  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 ||
91
+ React.createElement(Select, { "aria-label": t(status), id: "verify-case-status", selections: statusChange, onSelect: onStatusChange, isOpen: showDropdown, isDisabled: !canManageCase ||
108
92
  caseOverviewState.allCaseStatuses.isFetching ||
109
93
  (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
94
  React.createElement(Trans, null, option)))))));
@@ -1 +1 @@
1
- {"version":3,"file":"EARule.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARule.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,UAAU,cAAc;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAClG;AAGD,eAAO,MAAM,aAAa,+BAGxB,CAAC;AAEH,wBAAgB,gBAAgB,mBAM/B;AACD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;;CAAA,eAyBxC;AAED,iBAAS,WAAW,gBAGnB;AAED,iBAAS,iBAAiB,gBAsBzB;AAED,iBAAS,aAAa,CAAC,EAAE,SAA6B,EAAE,SAAc,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,eAgBnH;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"EARule.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARule.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,UAAU,cAAc;IACpB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAClG;AAGD,eAAO,MAAM,aAAa,+BAGxB,CAAC;AAEH,wBAAgB,gBAAgB,mBAM/B;AACD,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;;CAAA,eAyBxC;AAED,iBAAS,WAAW,gBAGnB;AAED,iBAAS,iBAAiB,gBAsBzB;AAED,iBAAS,aAAa,CAAC,EAAE,SAA6B,EAAE,SAAc,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,eAgBnH;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
2
  import { pcm } from '@cee-eng/hydrajs';
2
3
  import React, { useContext } from 'react';
3
4
  import { Trans } from 'react-i18next';
@@ -1 +1 @@
1
- {"version":3,"file":"InsightsRuleInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsRuleInfo.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,GAAG,EAAE,wBAAwB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,MAAM,eAuJ1E"}
1
+ {"version":3,"file":"InsightsRuleInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsRuleInfo.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,GAAG,EAAE,wBAAwB,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,MAAM,eA0J1E"}
@@ -1,6 +1,7 @@
1
1
  import { pcm } from '@cee-eng/hydrajs';
2
2
  import { Accordion, AccordionContent, AccordionItem, AccordionToggle, Label, LabelGroup } from '@patternfly/react-core';
3
3
  import BullseyeIcon from '@patternfly/react-icons/dist/js/icons/bullseye-icon';
4
+ import CaretRightIcon from '@patternfly/react-icons/dist/js/icons/caret-right-icon';
4
5
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
5
6
  import { getRuleReasonHtml } from '@rh-support/utils';
6
7
  import React, { useContext, useEffect, useRef, useState } from 'react';
@@ -74,6 +75,7 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys }) {
74
75
  React.createElement(Trans, null, "Additional info")),
75
76
  React.createElement(AccordionContent, { isHidden: !isAdditionalExpanded },
76
77
  React.createElement("p", { onClick: onAdditionalInfoElemClick, dangerouslySetInnerHTML: parseMoreInfo(ruleData === null || ruleData === void 0 ? void 0 : ruleData.more_info, (_g = insightsReport === null || insightsReport === void 0 ? void 0 : insightsReport.current) === null || _g === void 0 ? void 0 : _g.details) }))))),
77
- React.createElement("a", { className: "se-recommended ts-result-insights cta-link", rel: "noopener noreferrer", target: "_blank", onClick: onCtaClick(doc.view_uri), "data-tracking-id": "se-recommended-insights-rule", href: getTrackingULRWithQueryParams(doc.view_uri, SessionResourceSource.INSIGHTS) },
78
- React.createElement(Trans, null, "Related article")))))));
78
+ React.createElement("a", { className: "se-recommended pf-c-button pf-m-link ts-result-insights cta-link", rel: "noopener noreferrer", target: "_blank", onClick: onCtaClick(doc.view_uri), "data-tracking-id": "se-recommended-insights-rule", "aria-label": "Related article", role: "button", href: getTrackingULRWithQueryParams(doc.view_uri, SessionResourceSource.INSIGHTS) },
79
+ React.createElement(Trans, null, "Related article"),
80
+ React.createElement(CaretRightIcon, null)))))));
79
81
  }
@@ -84,7 +84,7 @@ export function InsightResultModal(props) {
84
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')),
85
85
  React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
86
86
  ] },
87
- 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 },
88
88
  props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
89
89
  props.EARule.length > 0 &&
90
90
  props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule })))))));
@@ -1 +1 @@
1
- {"version":3,"file":"useParseRuleMarkdown.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParseRuleMarkdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAQ5F,eAAO,MAAM,oBAAoB;8CAgBd,MAAM,8BAET,qBAAqB,qBACV,MAAM,cACb,MAAM;;;8BAMW,MAAM;0CAOzB,MAAM,UACR,qBAAqB,qBACV,MAAM,cACb,MAAM;;;0CA/BuB,MAAM,UAAU,qBAAqB;CA6CrF,CAAC"}
1
+ {"version":3,"file":"useParseRuleMarkdown.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParseRuleMarkdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAQ5F,eAAO,MAAM,oBAAoB;8CAgBd,MAAM,8BAET,qBAAqB,qBACV,MAAM,cACb,MAAM;;;8BAMW,MAAM;0CAQzB,MAAM,UACR,qBAAqB,qBACV,MAAM,cACb,MAAM;;;0CAhCuB,MAAM,UAAU,qBAAqB;CA8CrF,CAAC"}
@@ -20,13 +20,14 @@ export const useParseRuleMarkdown = () => {
20
20
  openLinksInNewTab: true,
21
21
  });
22
22
  }
23
+ // TODO: Remove pf-c-button, pf-m-link, anchor-tag-button once Accordion bug is fixed
23
24
  function parseMarkdownWithTracking(markdown, source, trackingClassName, trackingId) {
24
25
  const anchorHrefRegex = /href="(.*?)"/g;
25
26
  const targetBlankRegex = new RegExp(`target="blank"`, 'g');
26
27
  return {
27
28
  __html: parseMarkdown(markdown)
28
29
  .replace(anchorHrefRegex, `href="${getTrackingULRWithQueryParams('$1', source)}"`)
29
- .replace(targetBlankRegex, `target="blank" class="se-recommended ${trackingClassName}" data-tracking-id="${trackingId}"`),
30
+ .replace(targetBlankRegex, `target="blank" class="se-recommended pf-c-button pf-m-link anchor-tag-button ${trackingClassName}" data-tracking-id="${trackingId}"`),
30
31
  };
31
32
  }
32
33
  return { parseDotMarkdownWithTracking, parseMarkdown, parseMarkdownWithTracking, getTrackingULRWithQueryParams };
@@ -933,3 +933,7 @@ div.pf-c-alert.ea-rule-alert > div.pf-c-alert__description > p {
933
933
  .risk-label-critical {
934
934
  background-color: var(--pf-global--palette--red-200);
935
935
  }
936
+
937
+ .anchor-tag-button {
938
+ padding: 0;
939
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.53",
3
+ "version": "0.2.56",
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.27",
78
- "@rh-support/react-context": "0.2.30",
77
+ "@rh-support/components": "1.1.28",
78
+ "@rh-support/react-context": "0.2.31",
79
79
  "@rh-support/types": "0.2.0",
80
- "@rh-support/user-permissions": "0.2.21",
81
- "@rh-support/utils": "0.2.19",
80
+ "@rh-support/user-permissions": "0.2.22",
81
+ "@rh-support/utils": "0.2.20",
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": "2cf344190779d4ddb83084c2aa0664c6856c02d7"
146
+ "gitHead": "888b282fb16eda05ab2c622c298164921d22bcbc"
147
147
  }