@rh-support/cases 2.4.10-beta.6 → 2.5.0
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 +2 -0
- package/lib/esm/components/case/NewCaseButton.d.ts +2 -1
- package/lib/esm/components/case/NewCaseButton.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseList.d.ts +4 -3
- package/lib/esm/components/case-list/CaseList.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseList.js +42 -44
- package/lib/esm/components/case-list/CaseListContext.d.ts +1 -1
- package/lib/esm/components/case-list/CaseListContext.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListFilterContext.d.ts +1 -1
- package/lib/esm/components/case-list/CaseListFilterContext.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListFilterHelpers.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListFilterReducer.d.ts +6 -3
- package/lib/esm/components/case-list/CaseListFilterReducer.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListFilterReducer.js +3 -0
- package/lib/esm/components/case-list/CaseListReducer.d.ts +2 -2
- package/lib/esm/components/case-list/CaseListReducer.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.d.ts +3 -2
- 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 +25 -11
- package/lib/esm/components/case-list/case-list-filters/AccountsFilter.d.ts +2 -1
- 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 +10 -5
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.js +19 -4
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilter.d.ts +12 -1
- 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 +139 -163
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilterChip.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilterChip.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilterChip.js +1 -1
- package/lib/esm/components/case-list/case-list-filters/GroupsFilter.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/GroupsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/GroupsFilter.js +157 -27
- package/lib/esm/components/case-list/case-list-filters/InternalSsoNameFilter.d.ts +3 -0
- package/lib/esm/components/case-list/case-list-filters/InternalSsoNameFilter.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-filters/InternalSsoNameFilter.js +207 -0
- package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.d.ts.map +1 -1
- 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 +2 -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 +7 -5
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/SeverityFilter.js +4 -4
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/StatusFilter.js +4 -4
- package/lib/esm/components/case-list/case-list-filters/TypeFilter.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/TypeFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/TypeFilter.js +3 -3
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/VersionsFilter.js +35 -4
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts +2 -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 +211 -113
- package/lib/esm/components/case-list/case-list-table/CloseCaseBtn.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-table/CloseCaseBtn.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/CloseCaseBtn.js +7 -2
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts +19 -0
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.js +296 -0
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.scss +27 -0
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.d.ts +3 -1
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +19 -96
- package/lib/esm/components/case-list/case-list-table/SeverityLabel.d.ts +2 -1
- package/lib/esm/components/case-list/case-list-table/SeverityLabel.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.d.ts +9 -0
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.js +53 -0
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.scss +7 -0
- package/lib/esm/components/case-list/case-search/AdvanceSearch.d.ts +2 -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 +18 -13
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts +2 -1
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +7 -6
- package/lib/esm/components/case-list/case-search/CaseSearch.d.ts +2 -1
- package/lib/esm/components/case-list/case-search/CaseSearch.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/CaseSearch.js +2 -2
- package/lib/esm/components/case-list/case-search/SaveCaseSearchModal.d.ts +2 -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 +48 -40
- package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.js +1 -1
- package/lib/esm/components/escalations/EscalationForm.d.ts +1 -1
- package/lib/esm/components/escalations/EscalationForm.d.ts.map +1 -1
- package/lib/esm/components/escalations/EscalationForm.js +18 -9
- package/lib/esm/components/escalations/PartnerEscalation.d.ts +2 -1
- package/lib/esm/components/escalations/PartnerEscalation.d.ts.map +1 -1
- package/lib/esm/components/index.d.ts +2 -8
- package/lib/esm/components/index.d.ts.map +1 -1
- package/lib/esm/components/index.js +5 -8
- package/lib/esm/css/caseList.css +85 -64
- package/lib/esm/css/caseSearch.css +1 -1
- package/lib/esm/css/escalation.css +4 -4
- package/lib/esm/enums/cache.d.ts +1 -1
- package/lib/esm/enums/cache.d.ts.map +1 -1
- package/lib/esm/enums/case.js +1 -1
- package/lib/esm/enums/filters.d.ts +1 -1
- package/lib/esm/enums/filters.d.ts.map +1 -1
- package/lib/esm/enums/filters.js +1 -1
- package/lib/esm/i18n/template-es.js +1 -1
- package/lib/esm/index.d.ts +0 -2
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/models/caseList.d.ts +5 -2
- package/lib/esm/models/caseList.d.ts.map +1 -1
- package/lib/esm/scss/_main.scss +11 -11
- package/lib/esm/scss/_pf-overrides.scss +40 -4
- package/lib/esm/scss/index.scss +0 -1
- package/lib/esm/test-utils/testSetup.d.ts +1 -1
- package/lib/esm/test-utils/testSetup.d.ts.map +1 -1
- package/lib/esm/test-utils/testSetup.js +1 -1
- package/lib/esm/test-utils/testUtils.d.ts +1 -1
- package/lib/esm/test-utils/testUtils.js +1 -1
- package/lib/esm/utils/caseListUtils.js +3 -3
- package/lib/esm/utils/caseSearchUtils.d.ts +3 -3
- package/lib/esm/utils/caseSearchUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseSearchUtils.js +18 -5
- package/lib/esm/utils/constants.js +1 -1
- package/lib/esm/utils/routeUtils.js +2 -1
- package/package.json +35 -32
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { contacts } from '@cee-eng/hydrajs';
|
|
11
|
+
import { Button, Flex, FlexItem, MenuToggle, Select, SelectGroup, SelectList, SelectOption, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
12
|
+
import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
|
|
13
|
+
import { LoadingIndicator, useFetch, useSelectKeyboardNavigator } from '@rh-support/components';
|
|
14
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
15
|
+
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
16
|
+
import isEmpty from 'lodash/isEmpty';
|
|
17
|
+
import isNull from 'lodash/isNull';
|
|
18
|
+
import isUndefined from 'lodash/isUndefined';
|
|
19
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
21
|
+
import { SolrKeys } from '../../../enums/filters';
|
|
22
|
+
import { useCaseListDispatchContext, useCaseListStateContext } from '../CaseListContext';
|
|
23
|
+
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
24
|
+
import { updateFilters } from '../CaseListFilterReducer';
|
|
25
|
+
import { setChipsNameSsoMap } from '../CaseListReducer';
|
|
26
|
+
import { getFilterValues, getSelectedListObj } from './CreatorSsoNameFilter';
|
|
27
|
+
export default function InternalSsoNameFilter() {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
const { filterInfo } = useContext(CaseListFilterStateContext);
|
|
30
|
+
const dispatch = useContext(CaseListFilterDispatchContext);
|
|
31
|
+
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
32
|
+
const { chipsNameSsoMap } = useCaseListStateContext();
|
|
33
|
+
const CaseListDispatch = useCaseListDispatchContext();
|
|
34
|
+
const own = loggedInUserRights.data.getSSOUsername();
|
|
35
|
+
const PER_PAGE = 200;
|
|
36
|
+
const ASYNC_DROPDOWN_PAGE_SIZE = 10000;
|
|
37
|
+
const { request: getInternalUserContactsList, isFetching: isFetchingInternalContacts } = useFetch(contacts.getSFDCContacts, { propgateErrors: true });
|
|
38
|
+
const abortControllerRef = useRef(undefined);
|
|
39
|
+
const internalInputRef = useRef();
|
|
40
|
+
const [internalContactList, setInternalContactList] = useState([]);
|
|
41
|
+
const [renderedList, setRenderedList] = useState([]);
|
|
42
|
+
const [isInternalOpen, setIsInternalOpen] = useState(false);
|
|
43
|
+
const [noResults, setNoResults] = useState(false);
|
|
44
|
+
const [internalQuery, setInternalQuery] = useState('');
|
|
45
|
+
const filteredOptions = getFilterValues(renderedList, own);
|
|
46
|
+
const dropdownHeader = [
|
|
47
|
+
{
|
|
48
|
+
label: `${t('Cases created by me')}`,
|
|
49
|
+
value: 'createdByMe',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: `${t('Cases owned by me')}`,
|
|
53
|
+
value: 'ownedByMe',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
setRenderedList(internalContactList.slice(0, PER_PAGE));
|
|
58
|
+
}, [internalContactList]);
|
|
59
|
+
const onSelectInternal = (contact) => {
|
|
60
|
+
if (isNull(contact) || isUndefined(contact) || contact === 'show-more')
|
|
61
|
+
return;
|
|
62
|
+
let list = [];
|
|
63
|
+
if (selectedInternalContacts.some((item) => item.value === contact.value)) {
|
|
64
|
+
list = selectedInternalContacts.filter((item) => item.value !== contact.value);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
list = [...selectedInternalContacts, contact];
|
|
68
|
+
}
|
|
69
|
+
onFilterChangeAsync(list);
|
|
70
|
+
};
|
|
71
|
+
const { onInputKeyDown, focusedItemIndex } = useSelectKeyboardNavigator({
|
|
72
|
+
list: [...dropdownHeader, ...filteredOptions],
|
|
73
|
+
isOpen: isInternalOpen,
|
|
74
|
+
setIsOpen: setIsInternalOpen,
|
|
75
|
+
onSelect: onSelectInternal,
|
|
76
|
+
});
|
|
77
|
+
const selectedInternalContacts = useMemo(() => getSelectedListObj(renderedList, filterInfo, own, t),
|
|
78
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
+
[renderedList, filterInfo, own]);
|
|
80
|
+
const onFilterChangeAsync = (items) => {
|
|
81
|
+
const selectedItems = items.map((item) => item.value);
|
|
82
|
+
const caseCreated = selectedItems
|
|
83
|
+
.filter((o) => o !== 'ownedByMe')
|
|
84
|
+
.map((o) => (o === 'createdByMe' ? own : o));
|
|
85
|
+
const caseOwnedBy = selectedItems
|
|
86
|
+
.filter((o) => o !== 'createdByMe')
|
|
87
|
+
.map((o) => (o === 'ownedByMe' ? own : o));
|
|
88
|
+
const caseOwner = loggedInUserRights.data.isInternal() && caseOwnedBy.indexOf(own) !== -1 ? [own] : [];
|
|
89
|
+
updateFilters(dispatch, [
|
|
90
|
+
{
|
|
91
|
+
filterKey: SolrKeys.createdBySsoUsername,
|
|
92
|
+
values: caseCreated,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
filterKey: SolrKeys.caseContactSSO,
|
|
96
|
+
values: caseOwnedBy,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
filterKey: SolrKeys.caseOwner,
|
|
100
|
+
values: caseOwner,
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
// set name/sso pairs on state to be used in filter chip component
|
|
104
|
+
if (loggedInUserRights.data.isInternal()) {
|
|
105
|
+
const chipsNameSsoPairs = {};
|
|
106
|
+
items.forEach((item) => {
|
|
107
|
+
var _a, _b, _c, _d;
|
|
108
|
+
const sso = item.value.value;
|
|
109
|
+
if (sso !== 'ownedByMe' && sso !== 'createdByMe' && !chipsNameSsoMap[sso]) {
|
|
110
|
+
chipsNameSsoPairs[sso] = {
|
|
111
|
+
firstName: ((_a = item.value) === null || _a === void 0 ? void 0 : _a.firstName) || '',
|
|
112
|
+
lastName: ((_b = item.value) === null || _b === void 0 ? void 0 : _b.lastName) || '',
|
|
113
|
+
firstNameCustom: ((_c = item.value) === null || _c === void 0 ? void 0 : _c.firstNameCustom) || '',
|
|
114
|
+
lastNameCustom: ((_d = item.value) === null || _d === void 0 ? void 0 : _d.lastNameCustom) || '',
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
setChipsNameSsoMap(CaseListDispatch, chipsNameSsoPairs);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const onSearchAsync = (query) => __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
if (query == null) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (abortControllerRef.current !== undefined) {
|
|
126
|
+
// Cancel the previous request
|
|
127
|
+
abortControllerRef.current.abort();
|
|
128
|
+
}
|
|
129
|
+
// recreate a new AbortController for each call
|
|
130
|
+
let controller = new AbortController();
|
|
131
|
+
abortControllerRef.current = controller;
|
|
132
|
+
const queryParams = {
|
|
133
|
+
internal: false, // to get non-ldap contacts: false
|
|
134
|
+
limit: ASYNC_DROPDOWN_PAGE_SIZE,
|
|
135
|
+
nameLookup: query,
|
|
136
|
+
};
|
|
137
|
+
const response = yield getInternalUserContactsList(queryParams, controller.signal);
|
|
138
|
+
const contacts = response && response.items && response.items.length !== 0
|
|
139
|
+
? response.items.filter((c) => !isEmpty(c.ssoUsername))
|
|
140
|
+
: [];
|
|
141
|
+
setNoResults(isEmpty(contacts));
|
|
142
|
+
setInternalContactList(contacts);
|
|
143
|
+
});
|
|
144
|
+
const onDisplayMoreClick = () => {
|
|
145
|
+
setRenderedList((pre) => internalContactList.slice(0, pre.length + PER_PAGE));
|
|
146
|
+
setIsInternalOpen(true);
|
|
147
|
+
};
|
|
148
|
+
const filteredInternalList = useMemo(() => {
|
|
149
|
+
return [
|
|
150
|
+
...(isFetchingInternalContacts
|
|
151
|
+
? [
|
|
152
|
+
React.createElement("div", { key: "searching", className: "pf-v5-u-p-sm" },
|
|
153
|
+
React.createElement(Trans, null, "Searching...")),
|
|
154
|
+
]
|
|
155
|
+
: []),
|
|
156
|
+
...(noResults && !isFetchingInternalContacts
|
|
157
|
+
? [
|
|
158
|
+
React.createElement("div", { key: "no-results", className: "pf-v5-u-p-sm" },
|
|
159
|
+
React.createElement(Trans, null, "No results found")),
|
|
160
|
+
]
|
|
161
|
+
: []),
|
|
162
|
+
...dropdownHeader.map((contact, index) => (React.createElement(SelectOption, { key: contact.value, isFocused: focusedItemIndex === index, value: contact, hasCheckbox: true, isSelected: selectedInternalContacts.some((c) => c.value === contact.value) }, contact.label))),
|
|
163
|
+
...(!isEmpty(filteredOptions)
|
|
164
|
+
? [
|
|
165
|
+
React.createElement("div", { className: "pf-v5-c-divider", role: "separator" }),
|
|
166
|
+
React.createElement(SelectGroup, null,
|
|
167
|
+
React.createElement("h6", { className: "pf-v5-u-pl-md" },
|
|
168
|
+
React.createElement(Trans, null, "Created or owned by")),
|
|
169
|
+
filteredOptions.map((contact, index) => (React.createElement(SelectOption, { key: contact.value, isFocused: focusedItemIndex === index + dropdownHeader.length, value: contact, hasCheckbox: true, isSelected: selectedInternalContacts.some((c) => c.value === contact.value) }, contact.label)))),
|
|
170
|
+
]
|
|
171
|
+
: []),
|
|
172
|
+
...(renderedList.length < internalContactList.length
|
|
173
|
+
? [
|
|
174
|
+
React.createElement("div", { className: "pf-v5-c-divider", role: "separator" }),
|
|
175
|
+
React.createElement(SelectOption, { key: "show-more", value: 'show-more', onClick: onDisplayMoreClick },
|
|
176
|
+
React.createElement(Flex, { justifyContent: { default: 'justifyContentCenter' } },
|
|
177
|
+
React.createElement(FlexItem, null,
|
|
178
|
+
React.createElement(Button, { variant: "link", isInline: true },
|
|
179
|
+
React.createElement(Trans, null, "Display additional results"))))),
|
|
180
|
+
]
|
|
181
|
+
: []),
|
|
182
|
+
];
|
|
183
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
|
+
}, [
|
|
185
|
+
internalContactList,
|
|
186
|
+
own,
|
|
187
|
+
selectedInternalContacts,
|
|
188
|
+
renderedList,
|
|
189
|
+
focusedItemIndex,
|
|
190
|
+
isFetchingInternalContacts,
|
|
191
|
+
noResults,
|
|
192
|
+
]);
|
|
193
|
+
const onInternalQueryChange = (_v, query) => {
|
|
194
|
+
setInternalQuery(query);
|
|
195
|
+
onSearchAsync(query);
|
|
196
|
+
};
|
|
197
|
+
const onInternalToggle = (e) => {
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
setIsInternalOpen((pre) => !pre);
|
|
200
|
+
};
|
|
201
|
+
const internalToggle = (toggleRef) => (React.createElement(MenuToggle, { variant: "typeahead", onClick: onInternalToggle, innerRef: toggleRef, isExpanded: isInternalOpen, isFullWidth: true },
|
|
202
|
+
React.createElement(TextInputGroup, { isPlain: true },
|
|
203
|
+
React.createElement(TextInputGroupMain, { value: internalQuery, onClick: onInternalToggle, onKeyDown: onInputKeyDown, placeholder: getDropdownBtnPlaceholder(t('Search for a name'), selectedInternalContacts.map((i) => i.label), ' ', filteredInternalList.length, t('All selected')), onChange: onInternalQueryChange, isExpanded: isInternalOpen, innerRef: internalInputRef, "aria-controls": "internal-ssousername-filter", role: "combobox" }),
|
|
204
|
+
React.createElement(TextInputGroupUtilities, null, !isEmpty(internalQuery) && (React.createElement(Button, { variant: "plain", onClick: () => setInternalQuery(''), isDisabled: isFetchingInternalContacts, "aria-label": t('Clear') }, isFetchingInternalContacts ? (React.createElement(LoadingIndicator, { show: true, size: "sm" })) : (React.createElement(TimesCircleIcon, { "aria-hidden": true }))))))));
|
|
205
|
+
return (React.createElement(Select, { id: "internal-ssousername-filter", "data-tracking-id": "internal-ssousername-filter", isOpen: isInternalOpen, onOpenChange: () => setIsInternalOpen(false), toggle: internalToggle, popperProps: { direction: 'down', enableFlip: false }, isScrollable: true, onSelect: (_e, v) => onSelectInternal(v) },
|
|
206
|
+
React.createElement(SelectList, null, filteredInternalList)));
|
|
207
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IProductVersionPivotMap } from '../CaseList';
|
|
2
3
|
import { IProductFilter } from '../CaseListFilterReducer';
|
|
3
4
|
interface IProps {
|
|
4
5
|
productList: IProductFilter[];
|
|
5
6
|
productVersionPivot: IProductVersionPivotMap[];
|
|
6
7
|
}
|
|
7
|
-
export declare function ProductFilterChip({ productList, productVersionPivot }: IProps): JSX.Element;
|
|
8
|
+
export declare function ProductFilterChip({ productList, productVersionPivot }: IProps): React.JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=ProductFilterChip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductFilterChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductFilterChip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductFilterChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductFilterChip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAgB,MAAM,0BAA0B,CAAC;AAGxE,UAAU,MAAM;IACZ,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;CAClD;AAED,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,mBAAwB,EAAE,EAAE,MAAM,qBAgElF"}
|
|
@@ -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-c-button__icon", variant: ButtonVariant.plain, "aria-label": "Remove product", onClick: () => deleteProduct(currentProduct) },
|
|
33
|
+
React.createElement(Button, { className: "pf-v5-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,9 +1,10 @@
|
|
|
1
1
|
import { IFacetResponse } from '@rh-support/types/shared';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface IProps {
|
|
3
4
|
filterValues: IFacetResponse[];
|
|
4
5
|
isSolrSearchDown: boolean;
|
|
5
6
|
allProducts: string[];
|
|
6
7
|
}
|
|
7
|
-
export declare function ProductsFilter(props: IProps): JSX.Element;
|
|
8
|
+
export declare function ProductsFilter(props: IProps): React.JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=ProductsFilter.d.ts.map
|
|
@@ -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":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,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,qBAgH3C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Checkbox
|
|
1
|
+
import { Checkbox } from '@patternfly/react-core';
|
|
2
|
+
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
2
3
|
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
3
4
|
import isUndefined from 'lodash/isUndefined';
|
|
4
5
|
import React, { useContext, useState } from 'react';
|
|
@@ -34,7 +35,7 @@ export function ProductsFilter(props) {
|
|
|
34
35
|
// we get filter values from hydra metadata api
|
|
35
36
|
const singleSelectSolrIsDown = () => {
|
|
36
37
|
var _a, _b;
|
|
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 })))));
|
|
38
|
+
return (React.createElement(Select, { variant: SelectVariant.single, "aria-label": t('Select Input'), onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), 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 })))));
|
|
38
39
|
};
|
|
39
40
|
const onSelect = (e, selection) => {
|
|
40
41
|
let newSelectedProducts = [];
|
|
@@ -58,12 +59,13 @@ export function ProductsFilter(props) {
|
|
|
58
59
|
const onFilter = (_, value) => {
|
|
59
60
|
if (!value)
|
|
60
61
|
return getProductSelectOptions(productOptions);
|
|
61
|
-
const
|
|
62
|
+
const formattedValue = value === null || value === void 0 ? void 0 : value.replace(/\\/g, ''); // Removes '\' from search query as it creates SyntaxError for RegEx
|
|
63
|
+
const input = new RegExp(formattedValue, 'i');
|
|
62
64
|
const newOptions = productOptions.filter((product) => input.test(product.value));
|
|
63
65
|
return getProductSelectOptions(newOptions);
|
|
64
66
|
};
|
|
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" },
|
|
67
|
+
const multiSelectNew = () => (React.createElement(Select, { "aria-label": t('Select Input'), id: titleId, variant: SelectVariant.typeaheadMulti, onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), 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)));
|
|
68
|
+
return (React.createElement("div", { className: "pf-v5-c-select" },
|
|
67
69
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.product])),
|
|
68
70
|
isSolrSearchDown ? singleSelectSolrIsDown() : multiSelectNew()));
|
|
69
71
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IFacetResponse } from '@rh-support/types/shared';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface IProps {
|
|
3
4
|
filterValues: IFacetResponse[];
|
|
4
5
|
allCaseSeverities: string[];
|
|
5
6
|
isSolrSearchDown: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function SeverityFilter(props: IProps): JSX.Element;
|
|
8
|
+
export declare function SeverityFilter(props: IProps): React.JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=SeverityFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeverityFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/SeverityFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"SeverityFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/SeverityFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,UAAU,MAAM;IACZ,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA8E3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
1
|
+
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
2
2
|
import { getDropdownBtnPlaceholder } from '@rh-support/utils';
|
|
3
3
|
import React, { useContext, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
@@ -25,9 +25,9 @@ export function SeverityFilter(props) {
|
|
|
25
25
|
const titleId = 'case-list-severity-filter';
|
|
26
26
|
// solr is down and solr filter values are not available
|
|
27
27
|
// we get filter values from hydra metadata api
|
|
28
|
-
const singleSelectSolrIsDown = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.single, "aria-label": "Select Input", onToggle: toggleIsOpen, onSelect: onFilterChangeSingleSelect, selections: filterInfo[SolrKeys.severity][0], isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a severity'), "data-tracking-id": "severity-filter", hasPlaceholderStyle: true }, props.allCaseSeverities.map((severity) => (React.createElement(SelectOption, { key: severity, value: severity })))));
|
|
29
|
-
const multiSelect = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a severity'), onToggle: toggleIsOpen, onSelect: onFilterChangeMultipleSelect, selections: filterInfo[SolrKeys.severity], isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a severity'), filterInfo[SolrKeys.severity], ' ', props.filterValues.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "severity-filter", hasPlaceholderStyle: true }, props.filterValues.map((filterValue) => (React.createElement(SelectOption, { key: filterValue.value, value: filterValue.value })))));
|
|
30
|
-
return (React.createElement("div", { className: "pf-c-select" },
|
|
28
|
+
const singleSelectSolrIsDown = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.single, "aria-label": "Select Input", onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), onSelect: onFilterChangeSingleSelect, selections: filterInfo[SolrKeys.severity][0], isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a severity'), "data-tracking-id": "severity-filter", hasPlaceholderStyle: true }, props.allCaseSeverities.map((severity) => (React.createElement(SelectOption, { key: severity, value: severity })))));
|
|
29
|
+
const multiSelect = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a severity'), onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), onSelect: onFilterChangeMultipleSelect, selections: filterInfo[SolrKeys.severity], isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a severity'), filterInfo[SolrKeys.severity], ' ', props.filterValues.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "severity-filter", hasPlaceholderStyle: true }, props.filterValues.map((filterValue) => (React.createElement(SelectOption, { key: filterValue.value, value: filterValue.value })))));
|
|
30
|
+
return (React.createElement("div", { className: "pf-v5-c-select" },
|
|
31
31
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.severity])),
|
|
32
32
|
props.isSolrSearchDown ? singleSelectSolrIsDown() : multiSelect()));
|
|
33
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IFacetResponse } from '@rh-support/types/shared';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface IProps {
|
|
3
4
|
filterValues: IFacetResponse[];
|
|
4
5
|
isSolrSearchDown: boolean;
|
|
@@ -8,6 +9,6 @@ export interface IStatusFilterOptions {
|
|
|
8
9
|
key: string;
|
|
9
10
|
value: string;
|
|
10
11
|
}
|
|
11
|
-
export declare function StatusFilter(props: IProps): JSX.Element;
|
|
12
|
+
export declare function StatusFilter(props: IProps): React.JSX.Element;
|
|
12
13
|
export {};
|
|
13
14
|
//# sourceMappingURL=StatusFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/StatusFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/StatusFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAM;IACZ,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBA4GzC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
1
|
+
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
2
2
|
import React, { useContext, useState } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { SolrKeys } from '../../../enums/filters';
|
|
@@ -48,9 +48,9 @@ export function StatusFilter(props) {
|
|
|
48
48
|
const titleId = 'case-list-status-filter';
|
|
49
49
|
// solr is down and solr filter values are not available
|
|
50
50
|
// we get filter values from hydra metadata api
|
|
51
|
-
const singleSelectSolrIsDown = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.single, "aria-label": "Select Input", onToggle: toggleIsOpen, onSelect: onFilterChangeSingleSelect, selections: filterInfo[SolrKeys.status][0], isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a status'), "data-tracking-id": "status-filter", hasPlaceholderStyle: true }, props.allCaseStatuses.map((status) => (React.createElement(SelectOption, { key: status, value: status })))));
|
|
52
|
-
const multiSelect = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a status'), onToggle: toggleIsOpen, onSelect: onFilterChange, selections: filterInfo[SolrKeys.status], isOpen: isOpen, placeholderText: getBtnPlaceholder(t('Select a status'), filterInfo[SolrKeys.status], ' ', props.filterValues.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "status-filter", hasPlaceholderStyle: true }, props.filterValues.map((filterValue) => (React.createElement(SelectOption, { key: filterValue.value, value: filterValue.value })))));
|
|
53
|
-
return (React.createElement("div", { className: "pf-c-select" },
|
|
51
|
+
const singleSelectSolrIsDown = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.single, "aria-label": "Select Input", onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), onSelect: onFilterChangeSingleSelect, selections: filterInfo[SolrKeys.status][0], isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a status'), "data-tracking-id": "status-filter", hasPlaceholderStyle: true }, props.allCaseStatuses.map((status) => (React.createElement(SelectOption, { key: status, value: status })))));
|
|
52
|
+
const multiSelect = () => (React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a status'), onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), onSelect: onFilterChange, selections: filterInfo[SolrKeys.status], isOpen: isOpen, placeholderText: getBtnPlaceholder(t('Select a status'), filterInfo[SolrKeys.status], ' ', props.filterValues.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "status-filter", hasPlaceholderStyle: true }, props.filterValues.map((filterValue) => (React.createElement(SelectOption, { key: filterValue.value, value: filterValue.value })))));
|
|
53
|
+
return (React.createElement("div", { className: "pf-v5-c-select" },
|
|
54
54
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.status])),
|
|
55
55
|
props.isSolrSearchDown ? singleSelectSolrIsDown() : multiSelect()));
|
|
56
56
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IProps {
|
|
2
3
|
allCaseTypes: string[];
|
|
3
4
|
}
|
|
4
|
-
export declare function TypeFilter(props: IProps): JSX.Element;
|
|
5
|
+
export declare function TypeFilter(props: IProps): React.JSX.Element;
|
|
5
6
|
export {};
|
|
6
7
|
//# sourceMappingURL=TypeFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBAyDvC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
1
|
+
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
2
2
|
import { getDropdownBtnPlaceholder, toNewCaseTypeMapper, toOldCaseTypeSwitcher } from '@rh-support/utils';
|
|
3
3
|
import React, { useContext, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
@@ -27,7 +27,7 @@ export function TypeFilter(props) {
|
|
|
27
27
|
// To switch from old case type to new support type
|
|
28
28
|
const newCaseTypesArray = toNewCaseTypeMapper(props.allCaseTypes).sort();
|
|
29
29
|
const toNewCaseTypesFilter = toNewCaseTypeMapper(filterInfo[SolrKeys.type]);
|
|
30
|
-
return (React.createElement("div", { className: "pf-c-select" },
|
|
30
|
+
return (React.createElement("div", { className: "pf-v5-c-select" },
|
|
31
31
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.type])),
|
|
32
|
-
React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a support type'), onToggle: toggleIsOpen, onSelect: onFilterChangeMultipleSelect, selections: toNewCaseTypesFilter, isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a support type'), toNewCaseTypesFilter, ' ', props.allCaseTypes.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "type-filter", hasPlaceholderStyle: true }, newCaseTypesArray.map((filterValue) => (React.createElement(SelectOption, { key: filterValue, value: filterValue }))))));
|
|
32
|
+
React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a support type'), onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), onSelect: onFilterChangeMultipleSelect, selections: toNewCaseTypesFilter, isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a support type'), toNewCaseTypesFilter, ' ', props.allCaseTypes.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "type-filter", hasPlaceholderStyle: true }, newCaseTypesArray.map((filterValue) => (React.createElement(SelectOption, { key: filterValue, value: filterValue }))))));
|
|
33
33
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { IProductVersionPivotMap } from '../CaseList';
|
|
2
3
|
import { IProductFilter } from '../CaseListFilterReducer';
|
|
3
4
|
interface IProps {
|
|
4
5
|
productInfo: IProductFilter;
|
|
5
6
|
productVersionPivot: IProductVersionPivotMap[];
|
|
6
7
|
}
|
|
7
|
-
export declare function VersionsFilter({ productInfo, productVersionPivot }: IProps): JSX.Element;
|
|
8
|
+
export declare function VersionsFilter({ productInfo, productVersionPivot }: IProps): React.JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=VersionsFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/VersionsFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VersionsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/VersionsFilter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAI7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAgB,MAAM,0BAA0B,CAAC;AAoCxE,UAAU,MAAM;IACZ,WAAW,EAAE,cAAc,CAAC;IAC5B,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;CAClD;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,EAAE,MAAM,qBA+D1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
1
|
+
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
|
|
2
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import React, { useContext, useState } from 'react';
|
|
3
|
+
import React, { useContext, useMemo, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { SolrKeys, SolrPivotKeys } from '../../../enums/filters';
|
|
6
6
|
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
@@ -8,6 +8,34 @@ import { updateFilter } from '../CaseListFilterReducer';
|
|
|
8
8
|
function getVersionValuesForProduct(productPivot = [], productName) {
|
|
9
9
|
return (productPivot.find((item) => item.value === productName) || {}).case_version;
|
|
10
10
|
}
|
|
11
|
+
//split version into parts
|
|
12
|
+
function parseVersionIntoParts(version) {
|
|
13
|
+
//keep unknown version at last
|
|
14
|
+
if (version === 'Unknown')
|
|
15
|
+
return [Infinity];
|
|
16
|
+
//split dots and spaces
|
|
17
|
+
return version.split(/[.\s]/).map((p) => (isNaN(Number(p)) ? p : Number(p)));
|
|
18
|
+
}
|
|
19
|
+
function compareVersions(versionA, versionB) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const pA = parseVersionIntoParts(versionA), pB = parseVersionIntoParts(versionB);
|
|
22
|
+
//compare each part
|
|
23
|
+
for (let i = 0; i < Math.max(pA.length, pB.length); i++) {
|
|
24
|
+
const a = (_a = pA[i]) !== null && _a !== void 0 ? _a : 0, b = (_b = pB[i]) !== null && _b !== void 0 ? _b : 0; //undefined as 0
|
|
25
|
+
if (a == b)
|
|
26
|
+
continue;
|
|
27
|
+
if (typeof a === 'number' && typeof b === 'number')
|
|
28
|
+
return a - b;
|
|
29
|
+
if (typeof a === 'string' && typeof b === 'string')
|
|
30
|
+
return a.localeCompare(b);
|
|
31
|
+
//one is string and other is number => string takes precendence
|
|
32
|
+
if (typeof a === 'string')
|
|
33
|
+
return -1;
|
|
34
|
+
if (typeof b == 'string')
|
|
35
|
+
return 1;
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
11
39
|
export function VersionsFilter({ productInfo, productVersionPivot }) {
|
|
12
40
|
const { t } = useTranslation();
|
|
13
41
|
const { filterInfo } = useContext(CaseListFilterStateContext);
|
|
@@ -29,9 +57,12 @@ export function VersionsFilter({ productInfo, productVersionPivot }) {
|
|
|
29
57
|
};
|
|
30
58
|
updateFilter(dispatch, { filterKey: SolrPivotKeys.product_version, values: productNewState });
|
|
31
59
|
};
|
|
32
|
-
const versions =
|
|
60
|
+
const versions = useMemo(() => {
|
|
61
|
+
const versionValues = getVersionValuesForProduct(productVersionPivot, productInfo.value);
|
|
62
|
+
return versionValues === null || versionValues === void 0 ? void 0 : versionValues.sort((a, b) => compareVersions(a.value, b.value));
|
|
63
|
+
}, [productVersionPivot, productInfo.value]);
|
|
33
64
|
const titleId = 'case-list-versions-filter';
|
|
34
65
|
return (React.createElement(React.Fragment, null, !isEmpty(versions) && (React.createElement(React.Fragment, null,
|
|
35
66
|
React.createElement("label", { hidden: true, htmlFor: titleId }, t('Open versions dropdown')),
|
|
36
|
-
React.createElement(Select, { className: "version-filter-chip", variant: SelectVariant.checkbox, "aria-label": t('Version'), onToggle: toggleIsOpen, onSelect: onFilterChange, selections: productInfo.case_version.map((ver) => ver.value), isOpen: isOpen, placeholderText: 'Version', isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "versions-filter", hasPlaceholderStyle: true }, (versions || []).map((filterValue) => (React.createElement(SelectOption, { key: filterValue.value, value: filterValue.value, component: "div" }))))))));
|
|
67
|
+
React.createElement(Select, { className: "version-filter-chip", variant: SelectVariant.checkbox, "aria-label": t('Version'), onToggle: (_event, isExpanded) => toggleIsOpen(isExpanded), onSelect: onFilterChange, selections: productInfo.case_version.map((ver) => ver.value), isOpen: isOpen, placeholderText: 'Version', isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "versions-filter", hasPlaceholderStyle: true }, (versions || []).map((filterValue) => (React.createElement(SelectOption, { key: filterValue.value, value: filterValue.value, component: "div" }))))))));
|
|
37
68
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ICaseGroup } from '@cee-eng/hydrajs/@types/api/public/caseGroups';
|
|
2
2
|
import { ISolrResponse } from '@rh-support/types/shared';
|
|
3
3
|
import { UserAuth } from '@rh-support/user-permissions';
|
|
4
|
+
import React from 'react';
|
|
4
5
|
import { ICaseListResponse } from '../../../models/caseList';
|
|
5
6
|
import { IPaginationInfo, ISortInfo } from '../CaseListFilterReducer';
|
|
6
7
|
interface IProps {
|
|
@@ -13,6 +14,6 @@ interface IProps {
|
|
|
13
14
|
hasError: boolean;
|
|
14
15
|
isSolrDown?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare function CaseListTable(props: IProps): JSX.Element;
|
|
17
|
+
export declare function CaseListTable(props: IProps): React.JSX.Element;
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=CaseListTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseListTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseListTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAuB3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAQxD,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAEH,eAAe,EACf,SAAS,EAIZ,MAAM,0BAA0B,CAAC;AA6BlC,UAAU,MAAM;IACZ,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAsBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA4jB1C"}
|