@rh-support/troubleshoot 0.2.13 → 0.2.17
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/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +1 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts +2 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +2 -7
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +2 -2
- package/lib/esm/components/CaseInformation/Fts.js +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +9 -7
- package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +32 -10
- package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
- package/lib/esm/components/shared/input/ContactSelectorInternal.js +1 -3
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AA2BA,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AA2BA,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,eA0NnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -155,8 +155,6 @@ function OwnerSelector(props) {
|
|
|
155
155
|
React.createElement(Trans, null, "Owner"),
|
|
156
156
|
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, comparator: ownerComparator, isLocalChange: localOwnerChange, value: selectedOwner.data, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.owner, (v) => v.fullNameCustom) }),
|
|
157
157
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
158
|
-
showUsersWithSelectedGroupAccess ? (React.createElement(Typeahead, { id: "open-case-owner",
|
|
159
|
-
// @ts-expect-error
|
|
160
|
-
className: "react-select-custom", clearButton: true, isLoading: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, options: usersWithGroupAccess, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, labelKey: getHydraContactLabel, placeholder: t(`Search by name or username`), disabled: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, renderMenuItemChildren: renderMenuItemChildren, "data-tracking-id": "open-case-owner" })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, placeholder: t(`Search by name or username`), clearButton: true, id: "open-case-owner", name: "open-case-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: showValidationErrorAlert && isEmpty(selectedOwner.data) }))));
|
|
158
|
+
showUsersWithSelectedGroupAccess ? (React.createElement(Typeahead, { id: "open-case-owner", className: "react-select-custom", clearButton: true, isLoading: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, options: usersWithGroupAccess, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, labelKey: getHydraContactLabel, placeholder: t(`Search by name or username`), disabled: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, renderMenuItemChildren: renderMenuItemChildren, "data-tracking-id": "open-case-owner" })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, placeholder: t(`Search by name or username`), clearButton: true, id: "open-case-owner", name: "open-case-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: showValidationErrorAlert && isEmpty(selectedOwner.data) }))));
|
|
161
159
|
}
|
|
162
160
|
export { OwnerSelector };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isEmailValid } from '@rh-support/utils';
|
|
1
2
|
interface IProps {
|
|
2
3
|
caseNumber: string;
|
|
3
4
|
accountNumber: string;
|
|
@@ -7,7 +8,7 @@ export declare function useCustomEmails(props: IProps): {
|
|
|
7
8
|
addCustomEmail: (emailVal: string, onAdd?: () => void, skipAccountCheck?: boolean) => Promise<boolean>;
|
|
8
9
|
canAddCustomEmail: boolean;
|
|
9
10
|
hideCustomEmails: boolean;
|
|
10
|
-
isEmailValid:
|
|
11
|
+
isEmailValid: typeof isEmailValid;
|
|
11
12
|
isUpdatingCustomEmails: boolean;
|
|
12
13
|
showAddEmailToAccountModal: (emailString: string) => Promise<boolean>;
|
|
13
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomEmails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCustomEmails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAwB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM;+BAyED,MAAM;+BAnCN,MAAM,UAAU,MAAM,IAAI;;;;;8CAbX,MAAM;EAiGhE"}
|
|
@@ -11,7 +11,7 @@ import { kase } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { PromisifyModal, ToastNotification, useFetch } from '@rh-support/components';
|
|
12
12
|
import { fetchAccountCustomEmails, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
13
13
|
import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { haventLoadedMetadata } from '@rh-support/utils';
|
|
14
|
+
import { haventLoadedMetadata, isEmailValid } from '@rh-support/utils';
|
|
15
15
|
import { findIndex } from 'lodash';
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
17
17
|
import isEqual from 'lodash/isEqual';
|
|
@@ -37,11 +37,6 @@ export function useCustomEmails(props) {
|
|
|
37
37
|
.includes(props.accountNumber);
|
|
38
38
|
const deleteEmail = useFetch(kase.deleteCustomEmailFromCase, { propgateErrors: true });
|
|
39
39
|
const addNewEmail = useFetch(kase.addCustomEmailToCase, { propgateErrors: true });
|
|
40
|
-
const isEmailValid = (emailVal) => {
|
|
41
|
-
// HTML5 valid email regex specified by official spec https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
|
|
42
|
-
const mailRegExp = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
43
|
-
return mailRegExp.test(emailVal);
|
|
44
|
-
};
|
|
45
40
|
const showAddEmailToAccountModal = (emailString) => __awaiter(this, void 0, void 0, function* () {
|
|
46
41
|
let isAdded = yield PromisifyModal(({ show, onSubmit, onDismiss }) => (React.createElement(AddCustomEmailToAccount, { onAddSuccess: onSubmit, onClose: onDismiss, accountNumber: props.accountNumber, customEmailAddress: emailString })));
|
|
47
42
|
isAdded && fetchAccountCustomEmails(globalMetadataDispatch, props.accountNumber);
|
|
@@ -49,7 +44,7 @@ export function useCustomEmails(props) {
|
|
|
49
44
|
});
|
|
50
45
|
const addCustomEmail = (emailVal, onAdd, skipAccountCheck = false) => __awaiter(this, void 0, void 0, function* () {
|
|
51
46
|
try {
|
|
52
|
-
if (isEmpty(emailVal) || !isEmailValid) {
|
|
47
|
+
if (isEmpty(emailVal) || !isEmailValid(emailVal)) {
|
|
53
48
|
return;
|
|
54
49
|
}
|
|
55
50
|
// lower case the email vals to avoid sfdc error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAwB/F,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAwB/F,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAiMtD"}
|
|
@@ -29,7 +29,7 @@ const REOPEN_ESCALATION_MSG = 'Escalation reopened. A manager will review your r
|
|
|
29
29
|
const CLOSURE_ESCALATION_MSG = 'Escalation closed.';
|
|
30
30
|
export default function RMEEscalationList(props) {
|
|
31
31
|
const { t } = useTranslation();
|
|
32
|
-
const { request: updateEscalationRequest, isFetching: isUpdatingEscalation
|
|
32
|
+
const { request: updateEscalationRequest, isFetching: isUpdatingEscalation } = useFetch(escalations.updateEscalations, { propgateErrors: true });
|
|
33
33
|
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
34
34
|
propgateErrors: true,
|
|
35
35
|
});
|
|
@@ -116,7 +116,7 @@ export default function RMEEscalationList(props) {
|
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
118
|
return (React.createElement(React.Fragment, null,
|
|
119
|
-
React.createElement(Button, { variant: ButtonVariant.secondary, onClick: () => requestUpdateRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-update" },
|
|
119
|
+
React.createElement(Button, { className: "pf-u-ml-sm", variant: ButtonVariant.secondary, onClick: () => requestUpdateRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-update" },
|
|
120
120
|
React.createElement(Trans, null, "Request Update")),
|
|
121
121
|
React.createElement(Button, { variant: ButtonVariant.secondary, className: "pf-u-mt-sm pf-u-ml-sm", onClick: () => requestClosureRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-closure" },
|
|
122
122
|
React.createElement(Trans, null, "Request Closure"))));
|
|
@@ -130,7 +130,7 @@ function Fts(props) {
|
|
|
130
130
|
React.createElement("input", { type: "checkbox", id: "open-case-fts", "data-tracking-id": "open-case-fts", disabled: disableFtsNContact, name: "open-case-fts", checked: fts, onChange: onFtsChange }),
|
|
131
131
|
React.createElement("label", { htmlFor: "open-case-fts" },
|
|
132
132
|
React.createElement(Trans, null, "24x7 Support")),
|
|
133
|
-
React.createElement(LoadingIndicator, { size: "sm", isInline: true, show: isFtsUpdating })),
|
|
133
|
+
React.createElement(LoadingIndicator, { size: "sm", isInline: true, show: isFtsUpdating, className: "pf-u-ml-sm" })),
|
|
134
134
|
fts === true && (React.createElement(React.Fragment, null,
|
|
135
135
|
React.createElement(InlineEdit, { labelProps: { htmlFor: 'open-case-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: contactInfo24X7State === contactInfo24x7 || isFtsContactUpdating, loadingIndicator: isFtsContactUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : null },
|
|
136
136
|
React.createElement(TextAreaAutosize, { id: "open-case-24-7-contact", className: `form-control`, name: "open-case-24-7-contact", value: contactInfo24X7State, onChange: onFtsContactChange, disabled: disableFtsNContact, "data-tracking-id": "open-case-24-7-contact" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,eAiM1C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { Button, Tooltip, TooltipPosition } from '@patternfly/react-core';
|
|
10
11
|
import { ToastNotification } from '@rh-support/components';
|
|
11
12
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
12
13
|
import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
@@ -17,7 +18,7 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
17
18
|
import isEqual from 'lodash/isEqual';
|
|
18
19
|
import map from 'lodash/map';
|
|
19
20
|
import uniqBy from 'lodash/uniqBy';
|
|
20
|
-
import React, { useContext, useState } from 'react';
|
|
21
|
+
import React, { useContext, useRef, useState } from 'react';
|
|
21
22
|
import { Token } from 'react-bootstrap-typeahead';
|
|
22
23
|
import { Trans, useTranslation } from 'react-i18next';
|
|
23
24
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
@@ -100,6 +101,7 @@ function RHAssociatesSelector(props) {
|
|
|
100
101
|
return (React.createElement(Token, { key: idx, onRemove: props.onRemove, disabled: disabled, option: option }, props.labelKey(option)));
|
|
101
102
|
};
|
|
102
103
|
const canNotifyRHAssociates = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.NOTIFY_RH_ASSOCIATES);
|
|
104
|
+
const toolTipRef = useRef();
|
|
103
105
|
if (!canNotifyRHAssociates)
|
|
104
106
|
return React.createElement(React.Fragment, null);
|
|
105
107
|
return (React.createElement(React.Fragment, null, canNotifyRHAssociates && (React.createElement("div", { className: "form-group" },
|
|
@@ -109,12 +111,12 @@ function RHAssociatesSelector(props) {
|
|
|
109
111
|
internal: false,
|
|
110
112
|
isInternalContact: true,
|
|
111
113
|
}, placeholder: t(`Add watchers to this case`), onSelect: onNotifiedUserChange, renderToken: renderToken, isUpdating: isRHAssociatesUpdating }),
|
|
112
|
-
caseNumber && showAddWatchButton() && (React.createElement(
|
|
114
|
+
caseNumber && showAddWatchButton() && (React.createElement(Button, { variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-rh-watcher" },
|
|
113
115
|
React.createElement(Trans, null, "Add me as a watcher"))),
|
|
114
|
-
caseNumber && showRemoveWatchButton() && (React.createElement("div", {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
caseNumber && showRemoveWatchButton() && (React.createElement("div", { ref: toolTipRef, className: "remove-me-as-watcher pf-u-display-inline-block" }, isCurrentUserCaseContact ? (React.createElement(React.Fragment, null,
|
|
117
|
+
React.createElement(Tooltip, { trigger: 'mouseenter focus', reference: toolTipRef, position: TooltipPosition.top, content: React.createElement(Trans, null, "You are case contact and therefore you cannot be removed as watcher") }),
|
|
118
|
+
React.createElement(Button, { variant: "tertiary", onClick: removeCurrentUser, type: "button", isDisabled: true, "data-tracking-id": "case-remove-me-rh-watcher" },
|
|
119
|
+
React.createElement(Trans, null, "Remove me as a watcher")))) : (React.createElement(Button, { variant: "secondary", onClick: removeCurrentUser, type: "button", "data-tracking-id": "case-remove-me-rh-watcher" },
|
|
120
|
+
React.createElement(Trans, null, "Remove me as a watcher")))))))));
|
|
119
121
|
}
|
|
120
122
|
export { RHAssociatesSelector };
|
package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAOA,UAAU,MAAM;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,eA+GpD"}
|
|
@@ -7,17 +7,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { Button, Modal, ModalVariant, TextInput } from '@patternfly/react-core';
|
|
10
|
+
import { customEmail } from '@cee-eng/hydrajs';
|
|
11
|
+
import { Button, Form, FormGroup, Modal, ModalVariant, TextInput, ValidatedOptions } from '@patternfly/react-core';
|
|
12
12
|
import { ToastNotification, useFetch } from '@rh-support/components';
|
|
13
|
-
import
|
|
13
|
+
import isEmpty from 'lodash/isEmpty';
|
|
14
|
+
import React, { useState } from 'react';
|
|
14
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
15
16
|
export function AddCustomEmailToAccount(props) {
|
|
16
17
|
const { t } = useTranslation();
|
|
17
|
-
const { request, isFetching } = useFetch(
|
|
18
|
+
const { request, isFetching } = useFetch(customEmail.addCustomEmailToAccount, { propgateErrors: true });
|
|
19
|
+
const [firstName, setFirstName] = useState('');
|
|
20
|
+
const [lastName, setLastName] = useState('');
|
|
21
|
+
const [isSaveButtonClicked, setIsSaveButtonClicked] = useState(false);
|
|
18
22
|
const onAdd = () => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
setIsSaveButtonClicked(true);
|
|
24
|
+
if (isEmpty(firstName))
|
|
25
|
+
return;
|
|
19
26
|
try {
|
|
20
|
-
yield request(props.accountNumber, props.customEmailAddress);
|
|
27
|
+
yield request(props.accountNumber, props.customEmailAddress, firstName, lastName);
|
|
21
28
|
props.onAddSuccess && props.onAddSuccess();
|
|
22
29
|
}
|
|
23
30
|
catch (e) {
|
|
@@ -25,18 +32,33 @@ export function AddCustomEmailToAccount(props) {
|
|
|
25
32
|
handleClose();
|
|
26
33
|
}
|
|
27
34
|
});
|
|
35
|
+
const onFirstNameChange = (firstName) => setFirstName(firstName);
|
|
36
|
+
const onLastNameChange = (lastName) => setLastName(lastName);
|
|
28
37
|
const handleClose = () => {
|
|
38
|
+
setIsSaveButtonClicked(false);
|
|
29
39
|
props.onClose && props.onClose();
|
|
30
40
|
};
|
|
31
41
|
return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add a notification email to your account'), isOpen: true, onClose: handleClose, actions: [
|
|
32
|
-
React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching },
|
|
42
|
+
React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching || (isSaveButtonClicked && isEmpty(firstName)) },
|
|
33
43
|
React.createElement(Trans, null, "Add to account")),
|
|
34
44
|
React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose },
|
|
35
45
|
React.createElement(Trans, null, "Cancel")),
|
|
36
46
|
] },
|
|
37
|
-
React.createElement("p", { className: "pf-u-mb-
|
|
47
|
+
React.createElement("p", { className: "pf-u-mb-lg" },
|
|
38
48
|
React.createElement(Trans, null, "Note: This email will be added at an account level, not a case level.")),
|
|
39
|
-
React.createElement(
|
|
40
|
-
React.createElement(
|
|
41
|
-
|
|
49
|
+
React.createElement(Form, null,
|
|
50
|
+
React.createElement(FormGroup, { label: t('New email address'), fieldId: "custom-email-address", isRequired: true },
|
|
51
|
+
React.createElement(TextInput, { id: "custom-email", isDisabled: true, value: props.customEmailAddress, className: "form-control", isRequired: true })),
|
|
52
|
+
React.createElement(FormGroup, { label: t('First name'), fieldId: "custom-email-firstName", validated: !isSaveButtonClicked
|
|
53
|
+
? ValidatedOptions.default
|
|
54
|
+
: isEmpty(firstName)
|
|
55
|
+
? ValidatedOptions.error
|
|
56
|
+
: ValidatedOptions.default, isRequired: true, helperTextInvalid: t('First name cannot be empty') },
|
|
57
|
+
React.createElement(TextInput, { id: "custom-email-firstName", value: firstName, className: "form-control", isRequired: true, type: "text", validated: !isSaveButtonClicked
|
|
58
|
+
? ValidatedOptions.default
|
|
59
|
+
: isEmpty(firstName)
|
|
60
|
+
? ValidatedOptions.error
|
|
61
|
+
: ValidatedOptions.default, onChange: onFirstNameChange, "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 })),
|
|
62
|
+
React.createElement(FormGroup, { label: t('Last name'), fieldId: "custom-email-lastName", className: "pf-u-mb-md" },
|
|
63
|
+
React.createElement(TextInput, { id: "custom-email-lastName", value: lastName, className: "form-control", type: "text", onChange: onLastNameChange, "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 })))));
|
|
42
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactSelectorInternal.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/input/ContactSelectorInternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAMrF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA+B,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE1F,MAAM,WAAW,MAAM;IACnB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC9B,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAA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AAG,CAAC;IACf,UAAU,EAAE,eAAe,CAAC;IAE5B,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAalC;gBAEU,KAAK,EAAE,MAAM;IAUzB,gBAAgB,YAAa,QAAQ,KAAG,MAAM,CAS5C;IAEF,mBAAmB,aAAc,QAAQ,EAAE,KAAG,QAAQ,EAAE,CAGtD;IAEF,sBAAsB,MAAO,QAAQ,KAAG,OAAO,CAE7C;IAEF,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAoBpC,QAAQ,aAAoB,QAAQ,EAAE,mBAKpC;IAEF,OAAO,UAAW,KAAK,UAIrB;IAEF,YAAY,UAAiB,MAAM,GAAG,MAAM,mBA0C1C;IACF,sBAAsB,WAAY,QAAQ,yBAIxC;IAEF,MAAM;CAgCT"}
|
|
@@ -113,9 +113,7 @@ export class ContactSelectorInternal extends React.Component {
|
|
|
113
113
|
}
|
|
114
114
|
render() {
|
|
115
115
|
const conditionalProps = Object.assign({}, (this.props.renderToken ? { renderToken: this.props.renderToken } : undefined));
|
|
116
|
-
return (React.createElement(AsyncTypeahead, Object.assign({ id: this.props.id + '-contact-select',
|
|
117
|
-
// @ts-expect-error
|
|
118
|
-
className: `${this.props.className} contact-select`, defaultInputValue: "", autoFocus: this.props.autoFocus, clearButton: this.props.clearButton, isLoading: this.state.isLoading || this.props.isUpdating, options: this.state.options, selected: !isEmpty(this.state.selectedContacts) ? this.state.selectedContacts : [], onChange: this.onChange, onFocus: this.onFocus, labelKey: this.getSelectedLabel, onSearch: this.handleSearch, delay: this.props.debounceDelay, maxResults: this.props.maxResults, placeholder: this.props.placeholder, ref: this.typeahead, renderMenuItemChildren: this.renderMenuItemChildren, size: this.props.typeAheadSize, useCache: this.props.useCache, minLength: this.props.minLength, disabled: this.props.disabled || this.props.isUpdating, multiple: this.props.multiple }, conditionalProps)));
|
|
116
|
+
return (React.createElement(AsyncTypeahead, Object.assign({ id: this.props.id + '-contact-select', className: `${this.props.className} contact-select`, defaultInputValue: "", autoFocus: this.props.autoFocus, clearButton: this.props.clearButton, isLoading: this.state.isLoading || this.props.isUpdating, options: this.state.options, selected: !isEmpty(this.state.selectedContacts) ? this.state.selectedContacts : [], onChange: this.onChange, onFocus: this.onFocus, labelKey: this.getSelectedLabel, onSearch: this.handleSearch, delay: this.props.debounceDelay, maxResults: this.props.maxResults, placeholder: this.props.placeholder, ref: this.typeahead, renderMenuItemChildren: this.renderMenuItemChildren, size: this.props.typeAheadSize, useCache: this.props.useCache, minLength: this.props.minLength, disabled: this.props.disabled || this.props.isUpdating, multiple: this.props.multiple }, conditionalProps)));
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
119
|
ContactSelectorInternal.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.
|
|
30
|
-
"@cee-eng/ui-toolkit": "1.1.
|
|
29
|
+
"@cee-eng/hydrajs": "4.4.7",
|
|
30
|
+
"@cee-eng/ui-toolkit": "1.1.3",
|
|
31
31
|
"@patternfly/patternfly": "4.102.2",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.1.0",
|
|
33
33
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"react-virtualized": "^9.21.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@cee-eng/hydrajs": "4.
|
|
67
|
-
"@cee-eng/ui-toolkit": "1.1.
|
|
66
|
+
"@cee-eng/hydrajs": "4.4.7",
|
|
67
|
+
"@cee-eng/ui-toolkit": "1.1.3",
|
|
68
68
|
"@patternfly/patternfly": "4.102.2",
|
|
69
69
|
"@patternfly/pfe-accordion": "1.1.0",
|
|
70
70
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"@patternfly/react-core": "4.128.2",
|
|
73
73
|
"@progress/kendo-drawing": "^1.6.0",
|
|
74
74
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
75
|
-
"@rh-support/api": "0.3.
|
|
76
|
-
"@rh-support/components": "1.1.
|
|
77
|
-
"@rh-support/react-context": "0.2.
|
|
75
|
+
"@rh-support/api": "0.3.3",
|
|
76
|
+
"@rh-support/components": "1.1.9",
|
|
77
|
+
"@rh-support/react-context": "0.2.10",
|
|
78
78
|
"@rh-support/types": "0.2.0",
|
|
79
|
-
"@rh-support/user-permissions": "0.2.
|
|
80
|
-
"@rh-support/utils": "0.2.
|
|
79
|
+
"@rh-support/user-permissions": "0.2.5",
|
|
80
|
+
"@rh-support/utils": "0.2.5",
|
|
81
81
|
"@types/react-redux": "^7.1.12",
|
|
82
82
|
"@types/redux": "^3.6.0",
|
|
83
83
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "27553f3c53998d0f3657c7e2f04b2eacdcda00c2"
|
|
146
146
|
}
|