@rh-support/troubleshoot 0.4.1 → 1.0.1

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":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"AAwCA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,eA+VnD"}
1
+ {"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"AAwCA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,eAsWnD"}
@@ -147,11 +147,11 @@ export function RequestEscalationModal(props) {
147
147
  fetchCategories();
148
148
  // eslint-disable-next-line react-hooks/exhaustive-deps
149
149
  }, [props.show]);
150
- return (React.createElement(Modal, { isOpen: props.show, onClose: onCancel, actions: modalActions, header: header },
150
+ return (React.createElement(Modal, { id: "request-mgmt-escalation-modal", className: "request-escalation-modal", isOpen: props.show, onClose: onCancel, actions: modalActions, header: header },
151
151
  React.createElement("p", { className: "pf-u-mb-md" },
152
152
  React.createElement(Trans, { i18nKey: "i18RequestEscalationDescription" }, "Submit an escalation if an issue has become more severe or you feel the case needs a higher priority. A support manager will review your escalation request.")),
153
153
  React.createElement(AlertMessage, { variant: AlertType.DANGER, title: t('Could not create case escalation'), show: creationError, onClose: onErrorClose, isInline: true, className: "pf-u-mb-md" }),
154
- React.createElement(Form, { "aria-label": t('form') },
154
+ React.createElement(Form, { "aria-label": t('form'), className: "request-escalation-form" },
155
155
  React.createElement(Grid, { hasGutter: true, md: 12 },
156
156
  React.createElement(GridItem, { span: 6 },
157
157
  React.createElement(FormGroup, { isRequired: true, label: t('Category'), fieldId: "escalation-category" },
@@ -1 +1 @@
1
- {"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,iBAAiB,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA,EAAE,mBAAmB,CAAC,KAAA,KAAK,IAAI,CAAC;IACpH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,cAAc,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,eA6L5C"}
1
+ {"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,iBAAiB,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA,EAAE,mBAAmB,CAAC,KAAA,KAAK,IAAI,CAAC;IACpH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,cAAc,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,eA8L5C"}
@@ -69,13 +69,13 @@ export function ReopenCaseModal(props) {
69
69
  onDropdownToggle(false);
70
70
  };
71
71
  const isDescriptionEmpty = showTextArea ? isEmpty(reopenDescription === null || reopenDescription === void 0 ? void 0 : reopenDescription.trim()) : false;
72
- return (React.createElement(Modal, { id: "case-reopen-modal", title: t(`Reopening case ${props.caseNumber}`), "aria-describedby": "case-reopen-modal", isOpen: true, onClose: props.onClose, showClose: true, actions: [
72
+ return (React.createElement(Modal, { className: "case-reopen-modal", id: "case-reopen-modal", title: t(`Reopening case ${props.caseNumber}`), "aria-describedby": "case-reopen-modal", isOpen: true, onClose: props.onClose, showClose: true, actions: [
73
73
  React.createElement(Button, { key: "submit-description", variant: ButtonVariant.primary, onClick: onSubmit, isLoading: props.isUpdating, isDisabled: isDescriptionEmpty || showValidationError || props.isUpdating, "data-tracking-id": "reopen-case-description-modal-submit" },
74
74
  React.createElement(Trans, null, "Reopen case")),
75
75
  React.createElement(Button, { key: "close-modal", variant: ButtonVariant.secondary, onClick: props.onClose, isDisabled: props.isUpdating, "data-tracking-id": "reopen-case-description-modal-cancel" },
76
76
  React.createElement(Trans, null, "Cancel")),
77
77
  ], variant: ModalVariant.medium },
78
- React.createElement(Form, null,
78
+ React.createElement(Form, { className: "case-reopen-modal-form" },
79
79
  (!props.isInternal || !props.reopenStatus) && (React.createElement(FormGroup, { label: t(props.isInternal ? 'Status' : 'Reason'), isRequired: true, fieldId: "case-resolution", helperTextInvalid: "Required field", validated: showValidationError && (props.isInternal ? !selectedStatus : !selectedReason)
80
80
  ? 'error'
81
81
  : 'default', helperTextInvalidIcon: React.createElement(ExclamationCircleIcon, null) }, props.isInternal ? (React.createElement(Select, { "aria-label": t('Select an option that best fits'), id: "reopen-case-status", selections: selectedStatus, onSelect: onStatusChange, isOpen: showDropdown, isDisabled: props.isUpdating, menuAppendTo: document.body, validated: showValidationError && !selectedStatus ? 'error' : 'default', placeholderText: t('Select an option that best fits'), onToggle: onDropdownToggle }, props.allStatuses
@@ -1 +1 @@
1
- {"version":3,"file":"CaseExternalTrackerUpdate.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseExternalTrackerUpdate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAMjF,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,sBAAsB,CAAC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAID,QAAA,MAAM,yBAAyB,4EA4D7B,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"CaseExternalTrackerUpdate.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseExternalTrackerUpdate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAMjF,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,sBAAsB,CAAC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAID,QAAA,MAAM,yBAAyB,4EAsF7B,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
@@ -17,13 +17,14 @@ const CaseExternalTrackerUpdate = React.forwardRef((props, ref) => {
17
17
  return { __html: markdownToHTML(markdown, { openLinksInNewTab: true }) };
18
18
  };
19
19
  const onJumpToComment = (externalTrackerId) => () => props.showJumpToComment && props.onJumpToComment && props.onJumpToComment(externalTrackerId);
20
- const isPrivateUpdate = () => includes(privateVisibilityStatuses, props.trackerUpdate.visibility);
20
+ // To check and set if a comment is private or not
21
+ const isPrivateUpdate = () => includes(privateVisibilityStatuses, props.trackerUpdate.visibility) || !props.trackerUpdate.customerVisible;
21
22
  if (isPrivateUpdate() && !canSeePrivateComments)
22
23
  return React.createElement(React.Fragment, null);
23
24
  return (React.createElement("section", { ref: ref, id: props.trackerUpdate.id, className: `prevent-split support-comment ${isPrivateUpdate() ? 'private ' : ''}comment-external-tracker ${ref ? 'selected-case-comment' : ''}` },
24
25
  React.createElement("header", null,
25
26
  React.createElement("h4", null,
26
- React.createElement(TopologyIcon, { size: "sm" }),
27
+ React.createElement(TopologyIcon, { title: "Comment from external tracker", size: "sm" }),
27
28
  " ",
28
29
  props.trackerUpdate.updateBy),
29
30
  React.createElement("time", null, formatDateTime(props.trackerUpdate.createdDate))),
@@ -31,7 +32,16 @@ const CaseExternalTrackerUpdate = React.forwardRef((props, ref) => {
31
32
  props.trackerUpdate.originatingSystem,
32
33
  React.createElement("pre", { className: "push-top-narrow", dangerouslySetInnerHTML: sanetize(props.trackerUpdate.body) })),
33
34
  React.createElement("footer", null,
34
- React.createElement("div", { className: "comment-note" }, isPrivateUpdate() && React.createElement(Trans, null, "Private comment")),
35
+ isPrivateUpdate() && (React.createElement("div", { className: "comment-note" },
36
+ React.createElement(Trans, null,
37
+ "Private comment",
38
+ ' ',
39
+ !props.trackerUpdate.customerVisible && (React.createElement(React.Fragment, null,
40
+ React.createElement("span", { className: "external-tracker-label" },
41
+ "\u00B7 ",
42
+ React.createElement(Trans, null, " External tracker"))))))),
43
+ !isPrivateUpdate() && props.trackerUpdate.customerVisible && (React.createElement("div", { className: "comment-note external-tracker-label" },
44
+ React.createElement(Trans, null, "External tracker"))),
35
45
  React.createElement("span", { className: "pull-right pf-l-flex pf-m-align-items-center" },
36
46
  props.showJumpToComment && (React.createElement(DiscussionItemLink, { onClick: onJumpToComment(props.trackerUpdate.id), discussionType: DiscussionType.EXTERNAL_TRACKER, itemId: props.trackerUpdate.id, caseNumber: caseNumber, isCopyLink: false },
37
47
  React.createElement(Trans, null, "Jump to comment"))),
@@ -1 +1 @@
1
- {"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAKvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAuBrE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,eAyQ9B;kBAzQQ,QAAQ;;;AA2QjB,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAKvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAuBrE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,eA8Q9B;kBA9QQ,QAAQ;;;AAgRjB,eAAe,QAAQ,CAAC"}
@@ -171,7 +171,7 @@ function Severity(props) {
171
171
  allCaseSeverities.isFetching ||
172
172
  ownersEntitlements.isFetching ||
173
173
  versionsDetails.isFetching, isLoadingList: props.isFetching || versionsDetails.isFetching, isInValid: allCaseSeverities.isError || isSeverityInValid, required: true, onChange: onSeverityChange, onOuterClick: setIsSeverityInValidLocal, "data-tracking-id": "open-case-severity" })),
174
- React.createElement(UpdateSeverityModal, { show: openUpdateSeverityModal, onClose: toggleModal }))) : (React.createElement(Dropdown, { name: "open-case-severity", placeholder: t(`Select a severity`), title: t(`Select a severity`), list: allCaseSeverities.data
174
+ React.createElement(UpdateSeverityModal, { isDisabled: props.isFetching, isFetching: props.isFetching, show: openUpdateSeverityModal, onClose: toggleModal }))) : (React.createElement(Dropdown, { name: "open-case-severity", placeholder: t(`Select a severity`), title: t(`Select a severity`), list: allCaseSeverities.data
175
175
  ? toOptions(filteredSeverities, {
176
176
  labelKey: 'label',
177
177
  additionalInfoKey: 'additionalInfo',
@@ -25,7 +25,7 @@ import { getIsClusterIdInvalid, isClusterIdEnabledForProduct, } from '../../util
25
25
  import { NoClusterIDReasonSelector } from './NoClusterIDReasonSelector';
26
26
  import { OpenshiftDropdownV4 } from './OpenshiftDropdownV4';
27
27
  import { OpenShiftV3Inputbox } from './OpenShiftV3Inputbox';
28
- export const v3Tov4TransitionLink = () => (React.createElement("a", { className: "show-target", href: "https://access.redhat.com/documentation/en-us/openshift_container_platform/4.8/html-single/migrating_from_openshift_container_platform_3_to_4/index", target: "_blank", rel: "noopener noreferrer" },
28
+ export const v3Tov4TransitionLink = () => (React.createElement("a", { className: "show-target", href: "https://access.redhat.com/documentation/en-us/openshift_container_platform/4.11/html/migrating_from_version_3_to_4/index", target: "_blank", rel: "noopener noreferrer" },
29
29
  React.createElement(Trans, null, "How to transition from v3 to v4?")));
30
30
  export const discoverV4ClusterIdLink = () => (React.createElement("a", { className: "show-target", href: "/solutions/4505861", target: "_blank", rel: "noopener noreferrer" },
31
31
  React.createElement(Trans, null, "How do I determine my OpenShift 4.x Cluster ID?")));
@@ -1,4 +1,6 @@
1
1
  interface IProps {
2
+ isDisabled?: boolean;
3
+ isFetching?: boolean;
2
4
  show: boolean;
3
5
  onClose: () => void;
4
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AA0BA,UAAU,MAAM;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAwPxD"}
1
+ {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAsCA,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,eA4YxD"}
@@ -9,62 +9,128 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { publicApi } from '@cee-eng/hydrajs';
11
11
  import { Button, Modal, TextArea } from '@patternfly/react-core';
12
- import { ToastNotification, useFetch } from '@rh-support/components';
12
+ import { Dropdown, ToastNotification, useFetch } from '@rh-support/components';
13
13
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
14
- import { ability, resourceActions, resources } from '@rh-support/user-permissions';
14
+ import { autoEnableFtsOnCaseViewEditPage, severitySort, showFtsOnCreateCasePage, toOption, toOptions, } from '@rh-support/utils';
15
+ import find from 'lodash/find';
16
+ import includes from 'lodash/includes';
15
17
  import isEmpty from 'lodash/isEmpty';
16
18
  import isEqual from 'lodash/isEqual';
17
- import React, { useContext, useReducer, useState } from 'react';
19
+ import map from 'lodash/map';
20
+ import React, { useContext, useEffect, useReducer, useState } from 'react';
18
21
  import { Trans, useTranslation } from 'react-i18next';
19
22
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
20
23
  import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
21
24
  import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
22
25
  import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
26
+ import { getIrtForSLAAndSeverity, getOrtForSLAAndSeverity, getSeverityDescription } from '../../reducers/CaseHelpers';
23
27
  import { caseOverviewReducer, initialCaseViewState, setSeverityUpdating } from '../../reducers/CaseOverviewReducer';
24
28
  import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, updateCaseDetails, } from '../../reducers/CaseReducer';
25
- import Severity from '../CaseInformation/Severity';
26
29
  export default function UpdateSeverityModal(props) {
27
- const { show, onClose } = props;
30
+ const { show, onClose, isDisabled, isFetching } = props;
28
31
  const { t } = useTranslation();
29
32
  const [descriptionValue, setDescriptionValue] = useState('');
30
33
  const [caseOverviewState, caseOverviewDispatch] = useReducer(caseOverviewReducer, initialCaseViewState);
31
- const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
32
34
  const caseDispatch = useCaseDispatch();
33
35
  const canEditCase = useCanEditCase();
34
- const [updatedSeverity, setUpdatedSeverity] = useState();
35
- const [newSeverityValue, setNewSeverityValue] = useState([]);
36
+ const [updatedSeverity, setUpdatedSeverity] = useState({});
37
+ const [isSeverityInValid, setIsSeverityInValid] = useState(false);
38
+ const [seviritiesOptions, setSeveritiesOptions] = useState([]);
39
+ const [doNotShowIRT, setDoNotShowIRT] = useState(false);
36
40
  const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
37
41
  propgateErrors: true,
38
42
  });
39
43
  const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
40
44
  const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
41
45
  const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
42
- const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
46
+ const { globalMetadataState: { allCaseSeverities, allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
43
47
  const caseState = useCaseSelector((state) => ({
44
48
  caseDetails: {
45
49
  caseNumber: state.caseDetails.caseNumber,
46
50
  caseSeverity: state.caseDetails.severity,
47
51
  caseStatus: state.caseDetails.status,
52
+ product: state.caseDetails.product,
53
+ version: state.caseDetails.version,
54
+ entitlementSla: state.caseDetails.entitlementSla,
48
55
  },
49
56
  isCaseUpdating: state.isCaseUpdating,
57
+ versionsDetails: state.versionsDetails,
58
+ ownersEntitlements: state.ownersEntitlements,
50
59
  }), isEqual);
51
- const { caseDetails, isCaseUpdating } = caseState;
60
+ const { caseDetails, isCaseUpdating, ownersEntitlements, versionsDetails } = caseState;
52
61
  const [currentSeverity, setCurrentSeverity] = useState(caseDetails.caseSeverity);
62
+ const getAdditionalInfo = (sla, severity) => {
63
+ if (doNotShowIRT)
64
+ return React.createElement(React.Fragment, null);
65
+ const irt = getIrtForSLAAndSeverity(sla, severity);
66
+ const ort = getOrtForSLAAndSeverity(sla, severity);
67
+ return isEmpty(irt) ? undefined : irt === ort ? (React.createElement(React.Fragment, null,
68
+ React.createElement("strong", null, irt),
69
+ " ",
70
+ React.createElement(Trans, null, "initial and ongoing response time."))) : (React.createElement(React.Fragment, null,
71
+ React.createElement("strong", null, irt),
72
+ " ",
73
+ React.createElement(Trans, null, "initial and"),
74
+ " ",
75
+ React.createElement("strong", null, ort),
76
+ ' ',
77
+ React.createElement(Trans, null, "ongoing response time.")));
78
+ };
79
+ const slaLocal = caseDetails.entitlementSla;
80
+ // To set the filtered severities from data
81
+ const filteredSeverities = map(allCaseSeverities.data, (s) => {
82
+ const sevItem = {
83
+ name: s,
84
+ disabled: isEmpty(find(seviritiesOptions, (severity) => s === severity)),
85
+ label: `${s} - ${getSeverityDescription(s)}`,
86
+ additionalInfo: getAdditionalInfo(slaLocal, s),
87
+ };
88
+ return sevItem;
89
+ });
90
+ // To set the current selected severity
91
+ let selectedSeverity = {
92
+ name: currentSeverity,
93
+ disabled: false,
94
+ label: `${currentSeverity} - ${getSeverityDescription(currentSeverity)}`,
95
+ additionalInfo: getAdditionalInfo(slaLocal, currentSeverity),
96
+ };
97
+ // To reupdate the severity value when successfully submitted
98
+ const reUpdateSeverity = (severity) => {
99
+ selectedSeverity = {
100
+ name: severity,
101
+ disabled: false,
102
+ label: `${severity} - ${getSeverityDescription(severity)}`,
103
+ additionalInfo: getAdditionalInfo(slaLocal, severity),
104
+ };
105
+ };
106
+ // To check if severity is valid
107
+ const setIsSeverityInValidLocal = (selectedItem) => {
108
+ const isInvalid = isEmpty(selectedItem) || isEmpty(selectedItem.label);
109
+ setIsSeverityInValid(isInvalid);
110
+ };
111
+ // To update the state when severity changes
112
+ const updateState = (value) => {
113
+ const casePayload = { severity: value };
114
+ // .. change fts on sev change only while creating case or wchen we change to sev1
115
+ isEmpty(caseDetails.caseNumber) &&
116
+ (casePayload.fts = showFtsOnCreateCasePage(caseDetails.entitlementSla, value));
117
+ !isEmpty(caseDetails.caseNumber) &&
118
+ autoEnableFtsOnCaseViewEditPage(caseDetails.entitlementSla, value) &&
119
+ (casePayload.fts = true);
120
+ };
53
121
  // Modal cancel function which resets the field
54
- const onCancel = () => {
122
+ const onCancel = () => __awaiter(this, void 0, void 0, function* () {
55
123
  if (isCaseUpdating || isPostingComment)
56
124
  return;
57
- onClose();
58
125
  setSeverityUpdating(caseOverviewDispatch, false);
59
- setCaseDetails(caseDispatch, { severity: currentSeverity });
60
- setNewSeverityValue([]);
126
+ setCurrentSeverity(caseDetails.caseSeverity);
61
127
  setDescriptionValue('');
62
- };
128
+ onClose();
129
+ });
63
130
  // To handle on successful submit
64
131
  const onSuccessfulSubmit = () => {
65
132
  onClose();
66
133
  setSeverityUpdating(caseOverviewDispatch, false);
67
- setNewSeverityValue([]);
68
134
  setDescriptionValue('');
69
135
  };
70
136
  // To handle description change
@@ -74,14 +140,14 @@ export default function UpdateSeverityModal(props) {
74
140
  const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
75
141
  // Severity update successful comment body
76
142
  const severityUpdateComment = t('#### Severity update \n Severity changed from {{oldSeverity}} to {{newSeverity}}\n\n #### Description \n{{description}}', {
77
- oldSeverity: currentSeverity,
78
- newSeverity: newSeverityValue,
143
+ oldSeverity: caseDetails.caseSeverity,
144
+ newSeverity: updatedSeverity['severity'],
79
145
  description: descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim(),
80
146
  });
81
147
  // Severity update failed comment body
82
148
  const severityUpdateFailedComment = t('#### Severity update \n Failed to change severity from {{oldSeverity}} to {{newSeverity}}. Please try again\n', {
83
- oldSeverity: currentSeverity,
84
- newSeverity: newSeverityValue,
149
+ oldSeverity: caseDetails.caseSeverity,
150
+ newSeveritay: updatedSeverity['severity'],
85
151
  });
86
152
  try {
87
153
  setSeverityUpdating(caseOverviewDispatch, true);
@@ -94,7 +160,7 @@ export default function UpdateSeverityModal(props) {
94
160
  });
95
161
  try {
96
162
  checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), caseDetails.caseStatus);
97
- setCurrentSeverity(newSeverityValue);
163
+ setCurrentSeverity(updatedSeverity['severity']);
98
164
  onSuccessfulSubmit();
99
165
  ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
100
166
  }
@@ -115,9 +181,10 @@ export default function UpdateSeverityModal(props) {
115
181
  }
116
182
  catch (e) {
117
183
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
118
- severity: currentSeverity,
184
+ severity: caseDetails.caseSeverity,
119
185
  });
120
- setDescriptionValue('');
186
+ setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
187
+ reUpdateSeverity(caseDetails.caseSeverity);
121
188
  onClose();
122
189
  setSeverityUpdating(caseOverviewDispatch, false);
123
190
  ToastNotification.addDangerMessage(t(`Couldn't post severity update comment. Please try again`));
@@ -144,11 +211,10 @@ export default function UpdateSeverityModal(props) {
144
211
  };
145
212
  // To compare previous and current severity values
146
213
  const checkSeverityValid = () => {
147
- const checkForUndefined = newSeverityValue.length === 0;
148
- if (isEqual(currentSeverity, newSeverityValue)) {
214
+ if (isEqual(caseDetails.caseSeverity, updatedSeverity['severity'])) {
149
215
  return false;
150
216
  }
151
- else if (checkForUndefined) {
217
+ else if (isEmpty(updatedSeverity)) {
152
218
  return false;
153
219
  }
154
220
  else {
@@ -162,21 +228,77 @@ export default function UpdateSeverityModal(props) {
162
228
  React.createElement(Button, { key: "submit", variant: "primary", onClick: onSubmit, isLoading: isCaseUpdating || isPostingComment, "data-tracking-id": "update-severity-submit", isDisabled: isSubmitButtonDisabled || isCaseUpdating || isPostingComment }, t('Submit')),
163
229
  React.createElement(Button, { key: "back", variant: "link", onClick: onCancel, "data-tracking-id": "update-severity-cancel", isDisabled: isCaseUpdating || isPostingComment }, t('Cancel')),
164
230
  ];
165
- // To handle severity change in the modal
166
- const onSeverityChange = (payload) => __awaiter(this, void 0, void 0, function* () {
231
+ // To handle the severity change
232
+ const onSeverityChange = (option) => {
167
233
  if (canEditCase.alert())
168
234
  return;
169
- setUpdatedSeverity(payload);
170
- setNewSeverityValue(payload['severity']);
171
- setCaseDetails(caseDispatch, payload);
172
- });
235
+ setUpdatedSeverity({ severity: option.value.name });
236
+ setCurrentSeverity(option.value.name);
237
+ updateState(option.value.name);
238
+ setIsSeverityInValidLocal(option);
239
+ };
240
+ // To set severity options
241
+ useEffect(() => {
242
+ var _a, _b, _c;
243
+ if (!caseDetails.product ||
244
+ !caseDetails.version ||
245
+ allProducts.data.productsResult.length === 0 ||
246
+ ((_a = allCaseSeverities.data) === null || _a === void 0 ? void 0 : _a.length) === 0 ||
247
+ versionsDetails.isFetching)
248
+ return;
249
+ const productObj = find((_b = allProducts === null || allProducts === void 0 ? void 0 : allProducts.data) === null || _b === void 0 ? void 0 : _b.productsResult, (productItem) => productItem.name === caseDetails.product);
250
+ const versionDetail = find(versionsDetails === null || versionsDetails === void 0 ? void 0 : versionsDetails.data, (spec) => spec.name === caseDetails.version);
251
+ setDoNotShowIRT(versionDetail === null || versionDetail === void 0 ? void 0 : versionDetail.doNotShowIRT);
252
+ let availableSeverities;
253
+ if (versionDetail === null || versionDetail === void 0 ? void 0 : versionDetail.severities) {
254
+ //first check if at version level, do we have any severity limit
255
+ availableSeverities = versionDetail.severities;
256
+ }
257
+ else if (productObj === null || productObj === void 0 ? void 0 : productObj.severities) {
258
+ // second check if at product level, do we have any severity limit
259
+ availableSeverities = productObj.severities;
260
+ }
261
+ else {
262
+ // we have no limit, we show all severity options
263
+ availableSeverities = (_c = allCaseSeverities.data) !== null && _c !== void 0 ? _c : [];
264
+ }
265
+ setSeveritiesOptions(availableSeverities.sort((sevA, sevB) => severitySort(sevA, sevB)));
266
+ const shouldUpdateSeverityOnCaseCreate = !caseDetails.caseNumber &&
267
+ (!caseDetails.caseSeverity || !includes(availableSeverities, caseDetails.caseSeverity));
268
+ if (shouldUpdateSeverityOnCaseCreate) {
269
+ updateState(availableSeverities[0]);
270
+ }
271
+ // eslint-disable-next-line react-hooks/exhaustive-deps
272
+ }, [
273
+ caseDetails.product,
274
+ caseDetails.version,
275
+ allProducts,
276
+ allCaseSeverities,
277
+ versionsDetails,
278
+ seviritiesOptions,
279
+ caseDetails.caseSeverity,
280
+ ]);
173
281
  // Returns the modal body with its contents
174
282
  const modalBody = () => {
175
283
  return (React.createElement(React.Fragment, null,
176
284
  React.createElement("form", { "aria-label": t('form') },
177
285
  React.createElement("div", { className: "form-group pf-u-mt-xs" },
178
286
  React.createElement("div", null,
179
- React.createElement(Severity, { onCaseDetailsPage: false, onSeverityChange: onSeverityChange, isDisabled: !canManageCase && isCaseUpdating, isFetching: (caseOverviewState.caseSeverityUpdating && isCaseUpdating) || isPostingComment })),
287
+ React.createElement(Dropdown, { name: "open-case-severity", placeholder: t(`Select a severity`), title: t(`Select a severity`), list: allCaseSeverities.data
288
+ ? toOptions(filteredSeverities, {
289
+ labelKey: 'label',
290
+ additionalInfoKey: 'additionalInfo',
291
+ disabledKey: 'disabled',
292
+ })
293
+ : [], selectedItem: toOption(selectedSeverity, {
294
+ labelKey: 'label',
295
+ additionalInfoKey: 'additionalInfo',
296
+ disabledKey: 'disabled',
297
+ }), disabled: allCaseSeverities.isError ||
298
+ isDisabled ||
299
+ allCaseSeverities.isFetching ||
300
+ ownersEntitlements.isFetching ||
301
+ versionsDetails.isFetching, isLoadingList: isFetching || versionsDetails.isFetching, isInValid: allCaseSeverities.isError || isSeverityInValid, required: true, onChange: onSeverityChange, onOuterClick: setIsSeverityInValidLocal, "data-tracking-id": "open-case-severity" })),
180
302
  React.createElement("div", null,
181
303
  React.createElement("label", { htmlFor: "date-input", className: "pf-u-mt-md" },
182
304
  React.createElement(Trans, null, "Describe update"),
@@ -931,3 +931,17 @@ div.pf-c-alert.ea-rule-alert > div.pf-c-alert__description > p {
931
931
  .anchor-tag-link-td-none {
932
932
  text-decoration: none;
933
933
  }
934
+
935
+ // Text color for external tracker text on comments
936
+ .prevent-split.support-comment {
937
+ footer {
938
+ .comment-note {
939
+ span.external-tracker-label {
940
+ color: #151515 !important;
941
+ }
942
+ }
943
+ .comment-note.external-tracker-label {
944
+ color: #151515 !important;
945
+ }
946
+ }
947
+ }
@@ -322,3 +322,63 @@ div pfe-accordion {
322
322
  --pfe-accordion--FontSize--header: 16px;
323
323
  --pfe-accordion--FontWeight--header: 600;
324
324
  }
325
+
326
+ // To override font weight in CEP Form - PCM-11644
327
+ div#cep-details-modal.pf-c-modal-box__body {
328
+ form.pf-c-form.push-top-narrow {
329
+ div.pf-c-form__group {
330
+ div.pf-c-form__group-label {
331
+ label.pf-c-form__label {
332
+ span.pf-c-form__label-text {
333
+ font-weight: 600 !important;
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ // To override font weight in Request Escalation Form - PCM-11644
342
+ div#request-mgmt-escalation-modal.request-escalation-modal {
343
+ div.pf-c-modal-box__body {
344
+ form.pf-c-form.request-escalation-form {
345
+ div.pf-l-grid.pf-m-all-12-col-on-md.pf-m-gutter {
346
+ div.pf-l-grid__item.pf-m-6-col {
347
+ div.pf-c-form__group {
348
+ div.pf-c-form__group-label {
349
+ label.pf-c-form__label {
350
+ span.pf-c-form__label-text {
351
+ font-weight: 600 !important;
352
+ }
353
+ }
354
+ }
355
+ }
356
+ }
357
+ div.pf-c-form__group {
358
+ div.pf-c-form__group-label {
359
+ label.pf-c-form__label {
360
+ span.pf-c-form__label-text {
361
+ font-weight: 600 !important;
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+ }
370
+
371
+ // To override font weight on reopen case modal - PCM-11644
372
+ div#case-reopen-modal.pf-c-modal-box__body {
373
+ form.pf-c-form.case-reopen-modal-form {
374
+ div.pf-c-form__group {
375
+ div.pf-c-form__group-label {
376
+ label.pf-c-form__label {
377
+ span.pf-c-form__label-text {
378
+ font-weight: 600 !important;
379
+ }
380
+ }
381
+ }
382
+ }
383
+ }
384
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.4.1",
3
+ "version": "1.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.12.7",
29
+ "@cee-eng/hydrajs": "4.13.0",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
31
  "@patternfly/patternfly": "4.196.7",
32
32
  "@patternfly/pfe-accordion": "1.12.3",
@@ -63,7 +63,7 @@
63
63
  "react-virtualized": "^9.21.2"
64
64
  },
65
65
  "dependencies": {
66
- "@cee-eng/hydrajs": "4.12.7",
66
+ "@cee-eng/hydrajs": "4.13.0",
67
67
  "@cee-eng/ui-toolkit": "1.1.6",
68
68
  "@patternfly/patternfly": "4.196.7",
69
69
  "@patternfly/pfe-accordion": "1.12.3",
@@ -73,11 +73,11 @@
73
73
  "@patternfly/react-core": "4.202.16",
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
- "@rh-support/components": "1.1.83",
77
- "@rh-support/react-context": "0.3.4",
76
+ "@rh-support/components": "1.2.0",
77
+ "@rh-support/react-context": "1.0.1",
78
78
  "@rh-support/types": "0.2.0",
79
- "@rh-support/user-permissions": "0.2.67",
80
- "@rh-support/utils": "0.2.49",
79
+ "@rh-support/user-permissions": "1.0.0",
80
+ "@rh-support/utils": "1.0.0",
81
81
  "@types/react-redux": "^7.1.12",
82
82
  "@types/redux": "^3.6.0",
83
83
  "@webcomponents/webcomponentsjs": "^2.2.10",
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "9ec3db4f755eced3812b70aadaa81964dc186a01"
145
+ "gitHead": "4f98bb1c175ecda80b26a491f61afd603f78d9bd"
146
146
  }