@bento-core/facet-filter 1.0.1-ccdiintegrated.1 → 1.0.1-ccdiintegrated.2

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.
@@ -19,7 +19,8 @@ const BentoFacetFilter = _ref => {
19
19
  facetSection,
20
20
  CustomFacetSection,
21
21
  CustomFacetView,
22
- queryParams
22
+ queryParams,
23
+ basePath
23
24
  } = _ref;
24
25
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, CustomFacetSection && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(CustomFacetSection, {
25
26
  section: facetSection,
@@ -29,13 +30,15 @@ const BentoFacetFilter = _ref => {
29
30
  return /*#__PURE__*/_react.default.createElement(_ReduxNewSearchFacetView.default, {
30
31
  facet: facet,
31
32
  queryParams: queryParams,
32
- CustomView: CustomFacetView
33
+ CustomView: CustomFacetView,
34
+ basePath: basePath
33
35
  });
34
36
  }
35
37
  return /*#__PURE__*/_react.default.createElement(_ReduxNewFacetView.default, {
36
38
  facet: facet,
37
39
  queryParams: queryParams,
38
- CustomView: CustomFacetView
40
+ CustomView: CustomFacetView,
41
+ basePath: basePath
39
42
  }, /*#__PURE__*/_react.default.createElement(_core.List, {
40
43
  className: "List_".concat(facet.label)
41
44
  }, /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
@@ -38,7 +38,8 @@ const NewFacetView = _ref => {
38
38
  onTimeUnitChange,
39
39
  unknownAgesState,
40
40
  expandState,
41
- onToggleFacetExpand
41
+ onToggleFacetExpand,
42
+ basePath
42
43
  } = _ref;
43
44
  const expand = expandState[facet.datafield] !== undefined ? expandState[facet.datafield] : facet.expanded !== undefined && typeof facet.expanded === 'boolean' ? facet.expanded : false;
44
45
  const isUserInitiated = (0, _react.useRef)(false);
@@ -93,7 +94,7 @@ const NewFacetView = _ref => {
93
94
  paramValue[unknownAgesField] = '';
94
95
  }
95
96
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
96
- navigate("/exploreParticipants".concat(queryStr), {
97
+ navigate("".concat(basePath).concat(queryStr), {
97
98
  replace: true
98
99
  });
99
100
  setSortBy(null);
@@ -203,12 +204,14 @@ const NewFacetView = _ref => {
203
204
  facet: facet,
204
205
  queryParams: queryParams,
205
206
  sortBy: sortBy,
206
- timeUnit: timeUnit
207
+ timeUnit: timeUnit,
208
+ basePath: basePath
207
209
  })), !expand && type === _Types.InputTypes.CHECKBOX && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.List, {
208
210
  id: "filter_Items"
209
211
  }, /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
210
212
  facet: displayFacet,
211
- queryParams: queryParams
213
+ queryParams: queryParams,
214
+ basePath: basePath
212
215
  }))), !expand && selectedItems.length > limitCheckBoxCount && /*#__PURE__*/_react.default.createElement("div", {
213
216
  className: classes.showMore,
214
217
  onClick: onExpandFacet
@@ -60,7 +60,8 @@ const SearchFacetView = _ref => {
60
60
  queryParams,
61
61
  unknownAgesState,
62
62
  expandState,
63
- onToggleFacetExpand
63
+ onToggleFacetExpand,
64
+ basePath
64
65
  } = _ref;
65
66
  const expand = expandState[facet.datafield] !== undefined ? expandState[facet.datafield] : facet.expanded !== undefined && typeof facet.expanded === 'boolean' ? facet.expanded : false;
66
67
  const isUserInitiated = (0, _react.useRef)(false);
@@ -93,7 +94,7 @@ const SearchFacetView = _ref => {
93
94
  paramValue[unknownAgesField] = '';
94
95
  }
95
96
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
96
- navigate("/exploreParticipants".concat(queryStr), {
97
+ navigate("".concat(basePath).concat(queryStr), {
97
98
  replace: true
98
99
  });
99
100
  onSortChange(facet.datafield, null);
@@ -20,7 +20,8 @@ const FilterItems = _ref => {
20
20
  facet,
21
21
  queryParams,
22
22
  sortBy,
23
- timeUnit
23
+ timeUnit,
24
+ basePath
24
25
  } = _ref;
25
26
  const {
26
27
  type,
@@ -40,13 +41,15 @@ const FilterItems = _ref => {
40
41
  }),
41
42
  datafield: datafield,
42
43
  facet: facet,
43
- queryParams: queryParams
44
+ queryParams: queryParams,
45
+ basePath: basePath
44
46
  }));
45
47
  case _Types.InputTypes.SLIDER:
46
48
  return /*#__PURE__*/_react.default.createElement(_ReduxSlider.default, {
47
49
  facet: facet,
48
50
  queryParams: queryParams,
49
- timeUnit: timeUnit
51
+ timeUnit: timeUnit,
52
+ basePath: basePath
50
53
  });
51
54
  default:
52
55
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
@@ -24,7 +24,8 @@ const CheckBoxView = _ref => {
24
24
  datafield,
25
25
  onToggle,
26
26
  facet,
27
- queryParams
27
+ queryParams,
28
+ basePath
28
29
  } = _ref;
29
30
  const {
30
31
  name,
@@ -71,7 +72,7 @@ const CheckBoxView = _ref => {
71
72
  paramValue[datafield] = '';
72
73
  }
73
74
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
74
- navigate("/exploreParticipants".concat(queryStr));
75
+ navigate("".concat(basePath).concat(queryStr));
75
76
  onToggle(toggleCheckBoxItem);
76
77
  };
77
78
  const LabelComponent = () => /*#__PURE__*/_react.default.createElement(_core.Box, {
@@ -28,7 +28,8 @@ const SliderView = _ref => {
28
28
  queryParams,
29
29
  timeUnit = 'days',
30
30
  unknownAgesState,
31
- onUnknownAgesChange
31
+ onUnknownAgesChange,
32
+ basePath
32
33
  } = _ref;
33
34
  const {
34
35
  minLowerBound,
@@ -102,7 +103,7 @@ const SliderView = _ref => {
102
103
  const paramValue = {};
103
104
  paramValue[datafield] = daysValue;
104
105
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
105
- navigate("/exploreParticipants".concat(queryStr));
106
+ navigate("".concat(basePath).concat(queryStr));
106
107
  onSliderToggle(_objectSpread({
107
108
  sliderValue: daysValue
108
109
  }, facet));
@@ -138,7 +139,7 @@ const SliderView = _ref => {
138
139
  paramValue[datafield] = ''; // Clear the age range filter
139
140
  paramValue["".concat(datafield, "_unknownAges")] = 'only'; // Set the unknownAges parameter to only
140
141
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
141
- navigate("/exploreParticipants".concat(queryStr));
142
+ navigate("".concat(basePath).concat(queryStr));
142
143
 
143
144
  // Keep the current slider values for display (don't reset to defaults)
144
145
  // The slider will be disabled but show the user's previous selection
@@ -159,7 +160,7 @@ const SliderView = _ref => {
159
160
  paramValue[datafield] = ''; // Clear the age range filter
160
161
  paramValue["".concat(datafield, "_unknownAges")] = ''; // Clear the unknownAges parameter
161
162
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
162
- navigate("/exploreParticipants".concat(queryStr));
163
+ navigate("".concat(basePath).concat(queryStr));
163
164
 
164
165
  // Clear the slider state in the parent component
165
166
  onSliderToggle(_objectSpread({
@@ -171,7 +172,7 @@ const SliderView = _ref => {
171
172
  paramValue[datafield] = currentSliderValues;
172
173
  paramValue["".concat(datafield, "_unknownAges")] = ''; // Clear the unknownAges parameter since "include" is default
173
174
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
174
- navigate("/exploreParticipants".concat(queryStr));
175
+ navigate("".concat(basePath).concat(queryStr));
175
176
 
176
177
  // Restore the slider state in the parent component
177
178
  onSliderToggle(_objectSpread({
@@ -185,7 +186,7 @@ const SliderView = _ref => {
185
186
  paramValue[datafield] = currentSliderValues;
186
187
  paramValue["".concat(datafield, "_unknownAges")] = 'exclude'; // Set the unknownAges parameter to exclude
187
188
  const queryStr = (0, _util.generateQueryStr)(query, queryParams, paramValue);
188
- navigate("/exploreParticipants".concat(queryStr));
189
+ navigate("".concat(basePath).concat(queryStr));
189
190
 
190
191
  // Restore the slider state in the parent component
191
192
  onSliderToggle(_objectSpread({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/facet-filter",
3
- "version": "1.0.1-ccdiintegrated.1",
3
+ "version": "1.0.1-ccdiintegrated.2",
4
4
  "description": "### Bento core sidebar design:",
5
5
  "homepage": "https://github.com/CBIIT/bento-frontend#readme",
6
6
  "bugs": {
@@ -15,6 +15,7 @@ const BentoFacetFilter = ({
15
15
  CustomFacetSection,
16
16
  CustomFacetView,
17
17
  queryParams,
18
+ basePath,
18
19
  }) => {
19
20
  return (
20
21
  <>
@@ -30,6 +31,7 @@ const BentoFacetFilter = ({
30
31
  facet={facet}
31
32
  queryParams={queryParams}
32
33
  CustomView={CustomFacetView}
34
+ basePath={basePath}
33
35
  />
34
36
  );
35
37
  }
@@ -38,6 +40,7 @@ const BentoFacetFilter = ({
38
40
  facet={facet}
39
41
  queryParams={queryParams}
40
42
  CustomView={CustomFacetView}
43
+ basePath={basePath}
41
44
  >
42
45
  <List className={`List_${facet.label}`}>
43
46
  <FilterItems
@@ -33,6 +33,7 @@ const NewFacetView = ({
33
33
  unknownAgesState,
34
34
  expandState,
35
35
  onToggleFacetExpand,
36
+ basePath,
36
37
  }) => {
37
38
  const expand = expandState[facet.datafield] !== undefined ? expandState[facet.datafield] : (facet.expanded !== undefined && typeof facet.expanded === 'boolean' ? facet.expanded : false);
38
39
 
@@ -94,7 +95,7 @@ const NewFacetView = ({
94
95
  }
95
96
 
96
97
  const queryStr = generateQueryStr(query, queryParams, paramValue);
97
- navigate(`/exploreParticipants${queryStr}`, { replace: true });
98
+ navigate(`${basePath}${queryStr}`, { replace: true });
98
99
  setSortBy(null);
99
100
 
100
101
  // Reset the corresponding unknownAges parameter in Redux state
@@ -258,6 +259,7 @@ const NewFacetView = ({
258
259
  queryParams={queryParams}
259
260
  sortBy={sortBy}
260
261
  timeUnit={timeUnit}
262
+ basePath={basePath}
261
263
  />
262
264
  </Accordion>
263
265
  {
@@ -267,6 +269,7 @@ const NewFacetView = ({
267
269
  <FilterItems
268
270
  facet={displayFacet}
269
271
  queryParams={queryParams}
272
+ basePath={basePath}
270
273
  />
271
274
  </List>
272
275
  </>
@@ -58,6 +58,7 @@ const SearchFacetView = ({
58
58
  unknownAgesState,
59
59
  expandState,
60
60
  onToggleFacetExpand,
61
+ basePath,
61
62
  }) => {
62
63
  const expand = expandState[facet.datafield] !== undefined ? expandState[facet.datafield] : (facet.expanded !== undefined && typeof facet.expanded === 'boolean' ? facet.expanded : false);
63
64
 
@@ -96,7 +97,7 @@ const SearchFacetView = ({
96
97
  }
97
98
 
98
99
  const queryStr = generateQueryStr(query, queryParams, paramValue);
99
- navigate(`/exploreParticipants${queryStr}`, { replace: true });
100
+ navigate(`${basePath}${queryStr}`, { replace: true });
100
101
  onSortChange(facet.datafield, null);
101
102
 
102
103
  // Reset the corresponding unknownAges parameter in Redux state
@@ -11,6 +11,7 @@ const FilterItems = ({
11
11
  queryParams,
12
12
  sortBy,
13
13
  timeUnit,
14
+ basePath,
14
15
  }) => {
15
16
  const {
16
17
  type, datafield, section,
@@ -25,10 +26,16 @@ const FilterItems = ({
25
26
  datafield={datafield}
26
27
  facet={facet}
27
28
  queryParams={queryParams}
29
+ basePath={basePath}
28
30
  />
29
31
  ));
30
32
  case InputTypes.SLIDER:
31
- return (<ReduxSlider facet={facet} queryParams={queryParams} timeUnit={timeUnit} />);
33
+ return (<ReduxSlider
34
+ facet={facet}
35
+ queryParams={queryParams}
36
+ timeUnit={timeUnit}
37
+ basePath={basePath}
38
+ />);
32
39
  default:
33
40
  return (<></>);
34
41
  }
@@ -39,6 +39,7 @@ const CheckBoxView = ({
39
39
  onToggle,
40
40
  facet,
41
41
  queryParams,
42
+ basePath,
42
43
  }) => {
43
44
  const {
44
45
  name,
@@ -83,7 +84,7 @@ const CheckBoxView = ({
83
84
  paramValue[datafield] = '';
84
85
  }
85
86
  const queryStr = generateQueryStr(query, queryParams, paramValue);
86
- navigate(`/exploreParticipants${queryStr}`);
87
+ navigate(`${basePath}${queryStr}`);
87
88
  onToggle(toggleCheckBoxItem);
88
89
  };
89
90
 
@@ -31,6 +31,7 @@ const SliderView = ({
31
31
  timeUnit = 'days',
32
32
  unknownAgesState,
33
33
  onUnknownAgesChange,
34
+ basePath,
34
35
  }) => {
35
36
  const { minLowerBound, maxUpperBound, quantifier, datafield, facetValues } = facet;
36
37
  const lowerBoundValue = facetValues[0];
@@ -106,7 +107,7 @@ const SliderView = ({
106
107
  const paramValue = {};
107
108
  paramValue[datafield] = daysValue;
108
109
  const queryStr = generateQueryStr(query, queryParams, paramValue);
109
- navigate(`/exploreParticipants${queryStr}`);
110
+ navigate(`${basePath}${queryStr}`);
110
111
  onSliderToggle({ sliderValue: daysValue, ...facet });
111
112
  }
112
113
  };
@@ -149,7 +150,7 @@ const SliderView = ({
149
150
  paramValue[datafield] = ''; // Clear the age range filter
150
151
  paramValue[`${datafield}_unknownAges`] = 'only'; // Set the unknownAges parameter to only
151
152
  const queryStr = generateQueryStr(query, queryParams, paramValue);
152
- navigate(`/exploreParticipants${queryStr}`);
153
+ navigate(`${basePath}${queryStr}`);
153
154
 
154
155
  // Keep the current slider values for display (don't reset to defaults)
155
156
  // The slider will be disabled but show the user's previous selection
@@ -170,7 +171,7 @@ const SliderView = ({
170
171
  paramValue[datafield] = ''; // Clear the age range filter
171
172
  paramValue[`${datafield}_unknownAges`] = ''; // Clear the unknownAges parameter
172
173
  const queryStr = generateQueryStr(query, queryParams, paramValue);
173
- navigate(`/exploreParticipants${queryStr}`);
174
+ navigate(`${basePath}${queryStr}`);
174
175
 
175
176
  // Clear the slider state in the parent component
176
177
  onSliderToggle({ sliderValue: [], ...facet });
@@ -180,7 +181,7 @@ const SliderView = ({
180
181
  paramValue[datafield] = currentSliderValues;
181
182
  paramValue[`${datafield}_unknownAges`] = ''; // Clear the unknownAges parameter since "include" is default
182
183
  const queryStr = generateQueryStr(query, queryParams, paramValue);
183
- navigate(`/exploreParticipants${queryStr}`);
184
+ navigate(`${basePath}${queryStr}`);
184
185
 
185
186
  // Restore the slider state in the parent component
186
187
  onSliderToggle({ sliderValue: currentSliderValues, ...facet });
@@ -192,7 +193,7 @@ const SliderView = ({
192
193
  paramValue[datafield] = currentSliderValues;
193
194
  paramValue[`${datafield}_unknownAges`] = 'exclude'; // Set the unknownAges parameter to exclude
194
195
  const queryStr = generateQueryStr(query, queryParams, paramValue);
195
- navigate(`/exploreParticipants${queryStr}`);
196
+ navigate(`${basePath}${queryStr}`);
196
197
 
197
198
  // Restore the slider state in the parent component
198
199
  onSliderToggle({ sliderValue: currentSliderValues, ...facet });