@bento-core/query-bar 1.0.1-icdc.21 → 1.0.1-icdc.22
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/CopyURL_README.md +42 -0
- package/README.md +11 -1
- package/dist/generators/QueryBarGenerator.js +1 -1
- package/dist/generators/config.js +9 -0
- package/dist/generators/styles.js +1 -1
- package/package.json +1 -1
- package/src/generators/QueryBarGenerator.js +2 -1
- package/src/generators/config.js +9 -0
- package/src/generators/styles.js +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# DQB copy URL button Configuration
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
DashTemplateController.js
|
|
5
|
+
|
|
6
|
+
export const setActiveFilterByPathQuery = (match) => {
|
|
7
|
+
const query = decodeURI(match.params.filterQuery || '');
|
|
8
|
+
const filterObject = JSON.parse(query);
|
|
9
|
+
const { autocomplete = [], upload = [], uploadMetadata } = filterObject;
|
|
10
|
+
|
|
11
|
+
const activeFilterValues = Object.keys(filterObject).reduce((curr, key) => {
|
|
12
|
+
if (Array.isArray(filterObject[key])) {
|
|
13
|
+
const activeFilters = filterObject[key].reduce((value, item) => ({
|
|
14
|
+
...value,
|
|
15
|
+
[item]: true,
|
|
16
|
+
}), {});
|
|
17
|
+
return {
|
|
18
|
+
...curr,
|
|
19
|
+
[key]: activeFilters,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return curr;
|
|
23
|
+
}, {});
|
|
24
|
+
store.dispatch(clearAllAndSelectFacet(activeFilterValues));
|
|
25
|
+
store.dispatch(updateAutocompleteData(autocomplete));
|
|
26
|
+
store.dispatch(updateUploadData(upload));
|
|
27
|
+
store.dispatch(updateUploadMetadata(uploadMetadata));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// redirect
|
|
32
|
+
if (match.params.filterQuery) {
|
|
33
|
+
setActiveFilterByPathQuery(match);
|
|
34
|
+
const redirectUrl = '/explore';
|
|
35
|
+
history.push(redirectUrl);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
# DQB copy URL button theme style
|
|
41
|
+
|
|
42
|
+
``` https://github.com/CBIIT/bento-icdc-frontend/tree/v4.0.1/src/pages/dashboard/filterQueryBar```
|
package/README.md
CHANGED
|
@@ -63,6 +63,16 @@ const CONFIG = {
|
|
|
63
63
|
* @var {boolean}
|
|
64
64
|
*/
|
|
65
65
|
displayAllActiveFilters: false,
|
|
66
|
+
/**
|
|
67
|
+
* set root path for copy url (COPYURL_README)
|
|
68
|
+
* @var {boolean}
|
|
69
|
+
*/
|
|
70
|
+
rootPath: `${window.location.href}/`,
|
|
71
|
+
/**
|
|
72
|
+
* display copy url button (COPYURL_README)
|
|
73
|
+
* @var {boolean}
|
|
74
|
+
*/
|
|
75
|
+
viewQueryURL: true,
|
|
66
76
|
},
|
|
67
77
|
|
|
68
78
|
/* Component Helper Functions */
|
|
@@ -144,4 +154,4 @@ This component, which is generated by the provided generator, accepts the follow
|
|
|
144
154
|
/>
|
|
145
155
|
```
|
|
146
156
|
|
|
147
|
-
> **Warning**: The `statusReducer` prop requires the dashboard API data merged with the `facetsConfig` property. Please see the example in the demo implementation [here](https://github.com/CBIIT/bento-frontend/blob/7efd62cd3da0c29326e523055d30118244dc2f2f/packages/bento-frontend/src/pages/dashTemplate/filterQueryBar/QueryBarView.js#LL20C14-L20C14).
|
|
157
|
+
> **Warning**: The `statusReducer` prop requires the dashboard API data merged with the `facetsConfig` property. Please see the example in the demo implementation [here](https://github.com/CBIIT/bento-frontend/blob/7efd62cd3da0c29326e523055d30118244dc2f2f/packages/bento-frontend/src/pages/dashTemplate/filterQueryBar/QueryBarView.js#LL20C14-L20C14).
|
|
@@ -106,7 +106,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
106
106
|
}, "INPUT CASE SET") : null, autocomplete.length ? /*#__PURE__*/_react.default.createElement("span", null, ' ', /*#__PURE__*/_react.default.createElement("span", {
|
|
107
107
|
className: (0, _clsx.default)(classes.filterName, classes.localFindBackground),
|
|
108
108
|
onClick: clearAutocomplete
|
|
109
|
-
}, "Case
|
|
109
|
+
}, "Case IDs"), ' ', ' ', /*#__PURE__*/_react.default.createElement("span", {
|
|
110
110
|
className: classes.operators
|
|
111
111
|
}, autocomplete.length === 1 && !upload.length ? 'IS ' : 'IN ')) : null, /*#__PURE__*/_react.default.createElement("span", null, (upload.length > 0 ? 1 : 0) + autocomplete.length > 1 ? /*#__PURE__*/_react.default.createElement("span", {
|
|
112
112
|
className: classes.bracketsOpen
|
|
@@ -18,6 +18,15 @@ var _default = {
|
|
|
18
18
|
* @var {boolean}
|
|
19
19
|
*/
|
|
20
20
|
displayAllActiveFilters: false,
|
|
21
|
+
/**
|
|
22
|
+
* set root path for copy url
|
|
23
|
+
* @var {boolean}
|
|
24
|
+
*/
|
|
25
|
+
rootPath: "".concat(window.location.href, "/"),
|
|
26
|
+
/**
|
|
27
|
+
* display copy url button
|
|
28
|
+
* @var {boolean}
|
|
29
|
+
*/
|
|
21
30
|
viewQueryURL: false
|
|
22
31
|
},
|
|
23
32
|
/* Component Helper Functions */
|
package/package.json
CHANGED
|
@@ -126,7 +126,7 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
126
126
|
className={clsx(classes.filterName, classes.localFindBackground)}
|
|
127
127
|
onClick={clearAutocomplete}
|
|
128
128
|
>
|
|
129
|
-
Case
|
|
129
|
+
Case IDs
|
|
130
130
|
</span>
|
|
131
131
|
{' '}
|
|
132
132
|
{' '}
|
|
@@ -187,6 +187,7 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
187
187
|
</span>
|
|
188
188
|
</span>
|
|
189
189
|
) : null}
|
|
190
|
+
|
|
190
191
|
{/* Facet Sidebar Selections */}
|
|
191
192
|
{((autocomplete.length || upload.length) && mappedInputs.length)
|
|
192
193
|
? <span className={classes.operators}> AND </span>
|
package/src/generators/config.js
CHANGED
|
@@ -12,6 +12,15 @@ export default {
|
|
|
12
12
|
* @var {boolean}
|
|
13
13
|
*/
|
|
14
14
|
displayAllActiveFilters: false,
|
|
15
|
+
/**
|
|
16
|
+
* set root path for copy url
|
|
17
|
+
* @var {boolean}
|
|
18
|
+
*/
|
|
19
|
+
rootPath: `${window.location.href}/`,
|
|
20
|
+
/**
|
|
21
|
+
* display copy url button
|
|
22
|
+
* @var {boolean}
|
|
23
|
+
*/
|
|
15
24
|
viewQueryURL: false,
|
|
16
25
|
},
|
|
17
26
|
|