@zengenti/contensis-react-base 3.0.0-beta.21 → 3.0.0-beta.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/esm/search.js CHANGED
@@ -418,6 +418,7 @@ const selectListing = {
418
418
  getSelectedFilters: (state, listing = '') => getSelectedFilters(state, listing, Context$1.listings)
419
419
  };
420
420
  const selectCurrentPath = state => getImmutableOrJS(state, ['routing', 'currentPath']);
421
+ const selectCurrentProject = state => getImmutableOrJS(state, ['routing', 'currentProject']);
421
422
  const selectVersionStatus = state => getImmutableOrJS(state, ['version', 'contensisVersionStatus']);
422
423
 
423
424
  var selectors = /*#__PURE__*/Object.freeze({
@@ -460,6 +461,7 @@ var selectors = /*#__PURE__*/Object.freeze({
460
461
  selectFacets: selectFacets,
461
462
  selectListing: selectListing,
462
463
  selectCurrentPath: selectCurrentPath,
464
+ selectCurrentProject: selectCurrentProject,
463
465
  selectVersionStatus: selectVersionStatus
464
466
  });
465
467
 
@@ -1431,7 +1433,7 @@ const queryParamsTemplate = {
1431
1433
  }) => {
1432
1434
  var _getFacet;
1433
1435
 
1434
- return (_getFacet = getFacet(state, facet, context)) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId;
1436
+ return ((_getFacet = getFacet(state, facet, context)) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId) || selectCurrentProject(state);
1435
1437
  },
1436
1438
  searchTerm: root => root.context !== Context$1.minilist || getQueryParameter(root, 'useSearchTerm', false) ? getSearchTerm(root.state) : '',
1437
1439
  selectedFilters: ({
@@ -1545,9 +1547,10 @@ const filterParamsChanged = (action, state) => {
1545
1547
  const debugExecuteSearch = (action, state) => {
1546
1548
  const [queryParams, runSearch] = generateQueryParams(action, state);
1547
1549
  console.log('runSearch', runSearch, 'action', action, 'filterParamsChanged', filterParamsChanged(action, state), 'getIsLoaded(state, context, facet)', getIsLoaded(state, action.context, action.facet));
1548
- const stateParams = getQueryParams(action.ogState || state, action.facet, action.context);
1549
- stateParams.pageIndex = getPageIndex(action.ogState || state, action.facet, action.context);
1550
- stateParams.searchTerm = getSearchTerm(action.ogState || state);
1550
+ const stateParams = { ...getQueryParams(action.ogState || state, action.facet, action.context),
1551
+ pageIndex: getPageIndex(action.ogState || state, action.facet, action.context),
1552
+ searchTerm: getSearchTerm(action.ogState || state)
1553
+ };
1551
1554
  console.log(stateParams, queryParams);
1552
1555
  console.log('getSelectedFilters', getSelectedFilters(action.ogState || state, action.facet, action.context, 'js'), 'params', action.params);
1553
1556
  };