@rh-support/troubleshoot 2.2.1 → 2.2.3

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.
Files changed (22) hide show
  1. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  2. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +17 -8
  3. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +4 -2
  5. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  6. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +27 -10
  7. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts +1 -1
  8. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts.map +1 -1
  9. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  10. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  11. package/lib/esm/components/CaseInformation/Fts.js +2 -2
  12. package/lib/esm/components/CaseManagement/CaseManagement.js +3 -3
  13. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +1 -1
  14. package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
  15. package/lib/esm/components/EditDescription/EditDescription.js +4 -2
  16. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  17. package/lib/esm/components/shared/useIsSectionValid.js +16 -11
  18. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  19. package/lib/esm/hooks/useResetCaseCreate.js +3 -1
  20. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  21. package/lib/esm/reducers/CaseHelpers.js +17 -2
  22. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,sBAAsB,gBAuKrC"}
1
+ {"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAiBA,wBAAgB,sBAAsB,gBAgLrC"}
@@ -13,6 +13,7 @@ import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
13
13
  import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
14
14
  import { PhoneInput, ToastNotification } from '@rh-support/components';
15
15
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
16
+ import { isEmpty } from 'lodash';
16
17
  import isEqual from 'lodash/isEqual';
17
18
  import React, { useContext, useState } from 'react';
18
19
  import { Trans, useTranslation } from 'react-i18next';
@@ -36,6 +37,7 @@ export function CaseContactPhoneNumber() {
36
37
  const [isCasePhoneUpdating, setCasePhoneUpdating] = useState(false);
37
38
  const [localFullPhoneState, setLocalFullPhoneState] = useState(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber);
38
39
  const [localCountryCodeState, setLocalCountryCodeState] = useState(phoneCountryCode);
40
+ const [invalid, setInvalid] = useState(false);
39
41
  const caseDispatch = useCaseDispatch();
40
42
  const caseUpdateError = useCaseUpdateErrorMessage();
41
43
  const { t } = useTranslation();
@@ -104,24 +106,31 @@ export function CaseContactPhoneNumber() {
104
106
  caseUpdateError.showError(e, t(`Phone number failed to update`));
105
107
  }
106
108
  });
107
- const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} characters.', {
109
+ const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} digits.', {
108
110
  limit: PHONE_LIMIT,
109
111
  });
110
112
  const isPhoneNeedsReview = contactSSOName === loggedInUser.data.ssoUsername && suppliedPhoneNumberVerified === 'Deferred';
