@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/cjs/search.js CHANGED
@@ -448,6 +448,7 @@ const selectListing = {
448
448
  getSelectedFilters: (state, listing = '') => getSelectedFilters(state, listing, Context$1.listings)
449
449
  };
450
450
  const selectCurrentPath = state => getImmutableOrJS(state, ['routing', 'currentPath']);
451
+ const selectCurrentProject = state => getImmutableOrJS(state, ['routing', 'currentProject']);
451
452
  const selectVersionStatus = state => getImmutableOrJS(state, ['version', 'contensisVersionStatus']);
452
453
 
453
454
  var selectors = /*#__PURE__*/Object.freeze({
@@ -490,6 +491,7 @@ var selectors = /*#__PURE__*/Object.freeze({
490
491
  selectFacets: selectFacets,
491
492
  selectListing: selectListing,
492
493
  selectCurrentPath: selectCurrentPath,
494
+ selectCurrentProject: selectCurrentProject,
493
495
  selectVersionStatus: selectVersionStatus
494
496
  });
495
497
 
@@ -1461,7 +1463,7 @@ const queryParamsTemplate = {
1461
1463
  }) => {
1462
1464
  var _getFacet;
1463
1465
 
1464
- return (_getFacet = getFacet(state, facet, context)) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId;
1466
+ return ((_getFacet = getFacet(state, facet, context)) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId) || selectCurrentProject(state);
1465
1467
  },
1466
1468
  searchTerm: root => root.context !== Context$1.minilist || getQueryParameter(root, 'useSearchTerm', false) ? getSearchTerm(root.state) : '',
1467
1469
  selectedFilters: ({
@@ -1575,9 +1577,10 @@ const filterParamsChanged = (action, state) => {
1575
1577
  const debugExecuteSearch = (action, state) => {
1576
1578
  const [queryParams, runSearch] = generateQueryParams(action, state);
1577
1579
  console.log('runSearch', runSearch, 'action', action, 'filterParamsChanged', filterParamsChanged(action, state), 'getIsLoaded(state, context, facet)', getIsLoaded(state, action.context, action.facet));
1578
- const stateParams = getQueryParams(action.ogState || state, action.facet, action.context);
1579
- stateParams.pageIndex = getPageIndex(action.ogState || state, action.facet, action.context);
1580
- stateParams.searchTerm = getSearchTerm(action.ogState || state);
1580
+ const stateParams = { ...getQueryParams(action.ogState || state, action.facet, action.context),
1581
+ pageIndex: getPageIndex(action.ogState || state, action.facet, action.context),
1582
+ searchTerm: getSearchTerm(action.ogState || state)
1583
+ };
1581
1584
  console.log(stateParams, queryParams);
1582
1585
  console.log('getSelectedFilters', getSelectedFilters(action.ogState || state, action.facet, action.context, 'js'), 'params', action.params);
1583
1586
  };