@rh-support/troubleshoot 2.6.308 → 2.6.310
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.
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +11 -3
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +14 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +6 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -2
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts +3 -0
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -0
- package/lib/esm/components/CaseInformation/CaseLabels.js +98 -0
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +123 -45
- package/lib/esm/graphql/schemas/escalation.d.ts +4 -0
- package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +1 -1
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +21 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +84 -0
- package/lib/esm/i18n/template-de.d.ts +2 -2
- package/lib/esm/i18n/template-de.js +2 -2
- package/lib/esm/i18n/template-es.d.ts +2 -2
- package/lib/esm/i18n/template-es.js +2 -2
- package/lib/esm/i18n/template-fr.d.ts +2 -2
- package/lib/esm/i18n/template-fr.js +2 -2
- package/lib/esm/i18n/template-it.d.ts +2 -2
- package/lib/esm/i18n/template-it.js +2 -2
- package/lib/esm/i18n/template-jp.d.ts +2 -2
- package/lib/esm/i18n/template-jp.js +2 -2
- package/lib/esm/i18n/template-ko.d.ts +2 -2
- package/lib/esm/i18n/template-ko.js +2 -2
- package/lib/esm/i18n/template-pt.d.ts +2 -2
- package/lib/esm/i18n/template-pt.js +2 -2
- package/lib/esm/i18n/template-ru.d.ts +2 -2
- package/lib/esm/i18n/template-ru.js +2 -2
- package/lib/esm/i18n/template-zh.d.ts +2 -2
- package/lib/esm/i18n/template-zh.js +2 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts +7 -6
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +5 -5
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +6 -2
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAahF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAma7C"}
|
|
@@ -17,7 +17,7 @@ import TrendUpIcon from '@patternfly/react-icons/dist/js/icons/trend-up-icon';
|
|
|
17
17
|
import { ErrorBoundary, ToastNotification, useBreakpoint, useForceUpdate } from '@rh-support/components';
|
|
18
18
|
import { GlobalMetadataDispatchContext, toggleViewAsCustomerFlag, useGlobalStateContext, useUserPreferences, } from '@rh-support/react-context';
|
|
19
19
|
import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
20
|
-
import { isSpecialSupportOfferingEnabled, scrollIntoView } from '@rh-support/utils';
|
|
20
|
+
import { buildAccessRestrictionExclusionFilter, isSpecialSupportOfferingEnabled, scrollIntoView, } from '@rh-support/utils';
|
|
21
21
|
import isEmpty from 'lodash/isEmpty';
|
|
22
22
|
import isEqual from 'lodash/isEqual';
|
|
23
23
|
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -51,11 +51,19 @@ export function CaseDetailsAside(props) {
|
|
|
51
51
|
const { recommendationState: { isLoadingRecommendations, allDocs }, } = useRecommendationStateContext();
|
|
52
52
|
const { caseNumber } = props;
|
|
53
53
|
const { data: parentData, loading: isLoadingParentId } = useQuery(GET_PARENT_ID, {
|
|
54
|
-
variables: {
|
|
54
|
+
variables: {
|
|
55
|
+
where: {
|
|
56
|
+
and: [{ CaseNumber: { eq: caseNumber } }, buildAccessRestrictionExclusionFilter()],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
55
59
|
});
|
|
56
60
|
const parentId = (_f = (_e = (_d = (_c = (_b = (_a = parentData === null || parentData === void 0 ? void 0 : parentData.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCase) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Id;
|
|
57
61
|
const { loading: isLoadingEscalations } = useQuery(GET_ESCALATION_DETAILS, {
|
|
58
|
-
variables: {
|
|
62
|
+
variables: {
|
|
63
|
+
where: {
|
|
64
|
+
and: [{ ParentId: { eq: parentId } }, buildAccessRestrictionExclusionFilter()],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
59
67
|
skip: !parentId,
|
|
60
68
|
});
|
|
61
69
|
const isEscalationsFetching = isLoadingParentId || isLoadingEscalations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsErrorMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,UAAU,MAAM;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAID,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseDetailsErrorMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,UAAU,MAAM;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAID,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,qBA4FpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AlertMessage, AlertType, errorMessageTitle, formattedApiErrorMessage } from '@rh-support/components';
|
|
2
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { getSFDCSecureSupportCaseLink } from '@rh-support/utils';
|
|
3
|
+
import { CSS_ACCESS_RESTRICTION_ERROR_DETAIL, CSS_PORTAL_URL, getSFDCSecureSupportCaseLink } from '@rh-support/utils';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
6
|
// Here we need to use 'detailMessage' from case API if user is not authorized to see case details
|
|
@@ -11,11 +11,13 @@ export function CaseDetailsErrorMessage(props) {
|
|
|
11
11
|
// Initialize Default Props Below
|
|
12
12
|
const { isInlineError = false, canReadCase, canManageCase, caseNumber, errorDetails } = props;
|
|
13
13
|
const invalidCaseGroupErrorTitle = t('This case can only be viewed by a specific group');
|
|
14
|
+
const cssAccessRestrictionErrorTitle = t('This case is only available in Confirmed Sovereign Support');
|
|
14
15
|
/* There can be two condition for HTTP 403 error
|
|
15
16
|
1. Account mismatch.
|
|
16
17
|
2. Invalid case group
|
|
17
18
|
*/
|
|
18
19
|
const isCaseGroupError = (errorDetails === null || errorDetails === void 0 ? void 0 : errorDetails['detailMessage']) === INVALID_CASE_GROUP_API_ERROR_DEFAULT_MESSAGE;
|
|
20
|
+
const isCssAccessRestrictionError = (errorDetails === null || errorDetails === void 0 ? void 0 : errorDetails['detailMessage']) === CSS_ACCESS_RESTRICTION_ERROR_DETAIL;
|
|
19
21
|
const getErrorMessage = () => {
|
|
20
22
|
const { status, message = '' } = errorDetails || {};
|
|
21
23
|
const customDefaultErrorMessage403 = isCaseGroupError
|
|
@@ -23,7 +25,14 @@ export function CaseDetailsErrorMessage(props) {
|
|
|
23
25
|
: t('You are not authorized to see this case.');
|
|
24
26
|
const errorMessage404 = t("Case number doesn't exist");
|
|
25
27
|
let errorMessage403;
|
|
26
|
-
if (
|
|
28
|
+
if (isCssAccessRestrictionError) {
|
|
29
|
+
errorMessage403 = (React.createElement(React.Fragment, null,
|
|
30
|
+
"Open this case in the",
|
|
31
|
+
' ',
|
|
32
|
+
React.createElement("a", { href: CSS_PORTAL_URL, "data-tracking-id": "css-access-restriction-portal-redirect" }, "Confirmed Sovereign Support portal"),
|
|
33
|
+
"."));
|
|
34
|
+
}
|
|
35
|
+
else if (!canReadCase) {
|
|
27
36
|
errorMessage403 = customDefaultErrorMessage403;
|
|
28
37
|
}
|
|
29
38
|
else if (loggedInUserRights.data.isInternal() &&
|
|
@@ -48,8 +57,10 @@ export function CaseDetailsErrorMessage(props) {
|
|
|
48
57
|
};
|
|
49
58
|
return (React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v6-u-mb-lg", show: true,
|
|
50
59
|
// Here customizing title of alert based on case group error.
|
|
51
|
-
title: errorMessageTitle(errorDetails, Object.assign({}, (isCaseGroupError && {
|
|
60
|
+
title: errorMessageTitle(errorDetails, Object.assign(Object.assign({}, (isCaseGroupError && {
|
|
52
61
|
'403': { title: invalidCaseGroupErrorTitle },
|
|
62
|
+
})), (isCssAccessRestrictionError && {
|
|
63
|
+
'403': { title: cssAccessRestrictionErrorTitle },
|
|
53
64
|
})), canManageCase), isInline: isInlineError },
|
|
54
65
|
React.createElement(Trans, null, getErrorMessage())));
|
|
55
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAmBvD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA0E1D"}
|
|
@@ -5,6 +5,7 @@ import React, { useContext, useState } from 'react';
|
|
|
5
5
|
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
6
6
|
import { OwnerSelector } from '../../../AccountInfo/OwnerSelector';
|
|
7
7
|
import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
8
|
+
import CaseLabels from '../../../CaseInformation/CaseLabels';
|
|
8
9
|
import Fts from '../../../CaseInformation/Fts';
|
|
9
10
|
// import { Cep } from '../../../CaseManagement/Cep';
|
|
10
11
|
// import { RHAssociatesSelector } from '../../../CaseManagement/RHAssociatesSelector';
|
|
@@ -45,7 +46,11 @@ export default function CaseDetailsManagement(props) {
|
|
|
45
46
|
React.createElement(CaseContactPhoneNumberAlert, { isConfirm: true }),
|
|
46
47
|
canSeeInternalStatus && React.createElement(CaseInternalStatus, null),
|
|
47
48
|
canSeeSBRGroups && React.createElement(CaseSbrGroups, null),
|
|
48
|
-
React.createElement(
|
|
49
|
+
React.createElement(Flex, { direction: { default: 'column', lg: 'row' } },
|
|
50
|
+
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
51
|
+
React.createElement(CaseGroup, null)),
|
|
52
|
+
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
53
|
+
React.createElement(CaseLabels, null))),
|
|
49
54
|
React.createElement(CaseReferenceNumber, null),
|
|
50
55
|
React.createElement(Fts, { inlineEditable: true }),
|
|
51
56
|
React.createElement(SFDCUrl, null),
|
|
@@ -182,7 +182,7 @@ const CaseComments = React.forwardRef((props, ref) => {
|
|
|
182
182
|
.replace(/<\/?ul>/gi, ''));
|
|
183
183
|
}
|
|
184
184
|
const commentMarkdown = (markdown) => {
|
|
185
|
-
let htmlString = parseCommentMarkdown(markdown, { showButtonForAttachmentLink: true, disableImagePreview: isExportingPDF },
|
|
185
|
+
let htmlString = parseCommentMarkdown(markdown, { showButtonForAttachmentLink: true, disableImagePreview: isExportingPDF, encodeHTMLEntities: false },
|
|
186
186
|
// @ts-ignore
|
|
187
187
|
{ openLinksInNewTab: true, gfm: true, breaks: true });
|
|
188
188
|
if (isExportingPDF) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAmB5E,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;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAmB5E,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;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBAscxC"}
|
|
@@ -288,11 +288,10 @@ export function PostComment(props) {
|
|
|
288
288
|
let parsedPassedReply = getReplyText(passedReply !== null && passedReply !== void 0 ? passedReply : '', (_a = props.commentCreator) !== null && _a !== void 0 ? _a : '');
|
|
289
289
|
return (parsedPassedReply === null || parsedPassedReply === void 0 ? void 0 : parsedPassedReply.trim()) === (commentText === null || commentText === void 0 ? void 0 : commentText.trim());
|
|
290
290
|
};
|
|
291
|
+
// Submit stays independent of attachment upload so comments can be posted mid-upload (PCM-15915).
|
|
291
292
|
const isSubmitDisabled = isReplyDisabled() ||
|
|
292
293
|
isCommentEmpty ||
|
|
293
294
|
isPostCommentDisabled ||
|
|
294
|
-
isUploadingAttachments ||
|
|
295
|
-
hasQueuedUploads ||
|
|
296
295
|
(isConfirmedStateSideSupport && !cssCommentAgreed);
|
|
297
296
|
return (React.createElement("div", { className: `pf-v6-u-mb-md ${isExportingPDF ? 'hide-in-pdf' : ''}`, ref: componentRef },
|
|
298
297
|
React.createElement(Alert, { className: "pf-v6-u-mb-md pf-v6-u-font-size-sm", isInline: true, isPlain: true, variant: AlertVariant.info, title: React.createElement(Trans, { i18nKey: "markdownNotSupportedCommentWarning" },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseLabels.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseLabels.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAUzD,MAAM,CAAC,OAAO,UAAU,UAAU,sBA6KjC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { Label, MenuToggle, Select, SelectList, SelectOption, Spinner, } from '@patternfly/react-core';
|
|
11
|
+
import { ToastNotification } from '@rh-support/components';
|
|
12
|
+
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
|
+
import isEqual from 'lodash/isEqual';
|
|
14
|
+
import React, { useContext, useState } from 'react';
|
|
15
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
16
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
17
|
+
import { useCaseLabelLinks } from '../../hooks/useCaseLabelLinkMutations';
|
|
18
|
+
const NUM_VISIBLE_LABELS = 3;
|
|
19
|
+
export default function CaseLabels() {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const canEditCase = useCanEditCase();
|
|
22
|
+
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
23
|
+
const isOrgAdmin = loggedInUser.data.isOrgAdmin;
|
|
24
|
+
const { caseId, salesforceAccountId } = useCaseSelector((state) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return ({
|
|
27
|
+
caseId: state.caseDetails.id,
|
|
28
|
+
salesforceAccountId: (_b = (_a = state.selectedAccountDetails) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId,
|
|
29
|
+
});
|
|
30
|
+
}, isEqual);
|
|
31
|
+
const { availableLabels, assignedLinks, selectedLabelIds, loading, mutating, setAssignedLinks, createLink, deleteLink, } = useCaseLabelLinks(salesforceAccountId, caseId);
|
|
32
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
33
|
+
const handleSelect = (_event, labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (!labelId || typeof labelId !== 'string')
|
|
35
|
+
return;
|
|
36
|
+
if (canEditCase.alert())
|
|
37
|
+
return;
|
|
38
|
+
const existingLink = assignedLinks.find((link) => link.labelId === labelId);
|
|
39
|
+
try {
|
|
40
|
+
if (existingLink) {
|
|
41
|
+
yield deleteLink(existingLink.linkId);
|
|
42
|
+
setAssignedLinks((prev) => prev.filter((link) => link.linkId !== existingLink.linkId));
|
|
43
|
+
ToastNotification.addSuccessMessage(t('Label has been removed'));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const newId = yield createLink(caseId, labelId);
|
|
47
|
+
if (newId) {
|
|
48
|
+
setAssignedLinks((prev) => [...prev, { linkId: newId, labelId }]);
|
|
49
|
+
}
|
|
50
|
+
ToastNotification.addSuccessMessage(t('Label has been added'));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (_a) {
|
|
54
|
+
ToastNotification.addDangerMessage(t('Failed to update labels'));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const handleChipRemove = (labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
if (canEditCase.alert())
|
|
59
|
+
return;
|
|
60
|
+
const link = assignedLinks.find((l) => l.labelId === labelId);
|
|
61
|
+
if (!link)
|
|
62
|
+
return;
|
|
63
|
+
try {
|
|
64
|
+
yield deleteLink(link.linkId);
|
|
65
|
+
setAssignedLinks((prev) => prev.filter((l) => l.linkId !== link.linkId));
|
|
66
|
+
ToastNotification.addSuccessMessage(t('Label has been removed'));
|
|
67
|
+
}
|
|
68
|
+
catch (_a) {
|
|
69
|
+
ToastNotification.addDangerMessage(t('Failed to remove label'));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const selectedLabels = availableLabels.filter((l) => selectedLabelIds.includes(l.id));
|
|
73
|
+
const haltEvent = (e) => e.stopPropagation();
|
|
74
|
+
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen((prev) => !prev), isExpanded: isOpen, isDisabled: loading || mutating || !caseId || (!isOrgAdmin && availableLabels.length === 0), isFullWidth: true, style: { height: '36px' } }, loading || mutating ? (React.createElement(Spinner, { size: "md" })) : selectedLabels.length > 0 ? (React.createElement("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'nowrap' } },
|
|
75
|
+
selectedLabels.slice(0, NUM_VISIBLE_LABELS).map((label) => (React.createElement(Label, { key: label.id, variant: "outline", onClose: () => handleChipRemove(label.id), closeBtnAriaLabel: t('Remove label {{name}}', { name: label.name }), onClick: haltEvent }, label.name))),
|
|
76
|
+
selectedLabels.length > NUM_VISIBLE_LABELS && (React.createElement("span", { style: {
|
|
77
|
+
color: 'var(--pf-t--global--text--color--link--default)',
|
|
78
|
+
fontSize: '12px',
|
|
79
|
+
whiteSpace: 'nowrap',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
} }, t('{{count}} more', { count: selectedLabels.length - NUM_VISIBLE_LABELS }))))) : availableLabels.length === 0 ? (t('No label assigned')) : (t('Select labels'))));
|
|
82
|
+
if (!caseId)
|
|
83
|
+
return null;
|
|
84
|
+
return (React.createElement("div", { className: "form-group" },
|
|
85
|
+
React.createElement("label", { htmlFor: "case-labels" },
|
|
86
|
+
React.createElement(Trans, null, "Labels")),
|
|
87
|
+
React.createElement(Select, { id: "case-labels", "data-tracking-id": "case-labels", role: "menu", isOpen: isOpen, onSelect: handleSelect, onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
88
|
+
React.createElement(SelectList, { id: "case-labels-listbox" }, availableLabels.map((label) => (React.createElement(SelectOption, { key: label.id, value: label.id, hasCheckbox: true, isSelected: selectedLabelIds.includes(label.id) }, label.name))))),
|
|
89
|
+
!loading && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
90
|
+
React.createElement("strong", null, "No labels available:"),
|
|
91
|
+
" You haven't created any labels yet.",
|
|
92
|
+
' ',
|
|
93
|
+
React.createElement("a", { href: "/support/cases/#/manage/case-labels", style: { textDecoration: 'none' }, onClick: () => window.scrollTo(0, 0) }, "Create a label"),
|
|
94
|
+
' ',
|
|
95
|
+
"to start organizing your cases.")) : (React.createElement(Trans, null,
|
|
96
|
+
React.createElement("strong", null, "No labels available:"),
|
|
97
|
+
" Your organization admin hasn't created any labels yet. Contact them to add labels before you can select one."))))));
|
|
98
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAoCA,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,qBAwpBxD"}
|
|
@@ -7,12 +7,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
10
21
|
import { useApolloClient } from '@apollo/client/react';
|
|
11
|
-
import { publicApi } from '@cee-eng/hydrajs';
|
|
12
22
|
import { Button, Dropdown, DropdownItem, DropdownList, Flex, FlexItem, MenuToggle, Modal, ModalBody, ModalFooter, ModalHeader, Spinner, TextArea, } from '@patternfly/react-core';
|
|
13
|
-
import { ToastNotification
|
|
23
|
+
import { ToastNotification } from '@rh-support/components';
|
|
14
24
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
15
|
-
import { autoEnableFtsOnCaseViewEditPage,
|
|
25
|
+
import { autoEnableFtsOnCaseViewEditPage, isPremiumEntitlement, isSev1, isSev2, PreviousCaseTypes, severitySort, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage, } from '@rh-support/utils';
|
|
16
26
|
import { isUndefined } from 'lodash';
|
|
17
27
|
import find from 'lodash/find';
|
|
18
28
|
import includes from 'lodash/includes';
|
|
@@ -22,11 +32,11 @@ import map from 'lodash/map';
|
|
|
22
32
|
import React, { useContext, useEffect, useReducer, useRef, useState } from 'react';
|
|
23
33
|
import { Trans, useTranslation } from 'react-i18next';
|
|
24
34
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
25
|
-
import { GET_CASE_COMMENTS } from '../../hooks/useCaseComments';
|
|
26
35
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
27
36
|
import { getNewSeverityStringDef, getSeverityDescription } from '../../reducers/CaseHelpers';
|
|
28
37
|
import { caseOverviewReducer, initialCaseViewState, setSeverityUpdating } from '../../reducers/CaseOverviewReducer';
|
|
29
|
-
import { checkForCaseStatusToggleOnAttachOrComment, setCaseState, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
38
|
+
import { checkForCaseStatusToggleOnAttachOrComment, setCaseState, updateCaseDetails, updateCaseDetailsGraphQL, } from '../../reducers/CaseReducer';
|
|
39
|
+
import { usePostComment } from '../shared/usePostComment';
|
|
30
40
|
export default function UpdateSeverityModal(props) {
|
|
31
41
|
const { show, onClose, isDisabled, isFetching } = props;
|
|
32
42
|
const { t } = useTranslation();
|
|
@@ -40,9 +50,6 @@ export default function UpdateSeverityModal(props) {
|
|
|
40
50
|
const [isSeverityInValid, setIsSeverityInValid] = useState(false);
|
|
41
51
|
const [seviritiesOptions, setSeveritiesOptions] = useState([]);
|
|
42
52
|
const client = useApolloClient();
|
|
43
|
-
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
44
|
-
propgateErrors: true,
|
|
45
|
-
});
|
|
46
53
|
const { globalMetadataState: { allCaseSeverities, allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
47
54
|
const caseState = useCaseSelector((state) => ({
|
|
48
55
|
caseDetails: {
|
|
@@ -58,19 +65,51 @@ export default function UpdateSeverityModal(props) {
|
|
|
58
65
|
phoneCountryCode: state.caseDetails.phoneCountryCode,
|
|
59
66
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
60
67
|
},
|
|
68
|
+
existingCaseDetails: state.caseDetails,
|
|
61
69
|
isCaseUpdating: state.isCaseUpdating,
|
|
62
70
|
versionsDetails: state.versionsDetails,
|
|
63
71
|
ownersEntitlements: state.ownersEntitlements,
|
|
64
72
|
ftsContactSameAsOwner: state.ftsContactSameAsOwner,
|
|
65
73
|
}), isEqual);
|
|
66
|
-
const {
|
|
74
|
+
const { postComment, isPostingComment } = usePostComment({
|
|
75
|
+
caseNumber: caseState.caseDetails.caseNumber,
|
|
76
|
+
});
|
|
77
|
+
const { caseDetails, existingCaseDetails, isCaseUpdating, ownersEntitlements, versionsDetails, ftsContactSameAsOwner, } = caseState;
|
|
67
78
|
const { entitlementSla, fts, contactInfo24x7, caseType, phoneAreaCodePrefixLineNumber, phoneCountryCode } = caseDetails;
|
|
68
79
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
80
|
+
/** GraphQL-only severity/status update. FTS stays on Hydra and must not share this path — a Hydra failure used to roll severity back. */
|
|
81
|
+
const updateSeverityViaGraphQL = (severityPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const { severity, status } = severityPayload;
|
|
83
|
+
const graphqlUpdate = {};
|
|
84
|
+
if (severity !== undefined) {
|
|
85
|
+
graphqlUpdate.severity = severity;
|
|
86
|
+
}
|
|
87
|
+
if (status !== undefined) {
|
|
88
|
+
graphqlUpdate.status = status;
|
|
89
|
+
}
|
|
90
|
+
if (Object.keys(graphqlUpdate).length === 0) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
yield updateCaseDetailsGraphQL(caseDispatch, client, caseDetails.caseNumber, graphqlUpdate, false, {
|
|
94
|
+
existingCaseDetails,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
/** FTS / 24x7 via Hydra. Failures are surfaced but must not undo a successful GraphQL severity update. */
|
|
98
|
+
const updateFtsViaHydra = (ftsPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const { fts: ftsUpdate, contactInfo24x7: contactUpdate } = ftsPayload;
|
|
100
|
+
if (ftsUpdate === undefined && contactUpdate === undefined) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, Object.assign(Object.assign({}, (ftsUpdate !== undefined ? { fts: ftsUpdate } : {})), (contactUpdate !== undefined ? { contactInfo24x7: contactUpdate } : {})));
|
|
104
|
+
});
|
|
69
105
|
const [currentSeverity, setCurrentSeverity] = useState(caseDetails.caseSeverity);
|
|
70
106
|
const [localFtsContact, setLocalFtsContact] = useState(contactInfo24x7 || '');
|
|
71
107
|
const [localFts, setLocalFts] = useState(isUndefined(fts) ? true : fts);
|
|
72
108
|
const initialContactSameAsOwnerRef = useRef(ftsContactSameAsOwner !== null && ftsContactSameAsOwner !== void 0 ? ftsContactSameAsOwner : false);
|
|
73
|
-
const
|
|
109
|
+
const hasPremiumSla = isPremiumEntitlement(entitlementSla || '');
|
|
110
|
+
const severityForFts = String(currentSeverity !== null && currentSeverity !== void 0 ? currentSeverity : '').trim();
|
|
111
|
+
const shouldShowFts = isSev1(severityForFts) || isSev2(severityForFts);
|
|
112
|
+
const isPreviousSeveritySelected = isEqual(caseDetails.caseSeverity, currentSeverity);
|
|
74
113
|
const [isOpen, setIsOpen] = useState(false);
|
|
75
114
|
const onToggleClick = () => {
|
|
76
115
|
setIsOpen(!isOpen);
|
|
@@ -156,14 +195,14 @@ export default function UpdateSeverityModal(props) {
|
|
|
156
195
|
const updateCaseFtsInfo = () => __awaiter(this, void 0, void 0, function* () {
|
|
157
196
|
try {
|
|
158
197
|
const ftsUpdateComment = `${getFtsUpdateComment()} \n\n #### Description \n ${descriptionValue.trim()}`;
|
|
159
|
-
yield
|
|
198
|
+
yield updateFtsViaHydra({
|
|
160
199
|
fts: localFts,
|
|
161
200
|
contactInfo24x7: localFtsContact,
|
|
162
201
|
});
|
|
163
|
-
yield
|
|
164
|
-
caseNumber: caseDetails.caseNumber,
|
|
202
|
+
yield postComment({
|
|
165
203
|
commentBody: ftsUpdateComment === null || ftsUpdateComment === void 0 ? void 0 : ftsUpdateComment.trim(),
|
|
166
204
|
contentType: 'markdown',
|
|
205
|
+
updateDiscussionState: true,
|
|
167
206
|
});
|
|
168
207
|
ToastNotification.addSuccessMessage(t(`Case has been successfully updated`));
|
|
169
208
|
}
|
|
@@ -199,12 +238,19 @@ export default function UpdateSeverityModal(props) {
|
|
|
199
238
|
});
|
|
200
239
|
try {
|
|
201
240
|
setSeverityUpdating(caseOverviewDispatch, true);
|
|
202
|
-
|
|
241
|
+
const _a = updatedCaseDetails, { fts: ftsUpdate, contactInfo24x7: contactUpdate } = _a, severityAndStatus = __rest(_a, ["fts", "contactInfo24x7"]);
|
|
242
|
+
yield updateSeverityViaGraphQL(severityAndStatus);
|
|
243
|
+
if (ftsUpdate !== undefined || contactUpdate !== undefined) {
|
|
244
|
+
try {
|
|
245
|
+
yield updateFtsViaHydra({ fts: ftsUpdate, contactInfo24x7: contactUpdate });
|
|
246
|
+
}
|
|
247
|
+
catch (_b) { }
|
|
248
|
+
}
|
|
203
249
|
try {
|
|
204
|
-
yield
|
|
205
|
-
caseNumber: caseDetails.caseNumber,
|
|
250
|
+
yield postComment({
|
|
206
251
|
commentBody: severityUpdateComment === null || severityUpdateComment === void 0 ? void 0 : severityUpdateComment.trim(),
|
|
207
252
|
contentType: 'markdown',
|
|
253
|
+
updateDiscussionState: true,
|
|
208
254
|
});
|
|
209
255
|
try {
|
|
210
256
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), caseDetails.caseStatus);
|
|
@@ -213,20 +259,23 @@ export default function UpdateSeverityModal(props) {
|
|
|
213
259
|
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
214
260
|
}
|
|
215
261
|
catch (e) {
|
|
216
|
-
yield
|
|
217
|
-
caseNumber: caseDetails.caseNumber,
|
|
262
|
+
yield postComment({
|
|
218
263
|
commentBody: severityUpdateFailedComment === null || severityUpdateFailedComment === void 0 ? void 0 : severityUpdateFailedComment.trim(),
|
|
219
264
|
contentType: 'markdown',
|
|
265
|
+
updateDiscussionState: true,
|
|
220
266
|
});
|
|
221
267
|
onClose();
|
|
222
268
|
caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
|
|
223
|
-
yield
|
|
269
|
+
yield updateSeverityViaGraphQL({
|
|
270
|
+
status: 'Waiting on Customer',
|
|
271
|
+
severity: updatedCaseDetails['severity'],
|
|
272
|
+
});
|
|
224
273
|
}
|
|
225
274
|
}
|
|
226
275
|
catch (e) {
|
|
227
276
|
onClose();
|
|
228
277
|
caseUpdateError.showError(e, t(`Couldn't post severity update comment. Please try again`));
|
|
229
|
-
yield
|
|
278
|
+
yield updateSeverityViaGraphQL({
|
|
230
279
|
severity: caseDetails.caseSeverity,
|
|
231
280
|
});
|
|
232
281
|
setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
|
|
@@ -237,14 +286,13 @@ export default function UpdateSeverityModal(props) {
|
|
|
237
286
|
catch (e) {
|
|
238
287
|
onClose();
|
|
239
288
|
caseUpdateError.showError(e, t('Severity failed to update'));
|
|
240
|
-
yield
|
|
289
|
+
yield updateSeverityViaGraphQL({
|
|
241
290
|
severity: caseDetails.caseSeverity,
|
|
242
291
|
});
|
|
243
292
|
reUpdateSeverity(caseDetails.caseSeverity);
|
|
244
293
|
setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
|
|
245
294
|
}
|
|
246
295
|
finally {
|
|
247
|
-
yield client.refetchQueries({ include: [GET_CASE_COMMENTS] });
|
|
248
296
|
setIsUpdateClickedToShowError(false);
|
|
249
297
|
setDescriptionValue('');
|
|
250
298
|
}
|
|
@@ -262,14 +310,12 @@ export default function UpdateSeverityModal(props) {
|
|
|
262
310
|
if (isEmpty(updatedCaseDetails)) {
|
|
263
311
|
return false;
|
|
264
312
|
}
|
|
265
|
-
|
|
313
|
+
if (isEqual(caseDetails.caseSeverity, currentSeverity) &&
|
|
266
314
|
isEqual(caseDetails.fts, localFts) &&
|
|
267
315
|
isEqual(caseDetails.contactInfo24x7, localFtsContact)) {
|
|
268
316
|
return false;
|
|
269
317
|
}
|
|
270
|
-
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
318
|
+
return true;
|
|
273
319
|
};
|
|
274
320
|
const onFtsChange = (e) => {
|
|
275
321
|
if (canEditCase.alert())
|
|
@@ -284,8 +330,9 @@ export default function UpdateSeverityModal(props) {
|
|
|
284
330
|
if (!e.target.checked) {
|
|
285
331
|
return;
|
|
286
332
|
}
|
|
287
|
-
|
|
288
|
-
|
|
333
|
+
const ownerPhone = `${phoneCountryCode}-${phoneAreaCodePrefixLineNumber}`;
|
|
334
|
+
setUpdatedCaseDetails((pre) => (Object.assign(Object.assign({}, pre), { contactInfo24x7: ownerPhone })));
|
|
335
|
+
setLocalFtsContact(ownerPhone);
|
|
289
336
|
};
|
|
290
337
|
const onFtsContactChange = (e) => {
|
|
291
338
|
if (canEditCase.alert())
|
|
@@ -293,21 +340,53 @@ export default function UpdateSeverityModal(props) {
|
|
|
293
340
|
setLocalFtsContact(e.target.value);
|
|
294
341
|
setUpdatedCaseDetails((pre) => (Object.assign(Object.assign({}, pre), { contactInfo24x7: e.target.value.trim() })));
|
|
295
342
|
};
|
|
296
|
-
|
|
297
|
-
const
|
|
343
|
+
const isUpdateValid = checkIsUpdateValid();
|
|
344
|
+
const isDescriptionDisabled = (caseOverviewState.caseSeverityUpdating && isCaseUpdating) || isPostingComment || !isUpdateValid;
|
|
345
|
+
const isSubmitButtonDisabled = !(isUpdateValid && isTextAreaValid());
|
|
298
346
|
// To handle the severity change
|
|
299
|
-
const onSeverityChange = (
|
|
347
|
+
const onSeverityChange = (_event, value) => {
|
|
300
348
|
if (canEditCase.alert())
|
|
301
349
|
return;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
350
|
+
const option = typeof value === 'object' && value !== null && 'name' in value
|
|
351
|
+
? value
|
|
352
|
+
: filteredSeverities.find((s) => s.name === value) || {
|
|
353
|
+
name: String(value),
|
|
354
|
+
disabled: false,
|
|
355
|
+
label: String(value),
|
|
356
|
+
additionalInfo: '',
|
|
357
|
+
};
|
|
358
|
+
// Re-selecting the previously saved severity: reset and keep description/Update disabled
|
|
359
|
+
if (isEqual(caseDetails.caseSeverity, option.name)) {
|
|
360
|
+
setCurrentSeverity(option.name);
|
|
361
|
+
setUpdatedCaseDetails({});
|
|
362
|
+
setLocalFts(isUndefined(fts) ? true : !!fts);
|
|
363
|
+
setLocalFtsContact(contactInfo24x7 || '');
|
|
364
|
+
setCaseState(caseDispatch, { ftsContactSameAsOwner: initialContactSameAsOwnerRef.current });
|
|
365
|
+
setDescriptionValue('');
|
|
366
|
+
setIsUpdateClickedToShowError(false);
|
|
367
|
+
setIsSeverityInValidLocal(option);
|
|
368
|
+
setIsOpen(false);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (isSev1(option.name) && (hasPremiumSla || isEmpty(entitlementSla))) {
|
|
305
372
|
setLocalFts(true);
|
|
306
373
|
setLocalFtsContact('');
|
|
307
374
|
setCaseState(caseDispatch, { ftsContactSameAsOwner: false });
|
|
308
|
-
setUpdatedCaseDetails(
|
|
375
|
+
setUpdatedCaseDetails({
|
|
376
|
+
severity: option.name,
|
|
377
|
+
fts: !isIdea,
|
|
378
|
+
contactInfo24x7: '',
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
else if (isSev2(option.name) &&
|
|
382
|
+
(hasPremiumSla || isEmpty(entitlementSla) || showFtsOnCaseViewEditPage(entitlementSla || '', option.name))) {
|
|
383
|
+
setUpdatedCaseDetails({
|
|
384
|
+
severity: option.name,
|
|
385
|
+
});
|
|
309
386
|
}
|
|
310
387
|
else {
|
|
388
|
+
setLocalFts(false);
|
|
389
|
+
setLocalFtsContact('');
|
|
311
390
|
setUpdatedCaseDetails({ severity: option.name, fts: false });
|
|
312
391
|
}
|
|
313
392
|
setCurrentSeverity(option.name);
|
|
@@ -380,23 +459,21 @@ export default function UpdateSeverityModal(props) {
|
|
|
380
459
|
React.createElement(FlexItem, null, selectedSeverity.label || t(`Select a severity`)),
|
|
381
460
|
React.createElement(FlexItem, null, isFetching || versionsDetails.isFetching ? React.createElement(Spinner, { size: "md" }) : '')))), shouldFocusToggleOnSelect: true, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
382
461
|
React.createElement(DropdownList, null, allCaseSeverities.data
|
|
383
|
-
? filteredSeverities.map((option) => (React.createElement(DropdownItem, { value: option, key: option.name, description: option.additionalInfo }, option.label)))
|
|
462
|
+
? filteredSeverities.map((option) => (React.createElement(DropdownItem, { value: option.name, key: option.name, description: option.additionalInfo }, option.label)))
|
|
384
463
|
: []))),
|
|
385
464
|
React.createElement("div", null,
|
|
386
465
|
React.createElement("label", { htmlFor: "date-input", className: "pf-v6-u-mt-md" },
|
|
387
466
|
React.createElement(Trans, null, "Describe update"),
|
|
388
467
|
React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")),
|
|
389
|
-
React.createElement(TextArea, { placeholder: t('How has the business impact changed? If you have increased severity, please explain why.'), isDisabled: (
|
|
390
|
-
isPostingComment ||
|
|
391
|
-
!checkIsUpdateValid(), value: descriptionValue, onChange: (_event, value) => handleTextAreaChange(value), resizeOrientation: "vertical", "aria-label": "severity-update-descritpion", validated: isEmpty(descriptionValue) && isUpdateClickedToShowError ? 'error' : 'default', isRequired: true }),
|
|
468
|
+
React.createElement(TextArea, { placeholder: t('How has the business impact changed? If you have increased severity, please explain why.'), isDisabled: isDescriptionDisabled, value: descriptionValue, onChange: (_event, value) => handleTextAreaChange(value), resizeOrientation: "vertical", "aria-label": "severity-update-descritpion", validated: isEmpty(descriptionValue) && isUpdateClickedToShowError ? 'error' : 'default', isRequired: true }),
|
|
392
469
|
React.createElement("div", { className: "pf-v6-u-mt-xs" },
|
|
393
470
|
React.createElement(Trans, null, "To view your comment, go to the Discussion tab."))),
|
|
394
|
-
|
|
471
|
+
shouldShowFts && (React.createElement("div", { className: "pf-v6-u-mt-md pf-v6-u-mb-sm" },
|
|
395
472
|
React.createElement("div", null,
|
|
396
|
-
React.createElement("input", { type: "checkbox", id: "update-severity-fts", "data-tracking-id": "update-severity-fts", name: "update-severity-fts", checked: localFts, onChange: onFtsChange }),
|
|
473
|
+
React.createElement("input", { type: "checkbox", id: "update-severity-fts", "data-tracking-id": "update-severity-fts", name: "update-severity-fts", checked: localFts, onChange: onFtsChange, disabled: !isSev1(currentSeverity) }),
|
|
397
474
|
React.createElement("label", { htmlFor: "update-severity-fts" },
|
|
398
475
|
React.createElement(Trans, null, "24x7 Support"))),
|
|
399
|
-
localFts && (React.createElement("div", null,
|
|
476
|
+
(localFts || isSev1(currentSeverity) || isSev2(currentSeverity)) && (React.createElement("div", null,
|
|
400
477
|
React.createElement("label", { htmlFor: "update-severity-24-7-contact", className: "pf-v6-u-mt-xs" },
|
|
401
478
|
React.createElement(Trans, null, "Contact for 24x7 support")),
|
|
402
479
|
React.createElement("div", null,
|
|
@@ -416,8 +493,9 @@ export default function UpdateSeverityModal(props) {
|
|
|
416
493
|
React.createElement("p", { className: "pf-v6-u-text-color-subtle pf-v6-u-font-size-sm pf-v6-u-mb-md" }, t('Describing your update helps us better assist you.')),
|
|
417
494
|
modalBody()),
|
|
418
495
|
React.createElement(ModalFooter, null,
|
|
419
|
-
React.createElement(Button, { key: "submit", variant: "primary", onClick: onSubmit, isLoading: isCaseUpdating || isPostingComment, "data-tracking-id": "update-severity-submit", isDisabled:
|
|
420
|
-
|
|
421
|
-
|
|
496
|
+
React.createElement(Button, { key: "submit", variant: "primary", onClick: onSubmit, isLoading: isCaseUpdating || isPostingComment, "data-tracking-id": "update-severity-submit", isDisabled: (isPreviousSeveritySelected && !onlyFtsInfoChanged) ||
|
|
497
|
+
(!isUpdateClickedToShowError && isUpdateValid
|
|
498
|
+
? false
|
|
499
|
+
: isSubmitButtonDisabled || isCaseUpdating || isPostingComment) }, t('Update')),
|
|
422
500
|
React.createElement(Button, { key: "back", variant: "link", onClick: onCancel, "data-tracking-id": "update-severity-cancel", isDisabled: isCaseUpdating || isPostingComment }, t('Cancel')))));
|
|
423
501
|
}
|
|
@@ -3,6 +3,8 @@ export interface GetParentIdVariables {
|
|
|
3
3
|
CaseNumber: {
|
|
4
4
|
eq: string;
|
|
5
5
|
};
|
|
6
|
+
} | {
|
|
7
|
+
and: Array<Record<string, unknown>>;
|
|
6
8
|
};
|
|
7
9
|
}
|
|
8
10
|
export interface GetParentIdResponse {
|
|
@@ -58,6 +60,8 @@ export interface GetEscalationDetailsVariables {
|
|
|
58
60
|
ParentId: {
|
|
59
61
|
eq: string;
|
|
60
62
|
};
|
|
63
|
+
} | {
|
|
64
|
+
and: Array<Record<string, unknown>>;
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
export interface GetEscalationDetailsResponse {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escalation.d.ts","sourceRoot":"","sources":["../../../../src/graphql/schemas/escalation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACjC,KAAK,
|
|
1
|
+
{"version":3,"file":"escalation.d.ts","sourceRoot":"","sources":["../../../../src/graphql/schemas/escalation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACjC,KAAK,EACC;QACI,UAAU,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9B,GACD;QACI,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACvC,CAAC;CACX;AAED,MAAM,WAAW,mBAAmB;IAChC,oBAAoB,EAAE;QAClB,KAAK,EAAE;YACH,iBAAiB,EAAE;gBACf,KAAK,EAAE,KAAK,CAAC;oBACT,IAAI,EAAE;wBACF,EAAE,EAAE,MAAM,CAAC;qBACd,CAAC;iBACL,CAAC,CAAC;aACN,CAAC;SACL,CAAC;KACL,CAAC;CACL;AAED,MAAM,WAAW,gCAAgC;IAC7C,SAAS,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,qBAAqB,EAAE,MAAM,CAAC;QAC9B,yBAAyB,EAAE,MAAM,CAAC;KACrC,CAAC;CACL;AAED,MAAM,WAAW,+BAA+B;IAC5C,oBAAoB,EAAE;QAClB,UAAU,EAAE;YACR,mBAAmB,EAAE;gBACjB,EAAE,EAAE,MAAM,CAAC;gBACX,UAAU,EAAE;oBAAE,KAAK,EAAE,MAAM,CAAA;iBAAE,CAAC;gBAC9B,MAAM,EAAE;oBAAE,KAAK,EAAE,MAAM,CAAA;iBAAE,CAAC;gBAC1B,OAAO,EAAE;oBAAE,KAAK,EAAE,MAAM,CAAA;iBAAE,CAAC;gBAC3B,QAAQ,EAAE;oBAAE,KAAK,EAAE,MAAM,CAAA;iBAAE,CAAC;aAC/B,CAAC;SACL,CAAC;KACL,CAAC;CACL;AAED,MAAM,WAAW,6BAA6B;IAC1C,KAAK,EACC;QACI,QAAQ,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5B,GACD;QACI,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACvC,CAAC;CACX;AAED,MAAM,WAAW,4BAA4B;IACzC,oBAAoB,EAAE;QAClB,KAAK,EAAE;YACH,iBAAiB,EAAE;gBACf,KAAK,EAAE,KAAK,CAAC;oBACT,IAAI,EAAE;wBACF,UAAU,EAAE;4BAAE,KAAK,EAAE,MAAM,CAAA;yBAAE,CAAC;wBAC9B,OAAO,EAAE;4BAAE,KAAK,EAAE,MAAM,CAAA;yBAAE,CAAC;wBAC3B,MAAM,EAAE;4BAAE,KAAK,EAAE,MAAM,CAAA;yBAAE,CAAC;qBAC7B,CAAC;iBACL,CAAC,CAAC;aACN,CAAC;SACL,CAAC;KACL,CAAC;CACL"}
|