111
- return (React.createElement("div", { className: "form-group pf-u-pb-lg", style: { minWidth: '200px' } },
113
+ const noCharErrorMessage = t('Phone number can only have digits.');
114
+ const isPhoneNumberValid = (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT
115
+ ? ValidatedOptions.error
116
+ : isPhoneNeedsReview
117
+ ? ValidatedOptions.warning
118
+ : invalid
119
+ ? ValidatedOptions.error
120
+ : ValidatedOptions.default;
121
+ return (React.createElement("div", { className: "form-group pf-u-pb-sm", style: { minWidth: '200px' } },
112
122
  React.createElement("h3", { className: `subheading subheading-sm ${isExportingPDF ? 'expand-input' : ''}` },
113
123
  React.createElement(Trans, null, "Case owner's phone number"),
114
124
  !isExportingPDF ? ContactPhoneNumberPopOver() : ''),
115
125
  React.createElement(InputGroupText, { variant: InputGroupTextVariant.plain },
116
- React.createElement(PhoneInput, { phoneValue: localFullPhoneState, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT
117
- ? ValidatedOptions.error
118
- : isPhoneNeedsReview
119
- ? ValidatedOptions.warning
120
- : ValidatedOptions.default, isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating, isLoading: isCasePhoneUpdating, "data-tracking-id": "case-details-page-supplied-phone" }),
126
+ React.createElement(PhoneInput, { phoneValue: localFullPhoneState, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating, isLoading: isCasePhoneUpdating, "data-tracking-id": "case-details-page-supplied-phone", invalid: invalid, setInvalid: setInvalid }),
121
127
  React.createElement("button", { className: "btn btn-app btn-link pf-u-ml-sm", type: "button", "data-tracking-id": "case-details-page-supplied-phone-save", onClick: () => onSave(), disabled: (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT ||
122
128
  localFullPhoneState === phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber, style: { display: isExportingPDF ? 'none' : '' } },
123
129
  React.createElement(CheckIcon, null)),
124
- React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: onClear, "data-tracking-id": "case-details-page-supplied-phone-cancel", style: { display: isExportingPDF ? 'none' : '' } },
130
+ React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: onClear, "data-tracking-id": "case-details-page-supplied-phone-cancel", style: { display: isExportingPDF ? 'none' : '' }, disabled: isEmpty(localFullPhoneState) },
125
131
  React.createElement(TimesIcon, { color: "#6A6E73" }))),
132
+ invalid && React.createElement("p", { className: "form-instructions form-invalid" },
133
+ noCharErrorMessage,
134
+ " "),
126
135
  (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT && (React.createElement("p", { className: "form-instructions form-invalid" }, maxLengthErrorMessage))));
127
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHostname.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseHostname.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAMD,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,eAqKlC;kBArKQ,YAAY;;;AAwKrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"CaseHostname.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseHostname.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAc5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAMD,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,eA0KlC;kBA1KQ,YAAY;;;AA6KrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -22,6 +22,7 @@ import { HOSTNAME_LENGTH_LIMIT } from '../../../../reducers/CaseConstNTypes';
22
22
  import { updateCaseDetails } from '../../../../reducers/CaseReducer';
23
23
  import { CaseValuesToWatch } from '../../../shared/Constants';
24
24
  import { getChangedValueTooltip } from '../../../shared/utils';
25
+ import { PDFContext } from '../../PDFContainer';
25
26
  const defaultProps = {
26
27
  inlineEditable: false,
27
28
  };
@@ -38,6 +39,7 @@ function CaseHostname(props) {
38
39
  const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
39
40
  const [isShareHostNamesChecked, setIsShareHostNamesChecked] = useState(false);
40
41
  const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
42
+ const { isExportingPDF } = useContext(PDFContext);
41
43
  const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
42
44
  const { request: fetchHostnameDefault } = useFetch(accounts.getIsSharingHostname);
43
45
  const userOriginalHostnameValue = () => __awaiter(this, void 0, void 0, function* () {
@@ -108,8 +110,8 @@ function CaseHostname(props) {
108
110
  return (React.createElement(React.Fragment, null,
109
111
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'case-details-hostname' }, formClassName: props.className || '', labelContent: React.createElement(React.Fragment, null,
110
112
  React.createElement(Trans, null, "Hostname"),
111
- React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localHostnameChange, value: hostname, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.hostname) })), helperContent: React.createElement(Popover, { "aria-label": "Hostname Info", position: PopoverPosition.auto, bodyContent: hostNameVisibilityContent, closeBtnAriaLabel: "Close", headerContent: 'Share hostname?', onShow: () => userOriginalHostnameValue() },
112
- React.createElement(QuestionCircleIcon, { className: "pf-u-ml-xs icon-size", "aria-label": "Hostname Info" })), allowInlineEdit: props.inlineEditable, content: hostname, saveDisabled: hostnameState === hostname || isHostnameUpdating || lengthError, onSave: onSave, onCancel: onCancel, initialIsEditing: false, loadingIndicator: isHostnameUpdating ? React.createElement(LoadingIndicator, { show: isHostnameUpdating, isInline: true }) : undefined },
113
+ React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localHostnameChange, value: hostname, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.hostname) })), helperContent: !isExportingPDF ? (React.createElement(Popover, { "aria-label": "Hostname Info", position: PopoverPosition.auto, bodyContent: hostNameVisibilityContent, closeBtnAriaLabel: "Close", headerContent: 'Share hostname?', onShow: () => userOriginalHostnameValue() },
114
+ React.createElement(QuestionCircleIcon, { className: "pf-u-ml-xs icon-size", "aria-label": "Hostname Info" }))) : undefined, allowInlineEdit: props.inlineEditable, content: hostname, saveDisabled: hostnameState === hostname || isHostnameUpdating || lengthError, onSave: onSave, onCancel: onCancel, initialIsEditing: false, loadingIndicator: isHostnameUpdating ? React.createElement(LoadingIndicator, { show: isHostnameUpdating, isInline: true }) : undefined, isExportingPDF: isExportingPDF },
113
115
  React.createElement("input", { type: "text", id: "case-details-hostname", className: `form-control${lengthError ? ' form-invalid' : ''}`, name: "case-details-hostname", value: hostnameState, onChange: onHostnameChange, disabled: isHostnameUpdating, "data-tracking-id": "case-details-hostname", "aria-invalid": lengthError })),
