@rh-support/troubleshoot 2.5.1 → 2.5.3

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.
Files changed (28) hide show
  1. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/OwnerSelector.js +34 -4
  3. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +2 -1
  5. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +11 -3
  7. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +72 -23
  9. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +14 -1
  11. package/lib/esm/components/CaseInformation/CaseType.d.ts.map +1 -1
  12. package/lib/esm/components/CaseInformation/CaseType.js +12 -4
  13. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  14. package/lib/esm/components/CaseInformation/Severity.js +26 -31
  15. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  16. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +3 -2
  17. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -1
  18. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  19. package/lib/esm/components/SessionRestore/SessionRestore.js +2 -1
  20. package/lib/esm/components/shared/utils.d.ts +1 -0
  21. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  22. package/lib/esm/components/shared/utils.js +6 -0
  23. package/lib/esm/reducers/SessionRestoreReducer.d.ts +1 -1
  24. package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
  25. package/lib/esm/reducers/SessionRestoreReducer.js +21 -3
  26. package/lib/esm/scss/_main.scss +7 -1
  27. package/lib/esm/scss/_pf-overrides.scss +4 -0
  28. package/package.json +8 -10
@@ -1 +1 @@
1
- {"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAgPnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAiBxE,UAAU,MAAM;CAAG;AAMnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAoRnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -7,15 +7,15 @@ 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 { CaseContactsSelectorExternal, getHydraContactLabel, renderMenuItemChildren, ToastNotification, usePrevious, ValueChangedIcon, } from '@rh-support/components';
10
+ import { CaseContactsSelectorExternal, getHydraContactLabel, OwnerTypeaheadDropdown, ToastNotification, usePrevious, ValueChangedIcon, } from '@rh-support/components';
11
11
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
12
12
  import { sortHydraContacts } from '@rh-support/utils';
13
13
  import filter from 'lodash/filter';
14
14
  import isEmpty from 'lodash/isEmpty';
15
15
  import isEqual from 'lodash/isEqual';
16
+ import map from 'lodash/map';
16
17
  import uniqBy from 'lodash/uniqBy';
17
- import React, { useContext, useEffect, useState } from 'react';
18
- import { Typeahead } from 'react-bootstrap-typeahead';
18
+ import React, { useContext, useEffect, useMemo, useState } from 'react';
19
19
  import { Trans, useTranslation } from 'react-i18next';
20
20
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
21
21
  import { RouteContext } from '../../context/RouteContext';
@@ -24,6 +24,9 @@ import { setCaseDetails, setCaseOwner, setCaseState, setNotifiedUser, updateCase
24
24
  import { PDFContext } from '../CaseEditView/PDFContainer';
25
25
  import { CaseValuesToWatch } from '../shared/Constants';
26
26
  import { getChangedValueTooltip } from '../shared/utils';
27
+ function getOwnerDropdownOptions(contacts) {
28
+ return map(contacts, (contact) => ({ contact }));
29
+ }
27
30
  function OwnerSelector(props) {
28
31
  const { t } = useTranslation();
29
32
  const caseUpdateError = useCaseUpdateErrorMessage();
@@ -42,6 +45,9 @@ function OwnerSelector(props) {
42
45
  const previousAccountNumber = usePrevious(accountNumber);
43
46
  const { isExportingPDF } = useContext(PDFContext);
44
47
  const [usersWithGroupAccess, setUsersWithGroupAccess] = useState([]);
48
+ const [filteredContacts, setFilteredContacts] = useState([]);
49
+ const [ownerQuery, setOwnerQuery] = useState('');
50
+ const ownerDropdownOptions = useMemo(() => getOwnerDropdownOptions(filteredContacts), [filteredContacts]);
45
51
  const [localOwnerChange, setLocalOwnerChange] = useState(false);
46
52
  const afterLocalChange = () => setLocalOwnerChange(false);
47
53
  const ownerComparator = (value, pvalue) => value &&
@@ -158,11 +164,35 @@ function OwnerSelector(props) {
158
164
  const showUsersWithSelectedGroupAccess = caseNumber &&
159
165
  (selectedCaseGroupUsers.isFetching ||
160
166
  (!selectedCaseGroupUsers.isFetching && (selectedCaseGroupUsers.data || []).length > 0));
167
+ const onQueryUpdated = (query) => {
168
+ if (ownerQuery !== query) {
169
+ setOwnerQuery(query);
170
+ }
171
+ };
172
+ const onClearQuery = () => {
173
+ if (ownerQuery !== '') {
174
+ setOwnerQuery('');
175
+ }
176
+ };
177
+ useEffect(() => {
178
+ setOwnerQuery(getHydraContactLabel(selectedOwner.data));
179
+ }, [selectedOwner.data]);
180
+ useEffect(() => {
181
+ if (getHydraContactLabel(selectedOwner.data) === ownerQuery) {
182
+ setFilteredContacts(usersWithGroupAccess);
183
+ }
184
+ else {
185
+ const newContacts = filter(usersWithGroupAccess, (contact) => getHydraContactLabel(contact).toLowerCase().includes(ownerQuery.toLowerCase()));
186
+ setFilteredContacts(newContacts);
187
+ }
188
+ }, [usersWithGroupAccess, selectedOwner.data, ownerQuery]);
161
189
  return (React.createElement("div", { className: "form-group get-support-owner-wapper", "data-tracking-id": "get-support-owner" },
162
190
  React.createElement("label", { htmlFor: "get-support-owner" },
163
191
  React.createElement(Trans, null, "Owner"),
164
192
  React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, comparator: ownerComparator, isLocalChange: localOwnerChange, value: selectedOwner.data, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.owner, (v) => v.fullNameCustom) }),
165
193
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*")),
166
- showUsersWithSelectedGroupAccess ? (React.createElement(Typeahead, { id: "get-support-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 || isCasePhoneUpdating, renderMenuItemChildren: renderMenuItemChildren })) : (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: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data), isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating }))));
194
+ showUsersWithSelectedGroupAccess ? (React.createElement(React.Fragment, null,
195
+ React.createElement(OwnerTypeaheadDropdown, { id: "get-support-owner", hasClearButton: true, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], isDisabled: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating || isCasePhoneUpdating, onSelect: onCustomerContactSelect, onClearQuery: onClearQuery, onQueryUpdated: onQueryUpdated, options: ownerDropdownOptions, status: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data) ? 'danger' : undefined }))) : (React.createElement(React.Fragment, null,
196
+ 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: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data), isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating })))));
167
197
  }
