@bento-core/query-bar 1.0.0-c3dc.12 → 1.0.0-c3dc.13
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.
|
@@ -37,7 +37,28 @@ const QueryUrl = _ref => {
|
|
|
37
37
|
acc[datafield] = items;
|
|
38
38
|
return acc;
|
|
39
39
|
}, {});
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
// Extract unknownAges state from filterItems
|
|
42
|
+
const unknownAgesState = filterItems.reduce((acc, item) => {
|
|
43
|
+
const {
|
|
44
|
+
datafield,
|
|
45
|
+
unknownAges,
|
|
46
|
+
isUnknownAges,
|
|
47
|
+
parentDatafield
|
|
48
|
+
} = item;
|
|
49
|
+
// Only include unknownAges if it's set and not the default 'include'
|
|
50
|
+
if (unknownAges && unknownAges !== 'include') {
|
|
51
|
+
// Use parentDatafield if this is an unknownAges-only item, otherwise use datafield
|
|
52
|
+
const key = isUnknownAges ? parentDatafield : datafield;
|
|
53
|
+
if (key) {
|
|
54
|
+
acc[key] = unknownAges;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return acc;
|
|
58
|
+
}, {});
|
|
59
|
+
const queryString = JSON.stringify(_objectSpread(_objectSpread(_objectSpread({}, pathFilterParams), localFind), Object.keys(unknownAgesState).length > 0 && {
|
|
60
|
+
unknownAgesState
|
|
61
|
+
}));
|
|
41
62
|
const [url, setUrl] = (0, _react.useState)('');
|
|
42
63
|
const copyUrl = async () => {
|
|
43
64
|
toggleOpen();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/query-bar",
|
|
3
|
-
"version": "1.0.0-c3dc.
|
|
3
|
+
"version": "1.0.0-c3dc.13",
|
|
4
4
|
"description": "This package provides the Query Bar component that displays the current Facet Search and Local Find filters on the Dashboard/Explore page. It also provides the direct ability to reset all or some of the filters with the click of a button. It is designed to be implemented directly with the:",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react-redux": "^7.2.1"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@bento-core/facet-filter": "^1.0.1-c3dc.
|
|
26
|
+
"@bento-core/facet-filter": "^1.0.1-c3dc.12",
|
|
27
27
|
"lodash": "^4.17.20"
|
|
28
28
|
},
|
|
29
29
|
"author": "CTOS Bento Team",
|
|
@@ -32,9 +32,27 @@ const QueryUrl = ({
|
|
|
32
32
|
return acc;
|
|
33
33
|
}, {});
|
|
34
34
|
|
|
35
|
+
// Extract unknownAges state from filterItems
|
|
36
|
+
const unknownAgesState = filterItems.reduce((acc, item) => {
|
|
37
|
+
const {
|
|
38
|
+
datafield, unknownAges, isUnknownAges, parentDatafield,
|
|
39
|
+
} = item;
|
|
40
|
+
// Only include unknownAges if it's set and not the default 'include'
|
|
41
|
+
if (unknownAges && unknownAges !== 'include') {
|
|
42
|
+
// Use parentDatafield if this is an unknownAges-only item, otherwise use datafield
|
|
43
|
+
const key = isUnknownAges ? parentDatafield : datafield;
|
|
44
|
+
if (key) {
|
|
45
|
+
acc[key] = unknownAges;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return acc;
|
|
49
|
+
}, {});
|
|
50
|
+
|
|
35
51
|
const queryString = JSON.stringify({
|
|
36
52
|
...pathFilterParams,
|
|
37
53
|
...localFind,
|
|
54
|
+
// Include unknownAgesState if it has any entries
|
|
55
|
+
...(Object.keys(unknownAgesState).length > 0 && { unknownAgesState }),
|
|
38
56
|
});
|
|
39
57
|
const [url, setUrl] = useState('');
|
|
40
58
|
|