114
116
  lengthError && (React.createElement("div", { className: "pull-top" },
115
117
  React.createElement("p", { className: "form-instructions form-invalid" },
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAYA,wBAAgB,kBAAkB,gBA4DjC"}
1
+ {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAYA,wBAAgB,kBAAkB,gBAkFjC"}
@@ -2,7 +2,7 @@ import { ValidatedOptions } from '@patternfly/react-core';
2
2
  import { PhoneInput } from '@rh-support/components';
3
3
  import isEmpty from 'lodash/isEmpty';
4
4
  import isEqual from 'lodash/isEqual';
5
- import React from 'react';
5
+ import React, { useState } from 'react';
6
6
  import { Trans, useTranslation } from 'react-i18next';
7
7
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
8
8
  import { PHONE_LIMIT } from '../../reducers/CaseConstNTypes';
@@ -16,10 +16,14 @@ export function ContactPhoneNumber() {
16
16
  phoneCountryCode: state.caseDetails.phoneCountryCode,
17
17
  phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber,
18
18
  }), isEqual);
19
- const getPhone = () => phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber;
19
+ const [invalid, setInvalid] = useState(false);
20
+ const getPhone = () => phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber.replace(phoneCountryCode, '');
20
21
  const caseDispatch = useCaseDispatch();
21
22
  const { t } = useTranslation();
22
23
  const onPhoneChange = (fullPhone) => {
24
+ if (isEmpty(fullPhone)) {
25
+ setInvalid(false);
26
+ }
23
27
  setCaseDetails(caseDispatch, {
24
28
  phoneAreaCodePrefixLineNumber: phoneCountryCode
25
29
  ? fullPhone.substring(phoneCountryCode.length, fullPhone.length).trim()
@@ -27,19 +31,32 @@ export function ContactPhoneNumber() {
27
31
  });
28
32
  };
29
33
  const onCountryCodeChange = (phoneCountryCode) => {
30
- setCaseDetails(caseDispatch, { phoneCountryCode });
34
+ setCaseDetails(caseDispatch, { phoneCountryCode: phoneCountryCode });
31
35
  };
32
- const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} characters.', {
36
+ const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} digits.', {
33
37
  limit: PHONE_LIMIT,
34
38
  });
39
+ const phoneNumberEmptyError = t('Phone number cannot be empty when country code is given.');
40
+ // To check if country code is given but phone number empty
41
+ const isPhoneNumberEmpty = !isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber === null || phoneAreaCodePrefixLineNumber === void 0 ? void 0 : phoneAreaCodePrefixLineNumber.replace(phoneCountryCode, ''));
42
+ const isPhoneNumberValid = ((_a = getPhone) === null || _a === void 0 ? void 0 : _a.length) > PHONE_LIMIT
43
+ ? ValidatedOptions.error
44
+ : severity === "1 (Urgent)" /* SEV_1 */ && isEmpty(suppliedPhoneNumberVerified)
45
+ ? ValidatedOptions.warning
46
+ : isPhoneNumberEmpty
47
+ ? ValidatedOptions.error
48
+ : invalid
49
+ ? ValidatedOptions.error
50
+ : ValidatedOptions.default;
51
+ const noCharErrorMessage = t('Phone number can only have digits.');
35
52
  return (React.createElement("div", { className: "form-group pf-u-pb-xl", style: { minWidth: '200px' } },
36
53
  React.createElement("label", null,
37
54
  React.createElement(Trans, null, "Case owner's phone number"),
38
55
  ContactPhoneNumberPopOver()),
39
- React.createElement(PhoneInput, { phoneValue: getPhone(), onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: ((_a = getPhone) === null || _a === void 0 ? void 0 : _a.length) > PHONE_LIMIT
40
- ? ValidatedOptions.error
41
- : severity === "1 (Urgent)" /* SEV_1 */ && isEmpty(suppliedPhoneNumberVerified)
42
- ? ValidatedOptions.warning
43
- : ValidatedOptions.default }),
44
- ((_b = getPhone()) === null || _b === void 0 ? void 0 : _b.length) > PHONE_LIMIT && (React.createElement("p", { className: "form-instructions form-invalid" }, maxLengthErrorMessage))));
56
+ React.createElement(PhoneInput, { phoneValue: getPhone(), onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, invalid: invalid, setInvalid: setInvalid }),
57
+ invalid && React.createElement("p", { className: "form-instructions form-invalid" },
58
+ noCharErrorMessage,
59
+ " "),
60
+ ((_b = getPhone()) === null || _b === void 0 ? void 0 : _b.length) > PHONE_LIMIT && (React.createElement("p", { className: "form-instructions form-invalid" }, maxLengthErrorMessage)),
61
+ isPhoneNumberEmpty && React.createElement("p", { className: "form-instructions form-invalid" }, phoneNumberEmptyError)));
45
62
  }
@@ -1,2 +1,2 @@
1
- export declare function ContactPhoneNumberPopOver(): JSX.Element;
1
+ export declare const ContactPhoneNumberPopOver: () => JSX.Element;
2
2
  //# sourceMappingURL=ContactPhoneNumberPopOver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumberPopOver.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumberPopOver.tsx"],"names":[],"mappings":"AAKA,wBAAgB,yBAAyB,gBAexC"}
