@rh-support/cases 2.1.25 → 2.1.28
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-list/CaseList.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseList.js +2 -1
- 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 +11 -10
- 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 -2
- 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 +10 -0
- 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 +122 -164
- 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/InternalSsoNameFilter.d.ts +2 -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 +183 -0
- 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 -4
- 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 +1 -0
- 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 +11 -12
- 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 +9 -9
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +6 -5
- 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 +10 -8
- package/lib/esm/components/escalations/EscalationForm.d.ts.map +1 -1
- package/lib/esm/components/escalations/EscalationForm.js +18 -9
- package/lib/esm/css/caseList.css +49 -41
- 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 +8 -3
- package/package.json +12 -12
|
@@ -0,0 +1,183 @@
|
|
|
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, 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 { isUndefined } from 'lodash';
|
|
17
|
+
import isEmpty from 'lodash/isEmpty';
|
|
18
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
20
|
+
import { SolrKeys } from '../../../enums/filters';
|
|
21
|
+
import { useCaseListDispatchContext, useCaseListStateContext } from '../CaseListContext';
|
|
22
|
+
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
23
|
+
import { updateFilters } from '../CaseListFilterReducer';
|
|
24
|
+
import { setChipsNameSsoMap } from '../CaseListReducer';
|
|
25
|
+
import { getFilterValues, getSelectedListObj } from './CreatorSsoNameFilter';
|
|
26
|
+
export default function InternalSsoNameFilter() {
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
const { filterInfo } = useContext(CaseListFilterStateContext);
|
|
29
|
+
const dispatch = useContext(CaseListFilterDispatchContext);
|
|
30
|
+
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
31
|
+
const { chipsNameSsoMap } = useCaseListStateContext();
|
|
32
|
+
const CaseListDispatch = useCaseListDispatchContext();
|
|
33
|
+
const own = loggedInUserRights.data.getSSOUsername();
|
|
34
|
+
const PER_PAGE = 200;
|
|
35
|
+
const ASYNC_DROPDOWN_PAGE_SIZE = 10000;
|
|
36
|
+
const { request: getInternalUserContactsList, isFetching: isFetchingInternalContacts } = useFetch(contacts.getSFDCContacts, { propgateErrors: true });
|
|
37
|
+
const abortControllerRef = useRef(undefined);
|
|
38
|
+
const internalInputRef = useRef();
|
|
39
|
+
const [internalContactList, setInternalContactList] = useState([]);
|
|
40
|
+
const [renderedList, setRenderedList] = useState([]);
|
|
41
|
+
const [isInternalOpen, setIsInternalOpen] = useState(false);
|
|
42
|
+
const [internalQuery, setInternalQuery] = useState('');
|
|
43
|
+
const filteredOptions = getFilterValues(renderedList, own);
|
|
44
|
+
const dropdownHeader = [
|
|
45
|
+
{
|
|
46
|
+
label: `${t('Cases created by me')}`,
|
|
47
|
+
value: 'createdByMe',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: `${t('Cases owned by me')}`,
|
|
51
|
+
value: 'ownedByMe',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
setRenderedList(internalContactList.slice(0, PER_PAGE));
|
|
56
|
+
}, [internalContactList]);
|
|
57
|
+
const onSelectInternal = (contact) => {
|
|
58
|
+
if (isUndefined(contact) || contact === 'show-more')
|
|
59
|
+
return;
|
|
60
|
+
let list = [];
|
|
61
|
+
if (selectedInternalContacts.some((item) => item.value === contact.value)) {
|
|
62
|
+
list = selectedInternalContacts.filter((item) => item.value !== contact.value);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
list = [...selectedInternalContacts, contact];
|
|
66
|
+
}
|
|
67
|
+
onFilterChangeAsync(list);
|
|
68
|
+
setInternalQuery('');
|
|
69
|
+
};
|
|
70
|
+
const { onInputKeyDown, focusedItemIndex } = useSelectKeyboardNavigator({
|
|
71
|
+
list: [...dropdownHeader, ...filteredOptions],
|
|
72
|
+
isOpen: isInternalOpen,
|
|
73
|
+
setIsOpen: setIsInternalOpen,
|
|
74
|
+
onSelect: onSelectInternal,
|
|
75
|
+
});
|
|
76
|
+
const selectedInternalContacts = useMemo(() => getSelectedListObj(renderedList, filterInfo, own, t),
|
|
77
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
|
+
[renderedList, filterInfo, own]);
|
|
79
|
+
const onFilterChangeAsync = (items) => {
|
|
80
|
+
const selectedItems = items.map((item) => item.value);
|
|
81
|
+
const caseCreated = selectedItems
|
|
82
|
+
.filter((o) => o !== 'ownedByMe')
|
|
83
|
+
.map((o) => (o === 'createdByMe' ? own : o));
|
|
84
|
+
const caseOwnedBy = selectedItems
|
|
85
|
+
.filter((o) => o !== 'createdByMe')
|
|
86
|
+
.map((o) => (o === 'ownedByMe' ? own : o));
|
|
87
|
+
const caseOwner = loggedInUserRights.data.isInternal() && caseOwnedBy.indexOf(own) !== -1 ? [own] : [];
|
|
88
|
+
updateFilters(dispatch, [
|
|
89
|
+
{
|
|
90
|
+
filterKey: SolrKeys.createdBySsoUsername,
|
|
91
|
+
values: caseCreated,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
filterKey: SolrKeys.caseContactSSO,
|
|
95
|
+
values: caseOwnedBy,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
filterKey: SolrKeys.caseOwner,
|
|
99
|
+
values: caseOwner,
|
|
100
|
+
},
|
|
101
|
+
]);
|
|
102
|
+
// set name/sso pairs on state to be used in filter chip component
|
|
103
|
+
if (loggedInUserRights.data.isInternal()) {
|
|
104
|
+
const chipsNameSsoPairs = {};
|
|
105
|
+
items.forEach((item) => {
|
|
106
|
+
var _a, _b, _c, _d;
|
|
107
|
+
const sso = item.value.value;
|
|
108
|
+
if (sso !== 'ownedByMe' && sso !== 'createdByMe' && !chipsNameSsoMap[sso]) {
|
|
109
|
+
chipsNameSsoPairs[sso] = {
|
|
110
|
+
firstName: ((_a = item.value) === null || _a === void 0 ? void 0 : _a.firstName) || '',
|
|
111
|
+
lastName: ((_b = item.value) === null || _b === void 0 ? void 0 : _b.lastName) || '',
|
|
112
|
+
firstNameCustom: ((_c = item.value) === null || _c === void 0 ? void 0 : _c.firstNameCustom) || '',
|
|
113
|
+
lastNameCustom: ((_d = item.value) === null || _d === void 0 ? void 0 : _d.lastNameCustom) || '',
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
setChipsNameSsoMap(CaseListDispatch, chipsNameSsoPairs);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const onSearchAsync = (query) => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
if (query == null) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (abortControllerRef.current !== undefined) {
|
|
125
|
+
// Cancel the previous request
|
|
126
|
+
abortControllerRef.current.abort();
|
|
127
|
+
}
|
|
128
|
+
// recreate a new AbortController for each call
|
|
129
|
+
let controller = new AbortController();
|
|
130
|
+
abortControllerRef.current = controller;
|
|
131
|
+
const queryParams = {
|
|
132
|
+
internal: false,
|
|
133
|
+
limit: ASYNC_DROPDOWN_PAGE_SIZE,
|
|
134
|
+
nameLookup: query,
|
|
135
|
+
};
|
|
136
|
+
const response = yield getInternalUserContactsList(queryParams, controller.signal);
|
|
137
|
+
const contacts = response && response.items && response.items.length !== 0
|
|
138
|
+
? response.items.filter((c) => !isEmpty(c.ssoUsername))
|
|
139
|
+
: [];
|
|
140
|
+
setInternalContactList(contacts);
|
|
141
|
+
});
|
|
142
|
+
const onDisplayMoreClick = () => {
|
|
143
|
+
setRenderedList((pre) => internalContactList.slice(0, pre.length + PER_PAGE));
|
|
144
|
+
setIsInternalOpen(true);
|
|
145
|
+
};
|
|
146
|
+
const filteredInternalList = useMemo(() => {
|
|
147
|
+
return [
|
|
148
|
+
...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))),
|
|
149
|
+
...(!isEmpty(filteredOptions)
|
|
150
|
+
? [
|
|
151
|
+
React.createElement("div", { className: "pf-v5-c-divider", role: "separator" }),
|
|
152
|
+
React.createElement(SelectGroup, null,
|
|
153
|
+
React.createElement("h3", { className: "subheading subheading-sm pf-v5-u-pl-md" },
|
|
154
|
+
React.createElement(Trans, null, "Created or owned by")),
|
|
155
|
+
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)))),
|
|
156
|
+
]
|
|
157
|
+
: []),
|
|
158
|
+
...(renderedList.length < internalContactList.length
|
|
159
|
+
? [
|
|
160
|
+
React.createElement("div", { className: "pf-v5-c-divider", role: "separator" }),
|
|
161
|
+
React.createElement(SelectOption, { key: "show-more", value: 'show-more', onClick: onDisplayMoreClick },
|
|
162
|
+
React.createElement(Flex, { justifyContent: { default: 'justifyContentCenter' } },
|
|
163
|
+
React.createElement(FlexItem, null,
|
|
164
|
+
React.createElement(Button, { variant: "link", isInline: true },
|
|
165
|
+
React.createElement(Trans, null, "Display additional results"))))),
|
|
166
|
+
]
|
|
167
|
+
: []),
|
|
168
|
+
];
|
|
169
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
170
|
+
}, [internalContactList, own, selectedInternalContacts, renderedList, focusedItemIndex]);
|
|
171
|
+
const onInternalQueryChange = (_v, query) => {
|
|
172
|
+
setInternalQuery(query);
|
|
173
|
+
onSearchAsync(query);
|
|
174
|
+
};
|
|
175
|
+
const onInternalToggle = () => {
|
|
176
|
+
setIsInternalOpen((pre) => !pre);
|
|
177
|
+
};
|
|
178
|
+
const internalToggle = (toggleRef) => (React.createElement(MenuToggle, { variant: "typeahead", onClick: onInternalToggle, innerRef: toggleRef, isExpanded: isInternalOpen, isFullWidth: true },
|
|
179
|
+
React.createElement(TextInputGroup, { isPlain: true },
|
|
180
|
+
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 contacts')), onChange: onInternalQueryChange, isExpanded: isInternalOpen, innerRef: internalInputRef }),
|
|
181
|
+
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 }))))))));
|
|
182
|
+
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) }, filteredInternalList));
|
|
183
|
+
}
|
|
@@ -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 +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;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,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 = [];
|
|
@@ -62,8 +63,8 @@ export function ProductsFilter(props) {
|
|
|
62
63
|
const newOptions = productOptions.filter((product) => input.test(product.value));
|
|
63
64
|
return getProductSelectOptions(newOptions);
|
|
64
65
|
};
|
|
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" },
|
|
66
|
+
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)));
|
|
67
|
+
return (React.createElement("div", { className: "pf-v5-c-select" },
|
|
67
68
|
React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.product])),
|
|
68
69
|
isSolrSearchDown ? singleSelectSolrIsDown() : multiSelectNew()));
|
|
69
70
|
}
|
|
@@ -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,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,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,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 isEmpty from 'lodash/isEmpty';
|
|
3
3
|
import React, { useContext, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
@@ -33,5 +33,5 @@ export function VersionsFilter({ productInfo, productVersionPivot }) {
|
|
|
33
33
|
const titleId = 'case-list-versions-filter';
|
|
34
34
|
return (React.createElement(React.Fragment, null, !isEmpty(versions) && (React.createElement(React.Fragment, null,
|
|
35
35
|
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" }))))))));
|
|
36
|
+
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
37
|
}
|
|
@@ -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;AA8B3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAWxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAEH,eAAe,EACf,SAAS,EAIZ,MAAM,0BAA0B,CAAC;AA2BlC,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;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eA0X1C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStateVariant, PaginationVariant,
|
|
1
|
+
import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateHeader, EmptyStateIcon, EmptyStateVariant, PaginationVariant, } from '@patternfly/react-core';
|
|
2
2
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
3
3
|
import { PFTable, Table, TableColumnSelector, TablePagination, } from '@rh-support/components';
|
|
4
4
|
import { GlobalMetadataDispatchContext, GlobalMetadataStateContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
|
|
@@ -75,7 +75,7 @@ export function CaseListTable(props) {
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
id: CaseListColumnIds.summary,
|
|
78
|
-
cellWidth: 10,
|
|
78
|
+
cellWidth: props.isXXLScreen ? 30 : 10,
|
|
79
79
|
title: t('Issue summary'),
|
|
80
80
|
sortable: true,
|
|
81
81
|
accessor: (data) => data.case_summary,
|
|
@@ -259,15 +259,14 @@ export function CaseListTable(props) {
|
|
|
259
259
|
props: { colSpan: 9 },
|
|
260
260
|
title: (React.createElement(Bullseye, null,
|
|
261
261
|
React.createElement(EmptyState, { variant: EmptyStateVariant.full },
|
|
262
|
-
React.createElement(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
: 'No information to display')),
|
|
262
|
+
React.createElement(EmptyStateHeader, { titleText: React.createElement(React.Fragment, null,
|
|
263
|
+
React.createElement(Trans, null, isInternal && (!showingFilter || !hasSearchQuery)
|
|
264
|
+
? 'No results found'
|
|
265
|
+
: 'No information to display')), icon: React.createElement(EmptyStateIcon, { icon: SearchIcon }), headingLevel: "h2" }),
|
|
267
266
|
React.createElement(EmptyStateBody, null,
|
|
268
267
|
React.createElement(Trans, null, getEmptyStateErrMessage())),
|
|
269
|
-
(showingFilter || hasSearchQuery) && (React.createElement(Button, { variant: "link", onClick: clearAllFilters },
|
|
270
|
-
React.createElement(Trans, null, "Clear all")))))),
|
|
268
|
+
React.createElement(EmptyStateFooter, null, (showingFilter || hasSearchQuery) && (React.createElement(Button, { variant: "link", onClick: clearAllFilters },
|
|
269
|
+
React.createElement(Trans, null, "Clear all"))))))),
|
|
271
270
|
},
|
|
272
271
|
],
|
|
273
272
|
},
|
|
@@ -291,14 +290,14 @@ export function CaseListTable(props) {
|
|
|
291
290
|
};
|
|
292
291
|
return (React.createElement(React.Fragment, null,
|
|
293
292
|
React.createElement(Table, { columns: columns, data: caseListData, selectedColumns: selectedColumns },
|
|
294
|
-
React.createElement("div", { className: "case-list-table-toolbar pf-l-flex", ref: tableToolbarRef },
|
|
295
|
-
React.createElement("div", { className: "toolbar-actions pf-l-flex pf-m-space-items-sm" },
|
|
293
|
+
React.createElement("div", { className: "case-list-table-toolbar pf-v5-l-flex", ref: tableToolbarRef },
|
|
294
|
+
React.createElement("div", { className: "toolbar-actions pf-v5-l-flex pf-m-space-items-sm" },
|
|
296
295
|
React.createElement(TableColumnSelector, { onColumnSelectorChange: onColumnSelectorChange }),
|
|
297
296
|
React.createElement(ExportCaseListCSV, { currentFilteredCaseList: props.caseList, isExportCsvDisabled: props.isSolrDown }),
|
|
298
297
|
React.createElement(CloseCaseBtn, { selectedCases: selectedCases, caseList: caseListData, onCasesCloseSuccess: onCasesCloseSuccess })),
|
|
299
298
|
React.createElement("span", { className: "toolbar-pagination" },
|
|
300
299
|
React.createElement(TablePagination, { perPage: (_c = props.paginationInfo) === null || _c === void 0 ? void 0 : _c.pageSize, currentPage: (_d = props.paginationInfo) === null || _d === void 0 ? void 0 : _d.currentPage, onPerPageSelect: onPerPageSelect, onSetPage: onSetPage, variant: PaginationVariant.top, itemCount: getItemCount() }))),
|
|
301
|
-
React.createElement("div", { className: "pf-c-scroll-inner-wrapper" },
|
|
300
|
+
React.createElement("div", { className: "pf-v5-c-scroll-inner-wrapper" },
|
|
302
301
|
React.createElement(PFTable, { "aria-label": "case-list", className: "case-list-table", pagination: false, onRowClick: onRowClick, onSortChange: onSortChange, onSelect: onRowSelect, emptyStateRow: noResultFoundRow, sortInfo: props.sortInfo, isLoading: props.isCaseListPageLoading })),
|
|
303
302
|
caseListData.length > 9 && (React.createElement("footer", { className: "toolbar-pagination" },
|
|
304
303
|
React.createElement(TablePagination, { perPage: (_e = props === null || props === void 0 ? void 0 : props.paginationInfo) === null || _e === void 0 ? void 0 : _e.pageSize, currentPage: (_f = props === null || props === void 0 ? void 0 : props.paginationInfo) === null || _f === void 0 ? void 0 : _f.currentPage, onPerPageSelect: onPerPageSelect, onSetPage: onBottomPaginationSetPage, variant: PaginationVariant.bottom, itemCount: getItemCount() }))))));
|
|
@@ -115,5 +115,5 @@ export function ExportCaseListCSV(props) {
|
|
|
115
115
|
return (React.createElement("span", { title: (props.isExportCsvDisabled && getTooltipContent()) || '' },
|
|
116
116
|
React.createElement(Button, { variant: "tertiary", isDisabled: isBtnDisabled || props.isExportCsvDisabled, onClick: loggedInUsersAccount.data.secureSupport ? onExportCSVClickSecureSupport : onExportCSVClick, title: btnTitle, "data-tracking-id": "case-list-toolbar-export-csv" }, isFetchingCSVData ? (React.createElement(React.Fragment, null,
|
|
117
117
|
React.createElement(Trans, null, "Exporting CSV"),
|
|
118
|
-
React.createElement(Spinner, {
|
|
118
|
+
React.createElement(Spinner, { size: "md", "aria-label": "loading", className: "export-csv-loader pf-v5-u-ml-xs" }))) : (React.createElement(Trans, null, "Export CSV")))));
|
|
119
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/AdvanceSearch.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,EAAE,CAAC,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,0BAA0B,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AdvanceSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/AdvanceSearch.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,EAAE,CAAC,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,0BAA0B,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eAkT1C"}
|
|
@@ -211,18 +211,18 @@ export function AdvanceSearch(props) {
|
|
|
211
211
|
};
|
|
212
212
|
const isQueryInValid = inputString && !isParsingSuccessful;
|
|
213
213
|
return (React.createElement(React.Fragment, null,
|
|
214
|
-
React.createElement("div", { className: "pf-c-select pf-m-expanded", ref: dropdownWrapperRef },
|
|
215
|
-
React.createElement("div", { className: "pf-c-select__toggle pf-m-typeahead" },
|
|
216
|
-
React.createElement("div", { className: "pf-c-select__toggle-wrapper" },
|
|
217
|
-
React.createElement("input", { value: inputString, onChange: onQueryStringChange, onFocus: onInputFocus, ref: searchInputRef, onKeyDown: onKeyDown, placeholder: t('i18nEnterSolrQuery', 'Enter SOLR query, for example: severity:"1 (Urgent)" and status:"Waiting on Customer"'), className: `pf-c-form-control pf-c-select__toggle-typeahead ${inputString && isParsingSuccessful ? 'pf-m-success' : ''}`, type: "text", "aria-invalid": isQueryInValid ? true : false, autoComplete: "off", id: "advance-search-typeahead", "aria-label": t('Enter search query'), "aria-describedby": "advance-query-error-helper" })),
|
|
218
|
-
inputString && (React.createElement(Button, { onClick: onClear, className: "pf-c-button pf-m-plain pf-c-select__toggle-clear", variant: "plain", "data-tracking-id": "clear-search", "aria-label": t('Clear this search') },
|
|
214
|
+
React.createElement("div", { className: "pf-v5-c-select pf-m-expanded", ref: dropdownWrapperRef },
|
|
215
|
+
React.createElement("div", { className: "pf-v5-c-select__toggle pf-m-typeahead" },
|
|
216
|
+
React.createElement("div", { className: "pf-v5-c-select__toggle-wrapper" },
|
|
217
|
+
React.createElement("input", { value: inputString, onChange: onQueryStringChange, onFocus: onInputFocus, ref: searchInputRef, onKeyDown: onKeyDown, placeholder: t('i18nEnterSolrQuery', 'Enter SOLR query, for example: severity:"1 (Urgent)" and status:"Waiting on Customer"'), className: `pf-v5-c-form-control pf-v5-c-select__toggle-typeahead ${inputString && isParsingSuccessful ? 'pf-m-success' : ''}`, type: "text", "aria-invalid": isQueryInValid ? true : false, autoComplete: "off", id: "advance-search-typeahead", "aria-label": t('Enter search query'), "aria-describedby": "advance-query-error-helper" })),
|
|
218
|
+
inputString && (React.createElement(Button, { onClick: onClear, className: "pf-v5-c-button pf-m-plain pf-v5-c-select__toggle-clear", variant: "plain", "data-tracking-id": "clear-search", "aria-label": t('Clear this search') },
|
|
219
219
|
React.createElement(TimesCircleIcon, null)))),
|
|
220
|
-
isAutoCompleteListVisible && (React.createElement("ul", { className: "pf-c-select__menu", "aria-labelledby": "advance-search-typeahead-label", role: "listbox" }, autoCompleteList.map((item, index) => (React.createElement("li", { key: index, role: "presentation", className: `pf-c-select__menu-wrapper ${selectedItemIndex === index ? 'pf-m-focus' : ''}` },
|
|
221
|
-
React.createElement("button", { type: "button", onClick: (e) => onItemClick(item.value), className: "pf-c-select__menu-item", "aria-selected": selectedItemIndex === index ? true : false, role: "option" }, item.display))))))),
|
|
222
|
-
React.createElement(Button, { type: "button", variant: "primary", "data-tracking-id": "case-list-adv-search-button", className: "pf-u-ml-sm", onClick: onSearchSubmit, isDisabled: isAdvancedSearchButtonDisabled },
|
|
220
|
+
isAutoCompleteListVisible && (React.createElement("ul", { className: "pf-v5-c-select__menu", "aria-labelledby": "advance-search-typeahead-label", role: "listbox" }, autoCompleteList.map((item, index) => (React.createElement("li", { key: index, role: "presentation", className: `pf-v5-c-select__menu-wrapper ${selectedItemIndex === index ? 'pf-m-focus' : ''}` },
|
|
221
|
+
React.createElement("button", { type: "button", onClick: (e) => onItemClick(item.value), className: "pf-v5-c-select__menu-item", "aria-selected": selectedItemIndex === index ? true : false, role: "option" }, item.display))))))),
|
|
222
|
+
React.createElement(Button, { type: "button", variant: "primary", "data-tracking-id": "case-list-adv-search-button", className: "pf-v5-u-ml-sm", onClick: onSearchSubmit, isDisabled: isAdvancedSearchButtonDisabled },
|
|
223
223
|
React.createElement(Trans, null, "Search")),
|
|
224
224
|
React.createElement(Button, { variant: "link", onClick: onBasicClick, "data-tracking-id": "case-list-basic-toggle-button" },
|
|
225
225
|
React.createElement(Trans, null, "Basic")),
|
|
226
|
-
React.createElement(Button, { variant: "link", className: "pf-u-px-0", component: "a", rel: "noopener noreferrer", target: "_blank", href: "https://source.redhat.com/communitiesatredhat/applications/integration-community-of-practice/all/testallin/all_in_blog/advanced_search_in_the_customer_support_tool", "data-tracking-id": "advance-search-guide" },
|
|
226
|
+
React.createElement(Button, { variant: "link", className: "pf-v5-u-px-0", component: "a", rel: "noopener noreferrer", target: "_blank", href: "https://source.redhat.com/communitiesatredhat/applications/integration-community-of-practice/all/testallin/all_in_blog/advanced_search_in_the_customer_support_tool", "data-tracking-id": "advance-search-guide" },
|
|
227
227
|
React.createElement(InfoIcon, null))));
|
|
228
228
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookmarkedSearchesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/BookmarkedSearchesSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BookmarkedSearchesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/BookmarkedSearchesSelector.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAahE,UAAU,MAAM;IACZ,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,eAgTvD"}
|
|
@@ -7,7 +7,8 @@ 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 { Button, ButtonVariant,
|
|
10
|
+
import { Button, ButtonVariant, Split, SplitItem } from '@patternfly/react-core';
|
|
11
|
+
import { Dropdown, DropdownItem, DropdownSeparator, DropdownToggle, DropdownToggleAction, } from '@patternfly/react-core/deprecated';
|
|
11
12
|
import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
|
|
12
13
|
import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
|
|
13
14
|
import { ConfirmationServiceProvider } from '@rh-support/components';
|
|
@@ -166,16 +167,16 @@ export function BookmarkedSearchesSelector(props) {
|
|
|
166
167
|
.sort()
|
|
167
168
|
.map((bookmarkedSearch) => {
|
|
168
169
|
var _a;
|
|
169
|
-
return (React.createElement("li", { className: "pf-c-dropdown__menu-item pf-u-p-xs", key: bookmarkedSearch },
|
|
170
|
+
return (React.createElement("li", { className: "pf-v5-c-dropdown__menu-item pf-v5-u-p-xs", key: bookmarkedSearch },
|
|
170
171
|
React.createElement(Split, { key: `split-parent-${bookmarkedSearch}` },
|
|
171
172
|
React.createElement(SplitItem, { isFilled: true, key: `split-left-${bookmarkedSearch}` },
|
|
172
|
-
React.createElement(Button, { variant: ButtonVariant.plain, isBlock: true, className: "pf-u-text-align-left", onClick: onBookmarkSelectorChange(bookmarkedSearch, bookmarkedSearches[bookmarkedSearch], true) },
|
|
173
|
-
((_a = bookmarkedSearches[bookmarkedSearch]) === null || _a === void 0 ? void 0 : _a.defaultChecked) && (React.createElement(StarIcon, { title: "{t('Default search')}", color: "#F0AB00", className: "pf-u-mr-sm", "aria-label": t('Default search') })),
|
|
173
|
+
React.createElement(Button, { variant: ButtonVariant.plain, isBlock: true, className: "pf-v5-u-text-align-left", onClick: onBookmarkSelectorChange(bookmarkedSearch, bookmarkedSearches[bookmarkedSearch], true) },
|
|
174
|
+
((_a = bookmarkedSearches[bookmarkedSearch]) === null || _a === void 0 ? void 0 : _a.defaultChecked) && (React.createElement(StarIcon, { title: "{t('Default search')}", color: "#F0AB00", className: "pf-v5-u-mr-sm", "aria-label": t('Default search') })),
|
|
174
175
|
' ',
|
|
175
176
|
bookmarkedSearch)),
|
|
176
177
|
React.createElement(SplitItem, { key: `split-right-${bookmarkedSearch}` },
|
|
177
178
|
' ',
|
|
178
|
-
React.createElement(Button, { "aria-label": t('Edit or delete saved search'), className: "pf-u-pr-sm", onClick: onEditSavedSearchClick(bookmarkedSearch), variant: ButtonVariant.link, icon: React.createElement(PencilAltIcon, null) })))));
|
|
179
|
+
React.createElement(Button, { "aria-label": t('Edit or delete saved search'), className: "pf-v5-u-pr-sm", onClick: onEditSavedSearchClick(bookmarkedSearch), variant: ButtonVariant.link, icon: React.createElement(PencilAltIcon, null) })))));
|
|
179
180
|
});
|
|
180
181
|
const renderMostRecentSearch = [
|
|
181
182
|
React.createElement(DropdownItem, { key: "most-recent-search", component: "button", onClick: onBookmarkSelectorChange('', mostRecentSearch, true) },
|
|
@@ -94,7 +94,7 @@ export function CaseSearch(props) {
|
|
|
94
94
|
const renderBasicSearch = () => {
|
|
95
95
|
return (React.createElement(React.Fragment, null,
|
|
96
96
|
React.createElement("div", { className: "case-search-input-container" },
|
|
97
|
-
React.createElement(SearchInput, { className: "pf-u-w-100", placeholder: t('Search by keyword or case ID'), value: searchVal === null || searchVal === void 0 ? void 0 : searchVal.trim(), "data-tracking-id": "search-cases-text-input", id: "case-search-basic", "aria-label": t('Search by keyword or case ID'), onChange: onSearchValChange, onClear: clearSearchVal }),
|
|
97
|
+
React.createElement(SearchInput, { className: "pf-v5-u-w-100", placeholder: t('Search by keyword or case ID'), value: searchVal === null || searchVal === void 0 ? void 0 : searchVal.trim(), "data-tracking-id": "search-cases-text-input", id: "case-search-basic", "aria-label": t('Search by keyword or case ID'), onChange: (_event, val) => onSearchValChange(val), onClear: clearSearchVal }),
|
|
98
98
|
React.createElement(Button, { variant: "primary", type: "submit", className: "search-btn", "data-tracking-id": "case-list-search-button", isDisabled: isSearchButtonDisabled },
|
|
99
99
|
React.createElement(Trans, null, "Search")),
|
|
100
100
|
canUseAdvancedSearch && (React.createElement(Button, { variant: "link", onClick: () => onSearchTypeChange(CaseSearchQueryType.ADVANCED), isDisabled: isFetching, "data-tracking-id": "case-list-adv-toggle-button" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveCaseSearchModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/SaveCaseSearchModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SaveCaseSearchModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/SaveCaseSearchModal.tsx"],"names":[],"mappings":"AAgCA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,wBAAwB,EAAE,MAAM,CAAC;IACjC,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;CAC/B;AAOD,wBAAgB,mBAAmB,CAAC,EAChC,WAAW,EACX,WAAW,EACX,QAAQ,EACR,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,GAClB,EAAE,MAAM,eAmSR"}
|
|
@@ -7,7 +7,7 @@ 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 { Button, ButtonVariant, Checkbox, Form, FormGroup, Modal, ModalVariant, TextArea, TextInput, } from '@patternfly/react-core';
|
|
10
|
+
import { Button, ButtonVariant, Checkbox, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalVariant, TextArea, TextInput, } from '@patternfly/react-core';
|
|
11
11
|
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataDispatchContext, GlobalMetadataStateContext, updateUserPreferences, UserPreferencesKeys, } from '@rh-support/react-context';
|
|
13
13
|
import find from 'lodash/find';
|
|
@@ -183,7 +183,7 @@ export function SaveCaseSearchModal({ isModalOpen, modalToggle, isAdding, select
|
|
|
183
183
|
React.createElement(Button, { key: "cancel", variant: ButtonVariant.secondary, "data-tracking-id": "case-list-bookmark-search-canceled", onClick: closeModal },
|
|
184
184
|
React.createElement(Trans, null, "Cancel")),
|
|
185
185
|
React.createElement(React.Fragment, null,
|
|
186
|
-
React.createElement(Checkbox, { className: "pf-u-ml-md save-search-set-default", key: "set-as-default", "aria-label": t('Set as default'), id: "case-list-bookmark-search-set-as-default", "data-tracking-id": "case-list-bookmark-search-set-as-default", isChecked: localDefaultChecked, onChange: (
|
|
186
|
+
React.createElement(Checkbox, { className: "pf-v5-u-ml-md save-search-set-default", key: "set-as-default", "aria-label": t('Set as default'), id: "case-list-bookmark-search-set-as-default", "data-tracking-id": "case-list-bookmark-search-set-as-default", isChecked: localDefaultChecked, onChange: (e, checkbox) => {
|
|
187
187
|
e.stopPropagation();
|
|
188
188
|
setLocalDefaultChecked(!localDefaultChecked);
|
|
189
189
|
} }),
|
|
@@ -193,12 +193,14 @@ export function SaveCaseSearchModal({ isModalOpen, modalToggle, isAdding, select
|
|
|
193
193
|
React.createElement(Trans, null, "Remove")))),
|
|
194
194
|
] },
|
|
195
195
|
React.createElement(Form, { className: "save-search-form" },
|
|
196
|
-
React.createElement(FormGroup, { label: React.createElement("span", { className: "save-for-later-label-name" }, t('Name')), isRequired: true, fieldId: "save-search-name",
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
React.createElement(FormGroup, { label: React.createElement("span", { className: "save-for-later-label-name" }, t('Name')), isRequired: true, fieldId: "save-search-name", className: "form-group pull-bottom-narrow save-for-later-name" },
|
|
197
|
+
saveButtonIsClicked && isDuplicateNameError && (React.createElement(FormHelperText, null,
|
|
198
|
+
React.createElement(HelperText, null,
|
|
199
|
+
React.createElement(HelperTextItem, null,
|
|
200
|
+
React.createElement(Trans, null, "Filter with same name already exists. Please enter a unique name."))))),
|
|
201
|
+
React.createElement(TextInput, { isRequired: true, type: "text", placeholder: t('Enter a unique name to reference in the future'), id: "save-search-name", name: "save-search-name", "aria-describedby": "save-search-name-helper", value: localSavedSearchName, onChange: (_event, value) => handleSaveSearchNameChange(value), validated: saveButtonIsClicked && (isDuplicateNameError || isEmpty(localSavedSearchName.trim()))
|
|
200
202
|
? 'error'
|
|
201
203
|
: 'default' })),
|
|
202
|
-
React.createElement(FormGroup, { label: React.createElement("span", { className: "save-for-later-label-query" }, t('Search and filter query')), isRequired: true, fieldId: "filter-query", className: "form-group pf-u-mt-lg save-for-later-query"
|
|
203
|
-
React.createElement(TextArea, { isRequired: true, type: "text", id: "filter-query", name: "filter-query", "aria-describedby": "filter-query-helper", value: getQueryStr(),
|
|
204
|
+
React.createElement(FormGroup, { label: React.createElement("span", { className: "save-for-later-label-query" }, t('Search and filter query')), isRequired: true, fieldId: "filter-query", className: "form-group pf-v5-u-mt-lg save-for-later-query" },
|
|
205
|
+
React.createElement(TextArea, { isRequired: true, validated: saveButtonIsClicked ? 'error' : 'default', type: "text", id: "filter-query", name: "filter-query", "aria-describedby": "filter-query-helper", value: getQueryStr(), isDisabled: true, resizeOrientation: "vertical" })))));
|
|
204
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EscalationForm.d.ts","sourceRoot":"","sources":["../../../../src/components/escalations/EscalationForm.tsx"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"EscalationForm.d.ts","sourceRoot":"","sources":["../../../../src/components/escalations/EscalationForm.tsx"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAoBlC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIzE,OAAO,KAA2B,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKxD,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,SAAS,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IACxD,IAAI,CAAC,EACC,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,KAAK,GACL,MAAM,GACN,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,UAAU,EAAE,CAAC;CAC/B;AAED,UAAU,MAAM;IACZ,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,gBAAgB,EAAE,GAAG,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAKD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eAwP3C"}
|