@rh-support/troubleshoot 2.2.10 → 2.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,sBAAsB,gBAqOrC"}
1
+ {"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAuBA,wBAAgB,sBAAsB,gBA8OrC"}
@@ -17,7 +17,7 @@ import isEmpty from 'lodash/isEmpty';
17
17
  import isEqual from 'lodash/isEqual';
18
18
  import React, { useContext, useEffect, useState } from 'react';
19
19
  import { Trans, useTranslation } from 'react-i18next';
20
- import { PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHONE_NO_CHAR_ERROR, } from '../../../../constants/caseDetailsConstants';
20
+ import { PHONE_INSTRUCTION, PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHONE_NO_CHAR_ERROR, } from '../../../../constants/caseDetailsConstants';
21
21
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
22
22
  import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
23
23
  import { PHONE_LIMIT } from '../../../../reducers/CaseConstNTypes';
@@ -151,6 +151,12 @@ export function CaseContactPhoneNumber() {
151
151
  React.createElement(CheckIcon, null)),
152
152
  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) },
153
153
  React.createElement(TimesIcon, { color: "#6A6E73" }))),
154
+ !invalid &&
155
+ (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) < PHONE_LIMIT &&
156
+ !(isPhoneLineEmpty && isSaveClicked) &&
157
+ !(isSaveClicked && isPhoneNumberInvalid) &&
158
+ !isShowOldPhone && (React.createElement("p", { className: "form-instructions" },
159
+ React.createElement(Trans, null, PHONE_INSTRUCTION))),
154
160
  invalid && (React.createElement("p", { className: "form-instructions form-invalid" },
155
161
  React.createElement(Trans, null, PHONE_NO_CHAR_ERROR))),