1
+ {"version":3,"file":"ContactPhoneNumberPopOver.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumberPopOver.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,mBAerC,CAAC"}
@@ -2,8 +2,8 @@ import { Popover, PopoverPosition } from '@patternfly/react-core';
2
2
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
3
3
  import React from 'react';
4
4
  import { Trans } from 'react-i18next';
5
- export function ContactPhoneNumberPopOver() {
5
+ export const ContactPhoneNumberPopOver = () => {
6
6
  return (React.createElement(Popover, { "aria-label": "Support Severity Level info", position: PopoverPosition.right, bodyContent: React.createElement("p", null,
7
7
  React.createElement(Trans, null, "These changes to your phone number affect only this case.")), closeBtnAriaLabel: "Close" },
8
8
  React.createElement(QuestionCircleIcon, { className: "pf-u-ml-xs icon-size", "aria-label": "Contact Phone Number Info" })));
9
- }
9
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,GAAG,CAAC,KAAK,EAAE,MAAM,eAqLzB;kBArLQ,GAAG;;;AAwLZ,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,GAAG,CAAC,KAAK,EAAE,MAAM,eAsLzB;kBAtLQ,GAAG;;;AAyLZ,eAAe,GAAG,CAAC"}
@@ -134,13 +134,13 @@ function Fts(props) {
134
134
  // To disable save button if field is empty or is updating
135
135
  const isSaveDisabled = contactInfo24X7State === contactInfo24x7 || isFtsContactUpdating;
136
136
  return (React.createElement(React.Fragment, null,
137
- React.createElement("div", { className: "form-group push-top" },
137
+ React.createElement("div", { className: "form-group pf-u-mb-md" },
138
138
  React.createElement("input", { type: "checkbox", id: "get-support-fts", "data-tracking-id": "get-support-fts", disabled: disableFtsNContact, name: "get-support-fts", checked: fts, onChange: onFtsChange }),
139
139
  React.createElement("label", { htmlFor: "get-support-fts" },
140
140
  React.createElement(Trans, null, "24x7 Support")),
141
141
  React.createElement(LoadingIndicator, { size: "sm", isInline: true, show: isFtsUpdating, className: "pf-u-ml-sm" })),
142
142
  fts === true && (React.createElement(React.Fragment, null,
143
- React.createElement(InlineEdit, { labelProps: { htmlFor: 'get-support-24-7-contact' }, labelContent: React.createElement(Trans, null, "24x7 Contact"), allowInlineEdit: props.inlineEditable && !disableFtsNContact, hideSaveCancel: props.hideSaveCancel, initialIsEditing: props.initialIsEditing, content: contactInfo24x7, onSave: onSave, onCancel: onCancel, saveDisabled: isSaveDisabled, loadingIndicator: isFtsContactUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : undefined, isExportingPDF: isExportingPDF },
143
+ React.createElement(InlineEdit, { formClassName: "pf-u-mb-md", labelProps: { htmlFor: 'get-support-24-7-contact' }, labelContent: React.createElement(Trans, null, "24x7 Contact"), allowInlineEdit: props.inlineEditable && !disableFtsNContact, hideSaveCancel: props.hideSaveCancel, initialIsEditing: props.initialIsEditing, content: contactInfo24x7, onSave: onSave, onCancel: onCancel, saveDisabled: isSaveDisabled, loadingIndicator: isFtsContactUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : undefined, isExportingPDF: isExportingPDF },
144
144
  React.createElement(TextAreaAutosize, { id: "get-support-24-7-contact", className: `form-control`, name: "get-support-24-7-contact", value: contactInfo24X7State, onChange: onFtsContactChange, disabled: disableFtsNContact, "data-tracking-id": "get-support-24-7-contact" }),
145
145
  React.createElement("p", { className: "form-instructions" },
146
146
  React.createElement(Trans, null, "Please provide contact information where you can be reached at any time to help you with your case."))),
@@ -19,12 +19,12 @@ export default function CaseManagement(props) {
19
19
  setCaseDetails(caseDispatch, payload);
20
20
  };
21
21
  return (React.createElement("form", null,
22
+ React.createElement(SupportLevel, null),
22
23
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' }, className: "severity-flex-case-management" },
23
24
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
24
- React.createElement(SupportLevel, null)),
25
+ React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange })),
25
26
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
26
- React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange }))),
27
- React.createElement(ContactPhoneNumber, null),
27
+ React.createElement(ContactPhoneNumber, null))),
28
28
  React.createElement(ContactPhoneNumberAlert, null),
29
29
  React.createElement(Fts, { inlineEditable: false }),
30
30
  React.createElement(CaseLanguageSelector, { isManageStep: true }),
@@ -248,7 +248,7 @@ function CaseContactSelector(props) {
248
248
  };
249
249
  if (!canSeeEmailNotifications)