168
198
  export { OwnerSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAyBlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAiO5C"}
1
+ {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAyBlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkO5C"}
@@ -104,7 +104,8 @@ export function CaseDetailsTabs(props) {
104
104
  routePath: 'escalation',
105
105
  component: (React.createElement(RMEEscalationList, { escalations: caseEscalations.data, caseNumber: caseNumber, caseStatus: status, accountNumber: loggedInUserRights.data.getAccountNumber(), isInternal: loggedInUserRights.data.isInternal() })),
106
106
  });
107
- !loggedInUsersAccount.data.secureSupport &&
107
+ false &&
108
+ !loggedInUsersAccount.data.secureSupport &&
108
109
  tabsToRender.push({
109
110
  'data-tracking-id': 'case-history-tab',
110
111
  title: CaseDetailsTabsEnum.HISTORY,
@@ -1 +1 @@
1
- {"version":3,"file":"CaseStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAoDhC;kBApDQ,UAAU;;;AAuDnB,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CaseStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8DhC;kBA9DQ,UAAU;;;AAiEnB,eAAe,UAAU,CAAC"}
@@ -7,9 +7,9 @@ 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 { Dropdown, ValueChangedIcon } from '@rh-support/components';
11
- import { toOption, toOptions } from '@rh-support/utils';
10
+ import { SingleSelectDropdown, ValueChangedIcon } from '@rh-support/components';
12
11
  import isEmpty from 'lodash/isEmpty';
12
+ import map from 'lodash/map';
13
13
  import React, { useContext, useState } from 'react';
14
14
  import { Trans, useTranslation } from 'react-i18next';
15
15
  import { CaseValuesToWatch } from '../../shared/Constants';
@@ -37,12 +37,20 @@ function CaseStatus(props) {
37
37
  setLocalStatusChange(true);
38
38
  validateCaseStatus(option);
39
39
  });
40
+ const getDropdownOptions = map(props.allStatuses || [], (option) => ({
41
+ label: option,
42
+ value: option,
43
+ }));
44
+ const getSelectedDropdownOption = {
45
+ label: props.selectedStatus,
46
+ value: props.selectedStatus,
47
+ };
40
48
  return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
41
49
  React.createElement("h3", { className: "subheading subheading-sm" },
42
50
  React.createElement(Trans, null, "Status"),
43
51
  React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localStatusChange, value: props.selectedStatus, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.status) }),
44
52
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*")),
45
- React.createElement(Dropdown, { name: "case-details-status-selector", placeholder: t(`Select a status`), title: t(`Select a status`), list: props.allStatuses ? toOptions(props.allStatuses) : [], selectedItem: toOption(props.selectedStatus), disabled: props.hasError || props.isDisabled, isLoadingList: props.isFetching, isInValid: isCaseStatusInValid, required: true, onChange: onCaseStatusChange, onOuterClick: validateCaseStatus, "data-tracking-id": "case-details-status-selector" })));
53
+ React.createElement(SingleSelectDropdown, { placeholder: t(`Select a status`), dataTrackingId: "case-details-status-selector", options: getDropdownOptions, selected: getSelectedDropdownOption, isDisabled: props.hasError || props.isDisabled, isLoading: props.isFetching, isInvalid: isCaseStatusInValid, onSelect: onCaseStatusChange })));
46
54
  }
47
55
  CaseStatus.defaultProps = defaultProps;
48
56
  export default CaseStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA4PrC;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA2VrC;AAED,eAAe,eAAe,CAAC"}
