@rh-support/manage 1.1.7 → 2.0.1
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/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +2 -2
- package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +19 -7
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultGroupSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultGroupSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAMvF,UAAU,MAAM;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,eAAO,MAAM,kBAAkB,UAAW,MAAM,gBA2C/C,CAAC"}
|
|
@@ -34,7 +34,7 @@ export const GroupSelect = (props) => {
|
|
|
34
34
|
: t('Select a group to view accounts');
|
|
35
35
|
const getGroup = useCallback((groupName) => (caseGroups.data || []).find((groupObj) => groupObj.name === groupName), [caseGroups]);
|
|
36
36
|
const confirmation = useConfirmation();
|
|
37
|
-
//
|
|
37
|
+
// Fetch groups on init
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
var _a;
|
|
40
40
|
if (haventLoadedMetadata(caseGroups, (data) => data === undefined))
|
|
@@ -68,7 +68,7 @@ export const GroupSelect = (props) => {
|
|
|
68
68
|
}
|
|
69
69
|
setIsOpen(false);
|
|
70
70
|
};
|
|
71
|
-
//
|
|
71
|
+
// Group actions dropdown state
|
|
72
72
|
const hasGroupPermissions = ability.can(resourceActions.CREATE, resources.CASE_GROUPS);
|
|
73
73
|
const [showDropdown, setShowDropdown] = useState(hasGroupPermissions);
|
|
74
74
|
const [showInput, setShowInput] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentProductVersionSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"TopContentProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentProductVersionSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAInF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAS5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,eAAe,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC3D,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,2BAG1E;AAqBD,iBAAS,gCAAgC,CAAC,KAAK,EAAE,MAAM,eA0JtD;kBA1JQ,gCAAgC;;;AA6JzC,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { products as productsApi } from '@cee-eng/hydrajs';
|
|
2
2
|
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
3
|
+
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
|
|
3
4
|
import { useFetch } from '@rh-support/components';
|
|
4
5
|
import { getUniqueSortedVersions, getVersion } from '@rh-support/utils';
|
|
5
6
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -43,8 +44,12 @@ function TopContentProductVersionSelector(props) {
|
|
|
43
44
|
const { request: getProductVersions, isFetching: isLoadingVersions, data: versions, } = useFetch(productsApi.getProductVersions, { initialData: [], postProcessor: postVersionsProcessor });
|
|
44
45
|
const [isProductOpen, setIsProductOpen] = useState(false);
|
|
45
46
|
const [isVersionOpen, setIsVersionOpen] = useState(false);
|
|
46
|
-
const
|
|
47
|
+
const [selected, setSelected] = useState(undefined);
|
|
48
|
+
const { selectedVersion } = props;
|
|
47
49
|
const topContentDispatch = useTopContentDispatchContext();
|
|
50
|
+
const productOptions = products === null || products === void 0 ? void 0 : products.map((p, id) => (Object.assign(Object.assign({}, p), { toString: function () {
|
|
51
|
+
return p.name;
|
|
52
|
+
} })));
|
|
48
53
|
/**
|
|
49
54
|
* Fetch products on load
|
|
50
55
|
*/
|
|
@@ -73,15 +78,19 @@ function TopContentProductVersionSelector(props) {
|
|
|
73
78
|
};
|
|
74
79
|
const onProductClear = () => {
|
|
75
80
|
onProductChange({ name: '', id: '' });
|
|
81
|
+
setSelected(undefined);
|
|
76
82
|
};
|
|
77
83
|
const getProductOptions = (options) => {
|
|
78
|
-
return options.map((product, id) => (React.createElement(SelectOption, { key: id, value: product },
|
|
84
|
+
return options.map((product, id) => (React.createElement(SelectOption, { key: id, value: product, className: "pf-c-select__menu-wrapper" },
|
|
85
|
+
React.createElement("div", { className: "pf-c-select__menu-item-main" }, product.name),
|
|
86
|
+
selected && product.name === selected.name && (React.createElement("span", { className: "pf-c-select__menu-item-icon" },
|
|
87
|
+
React.createElement(CheckIcon, { "aria-hidden": true }))))));
|
|
79
88
|
};
|
|
80
89
|
const onProductFilter = (_, value) => {
|
|
81
90
|
if (!value)
|
|
82
|
-
return getProductOptions(
|
|
91
|
+
return getProductOptions(productOptions);
|
|
83
92
|
const input = new RegExp(value, 'i');
|
|
84
|
-
const newOptions =
|
|
93
|
+
const newOptions = productOptions === null || productOptions === void 0 ? void 0 : productOptions.filter((p) => input.test(p.name));
|
|
85
94
|
return getProductOptions(newOptions);
|
|
86
95
|
};
|
|
87
96
|
const onProductToggle = (isExpanded) => {
|
|
@@ -89,6 +98,7 @@ function TopContentProductVersionSelector(props) {
|
|
|
89
98
|
};
|
|
90
99
|
const onProductSelect = (event, selection, isPlaceholder) => {
|
|
91
100
|
onProductChange(selection);
|
|
101
|
+
setSelected(selection);
|
|
92
102
|
onProductToggle(false);
|
|
93
103
|
};
|
|
94
104
|
const onVersionToggle = (isExpanded) => {
|
|
@@ -98,15 +108,17 @@ function TopContentProductVersionSelector(props) {
|
|
|
98
108
|
onVersionChange(selection);
|
|
99
109
|
onVersionToggle(false);
|
|
100
110
|
};
|
|
111
|
+
const productLabelId = 'tc-product-dropdown-selector';
|
|
112
|
+
const versionLabelId = 'version-dropdown-selector';
|
|
101
113
|
return (React.createElement("div", { className: "toolbar" },
|
|
102
114
|
React.createElement("div", { className: "toolbar-left" },
|
|
103
|
-
React.createElement("label", { htmlFor: 'tc-product-dropdown-
|
|
115
|
+
React.createElement("label", { htmlFor: 'tc-product-selector-dropdown-toggle' },
|
|
104
116
|
React.createElement(Trans, null, "Product")),
|
|
105
|
-
React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, onToggle: onProductToggle, selections:
|
|
117
|
+
React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, onToggle: onProductToggle, selections: selected, isOpen: isProductOpen, onSelect: onProductSelect, onClear: onProductClear, placeholderText: t('Select a product') }, (isLoadingProducts && { loadingVariant: 'spinner' }), { onFilter: onProductFilter, isDisabled: isLoadingProducts, id: productLabelId, "data-tracking-id": productLabelId, "aria-label": t(productLabelId) }), getProductOptions(productOptions))),
|
|
106
118
|
React.createElement("div", { className: "toolbar-right" },
|
|
107
119
|
React.createElement("label", { htmlFor: "version-selector-dropdown-toggle" },
|
|
108
120
|
React.createElement(Trans, null, "Version")),
|
|
109
|
-
React.createElement(Select, Object.assign({ variant: SelectVariant.single, onToggle: onVersionToggle, onSelect: onVersionSelect, selections: selectedVersion, isOpen: isVersionOpen, placeholderText: t('Select a version'), isDisabled: isEmpty(versions === null || versions === void 0 ? void 0 : versions.items) }, (isLoadingVersions && { loadingVariant: 'spinner' }), { id:
|
|
121
|
+
React.createElement(Select, Object.assign({ variant: SelectVariant.single, onToggle: onVersionToggle, onSelect: onVersionSelect, selections: selectedVersion, isOpen: isVersionOpen, placeholderText: t('Select a version'), isDisabled: isEmpty(versions === null || versions === void 0 ? void 0 : versions.items) }, (isLoadingVersions && { loadingVariant: 'spinner' }), { id: versionLabelId, "data-tracking-id": versionLabelId, "aria-label": t(versionLabelId) }), ((versions === null || versions === void 0 ? void 0 : versions.items) || []).map((version, id) => (React.createElement(SelectOption, { key: id, value: version }, version)))))));
|
|
110
122
|
}
|
|
111
123
|
TopContentProductVersionSelector.defaultProps = defaultProps;
|
|
112
124
|
export { TopContentProductVersionSelector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
95
95
|
"@patternfly/react-core": "4.264.0",
|
|
96
96
|
"@patternfly/react-table": "4.111.33",
|
|
97
|
-
"@rh-support/components": "
|
|
98
|
-
"@rh-support/configs": "
|
|
99
|
-
"@rh-support/react-context": "
|
|
100
|
-
"@rh-support/types": "0.
|
|
101
|
-
"@rh-support/user-permissions": "
|
|
102
|
-
"@rh-support/utils": "
|
|
97
|
+
"@rh-support/components": "2.0.1",
|
|
98
|
+
"@rh-support/configs": "2.0.1",
|
|
99
|
+
"@rh-support/react-context": "2.0.1",
|
|
100
|
+
"@rh-support/types": "2.0.1",
|
|
101
|
+
"@rh-support/user-permissions": "2.0.1",
|
|
102
|
+
"@rh-support/utils": "2.0.1",
|
|
103
103
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
104
104
|
"i18next": ">=17.0.1",
|
|
105
105
|
"lodash": ">=4.17.15",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"react-i18next": ">=10.11.0",
|
|
110
110
|
"react-router-dom": ">=5.1.2"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "98c698c7f5ca8e1ec943598ef96a6fb816babc1e"
|
|
113
113
|
}
|