250
250
  return React.createElement(React.Fragment, null);
251
- return (React.createElement("div", { className: "form-group" },
251
+ return (React.createElement("div", { className: "form-group pf-u-mb-md" },
252
252
  React.createElement("label", { htmlFor: "get-support-notifications" },
253
253
  React.createElement(Trans, null, "Send notifications")),
254
254
  loggedInUserRights.data.isOrgAdmin() ? (React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"EditDescription.d.ts","sourceRoot":"","sources":["../../../../src/components/EditDescription/EditDescription.tsx"],"names":[],"mappings":"AAaA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;CAC3B;AAUD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAoEpD"}
1
+ {"version":3,"file":"EditDescription.d.ts","sourceRoot":"","sources":["../../../../src/components/EditDescription/EditDescription.tsx"],"names":[],"mappings":"AAcA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;CAC3B;AAUD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAuEpD"}
@@ -11,12 +11,13 @@ import { kase } from '@cee-eng/hydrajs';
11
11
  import { encodeAngularBrackets, linkifyBZIDs, linkifyWithCaseIDs } from '@cee-eng/ui-toolkit';
12
12
  import { InlineEdit, LoadingIndicator, TextAreaAutosize, ToastNotification } from '@rh-support/components';
13
13
  import isEqual from 'lodash/isEqual';
14
- import React, { useState } from 'react';
14
+ import React, { useContext, useState } from 'react';
15
15
  import { Trans, useTranslation } from 'react-i18next';
16
16
  import { useParams } from 'react-router-dom';
17
17
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
18
18
  import { DESCRIPTION_LENGTH_LIMIT, LargeDescriptionErrorMessage } from '../../reducers/CaseConstNTypes';
19
19
  import { setCaseDetails } from '../../reducers/CaseReducer';
20
+ import { PDFContext } from '../CaseEditView/PDFContainer';
20
21
  const linkifiedDescription = (text) => {
21
22
  text = encodeAngularBrackets(text);
22
23
  text = linkifyWithCaseIDs(text);
@@ -33,6 +34,7 @@ export default function EditDescription(props) {
33
34
  const caseDispatch = useCaseDispatch();
34
35
  const [localDescription, setLocalDescription] = useState(description);
35
36
  const [isUpdating, setIsUpdating] = useState(false);
37
+ const { isExportingPDF } = useContext(PDFContext);
36
38
  const [isDescriptionTextAreaFocused, setDescriptionTextAreaFocused] = useState(false);
37
39
  const onDescriptionSave = () => __awaiter(this, void 0, void 0, function* () {
38
40
  setDescriptionTextAreaFocused(false);
@@ -58,7 +60,7 @@ export default function EditDescription(props) {
58
60
  };
59
61
  const descriptionErrorMessage = t(LargeDescriptionErrorMessage, { limit: DESCRIPTION_LENGTH_LIMIT });
60
62
  return (React.createElement(InlineEdit, { labelContent: React.createElement(React.Fragment, null,
61
- React.createElement(Trans, null, "Description")), loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { size: "xs" }) : null, labelProps: { htmlFor: 'edit-description' }, content: React.createElement("div", { dangerouslySetInnerHTML: { __html: linkifiedDescription(localDescription) } }), allowInlineEdit: !!props.inlineEditable, saveDisabled: localDescription === description || isUpdating, usePreformattedTag: true, onSave: onDescriptionSave },
63
+ React.createElement(Trans, null, "Description")), loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { size: "xs" }) : null, labelProps: { htmlFor: 'edit-description' }, content: React.createElement("div", { dangerouslySetInnerHTML: { __html: linkifiedDescription(localDescription) } }), allowInlineEdit: !!props.inlineEditable, saveDisabled: localDescription === description || isUpdating, usePreformattedTag: true, onSave: onDescriptionSave, isExportingPDF: isExportingPDF },
62
64
  React.createElement(TextAreaAutosize, { id: "edit-description", name: "edit-description", className: `form-control${hasLargeCaseDescription ? ' form-invalid' : ''}`, value: localDescription, disabled: isUpdating, onChange: onDescriptionChange, "data-tracking-id": "edit-description" }),
63
65
  React.createElement("p", { className: "form-instructions" }, `${hasLargeCaseDescription && isDescriptionTextAreaFocused ? descriptionErrorMessage : ''}`)));
64
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAmM9D"}
1
+ {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAsM9D"}
@@ -43,7 +43,7 @@ export function useIsSectionValid(sectionName) {
43
43
  if (caseType === 'Feature / Enhancement Request') {
44
44
  unallowedFiles = selectedLocalFiles.filter((file) => !allowedTypesIdea.includes(file.type));
45
45
  }
46
- let hasUnallowedFiles = unallowedFiles.length > 0;
46
+ let hasUnallowedFiles = (unallowedFiles === null || unallowedFiles === void 0 ? void 0 : unallowedFiles.length) > 0;
47
47
  return !hasUnallowedFiles; // we want it false to trigger the error if its true
48
48
  };
49
49
  const isGetSupportSectionValidLocal = () => {
@@ -53,6 +53,7 @@ export function useIsSectionValid(sectionName) {
53
53
  !selectedAccountDetails.data.subscriptionAbuse);
54
54
  };
55
55
  const isSummarizeSectionValid = () => {
56
+ var _a;
56
57
  return (!isEmpty(product) &&
57
58
  !isEmpty(version) &&
58
59
  !allProducts.isFetching &&
@@ -60,15 +61,16 @@ export function useIsSectionValid(sectionName) {
60
61
  !topContent.isFetching &&
61
62
  !isEmpty(summary) &&
62
63
  !recommendationState.isLoadingRecommendations &&
63
- summary.length < SUMMARY_LENGTH_LIMIT);
64
+ ((_a = summary) === null || _a === void 0 ? void 0 : _a.length) < SUMMARY_LENGTH_LIMIT);
64
65
  };
65
66
  const isCaseManagementSectionValid = () => {
67
+ var _a, _b;
66
68
  const hasContactInfo24x7ValidLength = contactInfo24x7
67
- ? contactInfo24x7.length <= CONTACT_INFO_24X7_LIMIT
69
+ ? (contactInfo24x7 === null || contactInfo24x7 === void 0 ? void 0 : contactInfo24x7.length) <= CONTACT_INFO_24X7_LIMIT
68
70
  : true;
69
- const hasAlternateCaseIdValidLength = alternateId ? alternateId.length <= CASE_REFERENCE_NUMBER_LIMIT : true;
71
+ const hasAlternateCaseIdValidLength = alternateId ? (alternateId === null || alternateId === void 0 ? void 0 : alternateId.length) <= CASE_REFERENCE_NUMBER_LIMIT : true;
70
72
  const hasSuppliedPhoneValidLength = phoneAreaCodePrefixLineNumber || phoneCountryCode
71
- ? phoneCountryCode.length + phoneAreaCodePrefixLineNumber.length + 1 <= PHONE_LIMIT
73
+ ? ((_a = phoneCountryCode) === null || _a === void 0 ? void 0 : _a.length) + ((_b = phoneAreaCodePrefixLineNumber) === null || _b === void 0 ? void 0 : _b.length) + 1 <= PHONE_LIMIT
72
74
  : true;
73
75
  return (isCaseManagementStateValid(caseState, loggedInUserJwtToken) &&
74
76
  hasContactInfo24x7ValidLength &&
@@ -76,21 +78,24 @@ export function useIsSectionValid(sectionName) {
76
78
  hasSuppliedPhoneValidLength);
77
79
  };
78
80
  const isTroubleshootSectionValid = () => {
79
- var _a;
81
+ var _a, _b, _c;
80
82
  // don't check for entitled product if user is on search intent flow
81
83
  const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
82
84
  return (!recommendationState.isLoadingRecommendations &&
83
85
  !isEmpty(summary) &&
84
86
  isEntitledProductLocal &&
85
- summary.length <= SUMMARY_LENGTH_LIMIT &&
86
- description.length <= DESCRIPTION_LENGTH_LIMIT &&
87
- isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult));
87
+ ((_a = summary) === null || _a === void 0 ? void 0 : _a.length) <= SUMMARY_LENGTH_LIMIT &&
88
+ ((_b = description) === null || _b === void 0 ? void 0 : _b.length) <= DESCRIPTION_LENGTH_LIMIT &&
89
+ isClusterIDValid(caseState, (_c = allProducts.data) === null || _c === void 0 ? void 0 : _c.productsResult));
88
90
  };
89
91
  const isReviewSectionValid = () => {
90
92
  var _a;
91
93
  return (isEntitledProduct &&
92
94
  isCaseStateValid(caseState, loggedInUserJwtToken) &&
93
- isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult));
95
+ isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) &&
96
+ (!isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber === null || phoneAreaCodePrefixLineNumber === void 0 ? void 0 : phoneAreaCodePrefixLineNumber.replace(phoneCountryCode, ''))
97
+ ? false
98
+ : true));
94
99
  };
