@rh-support/troubleshoot 2.2.173 → 2.2.175

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":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,qBAiMzC"}
1
+ {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAkB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,qBA6LzC"}
@@ -15,7 +15,6 @@ import { CaseDetailsAside } from './CaseDetailsAside';
15
15
  import { CaseDetailsErrorMessage } from './CaseDetailsErrorMessage';
16
16
  import CaseDetailsModals from './CaseDetailsModals';
17
17
  import { CaseDetailsTabs } from './CaseDetailsTabs';
18
- import { CaseDetailsWarningMessage } from './CaseDetailsWarningMessage';
19
18
  import CaseOverview from './CaseOverview';
20
19
  import { PDFContext } from './PDFContainer';
21
20
  export default function Case(props) {
@@ -112,7 +111,6 @@ export default function Case(props) {
112
111
  React.createElement("article", { className: "grid-main" },
113
112
  React.createElement("section", { className: "grid-main-section" },
114
113
  (isFetchingCaseDetailsError || !canReadCase) && (React.createElement(CaseDetailsErrorMessage, { isError: isFetchingCaseDetailsError, errorDetails: caseDetailsError, canReadCase: canReadCase, caseNumber: caseNumber, isInlineError: true })),
115
- React.createElement(CaseDetailsWarningMessage, { caseNumber: caseNumber, selectedAccountDetails: selectedAccountDetails.data || {} }),
116
114
  canReadCase &&
117
115
  (!isFetchingCaseDetails || !isEmpty(product)) &&
118
116
  !isFetchingCaseDetailsError && (React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,qBAuHpC;kBAvHQ,cAAc;;;AA0HvB,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,qBAqHpC;kBArHQ,cAAc;;;AAwHvB,eAAe,cAAc,CAAC"}
@@ -76,8 +76,7 @@ function CaseActionPlan(props) {
76
76
  React.createElement(Trans, null, "Action plan")),
77
77
  !canUpdateActionPlan ? (React.createElement(CodeBlock, null,
78
78
  React.createElement(CodeBlockCode, null, isEmpty(actionPlan) ? t('No action plan to display.') : actionPlan))) : (React.createElement("form", null,
79
- React.createElement("div", { className: isExportingPDF ? 'hide-in-pdf' : '' },
80
- React.createElement(TextAreaResizable, { id: "rha-action-plan", disabled: isUpdating || isInternalWithoutSFDCUser, maxLength: 32768, name: "actionPlan", value: actionPlanState, onChange: onChange, rowsMin: 3 })),
79
+ React.createElement(TextAreaResizable, { id: "rha-action-plan", disabled: isUpdating || isInternalWithoutSFDCUser, maxLength: 32768, name: "actionPlan", value: actionPlanState, onChange: onChange, rowsMin: 3 }),
81
80
  !isInternalWithoutSFDCUser && (React.createElement("div", { className: `${isExportingPDF ? 'hide-in-pdf' : ''} push-top-narrow` },
82
81
  React.createElement("button", { className: "btn btn-app btn-primary", onClick: updateCase, disabled: isActionPlanEmpty || isUpdating || !formIsDirty, type: "button" },
83
82
  React.createElement(Trans, null, "Submit"),
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAwBxB,OAAO,KAAuD,MAAM,OAAO,CAAC;AA6I5E,QAAA,MAAM,QAAQ;;uBA8Qb,CAAC;AACF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAwBxB,OAAO,KAAuD,MAAM,OAAO,CAAC;AAoK5E,QAAA,MAAM,QAAQ;;uBAgRb,CAAC;AACF,eAAe,QAAQ,CAAC"}
@@ -40,9 +40,23 @@ const TimelineNode = React.forwardRef(({ leftEvent, rightEvent, user, useAvatar
40
40
  React.createElement("div", { ref: ref, "aria-label": `${useAvatar ? 'Open user profile' : 'Marker'}`, tabIndex: 0 }, useAvatar ? (React.createElement(Avatar, { src: 'https://www.patternfly.org/images/668560cd.svg', className: `timeline-avatar timeline-avatar-${user}`, alt: `${user}'s avatar` })) : (React.createElement("div", { className: `timeline-marker timeline-${user}` }))),
41
41
  rightEvent && React.createElement(TimelineEvent, Object.assign({}, rightEvent, { side: "right" }))));
42
42
  });
43
+ const applyReplacements = (text) => {
44
+ let newText = text;
45
+ //replacing Problem Statement to Title
46
+ if (newText.includes('Problem Statement')) {
47
+ newText = newText.replace(/Problem Statement/g, 'Title');
48
+ }
49
+ //we can add more conditions here if needed
50
+ return newText;
51
+ };
52
+ //function to replace Problem Statement with Title
53
+ const specialTimelineData = (apiResponse) => {
54
+ return Object.assign(Object.assign({}, apiResponse), { historyItems: apiResponse.historyItems.map((item) => (Object.assign(Object.assign({}, item), { outputText: applyReplacements(item.outputText) }))) });
55
+ };
43
56
  const transformApiResponseToTimelineData = (apiResponse) => {
44
57
  let previousUser = null;
45
- const timelineEvents = apiResponse.historyItems.map((item, index) => {
58
+ const modifiedApiResponse = specialTimelineData(apiResponse);
59
+ const timelineEvents = modifiedApiResponse.historyItems.map((item, index) => {
46
60
  const currentUser = item.createdByUserName;
47
61
  // If the current user is the same as the previous one, and it's not the first item, don't use an avatar. use !! cause previousUser start null.
48
62
  const useAvatar = index === 0 || (!!previousUser && currentUser !== previousUser);
@@ -142,6 +156,7 @@ const Timeline = ({ caseNumber }) => {
142
156
  });
143
157
  }
144
158
  fetchHistory();
159
+ // eslint-disable-next-line react-hooks/exhaustive-deps
145
160
  }, [caseNumber]);
146
161
  //Using useLayoutEffect because we are measuring styles based on DOM, useLayoutEffect runs after DOM Mutations https://react.dev/reference/react/useLayoutEffect
147
162
  useLayoutEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBAoKhD"}
1
+ {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBA6JhD"}
@@ -1,5 +1,5 @@
1
- import { Badge, Button, Popover, TextArea } from '@patternfly/react-core';
2
- import HelpIcon from '@patternfly/react-icons/dist/js/icons/help-icon';
1
+ import { Badge, Popover, TextArea } from '@patternfly/react-core';
2
+ import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
3
3
  // import ArrowRightIcon from '@patternfly/react-icons/dist/js/icons/arrow-right-icon'; This will be used for the Learn More button
4
4
  import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
5
5
  import { InlineEdit, useBreakpoint } from '@rh-support/components';
@@ -72,8 +72,7 @@ export default function Description(props) {
72
72
  React.createElement(Trans, null, "Describe your problem. Include specific actions and error messages."),
73
73
  isKT1Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
74
74
  React.createElement(Popover, { position: 'right', isVisible: isOpen, shouldClose: handleClose, headerContent: headerPopoverContent, bodyContent: PopoverContent },
75
- React.createElement(Button, { variant: "plain", "aria-label": "More info for problem description", onClick: handleToggle, className: "pf-v5-u-pl-sm kt-question-help-icon" },
76
- React.createElement(HelpIcon, null)))))), labelProps: { htmlFor: 'get-support-ktQ1-issue' }, content: issue, allowInlineEdit: !!props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: isEmpty(issue), usePreformattedTag: true, saveOnBlur: true },
75
+ React.createElement(QuestionCircleIcon, { className: "pf-v5-u-ml-xs icon-size", onClick: handleToggle }))))), labelProps: { htmlFor: 'get-support-ktQ1-issue' }, content: issue, allowInlineEdit: !!props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: isEmpty(issue), usePreformattedTag: true, saveOnBlur: true },
77
76
  React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: (isEmpty(summary) || isEmpty(version)) && isEmpty(issue) ? 'kt1-disabled' : '', "aria-invalid": (issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DETAILS_ISSUE_LIMIT ? 'true' : 'false', "aria-required": isKT1Required, isRequired: isKT1Required, value: issue, disabled: (isEmpty(summary) || isEmpty(version)) && isEmpty(issue), onChange: (e, value) => onKTQ1IssueChange(value, e), "data-tracking-id": "get-support-ktQ1-issue", placeholder: t(`The more detail that you include, the easier it is for us to help you. \nExample: \nI'm unable to start the SSHD service and am receiving the error message "Bad yes/no \nargument for ShowPatchLevel parameter"`), resizeOrientation: "vertical", validated: props.isSummarizeInvalid ? 'error' : 'default', rows: isLgScreenHeight ? 10 : 4, ref: textAreaRef, onClick: handleTextAreaClick }),
78
77
  React.createElement("p", { className: "form-instructions pf-v5-u-danger-color-100", "data-tracking-id": "large-20k-warning-ktQ1-environment" }, `${(issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DETAILS_ISSUE_LIMIT
79
78
  ? `This description exceeds ${CASE_DETAILS_ISSUE_LIMIT} characters. Try shortening it.`
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAgBxF,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAqkBxD"}
1
+ {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAgBxF,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAykBxD"}
@@ -309,7 +309,9 @@ export default function UpdateSeverityModal(props) {
309
309
  const onSeverityChange = (event, option) => {
310
310
  if (canEditCase.alert())
311
311
  return;
312
- if (isSev1(option.name) && isFtsEditableOnEditPage(entitlementSla, option.name)) {
312
+ if (!isEqual(caseDetails.caseSeverity, option.name) &&
313
+ isSev1(option.name) &&
314
+ isFtsEditableOnEditPage(entitlementSla, option.name)) {
313
315
  setLocalFts(true);
314
316
  setLocalFtsContact('');
315
317
  setUpdatedCaseDetails((pre) => (Object.assign(Object.assign({}, pre), { severity: option.name, fts: !isIdea })));
@@ -640,7 +640,7 @@ export const fetchCaseDetails = (dispatch, caseNumber, loggedInUserRights, logge
640
640
  const canChangeGroup = loggedInUserRights.isInternal() ||
641
641
  loggedInUser.isOrgAdmin ||
642
642
  loggedInUser.ssoUsername === caseDetails.contactSSOName ||
643
- loggedInUserRights.isPartner();
643
+ loggedInUserRights.isPartnerOrgAdmin();
644
644
  setCaseOwner(dispatch, { ssoUsername: data.contactSSOName, fullNameCustom: data.contactName }, '', undefined, undefined, false, undefined, canChangeGroup);
645
645
  const notifiedListUsers = map(data.notifiedUsers, (o) => ({
646
646
  ssoUsername: o.ssoUsername,
@@ -606,6 +606,7 @@ span.pf-v5-c-input-group__text {
606
606
  ul.pf-v5-c-menu__list,
607
607
  .pf-v5-c-modal-box__title {
608
608
  margin-bottom: 0px;
609
+ padding: 5px;
609
610
  }
610
611
 
611
612
  div.related-tasks-search-input-container#related-tasks-search-container {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.173",
3
+ "version": "2.2.175",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -133,5 +133,5 @@
133
133
  "defaults and supports es6-module",
134
134
  "maintained node versions"
135
135
  ],
136
- "gitHead": "0e8e72a89ed859d57ceb68dbbb94caa13a6f3569"
136
+ "gitHead": "1f6753bdcadf05aeacbef720888e034569e4750b"
137
137
  }
@@ -1,9 +0,0 @@
1
- import { IAccount } from '@cee-eng/hydrajs/@types/models/account';
2
- import React from 'react';
3
- interface IProps {
4
- caseNumber: string;
5
- selectedAccountDetails: IAccount;
6
- }
7
- export declare function CaseDetailsWarningMessage(props: IProps): React.JSX.Element;
8
- export {};
9
- //# sourceMappingURL=CaseDetailsWarningMessage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaseDetailsWarningMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsWarningMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,QAAQ,CAAC;CACpC;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,qBAYtD"}
@@ -1,10 +0,0 @@
1
- import { useSubscriptionAbused } from '@rh-support/react-context';
2
- import React from 'react';
3
- import { CaseSecureSupportAlert } from './CaseSecureSupportAlert';
4
- import { CaseSubscriptionAbuseAlert } from './CaseSubscriptionAbuseAlert';
5
- export function CaseDetailsWarningMessage(props) {
6
- const subscriptionAbused = useSubscriptionAbused();
7
- return (React.createElement(React.Fragment, null,
8
- React.createElement(CaseSecureSupportAlert, { caseNumber: props.caseNumber, selectedAccountDetails: props.selectedAccountDetails }),
9
- subscriptionAbused.isAccountFreezed && React.createElement(CaseSubscriptionAbuseAlert, null)));
10
- }
@@ -1,9 +0,0 @@
1
- import { IAccount } from '@cee-eng/hydrajs/@types/models/account';
2
- import React from 'react';
3
- interface IProps {
4
- caseNumber: string;
5
- selectedAccountDetails: IAccount;
6
- }
7
- export declare function CaseSecureSupportAlert(props: IProps): React.JSX.Element;
8
- export {};
9
- //# sourceMappingURL=CaseSecureSupportAlert.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaseSecureSupportAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseSecureSupportAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAIlE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,QAAQ,CAAC;CACpC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBA+BnD"}
@@ -1,22 +0,0 @@
1
- import { AlertMessage, AlertType } from '@rh-support/components';
2
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
- import { getSFDCSecureSupportCaseLink } from '@rh-support/utils';
4
- import React, { useContext } from 'react';
5
- import { Trans } from 'react-i18next';
6
- export function CaseSecureSupportAlert(props) {
7
- const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
8
- const isSecureSupportTechViewingSecureCase = loggedInUserRights.data.isSecureSupportTech() && props.selectedAccountDetails.secureSupport;
9
- const getWarningMsg = () => {
10
- if (isSecureSupportTechViewingSecureCase) {
11
- const shCaseLink = getSFDCSecureSupportCaseLink(props.caseNumber);
12
- return (React.createElement(React.Fragment, null,
13
- "Secured Support Technicians should use",
14
- ' ',
15
- React.createElement("a", { href: shCaseLink, "data-tracking-id": "securesupport-sh-redirect" }, "Support Hub"),
16
- ' ',
17
- "to access secure support cases."));
18
- }
19
- };
20
- return (React.createElement(AlertMessage, { className: "pf-v5-u-mb-md", variant: AlertType.WARNING, show: isSecureSupportTechViewingSecureCase, isInline: true },
21
- React.createElement(Trans, null, getWarningMsg())));
22
- }