@rh-support/troubleshoot 2.2.9 → 2.2.10

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.
@@ -124,7 +124,7 @@ export function CaseContactPhoneNumber() {
124
124
  : ValidatedOptions.default;
125
125
  useEffect(() => {
126
126
  var _a, _b;
127
- if (isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber && !isEmpty(phone))) {
127
+ if (isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber) && !isEmpty(phone)) {
128
128
  const oldPhoneline = ((_a = getPhoneObj(phone)) === null || _a === void 0 ? void 0 : _a.phoneLine) || '';
129
129
  const oldCountryCode = ((_b = getPhoneObj(phone)) === null || _b === void 0 ? void 0 : _b.countryCode) || '';
130
130
  if (oldPhoneline && oldCountryCode.replace('+', '')) {
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAoBA,wBAAgB,kBAAkB,gBA0IjC"}
1
+ {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB,gBAkJjC"}
@@ -6,7 +6,7 @@ import isEmpty from 'lodash/isEmpty';
6
6
  import isEqual from 'lodash/isEqual';
7
7
  import React, { useContext, useEffect, useState } from 'react';
8
8
  import { Trans, useTranslation } from 'react-i18next';
9
- import { PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHONE_NO_CHAR_ERROR, } from '../../constants/caseDetailsConstants';
9
+ import { PHONE_INSTRUCTION, PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHONE_NO_CHAR_ERROR, } from '../../constants/caseDetailsConstants';
10
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
11
11
  import { RouteContext } from '../../context/RouteContext';
12
12
  import { PHONE_LIMIT } from '../../reducers/CaseConstNTypes';
@@ -85,6 +85,11 @@ export function ContactPhoneNumber() {
85
85
  React.createElement(Trans, null, "Case owner's phone number"),
86
86
  ContactPhoneNumberPopOver()),
87
87
  React.createElement(PhoneInput, { phoneValue: localFullPhone, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, invalid: invalid, setInvalid: setInvalid }),
88
+ !invalid &&
89
+ getPhone().length < PHONE_LIMIT &&
90
+ !(isPhoneNumberEmpty && isNextBtnClickedToShowValidationError) &&
91
+ !(isNextBtnClickedToShowValidationError && isPhoneNumberInvalid) && (React.createElement("p", { className: "form-instructions" },
92
+ React.createElement(Trans, null, PHONE_INSTRUCTION))),
88
93
  invalid && (React.createElement("p", { className: "form-instructions form-invalid" },
89
94
  React.createElement(Trans, null, PHONE_NO_CHAR_ERROR))),
90
95
  getPhone().length > PHONE_LIMIT && (React.createElement("p", { className: "form-instructions form-invalid" }, maxLengthErrorMessage)),
@@ -21,9 +21,9 @@ export default function CaseManagement(props) {
21
21
  return (React.createElement("form", null,
22
22
  React.createElement(SupportLevel, null),
23
23
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
24
- React.createElement(FlexItem, { flex: { default: 'flex_1' }, className: "pf-u-mb-xl" },
24
+ React.createElement(FlexItem, { flex: { default: 'flex_1' }, className: "pf-u-mb-xs" },
25
25
  React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange })),
26
- React.createElement(FlexItem, { flex: { default: 'flex_1' }, className: "pf-u-mb-xl" },
26
+ React.createElement(FlexItem, { flex: { default: 'flex_1' }, className: "pf-u-mb-xs" },
27
27
  React.createElement(ContactPhoneNumber, null))),
28
28
  React.createElement(ContactPhoneNumberAlert, null),
29
29
  React.createElement(Fts, { inlineEditable: false }),
@@ -15,4 +15,5 @@ export declare enum CaseStatusEnum {
15
15
  export declare const PHONE_LINE_CANNOT_BE_EMPTY = "Phone number cannot be empty when country code is given.";
16
16
  export declare const PHONE_NO_CHAR_ERROR = "Phone number can only have digits.";
17
17
  export declare const PHONE_IS_NOT_VALID = "Phone number is invalid.";
18
+ export declare const PHONE_INSTRUCTION = "A current phone number with the country code helps us support you better.";
18
19
  //# sourceMappingURL=caseDetailsConstants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"caseDetailsConstants.d.ts","sourceRoot":"","sources":["../../../src/constants/caseDetailsConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,yBAAyB,CAAC;AAE3E,oBAAY,mBAAmB;IAC3B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,UAAU,gBAAgB;CAC7B;AAED,oBAAY,cAAc;IACtB,MAAM,WAAW;IACjB,mBAAmB,wBAAwB;IAC3C,iBAAiB,uBAAuB;CAC3C;AAED,eAAO,MAAM,0BAA0B,6DAA6D,CAAC;AAErG,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AAExE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC"}
1
+ {"version":3,"file":"caseDetailsConstants.d.ts","sourceRoot":"","sources":["../../../src/constants/caseDetailsConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oCAAoC,yBAAyB,CAAC;AAE3E,oBAAY,mBAAmB;IAC3B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,UAAU,gBAAgB;CAC7B;AAED,oBAAY,cAAc;IACtB,MAAM,WAAW;IACjB,mBAAmB,wBAAwB;IAC3C,iBAAiB,uBAAuB;CAC3C;AAED,eAAO,MAAM,0BAA0B,6DAA6D,CAAC;AAErG,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AAExE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,eAAO,MAAM,iBAAiB,8EAA8E,CAAC"}
@@ -17,3 +17,4 @@ export var CaseStatusEnum;
17
17
  export const PHONE_LINE_CANNOT_BE_EMPTY = 'Phone number cannot be empty when country code is given.';
18
18
  export const PHONE_NO_CHAR_ERROR = 'Phone number can only have digits.';
19
19
  export const PHONE_IS_NOT_VALID = 'Phone number is invalid.';
20
+ export const PHONE_INSTRUCTION = 'A current phone number with the country code helps us support you better.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -66,8 +66,8 @@
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.4",
70
- "@rh-support/react-context": "2.1.4",
69
+ "@rh-support/components": "2.1.5",
70
+ "@rh-support/react-context": "2.1.5",
71
71
  "@rh-support/types": "2.0.2",
72
72
  "@rh-support/user-permissions": "2.1.3",
73
73
  "@rh-support/utils": "2.1.1",
@@ -133,5 +133,5 @@
133
133
  "defaults and supports es6-module",
134
134
  "maintained node versions"
135
135
  ],
136
- "gitHead": "c49d603ef2cfff4400439dcdeb4e09ead60d5180"
136
+ "gitHead": "4de9544feb2e412e3f3fc6c95843cce2419a026c"
137
137
  }