@rh-support/troubleshoot 2.6.32 → 2.6.33

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":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,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,qBAsGpD"}
1
+ {"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,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,qBA+GpD"}
@@ -8,11 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { customEmail } from '@cee-eng/hydrajs';
11
- import { Button, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalFooter, ModalVariant, TextInput, ValidatedOptions, } from '@patternfly/react-core';
11
+ import { Button, ButtonVariant, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, TextInput, ValidatedOptions, } from '@patternfly/react-core';
12
12
  import { ToastNotification, useFetch } from '@rh-support/components';
13
13
  import isEmpty from 'lodash/isEmpty';
14
14
  import React, { useState } from 'react';
15
- import { Trans, useTranslation } from 'react-i18next';
15
+ import { useTranslation } from 'react-i18next';
16
16
  export function AddCustomEmailToAccount(props) {
17
17
  const { t } = useTranslation();
18
18
  const { request, isFetching } = useFetch(customEmail.addCustomEmailToAccount, { propgateErrors: true });
@@ -45,23 +45,21 @@ export function AddCustomEmailToAccount(props) {
45
45
  : isEmpty(firstName.trim())
46
46
  ? ValidatedOptions.error
47
47
  : ValidatedOptions.default;
48
- return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add a notification email to your account'), isOpen: true, onClose: handleClose, onEscapePress: handleClose },
49
- React.createElement("p", { className: "pf-v6-u-mb-lg" },
50
- React.createElement(Trans, null, "Note: This email will be added at an account level, not a case level.")),
51
- React.createElement(Form, null,
52
- React.createElement(FormGroup, { label: t('New email address'), fieldId: "custom-email-address", isRequired: true },
53
- React.createElement(TextInput, { id: "custom-email", isDisabled: true, value: props.customEmailAddress, isRequired: true })),
54
- React.createElement(FormGroup, { label: t('First name'), fieldId: "custom-email-firstName", isRequired: true },
55
- firstNameValidated === 'error' && (React.createElement(FormHelperText, null,
56
- React.createElement(HelperText, null,
57
- React.createElement(HelperTextItem, { variant: "error" },
58
- React.createElement(Trans, null, "First name cannot be empty"))))),
59
- React.createElement(TextInput, { id: "custom-email-firstName", value: firstName, isRequired: true, type: "text", validated: firstNameValidated, onChange: (_event, firstName) => onFirstNameChange(firstName), "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 })),
60
- React.createElement(FormGroup, { label: t('Last name'), fieldId: "custom-email-lastName", className: "pf-v6-u-mb-md" },
61
- React.createElement(TextInput, { id: "custom-email-lastName", value: lastName, type: "text", onChange: (_event, lastName) => onLastNameChange(lastName), "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 }))),
48
+ return (React.createElement(Modal, { isOpen: true, onClose: handleClose, variant: ModalVariant.medium, "aria-labelledby": "add-email-modal-title", "aria-describedby": "add-email-modal-body" },
49
+ React.createElement(ModalHeader, { title: t('Add a notification email to your account'), labelId: "add-email-modal-title" }),
50
+ React.createElement(ModalBody, { id: "add-email-modal-body" },
51
+ React.createElement("p", { className: "pf-v6-u-mb-md" }, t('Note: This email will be added at an account level, not a case level.')),
52
+ React.createElement(Form, null,
53
+ React.createElement(FormGroup, { label: t('New email address'), fieldId: "custom-email-address", isRequired: true },
54
+ React.createElement(TextInput, { id: "custom-email", isDisabled: true, value: props.customEmailAddress, isRequired: true, "aria-label": t('New email address') })),
55
+ React.createElement(FormGroup, { label: t('First name'), fieldId: "custom-email-firstName", isRequired: true },
56
+ React.createElement(TextInput, { id: "custom-email-firstName", value: firstName, isRequired: true, type: "text", validated: firstNameValidated, onChange: (_event, firstName) => onFirstNameChange(firstName), "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 }),
57
+ firstNameValidated === ValidatedOptions.error && (React.createElement(FormHelperText, null,
58
+ React.createElement(HelperText, null,
59
+ React.createElement(HelperTextItem, { variant: ValidatedOptions.error }, t('First name cannot be empty')))))),
60
+ React.createElement(FormGroup, { label: t('Last name'), fieldId: "custom-email-lastName" },
61
+ React.createElement(TextInput, { id: "custom-email-lastName", value: lastName, type: "text", onChange: (_event, lastName) => onLastNameChange(lastName), "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 })))),
62
62
  React.createElement(ModalFooter, null,
63
- React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching || (isSaveButtonClicked && isEmpty(firstName.trim())) },
64
- React.createElement(Trans, null, "Add to account")),
65
- React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose, isDisabled: isFetching },
66
- React.createElement(Trans, null, "Cancel")))));
63
+ React.createElement(Button, { key: "confirm", variant: ButtonVariant.primary, onClick: onAdd, isDisabled: isFetching || (isSaveButtonClicked && isEmpty(firstName.trim())), spinnerAriaValueText: isFetching ? t('Loading') : undefined, isLoading: isFetching }, t('Add to account')),
64
+ React.createElement(Button, { key: "cancel", variant: ButtonVariant.link, onClick: handleClose, isDisabled: isFetching }, t('Cancel')))));
67
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAqCD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBAiNxD"}
1
+ {"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AA+BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBAyMxD"}
@@ -19,7 +19,7 @@ var __rest = (this && this.__rest) || function (s, e) {
19
19
  return t;
20
20
  };
21
21
  import { accounts } from '@cee-eng/hydrajs';
22
- import { Button, Flex, FlexItem, Label, LabelGroup, Menu, MenuContent, MenuItem, MenuList, Popper, TextInput, } from '@patternfly/react-core';
22
+ import { Button, Flex, FlexItem, Label, LabelGroup, Menu, MenuContent, MenuItem, MenuList, Popper, TextInputGroup, TextInputGroupMain, } from '@patternfly/react-core';
23
23
  import { getHydraContactLabel, useFetch } from '@rh-support/components';
24
24
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
25
25
  import React, { useContext, useEffect, useRef, useState } from 'react';
@@ -42,7 +42,7 @@ const CustomHighlighter = ({ search, children }) => {
42
42
  return React.createElement(React.Fragment, null, children);
43
43
  const regex = new RegExp(`(${search})`, 'gi');
44
44
  const parts = children.split(regex);
45
- return (React.createElement(React.Fragment, null, parts.map((part, index) => regex.test(part) ? (React.createElement("mark", { key: index, style: { backgroundColor: '#fff3cd' } }, part)) : (part))));
45
+ return (React.createElement(React.Fragment, null, parts.map((part, index) => regex.test(part) ? (React.createElement("mark", { key: index, style: { backgroundColor: '#FFF3CD' } }, part)) : (part))));
46
46
  };
47
47
  export function NonOrgCaseNotifyeesSelector(props) {
48
48
  const [inputVal, setInputVal] = useState('');
@@ -84,11 +84,7 @@ export function NonOrgCaseNotifyeesSelector(props) {
84
84
  const { ssoName } = c, rest = __rest(c, ["ssoName"]);
85
85
  return Object.assign({ ssoUsername: ssoName }, rest);
86
86
  });
87
- setNotifyeesList([
88
- ...mappedContacts,
89
- { emailAddress: notificationAddress.email, caseNumber: '' },
90
- ]);
91
- setIsDropdownOpen(true);
87
+ setNotifyeesList([...mappedContacts, { emailAddress: notificationAddress.email }]);
92
88
  }
93
89
  else {
94
90
  if (notificationAddress === null || notificationAddress === void 0 ? void 0 : notificationAddress.email) {
@@ -140,11 +136,11 @@ export function NonOrgCaseNotifyeesSelector(props) {
140
136
  const renderSelectedItems = () => {
141
137
  if (props.selectedItems.length === 0)
142
138
  return null;
143
- return (React.createElement(LabelGroup, { style: { marginBottom: '8px' } }, props.selectedItems.map((option, index) => {
139
+ return (React.createElement(LabelGroup, { "aria-label": "Selected contacts" }, props.selectedItems.map((option, index) => {
144
140
  const isContactOption = isContact(option);
145
141
  const isCurrentUserCaseContact = isContactOption && option.ssoUsername === props.contactSsoUsername;
146
142
  const isDisabled = (props.isChipDisabled && isContactOption) || isCurrentUserCaseContact;
147
- return (React.createElement(Label, { key: getKey(option) || index, onClose: () => onRemoveItem(option), isDisabled: isDisabled, closeBtnAriaLabel: `Remove ${getHydraContactLabel(option)}`, variant: "outline" }, getHydraContactLabel(option)));
143
+ return (React.createElement(Label, { key: getKey(option) || index, onClose: () => onRemoveItem(option), isDisabled: isDisabled, closeBtnAriaLabel: `Remove ${getHydraContactLabel(option)}`, variant: "outline", color: "blue" }, getHydraContactLabel(option)));
148
144
  })));
149
145
  };
150
146
  const menu = (React.createElement(Menu, { ref: menuRef },
@@ -154,16 +150,13 @@ export function NonOrgCaseNotifyeesSelector(props) {
154
150
  return (React.createElement(Flex, null,
155
151
  React.createElement(FlexItem, { grow: { sm: 'grow' } },
156
152
  React.createElement("div", null,
157
- renderSelectedItems(),
158
153
  React.createElement(Flex, null,
159
154
  React.createElement(FlexItem, { grow: { sm: 'grow' } },
160
- React.createElement(Popper, { trigger: React.createElement(TextInput, { ref: inputRef, id: props.id, "data-tracking-id": props.dataTrackingId, value: inputVal, onChange: (event, value) => onInputChange(value), placeholder: props.placeholder, isDisabled: props.isDisabled || isFetching, onBlur: onBlur, validated: showGroupPermissionError || showAccountPermissionError ? 'error' : 'default' }), popper: menu, isVisible: isDropdownOpen && notifyeesList.length > 0, position: "start" })),
161
- React.createElement(FlexItem, null,
162
- React.createElement(Button, { variant: "primary", onClick: onAddClick, isLoading: props.isDisabled || isFetching, spinnerAriaValueText: props.isDisabled ? 'Loading' : undefined, isDisabled: !(inputVal || '').trim() || props.isDisabled || isFetching, "data-tracking-id": `${props.dataTrackingId}-add-btn` },
163
- React.createElement(Trans, null, "Add"))))),
164
- props.selectedItems.length > 0 && !showAccountPermissionError && !showAccountPermissionError && (React.createElement("p", { className: "form-instructions" },
165
- React.createElement(Trans, null, "Enter an email address or username for the person you want to notify"))),
166
- React.createElement("p", { className: "pf-v6-c-form__helper-text pf-m-error", style: { color: '#c9190b' } },
155
+ React.createElement(Popper, { trigger: React.createElement(TextInputGroup, null,
156
+ React.createElement(TextInputGroupMain, { ref: inputRef, id: props.id, "data-tracking-id": props.dataTrackingId, value: inputVal, onChange: (_, value) => onInputChange(value), placeholder: props.placeholder, disabled: props.isDisabled || isFetching, onBlur: onBlur }, renderSelectedItems())), popper: menu, isVisible: isDropdownOpen && notifyeesList.length > 0, position: "start" })),
157
+ React.createElement(Button, { variant: "primary", onClick: onAddClick, isLoading: props.isDisabled || isFetching, spinnerAriaValueText: props.isDisabled ? 'Loading' : undefined, isDisabled: !(inputVal || '').trim() || props.isDisabled || isFetching, "data-tracking-id": `${props.dataTrackingId}-add-btn`, className: "send-notifications-add" },
158
+ React.createElement(Trans, null, "Add")))),
159
+ React.createElement("p", { className: "pf-v6-c-form__helper-text pf-m-error", style: { color: '#C9190B' } },
167
160
  showGroupPermissionError && (React.createElement(Trans, null,
168
161
  inputVal,
169
162
  " was not found under the selected group. Please contact your Org Admin to add them to this group.")),
@@ -1312,3 +1312,7 @@ svg.pf-v6-u-ml-xs.icon-size {
1312
1312
  .remote-session-button:disabled {
1313
1313
  color: var(--pf-v6-c-button--disabled--Color);
1314
1314
  }
1315
+
1316
+ .send-notifications-add:disabled {
1317
+ color: var(--pf-v6-c-button--disabled--Color) !important;
1318
+ }
@@ -107,6 +107,7 @@
107
107
  }
108
108
 
109
109
  .pf-v6-c-alert {
110
+ margin-top: 24px;
110
111
  .pf-v6-c-alert__title {
111
112
  font-weight: 600 !important;
112
113
  font-size: 15px;
@@ -330,6 +331,10 @@
330
331
  color: var(--pf-v6-c-button--Color);
331
332
  }
332
333
 
334
+ .pf-m-aria-disabled {
335
+ color: var(--pf-v6-c-button--disabled--Color) !important;
336
+ }
337
+
333
338
  // Override disable color on darker backgrounds
334
339
  .case-overview-secondary,
335
340
  #review {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.6.32",
3
+ "version": "2.6.33",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -134,5 +134,5 @@
134
134
  "defaults and supports es6-module",
135
135
  "maintained node versions"
136
136
  ],
137
- "gitHead": "84eef7e2917784ff0ee4e573265279e2b37ea74c"
137
+ "gitHead": "f69973584d77efaa8fb77808e43757b074e50dc6"
138
138
  }