156
162
  (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT && (React.createElement("p", { className: "form-instructions form-invalid" }, maxLengthErrorMessage)),
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB,gBAkJjC"}
1
+ {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB,gBA2JjC"}
@@ -80,6 +80,15 @@ export function ContactPhoneNumber() {
80
80
  setLocalFullPhone(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber);
81
81
  // eslint-disable-next-line react-hooks/exhaustive-deps
82
82
  }, [phoneAreaCodePrefixLineNumber, phoneCountryCode, loggedInUser.data]);
83
+ useEffect(() => {
84
+ if (isEqual(localFullPhone.trim(), '+')) {
85
+ setLocalFullPhone('');
86
+ }
87
+ else if (!isEmpty(localFullPhone) && !localFullPhone.startsWith('+')) {
88
+ setLocalFullPhone('+' + localFullPhone.replace(' ', ''));
89
+ }
90
+ // eslint-disable-next-line react-hooks/exhaustive-deps
91
+ }, [localFullPhone]);
83
92
  return (React.createElement("div", { className: "form-group", style: { minWidth: '200px' } },
84
93
  React.createElement("label", null,
85
94
  React.createElement(Trans, null, "Case owner's phone number"),
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA4BA,MAAM,CAAC,OAAO,UAAU,UAAU,gBAmTjC"}
1
+ {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA4BA,MAAM,CAAC,OAAO,UAAU,UAAU,gBA6SjC"}
@@ -7,7 +7,7 @@ import { getConfigField, getRedhatDotComHost, PCM_CONFIG_FIELD_TYPE, PreviousCas
7
7
  import find from 'lodash/find';
8
8
  import isEmpty from 'lodash/isEmpty';
9
9
  import isEqual from 'lodash/isEqual';
10
- import React, { useContext, useEffect, useRef, useState } from 'react';
10
+ import React, { useContext, useEffect, useState } from 'react';
11
11
  import { Trans, useTranslation } from 'react-i18next';
12
12
  import { Link } from 'react-router-dom';
13
13
  import { useCaseSelector } from '../../context/CaseContext';
@@ -40,7 +40,6 @@ export default function SubmitCase() {
40
40
  }), isEqual);
41
41
  const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
42
42
  const { topContentState: { topContent }, } = useContext(TCStateContext);
43
- const tooltipRef = useRef();
44
43
  const { rulesState } = useContext(RulesStateContext);
45
44
  const { clusterRecommendationsState: { clusterRecommendations }, } = useContext(ClusterRecommendationsContext);
46
45
  const { attachmentState } = useContext(AttachmentStateContext);
@@ -135,8 +134,8 @@ export default function SubmitCase() {
135
134
  React.createElement(ActionListItem, null,
136
135
  React.createElement(Button, { component: "a", href: `${getRedhatDotComHost(Env.getEnvName())}/wapps/ugc/protected/${'personalInfo.html'}`, target: "_blank", variant: "secondary", "data-tracking-id": "get-support-update-info", className: "update-info-button" }, "Update info")),
137
136
  React.createElement(ActionListItem, null, viewDisabled ? (React.createElement(React.Fragment, null,
138
- React.createElement(Tooltip, { content: t('File upload in progress.'), "aria-live": 'polite', reference: tooltipRef }),
139
- React.createElement(Button, { className: "pf-u-ml-md", component: "a", href: getCaseURL(), variant: "primary", "data-tracking-id": "get-support-view-case", isDisabled: viewDisabled, ref: tooltipRef, "aria-label": t('View case') }, "View case"))) : (React.createElement(Button, { className: "pf-u-ml-md", component: (props) => React.createElement(Link, Object.assign({}, props, { to: `/case/${caseNumber}` })), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case') }, "View case")))))),
137
+ React.createElement(Tooltip, { content: t('File upload in progress.'), position: "bottom" },
138
+ React.createElement(Button, { className: "pf-u-ml-md", component: "a", href: getCaseURL(), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case'), isAriaDisabled: viewDisabled }, "View case")))) : (React.createElement(Button, { className: "pf-u-ml-md", component: (props) => React.createElement(Link, Object.assign({}, props, { to: `/case/${caseNumber}` })), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case') }, "View case")))))),
140
139
  !isEmpty(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(FileUploader, { idToUploadTo: caseNumber, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
141
140
  React.createElement("div", null,
142
141
  (!isEmpty(topContent.data) || !rulesState.EARules.rules || !clusterRecommendations) &&
@@ -1 +1 @@
1
- {"version":3,"file":"FileLister.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/FileLister.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAiB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGxE,eAAO,MAAM,qBAAqB,2FAAyC,CAAC;AAiB5E,UAAU,MAAM;IACZ,kBAAkB,EAAE,UAAU,EAAE,CAAC;IACjC,UAAU,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtG,YAAY,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,eAgS/C"}
1
+ {"version":3,"file":"FileLister.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/FileLister.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAiB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGxE,eAAO,MAAM,qBAAqB,2FAAyC,CAAC;AAiB5E,UAAU,MAAM;IACZ,kBAAkB,EAAE,UAAU,EAAE,CAAC;IACjC,UAAU,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtG,YAAY,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,eA2S/C"}
@@ -2,12 +2,14 @@ import { pcm } from '@cee-eng/hydrajs';
2
2
  import { Button, ButtonVariant, Label, Progress, ProgressMeasureLocation } from '@patternfly/react-core';
3
3
  import HistoryIcon from '@patternfly/react-icons/dist/js/icons/history-icon';
4
4
  import { CircularProgressbar } from '@rh-support/components';
5
- import { humanizeSize } from '@rh-support/utils';
5
+ import { humanizeSize, PreviousCaseTypes } from '@rh-support/utils';
6
6
  import capitalize from 'lodash/capitalize';
7
7
  import isEmpty from 'lodash/isEmpty';
8
+ import isEqual from 'lodash/isEqual';
8
9
  import map from 'lodash/map';
9
- import React from 'react';
10
+ import React, { useEffect, useState } from 'react';
10
11
  import { Trans, useTranslation } from 'react-i18next';
12
+ import { useCaseSelector } from '../../../context/CaseContext';
11
13
  import { ATTACHMENT_DESCRIPTION_LENGTH_LIMIT } from '../../../reducers/CaseConstNTypes';
12
14
  import { isAnalysingFile, isAnalysisFailed, isFileDeleted, isUploadAborted, isUploadedAndAnalysisFailed, isUploadedAndAnalysisSkipped, isUploadedAndAnalyzed, isUploadFailed, isUploading, isUploadingAttachment, isUploadingOnCase, isUploadingOnSession, isUploadOnTrack, isVerifyingUpload, shouldHideDescription, } from './reducer/AttachmentHelper';
13
15
  import { FileStatusHelper } from './reducer/FileStatusHelper';
@@ -35,6 +37,13 @@ export default function FileLister(props) {
35
37
  props.onFileEdit &&
36
38
  props.onFileEdit(editedLocalFile, indexToEdit, { description: editedLocalFile.description.trim() });
37
39
  };
40
+ const { caseType } = useCaseSelector((state) => ({
41
+ caseType: state.caseDetails.caseType,
42
+ }), isEqual);
43
+ const [isIdea, setIsIdea] = useState(false);
44
+ useEffect(() => {
45
+ setIsIdea(caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT);
46
+ }, [caseType]);
38
47
  // To retry file upload
39
48
  const onRetry = (index) => () => {
40
49
  props.onRetry && props.onRetry(index);
@@ -125,7 +134,7 @@ export default function FileLister(props) {
125
134
  React.createElement("input", { id: `file-${index + 1}-description`, "data-tracking-id": `case-${props.isSessionId ? 'create' : 'details'}-file-${index + 1}-description`, className: "file-description form-control pf-u-my-sm", type: "text", value: localFile.description, onChange: onDescriptionChange(localFile, index), maxLength: 255, placeholder: t(`${shouldHideDescription(localFile, props.isSessionId)
126
135
  ? ''
127
136
  : t('Enter a description')}`), hidden: shouldHideDescription(localFile, props.isSessionId) }),
128
- isUploadedAndAnalysisSkipped(localFile) && (React.createElement("span", { className: "text-muted" }, localFile.analysisMetadata.analysisErrorMesssage)),
137
+ isUploadedAndAnalysisSkipped(localFile) && !isIdea && (React.createElement("span", { className: "text-muted" }, localFile.analysisMetadata.analysisErrorMesssage)),
129
138
  localFile.description.length === ATTACHMENT_DESCRIPTION_LENGTH_LIMIT ? (React.createElement("p", { className: "form-instructions" },
130
139
  React.createElement(Trans, null, maxCaseAttachmentDescription))) : null,
131
140
  isUploadedAndAnalysisFailed(localFile) && (React.createElement("span", { className: "text-danger" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.10",
3
+ "version": "2.2.12",
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.5",
70
- "@rh-support/react-context": "2.1.5",
69
+ "@rh-support/components": "2.1.6",
70
+ "@rh-support/react-context": "2.1.6",
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": "4de9544feb2e412e3f3fc6c95843cce2419a026c"
136
+ "gitHead": "18d4816c03d679b40b4523e266e375e44344492a"
137
137
  }