@shopgate/pwa-common-commerce 7.20.0-beta.9 → 7.20.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// FEATURES
|
|
2
2
|
var FILTER='filter';// CONTENTS
|
|
3
|
-
var PRICE_RANGE='price-range';var SORT='sort-options';// POSITIONS
|
|
4
|
-
var BEFORE='before';var AFTER='after'
|
|
3
|
+
var PRICE_RANGE='price-range';var SORT='sort-options';var SELECTOR='selector';var APPLY_BUTTON='apply-button';var RESET_BUTTON='reset-button';var PAGE_CONTENT='page-content';// POSITIONS
|
|
4
|
+
var BEFORE='before';var AFTER='after';/** @deprecated Use PORTAL_FILTER_PRICE_RANGE instead */export var FILTER_PRICE_RANGE="".concat(FILTER,".").concat(PRICE_RANGE);/** @deprecated Use PORTAL_FILTER_PRICE_RANGE_BEFORE instead */export var FILTER_PRICE_RANGE_BEFORE="".concat(FILTER,".").concat(PRICE_RANGE,".").concat(BEFORE);/** @deprecated Use PORTAL_FILTER_PRICE_RANGE_AFTER instead */export var FILTER_PRICE_RANGE_AFTER="".concat(FILTER,".").concat(PRICE_RANGE,".").concat(AFTER);/** @deprecated Use PORTAL_FILTER_SORT_OPTIONS instead */export var FILTER_SORT_OPTIONS="".concat(FILTER,".").concat(SORT);export var PORTAL_FILTER_PRICE_RANGE=FILTER_PRICE_RANGE;export var PORTAL_FILTER_PRICE_RANGE_BEFORE=FILTER_PRICE_RANGE_BEFORE;export var PORTAL_FILTER_PRICE_RANGE_AFTER=FILTER_PRICE_RANGE_AFTER;export var PORTAL_FILTER_SORT_OPTIONS=FILTER_SORT_OPTIONS;export var PORTAL_FILTER_SELECTOR="".concat(FILTER,".").concat(SELECTOR);export var PORTAL_FILTER_SELECTOR_BEFORE="".concat(FILTER,".").concat(SELECTOR,".").concat(BEFORE);export var PORTAL_FILTER_SELECTOR_AFTER="".concat(FILTER,".").concat(SELECTOR,".").concat(AFTER);export var PORTAL_FILTER_APPLY_BUTTON="".concat(FILTER,".").concat(APPLY_BUTTON);export var PORTAL_FILTER_APPLY_BUTTON_BEFORE="".concat(FILTER,".").concat(APPLY_BUTTON,".").concat(BEFORE);export var PORTAL_FILTER_APPLY_BUTTON_AFTER="".concat(FILTER,".").concat(APPLY_BUTTON,".").concat(AFTER);export var PORTAL_FILTER_RESET_BUTTON="".concat(FILTER,".").concat(RESET_BUTTON);export var PORTAL_FILTER_RESET_BUTTON_BEFORE="".concat(FILTER,".").concat(RESET_BUTTON,".").concat(BEFORE);export var PORTAL_FILTER_RESET_BUTTON_AFTER="".concat(FILTER,".").concat(RESET_BUTTON,".").concat(AFTER);export var PORTAL_FILTER_PAGE_CONTENT="".concat(FILTER,".").concat(PAGE_CONTENT);export var PORTAL_FILTER_PAGE_CONTENT_BEFORE="".concat(FILTER,".").concat(PAGE_CONTENT,".").concat(BEFORE);export var PORTAL_FILTER_PAGE_CONTENT_AFTER="".concat(FILTER,".").concat(PAGE_CONTENT,".").concat(AFTER);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-common-commerce",
|
|
3
|
-
"version": "7.20.
|
|
3
|
+
"version": "7.20.1",
|
|
4
4
|
"description": "Commerce library for the Shopgate Connect PWA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"reselect": "^3.0.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@shopgate/pwa-common": "7.20.
|
|
23
|
-
"@shopgate/pwa-core": "7.20.
|
|
22
|
+
"@shopgate/pwa-common": "7.20.1",
|
|
23
|
+
"@shopgate/pwa-core": "7.20.1",
|
|
24
24
|
"lodash": "^4.17.4",
|
|
25
25
|
"react": "~16.12.0",
|
|
26
26
|
"react-dom": "~16.12.0"
|
|
@@ -4,4 +4,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){
|
|
|
4
4
|
*/export default function search(subscribe){subscribe(searchRequesting$,function(){LoadingProvider.setLoading(SEARCH_PATTERN);});subscribe(searchReceived$,function(){LoadingProvider.unsetLoading(SEARCH_PATTERN);});subscribe(searchBasedRouteWillEnter$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var _action$route;var action,dispatch,getState,filters,searchPhrase,sort,category,_getProductsResult,hash,expired;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:action=_ref.action,dispatch=_ref.dispatch,getState=_ref.getState;if([ACTION_PUSH,ACTION_REPLACE].includes(action===null||action===void 0?void 0:action.historyAction)){_context.next=3;break;}return _context.abrupt("return");case 3:filters=action.route.state.filters;searchPhrase=action.route.query.s;sort=action.route.query.sort;if(!(action.route.pattern===CATEGORY_ALL_PATTERN)){_context.next=14;break;}searchPhrase='*';if(filters){_context.next=14;break;}_context.next=11;return dispatch(fetchCategory(hex2bin(action.route.params.categoryId)));case 11:category=_context.sent;filters=getShowAllProductsFilters(category);router.update(action.route.id,{filters:filters,categoryName:category.name});case 14:_getProductsResult=getProductsResult(getState(),_extends({searchPhrase:searchPhrase,routeId:action===null||action===void 0?void 0:(_action$route=action.route)===null||_action$route===void 0?void 0:_action$route.id},buildFetchSearchResultsParams())),hash=_getProductsResult.hash,expired=_getProductsResult.expired;if(expired){dispatch(expireProductsByHash(hash));}dispatch(fetchSearchResults(_extends({filters:filters,searchPhrase:searchPhrase,sort:sort},buildFetchSearchResultsParams())));dispatch(fetchFilters({filters:buildFilterParamsForFetchFiltersRequest(filters)}));case 18:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());// No logic related to "show all products" necessary here, since stream only emits when
|
|
5
5
|
// location based shopping is active. That's currently only supported when new services are
|
|
6
6
|
// used, but the new services don't support "show all products".
|
|
7
|
-
subscribe(searchProductsNeedUpdate$,function(_ref3){var dispatch=_ref3.dispatch,getState=_ref3.getState;var _getCurrentRoute=getCurrentRoute(getState()),query=_getCurrentRoute.query,filters=_getCurrentRoute.state.filters;var
|
|
7
|
+
subscribe(searchProductsNeedUpdate$,function(_ref3){var dispatch=_ref3.dispatch,getState=_ref3.getState;var _getCurrentRoute=getCurrentRoute(getState()),query=_getCurrentRoute.query,filters=_getCurrentRoute.state.filters,pattern=_getCurrentRoute.pattern;var sort=query.sort;var searchPhrase=query.s;if(pattern===CATEGORY_ALL_PATTERN){searchPhrase='*';}dispatch(fetchSearchResults(_extends({filters:filters,searchPhrase:searchPhrase,sort:sort},buildFetchSearchResultsParams())));});subscribe(searchBasedFiltersDidUpdateFromFilterPage$,function(_ref4){var dispatch=_ref4.dispatch,action=_ref4.action;var filters=action.route.state.filters;var pattern=action.route.pattern;var sort=action.route.query.sort;var searchPhrase=action.route.query.s;if(pattern===CATEGORY_ALL_PATTERN){searchPhrase='*';}dispatch(fetchSearchResults(_extends({filters:filters,searchPhrase:searchPhrase,sort:sort},buildFetchSearchResultsParams())));});}
|