@@ -7,14 +7,16 @@ 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 { Alert, AlertVariant } from '@patternfly/react-core';
11
- import { AlertMessage, AlertType, Dropdown, ToastNotification } from '@rh-support/components';
10
+ import { Alert, AlertVariant, Button, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
11
+ import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
12
+ import { AlertMessage, AlertType, SingleSelectDropdown, ToastNotification, useSelectKeyboardNavigator, } from '@rh-support/components';
12
13
  import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
13
- import { getUniqueSortedVersions, haventLoadedMetadata, toOption, toOptions, } from '@rh-support/utils';
14
+ import { getUniqueSortedVersions, haventLoadedMetadata, toOption, } from '@rh-support/utils';
14
15
  import filter from 'lodash/filter';
15
16
  import isEmpty from 'lodash/isEmpty';
16
17
  import isEqual from 'lodash/isEqual';
17
- import React, { useContext, useEffect, useState } from 'react';
18
+ import map from 'lodash/map';
19
+ import React, { useContext, useEffect, useRef, useState } from 'react';
18
20
  import { Trans, useTranslation } from 'react-i18next';
19
21
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
20
22
  import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
@@ -27,6 +29,8 @@ function ProductNVersion(props) {
27
29
  const [versions, setVersions] = useState([]);
28
30
  const [isProductUpdating, setIsProductUpdating] = useState(false);
29
31
  const [isVersionUpdating, setIsVersionUpdating] = useState(false);
32
+ const [isOpen, setIsOpen] = useState(false);
33
+ const textInputRef = useRef();
30
34
  const { product, version, caseNumber, contactSSOName, versionsDetails } = useCaseSelector((state) => ({
31
35
  product: state.caseDetails.product,
32
36
  version: state.caseDetails.version,
@@ -42,23 +46,26 @@ function ProductNVersion(props) {
42
46
  const [selectedProductLocal, setSelectedProductLocal] = useState(product);
43
47
  const [selectedVersionLocal, setSelectedVersionLocal] = useState(version);
44
48
  const [isSEProductApiIsDown, setIsSEProductApiIsDown] = useState(false);
49
+ const [inputValue, setInputValue] = useState(product);
50
+ const [shouldFilter, setShouldFilter] = useState(false);
51
+ const onToggleClick = () => {
52
+ var _a;
53
+ setIsOpen(!isOpen);
54
+ if (!isOpen) {
55
+ setShouldFilter(false);
56
+ }
57
+ (_a = textInputRef === null || textInputRef === void 0 ? void 0 : textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
58
+ };
45
59
  const canEditCase = useCanEditCase();
46
60
  const { isExportingPDF } = useContext(PDFContext);
47
- useEffect(() => {
48
- if (haventLoadedMetadata(allProducts, (data) => isEmpty(data.productsResult))) {
49
- fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
50
- }
51
- // eslint-disable-next-line react-hooks/exhaustive-deps
52
- }, [allProducts, dispatchToGlobalMetadataReducer, contactSSOName]);
53
61
  const onProductChange = (option) => __awaiter(this, void 0, void 0, function* () {
54
62
  if (canEditCase.alert())
55
63
  return;
56
64
  validateProduct(option);
57
- setSelectedProductLocal(option.value.product);
65
+ setSelectedProductLocal(option.product);
58
66
  setSelectedVersionLocal('');
59
- if (!option.value.product) {
60
- return;
61
- }
67
+ setInputValue(option.product);
68
+ setIsOpen(false);
62
69
  });
63
70
  const onVersionChange = (option) => __awaiter(this, void 0, void 0, function* () {
64
71
  if (canEditCase.alert())
@@ -67,13 +74,15 @@ function ProductNVersion(props) {
67
74
  updateProductVerstion(selectedProductLocal, option.value);
68
75
  });
69
76
  const validateProduct = (selectedItem) => {
70
- const isValid = !isProductUpdating && (isEmpty(selectedItem) || isEmpty(selectedItem.label));
77
+ const isValid = !isProductUpdating && (isEmpty(selectedItem) || isEmpty(selectedItem.name));
71
78
  setIsProductInvalid(isValid);
72
79
  };
73
80
  const onOuterClick = () => {
74
81
  setSelectedProductLocal(product);
82
+ setInputValue(product);
75
83
  setSelectedVersionLocal(version);
76
84
  setIsProductInvalid(false);
85
+ setIsOpen(false);
77
86
  };
78
87
  const onProductClear = () => {
79
88
  const defaultSelectedProduct = {
@@ -82,10 +91,17 @@ function ProductNVersion(props) {
82
91
  versions: [],
83
92
  isEntitledProduct: true,
84
93
  };
94
+ setInputValue('');
85
95
  setIsProductInvalid(true);
86
96
  setIsVersionInvalid(true);
87
97
  onProductChange(toOption(defaultSelectedProduct, { labelKey: 'product' }));
88
98
  };
99
+ const onTextInputChange = (_event, value) => {
100
+ if (isOpen) {
101
+ setInputValue(value);
102
+ setShouldFilter(true);
103
+ }
104
+ };
89
105
  const updateProductVerstion = (selectedProduct, selectedVersion) => __awaiter(this, void 0, void 0, function* () {
90
106
  let onlyVersionChanged = false;
91
107
  try {
@@ -107,6 +123,7 @@ function ProductNVersion(props) {
107
123
  catch (e) {
108
124
  setSelectedVersionLocal(version);
109
125
  setSelectedProductLocal(product);
126
+ setInputValue(product);
110
127
  setIsProductUpdating(false);
111
128
  setIsVersionUpdating(false);
112
129
  if (onlyVersionChanged) {
@@ -171,6 +188,41 @@ function ProductNVersion(props) {
171
188
  setVersions(productVersions);
172
189
  // eslint-disable-next-line react-hooks/exhaustive-deps
173
190
  }, [versionsDetails.data]);
191
+ const computeDropdownList = () => {
192
+ const list = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
193
+ if (!list)
194
+ return [];
195
+ const options = shouldFilter && !isEmpty(inputValue.trim())
196
+ ? list.filter((v) => v.name.toLowerCase().includes((inputValue || '').toLowerCase()))
197
+ : list;
198
+ return options;
199
+ };
200
+ const { onInputKeyDown, focusedItemIndex } = useSelectKeyboardNavigator({
201
+ list: computeDropdownList(),
202
+ isOpen,
203
+ setIsOpen,
204
+ onSelect: onProductChange,
205
+ });
206
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true, isDisabled: isProductUpdating || (allProducts.isFetching && !allProducts.isError), status: isProductInvalid ? 'danger' : undefined },
207
+ React.createElement(TextInputGroup, { isPlain: true },
208
+ React.createElement(TextInputGroupMain, { value: inputValue, onClick: onToggleClick, onChange: onTextInputChange, onKeyDown: onInputKeyDown, autoComplete: "off", innerRef: textInputRef, placeholder: t('Select a product'), role: "combobox", isExpanded: isOpen, "aria-controls": "case-details-product-selector-listbox" }),
209
+ isProductUpdating ? (React.createElement(TextInputGroupUtilities, null,
210
+ React.createElement(Spinner, { size: "md" }))) : (React.createElement(TextInputGroupUtilities, Object.assign({}, (!inputValue ? { style: { display: 'none' } } : {})),
211
+ React.createElement(Button, { variant: "plain", onClick: onProductClear, "aria-label": "Clear input value" }, !isExportingPDF ? React.createElement(TimesIcon, { "aria-hidden": true }) : ''))))));
212
+ const getVersionDropdownOptions = map(versions, (option) => ({
213
+ label: option,
214
+ value: option,
215
+ }));
216
+ const getVersionSelectedDropdownOption = {
217
+ label: selectedVersionLocal,
218
+ value: selectedVersionLocal,
219
+ };
220
+ useEffect(() => {
221
+ if (haventLoadedMetadata(allProducts, (data) => isEmpty(data.productsResult))) {
222
+ fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
223
+ }
224
+ // eslint-disable-next-line react-hooks/exhaustive-deps
225
+ }, [allProducts, dispatchToGlobalMetadataReducer, contactSSOName]);
174
226
  return (React.createElement(React.Fragment, null,
175
227
  React.createElement(AlertMessage, { show: !allProducts.isFetching && allProducts.isError, title: t('There was an error loading products.'), variant: AlertType.DANGER }),
176
228
  isEmpty(selectedVersionLocal) && (selectedVersionLocal === null || selectedVersionLocal === void 0 ? void 0 : selectedVersionLocal.length) < 2 && (React.createElement(Alert, { isInline: true, className: "pf-v5-u-mb-md", variant: AlertVariant.danger, title: React.createElement(Trans, null, "Please clear the errors to change the product on your case") })),
@@ -179,16 +231,13 @@ function ProductNVersion(props) {
179
231
  React.createElement("div", { className: "product-selector-wrapper" },
180
232
  React.createElement("label", { htmlFor: "case-details-product-selector" },
181
233
  React.createElement(Trans, null, "Product")),
182
- React.createElement(Dropdown, { className: "open-case-product", placeholder: t('Select a product'), id: "case-details-product-selector", selectedItem: toOption({
183
- product: selectedProductLocal,
184
- versions: versions,
185
- featuredVersion: '',
186
- selectedVersion: selectedVersionLocal,
187
- isEntitledProduct: true,
188
- }, { labelKey: 'product' }), list: toOptions(filter(allProducts.data.productsResult, (p) => p.isEntitledProduct), { labelKey: 'product' }), title: t(`Select a product`), disabled: isProductUpdating || (allProducts.isFetching && !allProducts.isError), isInValid: isProductInvalid, onChange: onProductChange, isLoadingList: isProductUpdating, "data-tracking-id": "case-details-product-selector", onOuterClick: onOuterClick, searchable: true, onClearSelection: onProductClear, isExportingPDF: isExportingPDF })),
234
+ React.createElement(Select, { className: "open-case-product", id: "case-details-product-selector", onChange: onProductChange, "data-tracking-id": "case-details-product-selector", onBlur: () => onOuterClick, isOpen: isOpen, onSelect: (event, value) => onProductChange(value), onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
235
+ React.createElement(SelectList, { id: "case-details-product-selector-listbox" }, computeDropdownList().map((option, index) => (React.createElement(SelectOption, { key: option.productId, value: option, isFocused: focusedItemIndex === index }, option.name)))))),
189
236
  React.createElement("div", { className: "version-selector-wrapper" },
190
237
  React.createElement("label", { htmlFor: "version-dropdown" },
191
238
  React.createElement(Trans, null, "Version")),
192
- React.createElement(Dropdown, { className: "open-case-version", id: "version-dropdown", placeholder: t(`Select a version`), selectedItem: toOption(selectedVersionLocal), list: toOptions(versions), title: t(`Select a version`), isInValid: checkIfVersionIsInvalid, disabled: isVersionUpdating || (allProducts.isFetching && !allProducts.isError), onChange: onVersionChange, isLoadingList: isVersionUpdating || (isSEProductApiIsDown && versionsDetails.isFetching), "data-tracking-id": "case-details-version-selector" }))))));
239
+ React.createElement(SingleSelectDropdown, { className: "open-case-version", id: "version-dropdown", placeholder: t(`Select a version`), selected: getVersionSelectedDropdownOption, options: getVersionDropdownOptions, isInvalid: checkIfVersionIsInvalid, isDisabled: isVersionUpdating ||
240
+ (allProducts.isFetching && !allProducts.isError) ||
241
+ isEmpty(selectedProductLocal), onSelect: onVersionChange, isLoading: isVersionUpdating || (isSEProductApiIsDown && versionsDetails.isFetching), dataTrackingId: "case-details-version-selector", isScrollable: true }))))));
193
242
  }
194
243
  export default ProductNVersion;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAkB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBA8mBnD"}
1
+ {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAkB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAuCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBA6nBnD"}
@@ -29,6 +29,7 @@ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext,
29
29
  import { clearReplyComment, discussionSortOrderConst, DiscussionType, setCommentText, setDiscussions, setFilter, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateCommentStateFeedback, updateDiscussionStateAttachments, updateDiscussionStateComments, } from '../../../../reducers/CaseDiscussionTabReducer';
30
30
  import { setCaseState } from '../../../../reducers/CaseReducer';
31
31
  import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
32
+ import { removeSpecialChars } from '../../../shared/utils';
32
33
  import { PDFContext } from '../../PDFContainer';
33
34
  import CaseAttachment from './CaseAttachment';
34
35
  import CaseChat from './CaseChat';
@@ -199,13 +200,25 @@ export default function CaseDiscussion(props) {
199
200
  };
200
201
  const highlightSearchResults = (searchTerm) => {
201
202
  setTimeout(() => {
203
+ // to mark attachment link button text
204
+ if (!isEmpty(removeSpecialChars(searchTerm))) {
205
+ document.querySelectorAll('button.attachment-download-btn').forEach((button) => {
206
+ var _a, _b;
207
+ if ((_a = button === null || button === void 0 ? void 0 : button.textContent) === null || _a === void 0 ? void 0 : _a.includes(searchTerm)) {
208
+ button.textContent = (_b = button.textContent) === null || _b === void 0 ? void 0 : _b.replace(new RegExp(searchTerm, 'gi'), `<mark>${searchTerm}</mark>`);
209
+ }
210
+ });
211
+ }
202
212
  const d = document.querySelectorAll('.support-comment');
203
213
  const markInstance = new Mark(d);
204
214
  markInstance.unmark({
205
215
  done: () => {
206
216
  if (isEmpty(searchTerm))
207
217
  return;
208
- markInstance.mark(searchTerm, { separateWordSearch: false });
218
+ // removed { separateWordSearch: false }
219
+ // so the search term is split into individual words, and each word is matched separately.
220
+ // Search Term: "frontend developer" Matches: Text containing "frontend" or "developer".
221
+ markInstance.mark(searchTerm);
209
222
  },
210
223
  });
211
224
  }, 1000);
@@ -1 +1 @@
1
- {"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseType.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,UAAU,MAAM;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAoE7C"}
1
+ {"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseType.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,UAAU,MAAM;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,qBA6E7C"}
@@ -1,7 +1,8 @@
1
- import { Dropdown } from '@rh-support/components';
1
+ import { SingleSelectDropdown } from '@rh-support/components';
2
2
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
- import { PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, toOldCaseTypeSwitcher, toOption, toOptions, } from '@rh-support/utils';
3
+ import { PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, toOldCaseTypeSwitcher, } from '@rh-support/utils';
4
4
  import isEmpty from 'lodash/isEmpty';
5
+ import map from 'lodash/map';
5
6
  import React, { useContext, useMemo, useState } from 'react';
6
7
  import { Trans, useTranslation } from 'react-i18next';
7
8
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
@@ -30,13 +31,20 @@ export default function CaseType(props) {
30
31
  const mappedSupportTypes = toNewCaseTypeMapper(props.hideIdea
31
32
  ? allCaseTypes.data.filter((type) => type !== PreviousCaseTypes.FEATURE_ENHANCEMENT)
32
33
  : allCaseTypes.data).sort();
33
- const newCaseTypes = toOptions(mappedSupportTypes);
34
+ const getDropdownOptions = map(allCaseTypes.data ? mappedSupportTypes : [], (option) => ({
35
+ label: option,
36
+ value: option,
37
+ }));
38
+ const getSelectedDropdownOption = {
39
+ label: selectedNewCaseType,
40
+ value: selectedNewCaseType,
41
+ };
34
42
  return (React.createElement("div", { className: "form-group" },
35
43
  React.createElement("label", { htmlFor: "get-support-type" },
36
44
  React.createElement(Trans, null, "Support type"),
37
45
  ' ',
38
46
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
39
- React.createElement(Dropdown, { id: "get-support-type", name: "get-support-type", placeholder: t(`Select a category`), title: t(`Select a category`), list: allCaseTypes.data ? newCaseTypes : [], selectedItem: toOption(selectedNewCaseType), disabled: allCaseTypes.isError, isLoadingList: allCaseTypes.isFetching, isInValid: isCaseTypeInValid, required: true, onChange: onCaseTypeChange, onOuterClick: validateCaseType, "data-tracking-id": "get-support-type" })));
47
+ React.createElement(SingleSelectDropdown, { id: "get-support-type", placeholder: t(`Select a category`), options: getDropdownOptions, selected: getSelectedDropdownOption, isDisabled: allCaseTypes.isError, isLoading: allCaseTypes.isFetching, isInvalid: isCaseTypeInValid, onSelect: onCaseTypeChange, dataTrackingId: "get-support-type" })));
40
48
  }, [
41
49
  allCaseTypes.data,
42
50
  allCaseTypes.isError,
@@ -1 +1 @@
1
- {"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAerE,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,UAAU,M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AAM,qBAwQ9B;kBAxQQ,QAAQ;;;AA0QjB,eAAe,QAAQ,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { Icon, Popover, PopoverPosition, Tooltip, TooltipPosition } from '@patternfly/react-core';
2
2
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
3
3
  import WarningTriangleIcon from '@patternfly/react-icons/dist/js/icons/warning-triangle-icon';
4
- import { Dropdown, ValueChangedIcon } from '@rh-support/components';
4
+ import { SingleSelectDropdown, ValueChangedIcon } from '@rh-support/components';
5
5
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
6
- import { autoEnableFtsOnCaseViewEditPage, PreviousCaseTypes, severitySort, showFtsOnCreateCasePage, toOption, toOptions, } from '@rh-support/utils';
6
+ import { autoEnableFtsOnCaseViewEditPage, PreviousCaseTypes, severitySort, showFtsOnCreateCasePage, } from '@rh-support/utils';
7
7
  import find from 'lodash/find';
8
8
  import findLast from 'lodash/findLast';
9
9
  import includes from 'lodash/includes';
@@ -62,10 +62,10 @@ function Severity(props) {
62
62
  }
63
63
  };
64
64
  const onSeverityChange = (option) => {
65
- if (option.value.label === selectedSeverity.label) {
65
+ if (option.label === selectedSeverity.label) {
66
66
  return;
67
67
  }
68
- updateState(option.value.name);
68
+ updateState(option.value);
69
69
  setIsSeverityInValidLocal(option);
70
70
  setLocalSeverityChange(true);
71
71
  };
@@ -136,6 +136,20 @@ function Severity(props) {
136
136
  }
137
137
  // eslint-disable-next-line react-hooks/exhaustive-deps
138
138
  }, [product, version, allProducts, allCaseSeverities, versionsDetails, seviritiesOptions, severity]);
139
+ const getDropdownOptions = map(filteredSeverities, (option) => ({
140
+ label: option.label,
141
+ value: option.name,
142
+ description: option.additionalInfo,
143
+ disabled: option.disabled,
144
+ }));
145
+ const getSelectedDropdownOption = {
146
+ label: selectedSeverity.label,
147
+ value: selectedSeverity.name,
148
+ description: typeof selectedSeverity.additionalInfo === 'string'
149
+ ? selectedSeverity.additionalInfo
150
+ : `${selectedSeverity.additionalInfo}`,
151
+ disabled: selectedSeverity.disabled,
152
+ };
139
153
  return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
140
154
  React.createElement("label", null,
141
155
  React.createElement(Trans, null, "Severity")),
@@ -153,36 +167,17 @@ function Severity(props) {
153
167
  React.createElement(WarningTriangleIcon, { color: "#ec7a08", title: "Support Severity Level warning" })))),
154
168
  !props.isDisabled && isOnCaseDetailsPage ? (React.createElement(React.Fragment, null,
155
169
  React.createElement("div", { onClick: toggleModal },
156
- React.createElement(Dropdown, { name: "get-support-severity", placeholder: t(`Select a severity`), title: t(`Select a severity`), list: allCaseSeverities.data
157
- ? toOptions(filteredSeverities, {
158
- labelKey: 'label',
159
- additionalInfoKey: 'additionalInfo',
160
- disabledKey: 'disabled',
161
- })
162
- : [], selectedItem: toOption(selectedSeverity, {
163
- labelKey: 'label',
164
- additionalInfoKey: 'additionalInfo',
165
- disabledKey: 'disabled',
166
- }), disabled: allCaseSeverities.isError ||
170
+ React.createElement(SingleSelectDropdown, { dataTrackingId: "get-support-severity", selected: getSelectedDropdownOption, options: getDropdownOptions, onSelect: onSeverityChange, isDisabled: allCaseSeverities.isError ||
167
171
  props.isDisabled ||
168
172
  allCaseSeverities.isFetching ||
169
173
  ownersEntitlements.isFetching ||
170
- versionsDetails.isFetching, isLoadingList: props.isFetching, isInValid: allCaseSeverities.isError || isSeverityInValid, required: true, onChange: onSeverityChange, onOuterClick: setIsSeverityInValidLocal, "data-tracking-id": "get-support-severity" })),
171
- openUpdateSeverityModal && (React.createElement(UpdateSeverityModal, { isDisabled: props.isFetching, isFetching: props.isFetching, show: openUpdateSeverityModal, onClose: toggleModal })))) : (React.createElement(Dropdown, { name: "get-support-severity", placeholder: t(`Select a severity`), title: t(`Select a severity`), list: allCaseSeverities.data
172
- ? toOptions(filteredSeverities, {
173
- labelKey: 'label',
174
- additionalInfoKey: 'additionalInfo',
175
- disabledKey: 'disabled',
176
- })
177
- : [], selectedItem: toOption(selectedSeverity, {
178
- labelKey: 'label',
179
- additionalInfoKey: 'additionalInfo',
180
- disabledKey: 'disabled',
181
- }), disabled: allCaseSeverities.isError ||
182
- props.isDisabled ||
183
- allCaseSeverities.isFetching ||
184
- ownersEntitlements.isFetching ||
185
- versionsDetails.isFetching, isLoadingList: props.isFetching, isInValid: allCaseSeverities.isError || isSeverityInValid, required: true, onChange: onSeverityChange, onOuterClick: setIsSeverityInValidLocal, "data-tracking-id": "get-support-severity" }))));
174
+ versionsDetails.isFetching, isLoading: props.isFetching, placeholder: t(`Select a severity`), isInvalid: allCaseSeverities.isError || isSeverityInValid, isScrollable: true })),
175
+ openUpdateSeverityModal && (React.createElement(UpdateSeverityModal, { isDisabled: props.isFetching, isFetching: props.isFetching, show: openUpdateSeverityModal, onClose: toggleModal })))) : (React.createElement("div", null,
176
+ React.createElement(SingleSelectDropdown, { className: "case-creation-severity-select", dataTrackingId: "get-support-severity", selected: getSelectedDropdownOption, options: getDropdownOptions, onSelect: onSeverityChange, isDisabled: allCaseSeverities.isError ||
177
+ props.isDisabled ||
178
+ allCaseSeverities.isFetching ||
179
+ ownersEntitlements.isFetching ||
180
+ versionsDetails.isFetching, isLoading: props.isFetching, placeholder: t(`Select a severity`), isInvalid: allCaseSeverities.isError || isSeverityInValid, isScrollable: true })))));
186
181
  }
