@rh-support/troubleshoot 2.6.32 → 2.6.34

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":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAsdzC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAsdzC;AAED,eAAe,mBAAmB,CAAC"}
@@ -16,6 +16,8 @@ import difference from 'lodash/difference';
16
16
  import differenceBy from 'lodash/differenceBy';
17
17
  import filter from 'lodash/filter';
18
18
  import find from 'lodash/find';
19
+ import intersection from 'lodash/intersection';
20
+ import intersectionBy from 'lodash/intersectionBy';
19
21
  import isEmpty from 'lodash/isEmpty';
20
22
  import isEqual from 'lodash/isEqual';
21
23
  import map from 'lodash/map';
@@ -110,7 +112,7 @@ function CaseContactSelector(props) {
110
112
  });
111
113
  const processCaseContacts = (selectedContacts) => __awaiter(this, void 0, void 0, function* () {
112
114
  const toAdd = filter(differenceBy(selectedContacts, selectedNotificationContacts, 'ssoUsername'), (item) => item.ssoUsername !== contactSsoUsername);
113
- const toRemove = filter(differenceBy(selectedNotificationContacts, selectedContacts, 'ssoUsername'), (item) => !item.isInternal && item.ssoUsername !== contactSsoUsername);
115
+ const toRemove = filter(intersectionBy(selectedContacts, selectedNotificationContacts, 'ssoUsername'), (item) => !item.isInternal && item.ssoUsername !== contactSsoUsername);
114
116
  (toAdd.length || toRemove.length) && clearErrorState();
115
117
  if ((toAdd || []).length > 0) {
116
118
  if (loggedInUserRights.data.isOrgAdmin()) {
@@ -127,7 +129,7 @@ function CaseContactSelector(props) {
127
129
  });
128
130
  const processCustomEmails = (selectedCustomEmails) => __awaiter(this, void 0, void 0, function* () {
129
131
  const currentEmails = customEmailsList.data.map((item) => item.emailAddress);
130
- const toRemoveEmails = difference(currentEmails, selectedCustomEmails);
132
+ const toRemoveEmails = intersection(currentEmails, selectedCustomEmails);
131
133
  const toAddEmails = difference(selectedCustomEmails, currentEmails);
132
134
  (toAddEmails.length || toRemoveEmails.length) && clearErrorState();
133
135
  if ((toAddEmails || []).length > 0) {
@@ -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,qBAuMxD"}
@@ -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('');
@@ -60,15 +60,13 @@ export function NonOrgCaseNotifyeesSelector(props) {
60
60
  }
61
61
  }, [props.typeaheadRef]);
62
62
  const onItemSelect = (option) => {
63
- const newSelected = [...props.selectedItems, option];
64
- props.onChange && props.onChange(newSelected);
63
+ props.onChange && props.onChange([option]);
65
64
  setInputVal('');
66
65
  clearList();
67
66
  setIsDropdownOpen(false);
68
67
  };
69
68
  const onRemoveItem = (optionToRemove) => {
70
- const newSelected = props.selectedItems.filter((item) => getKey(item) !== getKey(optionToRemove));
71
- props.onChange && props.onChange(newSelected);
69
+ props.onChange && props.onChange([optionToRemove]);
72
70
  };
73
71
  const onAddClick = () => __awaiter(this, void 0, void 0, function* () {
74
72
  var _a, _b, _c;
@@ -84,11 +82,7 @@ export function NonOrgCaseNotifyeesSelector(props) {
84
82
  const { ssoName } = c, rest = __rest(c, ["ssoName"]);
85
83
  return Object.assign({ ssoUsername: ssoName }, rest);
86
84
  });
87
- setNotifyeesList([
88
- ...mappedContacts,
89
- { emailAddress: notificationAddress.email, caseNumber: '' },
90
- ]);
91
- setIsDropdownOpen(true);
85
+ setNotifyeesList([...mappedContacts, { emailAddress: notificationAddress.email }]);
92
86
  }
93
87
  else {
94
88
  if (notificationAddress === null || notificationAddress === void 0 ? void 0 : notificationAddress.email) {
@@ -140,11 +134,11 @@ export function NonOrgCaseNotifyeesSelector(props) {
140
134
  const renderSelectedItems = () => {
141
135
  if (props.selectedItems.length === 0)
142
136
  return null;
143
- return (React.createElement(LabelGroup, { style: { marginBottom: '8px' } }, props.selectedItems.map((option, index) => {
137
+ return (React.createElement(LabelGroup, { "aria-label": "Selected contacts" }, props.selectedItems.map((option, index) => {
144
138
  const isContactOption = isContact(option);
145
139
  const isCurrentUserCaseContact = isContactOption && option.ssoUsername === props.contactSsoUsername;
146
140
  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)));
141
+ return (React.createElement(Label, { key: getKey(option) || index, onClose: () => onRemoveItem(option), isDisabled: isDisabled, closeBtnAriaLabel: `Remove ${getHydraContactLabel(option)}`, variant: "outline", color: "blue" }, getHydraContactLabel(option)));
148
142
  })));
149
143
  };
150
144
  const menu = (React.createElement(Menu, { ref: menuRef },
@@ -154,16 +148,13 @@ export function NonOrgCaseNotifyeesSelector(props) {
154
148
  return (React.createElement(Flex, null,
155
149
  React.createElement(FlexItem, { grow: { sm: 'grow' } },
156
150
  React.createElement("div", null,
157
- renderSelectedItems(),
158
151
  React.createElement(Flex, null,
159
152
  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' } },
153
+ React.createElement(Popper, { trigger: React.createElement(TextInputGroup, null,
154
+ 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" })),
155
+ 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" },
156
+ React.createElement(Trans, null, "Add")))),
157
+ React.createElement("p", { className: "pf-v6-c-form__helper-text pf-m-error", style: { color: '#C9190B' } },
167
158
  showGroupPermissionError && (React.createElement(Trans, null,
168
159
  inputVal,
169
160
  " 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 {
@@ -822,3 +827,7 @@ div.case-details-tabs pre {
822
827
  padding-left: 1.5rem;
823
828
  padding-right: 1.5rem;
824
829
  }
830
+
831
+ .pf-v6-c-alert {
832
+ margin-top: 0;
833
+ }
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.34",
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": "976f134e20f3bf65b6bf613d6f39060724683cf9"
138
138
  }