@rh-support/cases 2.1.33 → 2.4.10-beta.6
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/README.md +0 -2
- package/lib/esm/components/case-list/CaseList.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseList.js +2 -3
- package/lib/esm/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.js +10 -14
- package/lib/esm/components/case-list/case-list-filters/AccountsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AccountsFilter.js +5 -10
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilter.d.ts +0 -10
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilter.js +164 -134
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilterChip.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/GroupsFilter.js +2 -2
- package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/ProductsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/ProductsFilter.js +5 -7
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.js +4 -4
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.js +4 -4
- package/lib/esm/components/case-list/case-list-filters/TypeFilter.js +3 -3
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.js +2 -2
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts +0 -1
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/CaseListTable.js +12 -11
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +1 -1
- package/lib/esm/components/case-list/case-search/AdvanceSearch.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/AdvanceSearch.js +13 -18
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +5 -6
- package/lib/esm/components/case-list/case-search/CaseSearch.js +1 -1
- package/lib/esm/components/case-list/case-search/SaveCaseSearchModal.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/SaveCaseSearchModal.js +8 -10
- package/lib/esm/components/escalations/EscalationForm.d.ts.map +1 -1
- package/lib/esm/components/escalations/EscalationForm.js +9 -18
- package/lib/esm/css/caseList.css +42 -50
- package/lib/esm/css/caseSearch.css +1 -1
- package/lib/esm/css/escalation.css +4 -4
- package/lib/esm/scss/_main.scss +11 -11
- package/lib/esm/scss/_pf-overrides.scss +3 -8
- package/package.json +14 -14
- package/lib/esm/components/case-list/case-list-filters/InternalSsoNameFilter.d.ts +0 -2
- package/lib/esm/components/case-list/case-list-filters/InternalSsoNameFilter.d.ts.map +0 -1
- package/lib/esm/components/case-list/case-list-filters/InternalSsoNameFilter.js +0 -207
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AA4BlC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,0BAA0B,EAI7B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAK1C,OAAO,EAAgB,WAAW,EAA2B,MAAM,uBAAuB,CAAC;AAmC3F,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,oBAAY,YAAY,GAAG,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAM5F,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AA4BlC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAKH,0BAA0B,EAI7B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAK1C,OAAO,EAAgB,WAAW,EAA2B,MAAM,uBAAuB,CAAC;AAmC3F,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,oBAAY,YAAY,GAAG,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAM5F,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eA2frC"}
|
|
@@ -58,7 +58,6 @@ export function CaseList(props) {
|
|
|
58
58
|
const searchType = searchParams[FILTER_URL_QUERY_TYPE];
|
|
59
59
|
const abortControllerRef = useRef(undefined);
|
|
60
60
|
const isXLScreen = breakPoint.xl;
|
|
61
|
-
const isXXLScreen = breakPoint.xxl;
|
|
62
61
|
const isFirstMount = useRef(true);
|
|
63
62
|
const filterSectionRef = useRef(null);
|
|
64
63
|
const filterState = useContext(CaseListFilterStateContext);
|
|
@@ -346,7 +345,7 @@ export function CaseList(props) {
|
|
|
346
345
|
React.createElement(CaseListFilterChips, { productVersionPivotValues: get(pivotValues, SolrPivotKeys.product_version, []), isSolrSearchDown: isSolrSearchDown })))),
|
|
347
346
|
React.createElement("section", { className: "case-search-bottom" },
|
|
348
347
|
isBasicSearchMode && (React.createElement("aside", { className: `case-search-filters ${((_a = filterSectionRef.current) === null || _a === void 0 ? void 0 : _a.expanded) ? '' : 'collapsed'}` },
|
|
349
|
-
React.createElement("
|
|
348
|
+
React.createElement("h3", { className: "filter-header" }, ((_b = filterSectionRef.current) === null || _b === void 0 ? void 0 : _b.expanded) ? (React.createElement(React.Fragment, null,
|
|
350
349
|
React.createElement(Button, { variant: "link", isActive: true, title: t('Collapse filter section'), onClick: onToggleFilterBtnClick, iconPosition: "right", icon: isXLScreen ? React.createElement(AngleDoubleLeftIcon, null) : React.createElement(AngleDoubleUpIcon, null) },
|
|
351
350
|
React.createElement("span", null,
|
|
352
351
|
React.createElement(Trans, null, "Filters"))))) : (React.createElement(Button, { variant: "link", isActive: false, title: t('Expand filter section'), onClick: onToggleFilterBtnClick, iconPosition: "right", icon: isXLScreen ? React.createElement(AngleDoubleRightIcon, null) : React.createElement(AngleDoubleDownIcon, null) }, isXLScreen ? null : (React.createElement("span", null,
|
|
@@ -356,5 +355,5 @@ export function CaseList(props) {
|
|
|
356
355
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading filters') } },
|
|
357
356
|
React.createElement(CaseListFilters, { filterValues: filterValuesFromFacetResponse, allCaseTypes: allCaseTypes, allCaseStatuses: allCaseStatuses, allCaseSeverities: allCaseSeverities, allProducts: allProducts, isSolrSearchDown: isSolrSearchDown })))))),
|
|
358
357
|
React.createElement("section", { className: "case-search-table" },
|
|
359
|
-
React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, paginationInfo: filterState.paginationInfo, isCaseListPageLoading: isFetching, hasError: hasError, isSolrDown: isSolrSearchDown
|
|
358
|
+
React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, paginationInfo: filterState.paginationInfo, isCaseListPageLoading: isFetching, hasError: hasError, isSolrDown: isSolrSearchDown })))));
|
|
360
359
|
}
|
package/lib/esm/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountsBookmarkedGroupFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountsBookmarkedGroupFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY,eAAgB,MAAM,gBAS9C,CAAC;AAEF,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;IACjC,wBAAwB,EAAE,OAAO,CAAC;IAClC,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAOD,eAAO,MAAM,QAAQ,cAAe,MAAM,eAAe,MAAM,WACiB,CAAC;AAEjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,eAgJ1D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Label, Tooltip } from '@patternfly/react-core';
|
|
2
|
-
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
1
|
+
import { Label, Select, SelectOption, SelectVariant, Tooltip } from '@patternfly/react-core';
|
|
3
2
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
4
3
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
5
4
|
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
@@ -17,8 +16,8 @@ import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../Ca
|
|
|
17
16
|
import { updateFilter } from '../CaseListFilterReducer';
|
|
18
17
|
export const appendToMenu = (listLength) => {
|
|
19
18
|
return (React.createElement(React.Fragment, null,
|
|
20
|
-
listLength !== 0 && React.createElement("div", { className: "pf-
|
|
21
|
-
React.createElement(Link, { className: "cta cta-link pf-
|
|
19
|
+
listLength !== 0 && React.createElement("div", { className: "pf-c-divider", role: "separator" }),
|
|
20
|
+
React.createElement(Link, { className: "cta cta-link pf-c-select__menu-item", to: "/manage/bookmarks" },
|
|
22
21
|
React.createElement(Trans, null, "Manage bookmarks"))));
|
|
23
22
|
};
|
|
24
23
|
export const getLabel = (accountNo, accountName) => accountNo ? (accountName ? `${accountName} <${accountNo}>` : accountNo) : '';
|
|
@@ -46,7 +45,7 @@ export function AccountsBookmarkedGroupFilter(props) {
|
|
|
46
45
|
const selectedAccounts = filterInfo[SolrKeys.accountNumber].filter((item) => !Array.isArray(item.key));
|
|
47
46
|
const getInfoToolTip = (groupName) => {
|
|
48
47
|
const list = groupedBookmarks[groupName];
|
|
49
|
-
return (React.createElement("ul", { className: "no-list-style pf-
|
|
48
|
+
return (React.createElement("ul", { className: "no-list-style pf-u-pl-0" }, list.map((b) => {
|
|
50
49
|
return (React.createElement("li", { key: b.accountNumber },
|
|
51
50
|
b.name,
|
|
52
51
|
" (",
|
|
@@ -56,12 +55,12 @@ export function AccountsBookmarkedGroupFilter(props) {
|
|
|
56
55
|
};
|
|
57
56
|
const getBookmarksOptions = (options) => {
|
|
58
57
|
return [
|
|
59
|
-
...options.map((b, id) => (React.createElement(SelectOption, { key: id, value: b, className: "pf-
|
|
60
|
-
React.createElement("div", { className: "pf-
|
|
61
|
-
React.createElement("input", { className: "pf-
|
|
58
|
+
...options.map((b, id) => (React.createElement(SelectOption, { key: id, value: b, className: "pf-c-select__menu-wrapper", role: "presentation" },
|
|
59
|
+
React.createElement("div", { className: "pf-c-select__menu-item-main" },
|
|
60
|
+
React.createElement("input", { className: "pf-c-check__input pf-u-mr-sm", type: "checkbox", checked: some(filterInfo[SolrKeys.accountNumber], b) }),
|
|
62
61
|
React.createElement("span", null, b.value)),
|
|
63
62
|
Array.isArray(b.key) && (React.createElement(Tooltip, { content: getInfoToolTip(b.value), "aria-label": t('Bookmarked Accounts List') },
|
|
64
|
-
React.createElement(Label, { color: "cyan", className: "pf-
|
|
63
|
+
React.createElement(Label, { color: "cyan", className: "pf-u-ml-auto pf-u-mr-sm", icon: React.createElement(InfoCircleIcon, null), "aria-label": t('Bookmarked Accounts') }, b.key.length)))))),
|
|
65
64
|
...(canManageBookmarkAccounts ? [appendToMenu((bookmarkedGroupAccounts.data || []).length)] : []),
|
|
66
65
|
];
|
|
67
66
|
};
|
|
@@ -97,10 +96,7 @@ export function AccountsBookmarkedGroupFilter(props) {
|
|
|
97
96
|
if (!canReadBookmarkAccounts && !canAccessManagedAccounts) {
|
|
98
97
|
return null;
|
|
99
98
|
}
|
|
100
|
-
|
|
101
|
-
if (isEmpty(managedAccountsList))
|
|
102
|
-
return null;
|
|
103
|
-
return (React.createElement("div", { className: "pf-v5-c-select" },
|
|
99
|
+
return (React.createElement("div", { className: "pf-c-select" },
|
|
104
100
|
React.createElement("label", { htmlFor: "case-list-group-filter" }, canAccessManagedAccounts ? t('Accounts') : t(filterNamesMap[SolrKeys.accountNumber])),
|
|
105
|
-
React.createElement(Select, { variant: SelectVariant.typeaheadMulti, onToggle:
|
|
101
|
+
React.createElement(Select, { variant: SelectVariant.typeaheadMulti, onToggle: onBookmarksToggle, onSelect: onBookmarksSelect, onClear: onBookmarksClear, isOpen: isOpen, onFilter: onBookmarksFilter, placeholderText: getDropdownBtnPlaceholder(t(canAccessManagedAccounts ? 'Search for an account' : 'Search for a bookmark'), canAccessManagedAccounts ? selectedAccounts : selectedBookmarks, '', dropdownOptions.length, canAccessManagedAccounts ? t('All accounts') : t('All bookmarks')), "data-tracking-id": "accounts-filter", id: "case-list-group-filter" }, getBookmarksOptions(dropdownOptions))));
|
|
106
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAe1F,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,gCAAgC,YAAa,QAAQ,WAMjE,CAAC;AACF,eAAO,MAAM,+BAA+B,YAAa,QAAQ,sBAAsB,CAAC,WAEvF,CAAC;AAEF,eAAO,MAAM,QAAQ,0CACyD,CAAC;AAE/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AccountsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAe1F,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,gCAAgC,YAAa,QAAQ,WAMjE,CAAC;AACF,eAAO,MAAM,+BAA+B,YAAa,QAAQ,sBAAsB,CAAC,WAEvF,CAAC;AAEF,eAAO,MAAM,QAAQ,0CACyD,CAAC;AAE/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eAqF3C"}
|
|
@@ -14,8 +14,8 @@ import differenceBy from 'lodash/differenceBy';
|
|
|
14
14
|
import filter from 'lodash/filter';
|
|
15
15
|
import remove from 'lodash/remove';
|
|
16
16
|
import uniqBy from 'lodash/uniqBy';
|
|
17
|
-
import React, { useContext, useEffect
|
|
18
|
-
import {
|
|
17
|
+
import React, { useContext, useEffect } from 'react';
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { SolrKeys } from '../../../enums/filters';
|
|
20
20
|
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
21
21
|
import { updateFilter } from '../CaseListFilterReducer';
|
|
@@ -35,14 +35,12 @@ export function AccountsFilter(props) {
|
|
|
35
35
|
const { canReadBookmarkAccounts } = props;
|
|
36
36
|
const { filterInfo } = useContext(CaseListFilterStateContext);
|
|
37
37
|
const dispatch = useContext(CaseListFilterDispatchContext);
|
|
38
|
-
const selectedAccounts =
|
|
38
|
+
const selectedAccounts = filterInfo[SolrKeys.accountNumber]
|
|
39
39
|
.filter((item) => !Array.isArray(item.key))
|
|
40
40
|
.map((item) => ({
|
|
41
41
|
name: item.value,
|
|
42
42
|
accountNumber: item.key,
|
|
43
|
-
}))
|
|
44
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
-
[filterInfo, filterInfo[SolrKeys.accountNumber]]);
|
|
43
|
+
}));
|
|
46
44
|
const onAccountsFilterChange = (selected) => {
|
|
47
45
|
const toAdd = differenceBy(selected, selectedAccounts, 'accountNumber');
|
|
48
46
|
const toRemove = differenceBy(selectedAccounts, selected, 'accountNumber');
|
|
@@ -97,8 +95,5 @@ export function AccountsFilter(props) {
|
|
|
97
95
|
if (!canReadBookmarkAccounts) {
|
|
98
96
|
return null;
|
|
99
97
|
}
|
|
100
|
-
return (React.createElement(
|
|
101
|
-
React.createElement("label", { htmlFor: "case-list-accounts-filter" },
|
|
102
|
-
React.createElement(Trans, null, "Accounts")),
|
|
103
|
-
React.createElement(AccountSelectorInternal, { label: t('i18nAccounts', 'Accounts'), selectedAccounts: selectedAccounts, multiple: true, suggestBookmarkAccounts: false, placeholder: getDropdownBtnPlaceholder(t('Search for an account'), (selectedAccounts || []).map((i) => i.name), ''), onSelect: onAccountsFilterChange })));
|
|
98
|
+
return (React.createElement(AccountSelectorInternal, { label: t('i18nAccounts', 'Accounts'), selectedAccounts: selectedAccounts, multiple: true, suggestBookmarkAccounts: false, placeholder: getDropdownBtnPlaceholder(t('Search for an account'), (selectedAccounts || []).map((i) => i.name), ''), onSelect: onAccountsFilterChange }));
|
|
104
99
|
}
|
|
@@ -25,5 +25,5 @@ export function AdditionalFilters() {
|
|
|
25
25
|
React.createElement("div", { className: "additional-filters" },
|
|
26
26
|
React.createElement("h3", null,
|
|
27
27
|
React.createElement(Trans, null, "More")),
|
|
28
|
-
React.createElement(Checkbox, { label: t(AdditionalFilterLabels[SolrKeys.escalation]), isChecked: escalated, onChange:
|
|
28
|
+
React.createElement(Checkbox, { label: t(AdditionalFilterLabels[SolrKeys.escalation]), isChecked: escalated, onChange: onEscalatedChange, "aria-label": t(AdditionalFilterLabels[SolrKeys.escalation]), id: "escalated", name: "escalated", "data-tracking-id": "escalated-filter-selector" }))));
|
|
29
29
|
}
|
|
@@ -44,7 +44,7 @@ export function CaseListFilterChips(props) {
|
|
|
44
44
|
return (React.createElement("div", { className: "filter-chip", key: `${filterKey}-bookmarks-${groupName}` },
|
|
45
45
|
React.createElement("span", { className: "filter-chip__heading" },
|
|
46
46
|
React.createElement(Trans, null, groupName || filterNamesMap[filterKey] || filterKey)),
|
|
47
|
-
React.createElement(ChipGroup, { numChips: 7, className: "pf-
|
|
47
|
+
React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey, caseTypeFilter, groupName))));
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
const renderAccountFilterChip = () => {
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
export declare const getFullName: (contact: any) => string;
|
|
2
|
-
export declare const getFilterValues: (contactList: any, own: any) => {
|
|
3
|
-
firstName: string;
|
|
4
|
-
lastName: string;
|
|
5
|
-
firstNameCustom: string;
|
|
6
|
-
lastNameCustom: string;
|
|
7
|
-
value: string;
|
|
8
|
-
label: string;
|
|
9
|
-
}[];
|
|
10
|
-
export declare const getSelectedListObj: (contactsList: any, filterInfo: any, own: any, t: any) => any[];
|
|
11
1
|
export declare function CreatorSsoNameFilter(): JSX.Element;
|
|
12
2
|
//# sourceMappingURL=CreatorSsoNameFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatorSsoNameFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CreatorSsoNameFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreatorSsoNameFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CreatorSsoNameFilter.tsx"],"names":[],"mappings":"AAmDA,wBAAgB,oBAAoB,gBAwSnC"}
|
|
@@ -7,25 +7,21 @@ 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 { accounts } from '@cee-eng/hydrajs';
|
|
11
|
-
import {
|
|
12
|
-
import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
|
|
13
|
-
import { LoadingIndicator, useFetch, useSelectKeyboardNavigator } from '@rh-support/components';
|
|
10
|
+
import { accounts, contacts } from '@cee-eng/hydrajs';
|
|
11
|
+
import { AsyncMultiDropDownList, MultiSelectDropDownList, useFetch } from '@rh-support/components';
|
|
14
12
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
15
|
-
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
16
|
-
import
|
|
17
|
-
import isUndefined from 'lodash/isUndefined';
|
|
13
|
+
import { getDropdownBtnPlaceholder, toOptions } from '@rh-support/utils';
|
|
14
|
+
import isEmpty from 'lodash/isEmpty';
|
|
18
15
|
import uniqBy from 'lodash/uniqBy';
|
|
19
|
-
import React, { useContext, useEffect,
|
|
16
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
20
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
21
18
|
import { SolrKeys } from '../../../enums/filters';
|
|
22
19
|
import { filterNamesMap } from '../../../utils/constants';
|
|
23
|
-
import { useCaseListDispatchContext } from '../CaseListContext';
|
|
20
|
+
import { useCaseListDispatchContext, useCaseListStateContext } from '../CaseListContext';
|
|
24
21
|
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
25
22
|
import { updateFilters } from '../CaseListFilterReducer';
|
|
26
23
|
import { setChipsNameSsoMap } from '../CaseListReducer';
|
|
27
|
-
|
|
28
|
-
export const getFullName = (contact) => {
|
|
24
|
+
const getFullName = (contact) => {
|
|
29
25
|
return contact.fullNameCustom
|
|
30
26
|
? `${contact.firstNameCustom} ${contact.lastNameCustom}`
|
|
31
27
|
: `${contact.firstName} ${contact.lastName}`;
|
|
@@ -38,104 +34,25 @@ const mapToObj = (arr) => arr.map((item) => ({
|
|
|
38
34
|
value: item.ssoUsername,
|
|
39
35
|
label: `${getFullName(item)} <${item.ssoUsername}>`,
|
|
40
36
|
}));
|
|
41
|
-
|
|
42
|
-
export const getSelectedListObj = (contactsList, filterInfo, own, t) => {
|
|
43
|
-
const created = [...filterInfo[SolrKeys.createdBySsoUsername]].reduce((result, sso) => {
|
|
44
|
-
if (sso === own) {
|
|
45
|
-
result.push({ value: 'createdByMe', label: t('Cases created by me') });
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
const contact = contactsList.find((item) => (item === null || item === void 0 ? void 0 : item.ssoUsername) === sso);
|
|
49
|
-
contact &&
|
|
50
|
-
result.push({
|
|
51
|
-
value: contact.ssoUsername,
|
|
52
|
-
label: `${getFullName(contact)} <${contact.ssoUsername}>`,
|
|
53
|
-
});
|
|
54
|
-
!contact &&
|
|
55
|
-
result.push({
|
|
56
|
-
value: sso,
|
|
57
|
-
label: '',
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
}, []);
|
|
62
|
-
const owned = [...filterInfo[SolrKeys.caseContactSSO]].reduce((result, sso) => {
|
|
63
|
-
if (sso === own) {
|
|
64
|
-
result.push({ value: 'ownedByMe', label: t('Cases owned by me') });
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
const contact = contactsList.find((item) => item.ssoUsername === sso);
|
|
68
|
-
contact &&
|
|
69
|
-
result.push({
|
|
70
|
-
value: contact.ssoUsername,
|
|
71
|
-
label: `${getFullName(contact)} <${contact.ssoUsername}>`,
|
|
72
|
-
});
|
|
73
|
-
!contact &&
|
|
74
|
-
result.push({
|
|
75
|
-
value: sso,
|
|
76
|
-
label: '',
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return result;
|
|
80
|
-
}, []);
|
|
81
|
-
const selected = uniqBy([...created, ...owned], 'value');
|
|
82
|
-
return selected;
|
|
83
|
-
};
|
|
37
|
+
const getFilterValues = (contactList, own) => mapToObj(contactList).filter((o) => o.value !== own);
|
|
84
38
|
export function CreatorSsoNameFilter() {
|
|
85
39
|
const { t } = useTranslation();
|
|
86
40
|
const { filterInfo } = useContext(CaseListFilterStateContext);
|
|
87
41
|
const dispatch = useContext(CaseListFilterDispatchContext);
|
|
88
42
|
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
43
|
+
const { chipsNameSsoMap } = useCaseListStateContext();
|
|
89
44
|
const CaseListDispatch = useCaseListDispatchContext();
|
|
90
45
|
const own = loggedInUserRights.data.getSSOUsername();
|
|
46
|
+
const PER_PAGE = 200;
|
|
91
47
|
const isExternalNonOrgAdmin = !loggedInUserRights.data.isInternal() && loggedInUserRights.data.isCustomerNonOrgAdmin();
|
|
48
|
+
const ASYNC_DROPDOWN_PAGE_SIZE = 10000;
|
|
92
49
|
const { request: getExternalUserContactsList, isFetching: isFetchingExternalContacts } = useFetch(accounts.getAccountContacts, { propgateErrors: true });
|
|
93
|
-
const
|
|
50
|
+
const { request: getInternalUserContactsList, isFetching: isFetchingInternalContacts } = useFetch(contacts.getSFDCContacts, { propgateErrors: true });
|
|
51
|
+
const abortControllerRef = useRef(undefined);
|
|
94
52
|
const [externalContactList, setExternalContactList] = useState([]);
|
|
95
|
-
const [
|
|
96
|
-
const [noResults, setNoResults] = useState(false);
|
|
97
|
-
const [externalQuery, setExternalQuery] = useState('');
|
|
98
|
-
const onSelectExternal = (contact) => {
|
|
99
|
-
if (isNull(contact) || isUndefined(contact))
|
|
100
|
-
return;
|
|
101
|
-
let list = [];
|
|
102
|
-
if (selectedExternalContacts.some((item) => item.value === contact.value)) {
|
|
103
|
-
list = selectedExternalContacts.filter((item) => item.value !== contact.value);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
list = [...selectedExternalContacts, contact];
|
|
107
|
-
}
|
|
108
|
-
onFilterChange(list);
|
|
109
|
-
setExternalQuery('');
|
|
110
|
-
};
|
|
111
|
-
const dropdownHeader = [
|
|
112
|
-
{
|
|
113
|
-
label: `${t('Cases created by me')}`,
|
|
114
|
-
value: 'createdByMe',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
label: `${t('Cases owned by me')}`,
|
|
118
|
-
value: 'ownedByMe',
|
|
119
|
-
},
|
|
120
|
-
];
|
|
121
|
-
const filteredOptions = useMemo(() => {
|
|
122
|
-
const filteredValues = getFilterValues(externalContactList, own);
|
|
123
|
-
const input = new RegExp(externalQuery, 'i');
|
|
124
|
-
const newOptions = filteredValues.filter((v) => input.test(v.label || ''));
|
|
125
|
-
setNoResults(isEmpty(newOptions));
|
|
126
|
-
return newOptions;
|
|
127
|
-
}, [externalContactList, own, externalQuery]);
|
|
128
|
-
const { onInputKeyDown, focusedItemIndex } = useSelectKeyboardNavigator({
|
|
129
|
-
list: [...dropdownHeader, ...filteredOptions],
|
|
130
|
-
isOpen: isExternalOpen,
|
|
131
|
-
setIsOpen: setIsExternalOpen,
|
|
132
|
-
onSelect: onSelectExternal,
|
|
133
|
-
});
|
|
134
|
-
const selectedExternalContacts = useMemo(() => getSelectedListObj(externalContactList, filterInfo, own, t),
|
|
135
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
|
-
[externalContactList, filterInfo, own]);
|
|
53
|
+
const [internalContactList, setInternalContactList] = useState([]);
|
|
137
54
|
const onFilterChange = (items) => {
|
|
138
|
-
const selectedItems = items.map((item) => item.value);
|
|
55
|
+
const selectedItems = items.map((item) => item.value.value);
|
|
139
56
|
const caseCreated = selectedItems
|
|
140
57
|
.filter((o) => o !== 'ownedByMe')
|
|
141
58
|
.map((o) => (o === 'createdByMe' ? own : o));
|
|
@@ -158,6 +75,134 @@ export function CreatorSsoNameFilter() {
|
|
|
158
75
|
},
|
|
159
76
|
]);
|
|
160
77
|
};
|
|
78
|
+
const onFilterChangeAsync = (items) => {
|
|
79
|
+
const selectedItems = items.map((item) => item.value.value);
|
|
80
|
+
const caseCreated = selectedItems
|
|
81
|
+
.filter((o) => o !== 'ownedByMe')
|
|
82
|
+
.map((o) => (o === 'createdByMe' ? own : o));
|
|
83
|
+
const caseOwnedBy = selectedItems
|
|
84
|
+
.filter((o) => o !== 'createdByMe')
|
|
85
|
+
.map((o) => (o === 'ownedByMe' ? own : o));
|
|
86
|
+
const caseOwner = loggedInUserRights.data.isInternal() && caseOwnedBy.indexOf(own) !== -1 ? [own] : [];
|
|
87
|
+
updateFilters(dispatch, [
|
|
88
|
+
{
|
|
89
|
+
filterKey: SolrKeys.createdBySsoUsername,
|
|
90
|
+
values: caseCreated,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
filterKey: SolrKeys.caseContactSSO,
|
|
94
|
+
values: caseOwnedBy,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
filterKey: SolrKeys.caseOwner,
|
|
98
|
+
values: caseOwner,
|
|
99
|
+
},
|
|
100
|
+
]);
|
|
101
|
+
// set name/sso pairs on state to be used in filter chip component
|
|
102
|
+
if (loggedInUserRights.data.isInternal()) {
|
|
103
|
+
const chipsNameSsoPairs = {};
|
|
104
|
+
items.forEach((item) => {
|
|
105
|
+
var _a, _b, _c, _d;
|
|
106
|
+
const sso = item.value.value;
|
|
107
|
+
if (sso !== 'ownedByMe' && sso !== 'createdByMe' && !chipsNameSsoMap[sso]) {
|
|
108
|
+
chipsNameSsoPairs[sso] = {
|
|
109
|
+
firstName: ((_a = item.value) === null || _a === void 0 ? void 0 : _a.firstName) || '',
|
|
110
|
+
lastName: ((_b = item.value) === null || _b === void 0 ? void 0 : _b.lastName) || '',
|
|
111
|
+
firstNameCustom: ((_c = item.value) === null || _c === void 0 ? void 0 : _c.firstNameCustom) || '',
|
|
112
|
+
lastNameCustom: ((_d = item.value) === null || _d === void 0 ? void 0 : _d.lastNameCustom) || '',
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
setChipsNameSsoMap(CaseListDispatch, chipsNameSsoPairs);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const dropdownHeader = [
|
|
120
|
+
{
|
|
121
|
+
isNotSearchable: true,
|
|
122
|
+
label: `${t('Cases created by me')}`,
|
|
123
|
+
value: 'createdByMe',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
isNotSearchable: true,
|
|
127
|
+
label: `${t('Cases owned by me')}`,
|
|
128
|
+
value: 'ownedByMe',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
children: isExternalNonOrgAdmin || (externalContactList.length === 0 && internalContactList.length === 0) ? (React.createElement(React.Fragment, null)) : (React.createElement(React.Fragment, null,
|
|
132
|
+
React.createElement("div", { className: "pf-c-divider", role: "separator" }),
|
|
133
|
+
React.createElement("h3", { className: "subheading subheading-sm pf-u-pl-md" },
|
|
134
|
+
React.createElement(Trans, null, "Created or owned by")))),
|
|
135
|
+
isNotSearchable: true,
|
|
136
|
+
isNonActionable: true,
|
|
137
|
+
isNotSelectable: true,
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
const getSelectedListObj = (contactsList) => {
|
|
141
|
+
const created = [...filterInfo[SolrKeys.createdBySsoUsername]].reduce((result, sso) => {
|
|
142
|
+
if (sso === own) {
|
|
143
|
+
result.push({ value: 'createdByMe', label: t('Cases created by me') });
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
const contact = contactsList.find((item) => (item === null || item === void 0 ? void 0 : item.ssoUsername) === sso);
|
|
147
|
+
contact &&
|
|
148
|
+
result.push({
|
|
149
|
+
value: contact.ssoUsername,
|
|
150
|
+
label: `${getFullName(contact)} <${contact.ssoUsername}>`,
|
|
151
|
+
});
|
|
152
|
+
!contact &&
|
|
153
|
+
result.push({
|
|
154
|
+
value: sso,
|
|
155
|
+
label: '',
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}, []);
|
|
160
|
+
const owned = [...filterInfo[SolrKeys.caseContactSSO]].reduce((result, sso) => {
|
|
161
|
+
if (sso === own) {
|
|
162
|
+
result.push({ value: 'ownedByMe', label: t('Cases owned by me') });
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const contact = contactsList.find((item) => item.ssoUsername === sso);
|
|
166
|
+
contact &&
|
|
167
|
+
result.push({
|
|
168
|
+
value: contact.ssoUsername,
|
|
169
|
+
label: `${getFullName(contact)} <${contact.ssoUsername}>`,
|
|
170
|
+
});
|
|
171
|
+
!contact &&
|
|
172
|
+
result.push({
|
|
173
|
+
value: sso,
|
|
174
|
+
label: '',
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}, []);
|
|
179
|
+
const selected = uniqBy([...created, ...owned], 'value');
|
|
180
|
+
return toOptions(selected, {
|
|
181
|
+
labelKey: 'label',
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
const onSearchAsync = (query) => __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
if (query == null) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (abortControllerRef.current !== undefined) {
|
|
189
|
+
// Cancel the previous request
|
|
190
|
+
abortControllerRef.current.abort();
|
|
191
|
+
}
|
|
192
|
+
// recreate a new AbortController for each call
|
|
193
|
+
let controller = new AbortController();
|
|
194
|
+
abortControllerRef.current = controller;
|
|
195
|
+
const queryParams = {
|
|
196
|
+
internal: false,
|
|
197
|
+
limit: ASYNC_DROPDOWN_PAGE_SIZE,
|
|
198
|
+
nameLookup: query,
|
|
199
|
+
};
|
|
200
|
+
const response = yield getInternalUserContactsList(queryParams, controller.signal);
|
|
201
|
+
const contacts = response && response.items && response.items.length !== 0
|
|
202
|
+
? response.items.filter((c) => !isEmpty(c.ssoUsername))
|
|
203
|
+
: [];
|
|
204
|
+
setInternalContactList(contacts);
|
|
205
|
+
});
|
|
161
206
|
// fetch data on load for external users
|
|
162
207
|
useEffect(() => {
|
|
163
208
|
if (loggedInUserRights.data.isInternal())
|
|
@@ -176,40 +221,25 @@ export function CreatorSsoNameFilter() {
|
|
|
176
221
|
fetchStrataAccountUsers();
|
|
177
222
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
178
223
|
}, [dispatch, isExternalNonOrgAdmin, loggedInUserRights.data]);
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const onExternalQueryChange = (_v, query) => {
|
|
201
|
-
setExternalQuery(query);
|
|
202
|
-
};
|
|
203
|
-
const onExternalToggle = () => {
|
|
204
|
-
setIsExternalOpen((pre) => !pre);
|
|
205
|
-
};
|
|
206
|
-
const externalToggle = (toggleRef) => (React.createElement(MenuToggle, { variant: "typeahead", onClick: onExternalToggle, innerRef: toggleRef, isExpanded: isExternalOpen, isFullWidth: true },
|
|
207
|
-
React.createElement(TextInputGroup, { isPlain: true },
|
|
208
|
-
React.createElement(TextInputGroupMain, { value: externalQuery, onClick: onExternalToggle, onKeyDown: onInputKeyDown, placeholder: getDropdownBtnPlaceholder(t('Search for a name'), selectedExternalContacts.map((i) => i.label), ' ', filteredOptions.length + dropdownHeader.length, t('All contacts')), onChange: onExternalQueryChange, isExpanded: isExternalOpen, innerRef: externalInputRef }),
|
|
209
|
-
React.createElement(TextInputGroupUtilities, null, !isEmpty(externalQuery) && (React.createElement(Button, { variant: "plain", onClick: () => setExternalQuery(''), isDisabled: isFetchingExternalContacts, "aria-label": t('Clear') }, isFetchingExternalContacts ? (React.createElement(LoadingIndicator, { show: true, size: "sm" })) : (React.createElement(TimesCircleIcon, { "aria-hidden": true }))))))));
|
|
210
|
-
return (React.createElement("div", null,
|
|
211
|
-
React.createElement("label", { htmlFor: "case-list-username-filter" },
|
|
212
|
-
React.createElement(Trans, null, filterNamesMap['usernameFilterTitle'])),
|
|
213
|
-
!loggedInUserRights.data.isInternal() ? (React.createElement(Select, { id: "external-ssousername-filter", "data-tracking-id": "external-ssousername-filter", isOpen: isExternalOpen, onOpenChange: () => setIsExternalOpen(false), toggle: externalToggle, popperProps: { direction: 'down', enableFlip: false }, isScrollable: true, onSelect: (_e, v) => onSelectExternal(v) },
|
|
214
|
-
React.createElement(SelectList, null, filteredExternalList))) : (React.createElement(InternalSsoNameFilter, null))));
|
|
224
|
+
const asyncMultiDropDownList = [
|
|
225
|
+
...dropdownHeader,
|
|
226
|
+
...getFilterValues(internalContactList, own),
|
|
227
|
+
];
|
|
228
|
+
const multiDropDownList = [
|
|
229
|
+
...dropdownHeader,
|
|
230
|
+
...getFilterValues(externalContactList, own),
|
|
231
|
+
];
|
|
232
|
+
return (React.createElement(React.Fragment, null, !loggedInUserRights.data.isInternal() ? (React.createElement(MultiSelectDropDownList, { placeholder: getDropdownBtnPlaceholder(t('Search for a name'), getSelectedListObj(externalContactList).map((i) => i.label), ' ', multiDropDownList.length, t('All contacts')), id: "external-ssousername-filter", "data-tracking-id": "external-ssousername-filter", selectedItems: getSelectedListObj(externalContactList), list: toOptions(multiDropDownList, {
|
|
233
|
+
labelKey: 'label',
|
|
234
|
+
childrenKey: 'children',
|
|
235
|
+
nonSearchableItemKey: 'isNotSearchable',
|
|
236
|
+
nonActionableItemKey: 'isNonActionable',
|
|
237
|
+
nonSelectableItemKey: 'isNotSelectable',
|
|
238
|
+
}), title: t(filterNamesMap['usernameFilterTitle']), onChange: onFilterChange, emptyListLabel: isExternalNonOrgAdmin ? '' : t('No results found'), searchable: true, label: t(filterNamesMap['usernameFilterTitle']), isLoadingList: isFetchingExternalContacts })) : (React.createElement(AsyncMultiDropDownList, { placeholder: getDropdownBtnPlaceholder(t('Search for a name'), getSelectedListObj(internalContactList).map((i) => i.label), ' ', asyncMultiDropDownList.length, t('All contacts')), id: "internal-ssousername-async-filter", "data-tracking-id": "internal-ssousername-async-filter", selectedItems: getSelectedListObj(internalContactList), list: toOptions(asyncMultiDropDownList, {
|
|
239
|
+
labelKey: 'label',
|
|
240
|
+
childrenKey: 'children',
|
|
241
|
+
nonSearchableItemKey: 'isNotSearchable',
|
|
242
|
+
nonActionableItemKey: 'isNonActionable',
|
|
243
|
+
nonSelectableItemKey: 'isNotSelectable',
|
|
244
|
+
}), title: t(filterNamesMap['usernameFilterTitle']), onChange: onFilterChangeAsync, delay: 300, useCache: true, paginate: true, emptyListLabel: t('No results found'), maxResults: PER_PAGE, onSearch: onSearchAsync, minLength: 0, label: t(filterNamesMap['usernameFilterTitle']), isLoadingList: isFetchingInternalContacts }))));
|
|
215
245
|
}
|
|
@@ -103,7 +103,7 @@ export function CreatorSsoNameFilterChip() {
|
|
|
103
103
|
return (React.createElement("div", { className: "filter-chip" },
|
|
104
104
|
React.createElement("span", { className: "filter-chip__heading" },
|
|
105
105
|
React.createElement(Trans, null, filterNamesMap['usernameFilterTitle'])),
|
|
106
|
-
React.createElement(ChipGroup, { numChips: 7, className: "pf-
|
|
106
|
+
React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group" },
|
|
107
107
|
own &&
|
|
108
108
|
filterInfo &&
|
|
109
109
|
filterInfo[SolrKeys.createdBySsoUsername] &&
|
|
@@ -26,8 +26,8 @@ export function GroupsFilter() {
|
|
|
26
26
|
...(caseGroups.data ? caseGroups.data.map((group) => ({ value: group.name, key: group.groupNum })) : []),
|
|
27
27
|
{
|
|
28
28
|
children: canViewCaseGroups ? (React.createElement(React.Fragment, null,
|
|
29
|
-
React.createElement("div", { className: "pf-
|
|
30
|
-
React.createElement(Link, { className: "cta cta-link pf-
|
|
29
|
+
React.createElement("div", { className: "pf-c-divider", role: "separator" }),
|
|
30
|
+
React.createElement(Link, { className: "cta cta-link pf-c-select__menu-item", to: "/manage/groups" },
|
|
31
31
|
React.createElement(Trans, null, "Manage groups")))) : (React.createElement(React.Fragment, null)),
|
|
32
32
|
isNotSearchable: true,
|
|
33
33
|
isNonActionable: true,
|
|
@@ -30,6 +30,6 @@ export function ProductFilterChip({ productList, productVersionPivot = [] }) {
|
|
|
30
30
|
canAccessVersionsFilter ? (React.createElement(React.Fragment, null, productList.map((currentProduct, index) => (React.createElement(ChipGroup, { numChips: 10, key: `${currentProduct.value}-${index}`, categoryName: currentProduct.value },
|
|
31
31
|
React.createElement(VersionsFilter, { productInfo: currentProduct, productVersionPivot: productVersionPivot }),
|
|
32
32
|
currentProduct[SolrKeys.version].map((chip) => (React.createElement(Chip, { key: chip.value, onClick: () => deleteVersion(currentProduct, chip) }, chip.value))),
|
|
33
|
-
React.createElement(Button, { className: "pf-
|
|
33
|
+
React.createElement(Button, { className: "pf-c-button__icon", variant: ButtonVariant.plain, "aria-label": "Remove product", onClick: () => deleteProduct(currentProduct) },
|
|
34
34
|
React.createElement(TimesCircleIcon, { "aria-hidden": "true" }))))))) : (React.createElement(ChipGroup, { numChips: 10, categoryName: "Product", key: "products" }, productList.map((currentProduct, index) => (React.createElement(Chip, { key: `${currentProduct.value}-${index}`, onClick: () => deleteProduct(currentProduct) }, currentProduct.value)))))));
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductsFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAW1D,UAAU,MAAM;IACZ,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eA8G3C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Checkbox } from '@patternfly/react-core';
|
|
2
|
-
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
1
|
+
import { Checkbox, Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
3
2
|
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
4
3
|
import isUndefined from 'lodash/isUndefined';
|
|
5
4
|
import React, { useContext, useState } from 'react';
|
|
@@ -35,7 +34,7 @@ export function ProductsFilter(props) {
|
|
|
35
34
|
// we get filter values from hydra metadata api
|
|
36
35
|
const singleSelectSolrIsDown = () => {
|
|
37
36
|
var _a, _b;
|
|
38
|
-
return (React.createElement(Select, { variant: SelectVariant.single, "aria-label": t('Select Input'), onToggle:
|
|
37
|
+
return (React.createElement(Select, { variant: SelectVariant.single, "aria-label": t('Select Input'), onToggle: toggleIsOpen, onSelect: onFilterChangeSingleSelect, selections: (_b = (_a = filterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value, isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a product'), "data-tracking-id": "products-filter", id: "products-filter" }, allProducts.map((product) => (React.createElement(SelectOption, { key: product, value: product })))));
|
|
39
38
|
};
|
|
40
39
|
const onSelect = (e, selection) => {
|
|
41
40
|
let newSelectedProducts = [];
|
|
@@ -59,13 +58,12 @@ export function ProductsFilter(props) {
|
|
|
59
58
|
const onFilter = (_, value) => {
|
|
60
59
|
if (!value)
|
|
61
60
|
return getProductSelectOptions(productOptions);
|
|
62
|
-
const
|
|
63
|
-
const input = new RegExp(formattedValue, 'i');
|
|
61
|
+
const input = new RegExp(value, 'i');
|
|
64
62
|
const newOptions = productOptions.filter((product) => input.test(product.value));
|
|
65
63
|
return getProductSelectOptions(newOptions);
|
|
66
64
|
};
|
|
67
|
-
const multiSelectNew = () => (React.createElement(Select, { "aria-label": t('Select Input'), id: titleId, variant: SelectVariant.typeaheadMulti, onToggle:
|
|
68
|
-
return (React.createElement("div", { className: "pf-
|
|
65
|
+
const multiSelectNew = () => (React.createElement(Select, { "aria-label": t('Select Input'), id: titleId, variant: SelectVariant.typeaheadMulti, onToggle: toggleIsOpen, onSelect: onSelect, isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a product'), filterInfo[SolrPivotKeys.product_version].map((i) => i.value), '', props.filterValues.length, t('All selected')), onFilter: onFilter }, getProductSelectOptions(productOptions)));
|
|
66
|
+
return (React.createElement("div", { className: "pf-c-select" },
|
|
69
67
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.product])),
|
|
70
68
|
isSolrSearchDown ? singleSelectSolrIsDown() : multiSelectNew()));
|
|
71
69
|
}
|