95
100
  const isDescribeIdeaSectionValid = () => {
96
101
  return (isCaseManagementStateValid(caseState, loggedInUserJwtToken) &&
@@ -100,7 +105,7 @@ export function useIsSectionValid(sectionName) {
100
105
  };
101
106
  const isCaseDescribeMoreSectionValidLocal = () => {
102
107
  var _a;
103
- const hostnameIsValid = hostname ? hostname.length <= HOSTNAME_LENGTH_LIMIT : true;
108
+ const hostnameIsValid = hostname ? (hostname === null || hostname === void 0 ? void 0 : hostname.length) <= HOSTNAME_LENGTH_LIMIT : true;
104
109
  return (!caseState.hasInvalidEntitlements &&
105
110
  isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) &&
106
111
  isCaseInformationSectionValid(caseState, loggedInUserJwtToken) &&
@@ -1 +1 @@
1
- {"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"AAoBA,wBAAgB,kBAAkB;;EAoCjC"}
1
+ {"version":3,"file":"useResetCaseCreate.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResetCaseCreate.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB;;EAsCjC"}
@@ -1,4 +1,4 @@
1
- import { fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
1
+ import { fetchLoggedInUser, fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
2
2
  import { useContext } from 'react';
3
3
  import { AttachmentDispatchContext, resetAttachment } from '../components/shared/fileUpload';
4
4
  import { useCaseDispatch } from '../context/CaseContext';
@@ -22,6 +22,8 @@ export function useResetCaseCreate() {
22
22
  const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
23
23
  const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
24
24
  const resetCaseCreateState = () => {
25
+ // On case creation we refetch the user contact details to get users updated phone number
26
+ fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, {});
25
27
  resetAttachment(dispatchToAttachmentReducer);
26
28
  resetTopContent(tcDispatch);
27
29
  resetRecommendations(recommendationsDispatch);
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkB3D,OAAO,EAUH,UAAU,EAgBb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,WAAW,KAAG,MAOrE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,mBAAmB,SAAS,MAAM,sBAyB9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,UACvB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,kBACb,MAAM,YACZ,MAAM,YACN,MAAM,KACjB,MAyBF,CAAC;AAIF,eAAO,MAAM,oBAAoB,UACtB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,KAC9B,MAQF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,MAAM,KAAG,MAKzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAqC5B,CAAC;AAIF,eAAO,MAAM,gBAAgB,cAAe,UAAU,wBAAwB,QAAQ,eAAe,CAAC,KAAG,OA8BxG,CAAC;AAEF,eAAO,MAAM,oBAAoB,cAClB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OA0BF,CAAC;AAEF,eAAO,MAAM,0BAA0B,cACxB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAiBF,CAAC;AAIF,eAAO,MAAM,6BAA6B,cAC3B,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAuBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,cACf,UAAU,gBACP,YAAY,iBACZ,OAAO,KACtB,QAAQ,YAAY,CA2EtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,qBAAsB,YAAY,EAAE,KAAG,YAAY,EAEvF,CAAC;AACF,eAAO,MAAM,yBAAyB,qBAAsB,YAAY,EAAE,KAAG,OAE5E,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACrB,YAAY,6BACE,MAAM,mBAChB,MAAM,KACxB,QAAQ,YAAY,CAgCtB,CAAC;AACF,eAAO,MAAM,yBAAyB,gBACrB,QAAQ,YAAY,CAAC,gCACJ,QAAQ,EAAE,KACzC,eA+CF,CAAC"}
1
+ {"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkB3D,OAAO,EAUH,UAAU,EAgBb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,WAAW,KAAG,MAOrE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,mBAAmB,SAAS,MAAM,sBAyB9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,UACvB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,kBACb,MAAM,YACZ,MAAM,YACN,MAAM,KACjB,MAyBF,CAAC;AAIF,eAAO,MAAM,oBAAoB,UACtB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,KAC9B,MAQF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,MAAM,KAAG,MAKzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAqC5B,CAAC;AAIF,eAAO,MAAM,gBAAgB,cAAe,UAAU,wBAAwB,QAAQ,eAAe,CAAC,KAAG,OAwCxG,CAAC;AAEF,eAAO,MAAM,oBAAoB,cAClB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OA0BF,CAAC;AAEF,eAAO,MAAM,0BAA0B,cACxB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAqBF,CAAC;AAIF,eAAO,MAAM,6BAA6B,cAC3B,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAuBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,cACf,UAAU,gBACP,YAAY,iBACZ,OAAO,KACtB,QAAQ,YAAY,CA2EtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,qBAAsB,YAAY,EAAE,KAAG,YAAY,EAEvF,CAAC;AACF,eAAO,MAAM,yBAAyB,qBAAsB,YAAY,EAAE,KAAG,OAE5E,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACrB,YAAY,6BACE,MAAM,mBAChB,MAAM,KACxB,QAAQ,YAAY,CAgCtB,CAAC;AACF,eAAO,MAAM,yBAAyB,gBACrB,QAAQ,YAAY,CAAC,gCACJ,QAAQ,EAAE,KACzC,eA+CF,CAAC"}
@@ -132,6 +132,7 @@ export const isClusterIDValid = (caseState, allProducts) => {
132
132
  export const isCaseStateValid = (caseState, loggedInUserJwtToken) => {
133
133
  var _a, _b;
134
134
  const case_details = caseState.caseDetails;
135
+ const regex = /^[\d ()+-]+$/;
135
136
  return (!isEmpty(case_details.issue) &&
136
137
  isEmpty(case_details.caseNumber) &&
137
138
  !caseState.hasLargeCaseDescription &&
@@ -151,8 +152,17 @@ export const isCaseStateValid = (caseState, loggedInUserJwtToken) => {
151
152
  !isEmpty(case_details.severity) &&
152
153
  !isEmpty(case_details.accountNumberRef) &&
153
154
  !isEmpty(case_details.contactSSOName) &&
154
- ((_a = case_details.phoneCountryCode) === null || _a === void 0 ? void 0 : _a.length) + ((_b = case_details.phoneAreaCodePrefixLineNumber) === null || _b === void 0 ? void 0 : _b.length) + 1 <=
155
- PHONE_LIMIT &&
155
+ // Country Code and Phone Number Not Mandatory
156
+ (!isEmpty(case_details.phoneCountryCode) && !isEmpty(case_details.phoneAreaCodePrefixLineNumber)
157
+ ? ((_a = case_details.phoneCountryCode) === null || _a === void 0 ? void 0 : _a.length) + ((_b = case_details.phoneAreaCodePrefixLineNumber) === null || _b === void 0 ? void 0 : _b.length) + 1 <=
158
+ PHONE_LIMIT
159
+ : true) &&
160
+ // To validate case state if country code is given but phone number is empty
161
+ (!isEmpty(case_details.phoneCountryCode) &&
162
+ isEmpty(case_details.phoneAreaCodePrefixLineNumber.replace(case_details.phoneCountryCode, ''))
163
+ ? false
164
+ : true) &&
165
+ regex.test(case_details.phoneAreaCodePrefixLineNumber.replace(case_details.phoneCountryCode, '')) &&
156
166
  (caseState.selectedAccountDetails.data.requireCGroupOnCreate
157
167
  ? !isEmpty(case_details.groupNumber) && case_details.groupNumber !== '-1'
158
168
  : true) &&
@@ -184,6 +194,7 @@ export const isIdeaCaseStateValid = (caseState, loggedInUserJwtToken) => {
184
194
  canManageCase(loggedInUserJwtToken));
185
195
  };
186
196
  export const isCaseManagementStateValid = (caseState, loggedInUserJwtToken) => {
197
+ var _a;
187
198
  const case_details = caseState.caseDetails;
188
199
  return (isEmpty(case_details.caseNumber) &&
189
200
  !caseState.hasLargeCaseDescription &&
@@ -197,6 +208,10 @@ export const isCaseManagementStateValid = (caseState, loggedInUserJwtToken) => {
197
208
  (caseState.selectedAccountDetails.data.requireCGroupOnCreate
198
209
  ? !isEmpty(case_details.groupNumber) && case_details.groupNumber !== '-1'
199
210
  : true) &&
211
+ (!isEmpty(case_details.phoneCountryCode) &&
212
+ isEmpty((_a = case_details.phoneAreaCodePrefixLineNumber) === null || _a === void 0 ? void 0 : _a.replace(case_details.phoneCountryCode, ''))
213
+ ? false
214
+ : true) &&
200
215
  canManageCase(loggedInUserJwtToken));
201
216
  };
202
217
  // Add a !isEmpty to to make any KTQuestion Mandatory in isCaseInformationSectionValid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -66,10 +66,10 @@
66
66
  "@patternfly/react-core": "4.264.0",
67
67
  "@progress/kendo-drawing": "^1.6.0",
68
68
  "@progress/kendo-react-pdf": "^3.12.0",
69
- "@rh-support/components": "2.1.0",
70
- "@rh-support/react-context": "2.1.0",
69
+ "@rh-support/components": "2.1.2",
70
+ "@rh-support/react-context": "2.1.2",
71
71
  "@rh-support/types": "2.0.2",
72
- "@rh-support/user-permissions": "2.1.0",
72
+ "@rh-support/user-permissions": "2.1.2",
73
73
  "@rh-support/utils": "2.1.0",
74
74
  "@types/react-redux": "^7.1.12",
75
75
  "@types/redux": "^3.6.0",
@@ -133,5 +133,5 @@
133
133
  "defaults and supports es6-module",
134
134
  "maintained node versions"
135
135
  ],
136
- "gitHead": "668544a9062084668eea4be43bf931bf04998daf"
136
+ "gitHead": "01f23b19ee074f6515c54b2cdec744deb3ba2c1b"
137
137
  }