187
182
  Severity.defaultProps = defaultProps;
188
183
  export default Severity;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA8bzC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAkczC;AAED,eAAe,mBAAmB,CAAC"}
@@ -252,6 +252,7 @@ function CaseContactSelector(props) {
252
252
  groupContactToAdd && setGroupContactToAdd(null);
253
253
  emailToAdd && setEmailToAdd('');
254
254
  };
255
+ const getCreateNewText = (query) => `Add to your account: ${query}`;
255
256
  if (!canSeeEmailNotifications)
256
257
  return React.createElement(React.Fragment, null);
257
258
  return (React.createElement("div", { className: "form-group pf-v5-u-mb-md" },
@@ -259,10 +260,10 @@ function CaseContactSelector(props) {
259
260
  React.createElement(Trans, null, "Send notifications"),
260
261
  loggedInUserRights.data.isOrgAdmin() ? (React.createElement(React.Fragment, null,
261
262
  React.createElement("div", { "data-tracking-id": "send-notification-listbox" },
262
- React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: [
263
+ React.createElement(CaseContactsSelectorExternal, { groupContactsAndEmails: true, allowCustomEmailAdd: true, loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: [
263
264
  ...customEmailsList.data,
264
265
  ...filter(selectedNotificationContacts, (c) => !c.isInternal),
265
- ], contactsToExclude: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onNotifiedUserChange, clearButton: true, multiple: true, placeholder: t(`Search for an email address or username of the person you want to notify`), id: "open-case-notifications", name: "open-case-notifications", className: "react-select-custom", renderToken: renderToken, isUpdating: isAssociatesUpdating || customEmailsList.isFetching || isUpdatingCustomEmails, isExportingPDF: isExportingPDF, allowNew: onAddNew, newSelectionPrefix: t('Add to your account: '), customEmails: accountCustomEmails.data || [] })),
266
+ ], contactsToExclude: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onNotifiedUserChange, clearButton: true, multiple: true, placeholder: t(`Search for an email address or username of the person you want to notify`), id: "open-case-notifications", name: "open-case-notifications", className: "react-select-custom", renderToken: renderToken, isUpdating: isAssociatesUpdating || customEmailsList.isFetching || isUpdatingCustomEmails, isExportingPDF: isExportingPDF, customEmails: accountCustomEmails.data || [], canAddNew: onAddNew, getCreateNewText: getCreateNewText })),
266
267
  !showGroupPermissionError && !showAccountPermissionError && (React.createElement("p", { className: "form-instructions" },
267
268
  React.createElement(Trans, null, "Include someone from your account to inform about the status of this case."))),
268
269
  showGroupPermissionError && !isExportingPDF && (React.createElement("p", { className: "form-instructions form-invalid" }, loggedInUserRights.data.isOrgAdmin() && (React.createElement(Trans, null,
@@ -12,7 +12,7 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
12
12
  const { routeState: { isCaseCreate, isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
13
13
  return (React.createElement(React.Fragment, null,
14
14
  React.createElement("div", { className: "product-selector-wrapper" },
15
- React.createElement("label", { htmlFor: "product-selector-dropdown-downshift-search", ref: ref },
15
+ React.createElement("label", { htmlFor: "product-selector-dropdown-search", ref: ref },
16
16
  React.createElement(Trans, null, "Product"),
17
17
  ' ',
18
18
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA8V3C"}
1
+ {"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA+V3C"}
@@ -57,7 +57,8 @@ export function SessionRestore(props) {
57
57
  * Fetching previous sessions on load
58
58
  */
59
59
  useEffect(() => {
60
- currentUrlSeSessionId && getIndividualSessionById(sessionRestoreDispatch, currentUrlSeSessionId);
60
+ currentUrlSeSessionId &&
61
+ getIndividualSessionById(sessionRestoreDispatch, currentUrlSeSessionId, isCaseCreate, ABTestVariation);
61
62
  loadPreviousSessions(sessionRestoreDispatch, caseDispatch);
62
63
  // eslint-disable-next-line react-hooks/exhaustive-deps
63
64
  }, [sessionRestoreDispatch, caseDispatch]);
@@ -15,5 +15,6 @@ export declare const isPhoneValid: (countryCode: string, phoneLine: string) => b
15
15
  export declare const trimAndReplacePlus: (value: string) => string;
16
16
  export declare const removeAllSpaces: (value: string) => string;
17
17
  export declare const removeAllChars: (value: string) => string;
18
+ export declare const removeSpecialChars: (value: string) => string;
18
19
  export declare const getProductObj: (products: Partial<ISEProduct>[], product: string) => Partial<ISEProduct>;
19
20
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACpC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,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C,UAAU,CAAC,EAAE,WAAW,MAAM,wBAG7E,CAAC"}
@@ -55,6 +55,12 @@ export const removeAllChars = (value) => {
55
55
  // to remove all chars, brackets and have only digits
56
56
  return value === null || value === void 0 ? void 0 : value.replace(/[^0-9]/g, '');
57
57
  };
58
+ export const removeSpecialChars = (value) => {
59
+ if (!value)
60
+ return '';
61
+ // to allow only chars and digits
62
+ return value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z0-9]/g, '');
63
+ };
58
64
  export const getProductObj = (products, product) => {
59
65
  const productIndex = findIndex(products, (p) => p.product === product);
60
66
  return productIndex === -1 ? {} : products[productIndex];
@@ -58,7 +58,7 @@ export declare enum SessionRestoreConstants {
58
58
  export declare const initialSessionRestoreState: ISessionRestoreState;
59
59
  export type SessionRestoreDispatchType = (value: IActionType) => void;
60
60
  export declare const sessionRestoreReducer: (state: ISessionRestoreState, action: IActionType) => ISessionRestoreState;
61
- export declare const getIndividualSessionById: (dispatch: SessionReducerDispatchType, sessionId: string | undefined) => Promise<void>;
61
+ export declare const getIndividualSessionById: (dispatch: SessionReducerDispatchType, sessionId: string | undefined, isCaseCreate: boolean, ABTestVariation?: string) => Promise<void>;
62
62
  export declare const loadPreviousSessions: (dispatch: SessionReducerDispatchType, caseDispatch: CaseReducerDispatchType) => Promise<void>;
63
63
  export declare const createSession: (dispatch: SessionReducerDispatchType, sessionDetails: ISessionDetails, session: ISession) => Promise<string>;
64
64
  export declare const updateSession: (dispatch: SessionReducerDispatchType, sessionId: string, sessionDetails: ISessionDetails, session?: ISession) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRestoreReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/SessionRestoreReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,IAAI,sBAAsB,EAC/C,yBAAyB,IAAI,0BAA0B,EACvD,gCAAgC,IAAI,iCAAiC,EACxE,MAAM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AAgB,EAAE,0BAA0B,EAC5C,QAAQ,GAAE,MAAU,EACpB,WAAW,GAAE,MAAU,GACxB,gBAAgB,EAAE,CAMpB;AAGD,eAAO,MAAM,iBAAiB,QACrB,mBAAmB,oBACN,0BAA0B,SACtC,MAAM,KACb,gBAOD,CAAC;AAEH,eAAO,MAAM,mBAAmB,QACvB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAEH,eAAO,MAAM,oBAAoB,WACrB,cAAc,oBACJ,0BAA0B,SACtC,MAAM,sBACO,iCAAiC,GAAG,SAAS,KACjE,gBAOD,CAAC;AAEH,eAAO,MAAM,iBAAiB,QACrB,0BAA0B,oBACb,0BAA0B,SACtC,MAAM,sBACO,iCAAiC,GAAG,SAAS,8CAGjE,gBAAgB,EAgBlB,CAAC;AAEF,eAAO,MAAM,cAAc,gFAY1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,gFAYjC,CAAC;AAGF,eAAO,MAAM,gBAAgB,QACpB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAIH,eAAO,MAAM,YAAY,eACT,mBAAmB,mBACd,mBAAmB,EAAE,YAC7B,mBAAmB,EAAE,uBAWjC,CAAC"}
1
+ {"version":3,"file":"SessionRestoreReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/SessionRestoreReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,IAAI,sBAAsB,EAC/C,yBAAyB,IAAI,0BAA0B,EACvD,gCAAgC,IAAI,iCAAiC,EACxE,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE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,eAAO,MAAM,mBAAmB,QACvB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAEH,eAAO,MAAM,oBAAoB,WACrB,cAAc,oBACJ,0BAA0B,SACtC,MAAM,sBACO,iCAAiC,GAAG,SAAS,KACjE,gBAOD,CAAC;AAEH,eAAO,MAAM,iBAAiB,QACrB,0BAA0B,oBACb,0BAA0B,SACtC,MAAM,sBACO,iCAAiC,GAAG,SAAS,8CAGjE,gBAAgB,EAgBlB,CAAC;AAEF,eAAO,MAAM,cAAc,gFAY1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,gFAYjC,CAAC;AAGF,eAAO,MAAM,gBAAgB,QACpB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAIH,eAAO,MAAM,YAAY,eACT,mBAAmB,mBACd,mBAAmB,EAAE,YAC7B,mBAAmB,EAAE,uBAWjC,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
- import { getApiCreationStatus, getApiResourceObject, getApiUpdationStatus, getPastUTCDateFromNow, getResTypeFromUrl, promiseReflection, } from '@rh-support/utils';
11
+ import { getApiCreationStatus, getApiResourceObject, getApiUpdationStatus, getPastUTCDateFromNow, getResTypeFromUrl, getUserAgentForCaseMode, promiseReflection, } from '@rh-support/utils';
12
12
  import cloneDeep from 'lodash/cloneDeep';
13
13
  import differenceBy from 'lodash/differenceBy';
14
14
  import filter from 'lodash/filter';
@@ -123,15 +123,33 @@ export const sessionRestoreReducer = (state, action) => {
123
123
  }
124
124
  };
125
125
  // Function to get individual Session by id
126
- export const getIndividualSessionById = (dispatch, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
126
+ export const getIndividualSessionById = (dispatch, sessionId, isCaseCreate, ABTestVariation) => __awaiter(void 0, void 0, void 0, function* () {
127
127
  if (isEmpty(sessionId))
128
128
  return;
129
129
  try {
130
130
  const sessions = yield getSessions({
131
131
  sessionId: sessionId,
132
132
  });
133
+ let sessionItem = sessions[0];
134
+ if (!sessionItem.session.userAgent) {
135
+ // session created by console, need to add user agent and A/B test variation
136
+ const userAgent = getUserAgentForCaseMode(isCaseCreate) + ABTestVariation
137
+ ? ABTestVariation === 'A'
138
+ ? '-A-1'
139
+ : '-B-1'
140
+ : '';
141
+ sessionItem = Object.assign(Object.assign({}, sessionItem), { session: Object.assign(Object.assign({}, sessionItem.session), { userAgent }) });
142
+ }
143
+ else {
144
+ // session created before running A/B test, need to add A/B test variation
145
+ if ((ABTestVariation && !sessionItem.session.userAgent.includes('A')) ||
146
+ !sessionItem.session.userAgent.includes('B')) {
147
+ const userAgent = sessionItem.session.userAgent + (ABTestVariation === 'A') ? '-A-1' : '-B-1';
148
+ sessionItem = Object.assign(Object.assign({}, sessionItem), { session: Object.assign(Object.assign({}, sessionItem.session), { userAgent }) });
149
+ }
150
+ }
133
151
  if (!isEmpty(sessions)) {
134
- dispatch({ type: SessionRestoreConstants.setIndividualSession, payload: { sessionItem: sessions[0] } });
152
+ dispatch({ type: SessionRestoreConstants.setIndividualSession, payload: { sessionItem } });
135
153
  }
136
154
  }
137
155
  catch (error) { }
@@ -1012,7 +1012,7 @@ svg.pf-v5-u-ml-xs.icon-size {
1012
1012
  .get-support-severity-modal-text,
1013
1013
  .case-type-selector-text {
1014
1014
  .pf-v5-c-menu-toggle__text {
1015
- width: 100%;
1015
+ width: 100% !important;
1016
1016
  }
1017
1017
  }
1018
1018
 
@@ -1093,6 +1093,12 @@ svg.pf-v5-u-ml-xs.icon-size {
1093
1093
  height: 32px;
1094
1094
  }
1095
1095
 
1096
+ .single-select-toggle-text {
1097
+ span.pf-v5-c-menu-toggle__text {
1098
+ width: 100% !important;
1099
+ }
1100
+ }
1101
+
1096
1102
  .gradient.label-container-icon::before {
1097
1103
  content: '';
1098
1104
  display: block;
@@ -790,3 +790,7 @@ div.case-details-tabs pre {
790
790
  min-width: calc(100% + 269px) !important;
791
791
  }
792
792
  }
793
+
794
+ .case-creation-severity-select {
795
+ max-width: min-content !important;
796
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -25,12 +25,11 @@
25
25
  "lib/**/*"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@cee-eng/hydrajs": "4.17.36",
28
+ "@cee-eng/hydrajs": "4.18.0",
29
29
  "@cee-eng/ui-toolkit": "1.1.8",
30
30
  "@patternfly/patternfly": "5.4.0",
31
31
  "@patternfly/react-core": "5.4.0",
32
32
  "dompurify": "^2.2.6",
33
- "downshift": "^6.0.5",
34
33
  "i18next": "^23.15.0",
35
34
  "js-markdown-extra": "^1.2.4",
36
35
  "js-worker-search": "^1.4.1",
@@ -51,7 +50,7 @@
51
50
  "react-virtualized": "^9.22.5"
52
51
  },
53
52
  "dependencies": {
54
- "@cee-eng/hydrajs": "4.17.36",
53
+ "@cee-eng/hydrajs": "4.18.0",
55
54
  "@cee-eng/ui-toolkit": "1.1.8",
56
55
  "@patternfly/patternfly": "5.4.0",
57
56
  "@patternfly/react-core": "5.4.0",
@@ -60,17 +59,16 @@
60
59
  "@progress/kendo-licensing": "1.3.5",
61
60
  "@progress/kendo-react-pdf": "^5.16.0",
62
61
  "@redux-devtools/extension": "^3.3.0",
63
- "@rh-support/components": "2.5.1",
64
- "@rh-support/react-context": "2.5.1",
62
+ "@rh-support/components": "2.5.3",
63
+ "@rh-support/react-context": "2.5.3",
65
64
  "@rh-support/types": "2.0.5",
66
- "@rh-support/user-permissions": "2.5.0",
67
- "@rh-support/utils": "2.5.0",
65
+ "@rh-support/user-permissions": "2.5.1",
66
+ "@rh-support/utils": "2.5.1",
68
67
  "@types/react-redux": "^7.1.33",
69
68
  "@types/redux": "^3.6.0",
70
69
  "date-fns": "3.6.0",
71
70
  "dompurify": "^2.2.6",
72
71
  "dot": "^1.1.3",
73
- "downshift": "^6.0.5",
74
72
  "history": "4.10.1",
75
73
  "i18next": "^23.15.0",
76
74
  "js-markdown-extra": "^1.2.4",
@@ -137,5 +135,5 @@
137
135
  "defaults and supports es6-module",
138
136
  "maintained node versions"
139
137
  ],
140
- "gitHead": "78f51b2cfd60107a49503d13542ba46d29df4d04"
138
+ "gitHead": "92c1c95e58dc8e6d2df7fd21b3815da9b7d713c9"
141
139
  }