@shopgate/pwa-common-commerce 7.32.0-beta.5 → 7.32.0-beta.7

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,6 +1,6 @@
1
1
  /**
2
- * Check if shipping line should be shown
3
- * @param {Object} cartConfig shippingConfig
2
+ * Check if tax line should be shown
3
+ * @param {Object} cartConfig cartConfig
4
4
  * @param {Object} tax tax
5
5
  * @returns {Object|null}
6
6
  */
@@ -153,10 +153,10 @@ export default function cart(subscribe) {
153
153
  message,
154
154
  handled,
155
155
  code,
156
- additionalParams,
157
- translated,
158
- context
156
+ translated
159
157
  } = errors[0];
158
+ const context = errors[0].context || errors[0].pipeline;
159
+ const additionalParams = errors[0].additionalParams || errors[0].messageParams || {};
160
160
 
161
161
  // Some errors are already handled automatically before
162
162
  if (handled) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common-commerce",
3
- "version": "7.32.0-beta.5",
3
+ "version": "7.32.0-beta.7",
4
4
  "description": "Commerce library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -20,8 +20,8 @@
20
20
  "reselect": "^4.1.8"
21
21
  },
22
22
  "devDependencies": {
23
- "@shopgate/pwa-common": "7.32.0-beta.5",
24
- "@shopgate/pwa-core": "7.32.0-beta.5",
23
+ "@shopgate/pwa-common": "7.32.0-beta.7",
24
+ "@shopgate/pwa-core": "7.32.0-beta.7",
25
25
  "@types/lodash": "^4.17.24",
26
26
  "lodash": "^4.17.23",
27
27
  "react": "^17.0.2",
package/product/index.js CHANGED
@@ -15,7 +15,6 @@ export { default as fetchProductShipping } from "./actions/fetchProductShipping"
15
15
  export { default as fetchProductVariants } from "./actions/fetchProductVariants";
16
16
 
17
17
  // COLLECTIONS
18
- export { default as productImageFormats } from "./collections/ProductImageFormats";
19
18
 
20
19
  // CONSTANTS
21
20
  export * from "./constants/index";
@@ -1,63 +0,0 @@
1
- import "core-js/modules/es.array.reduce.js";
2
- /**
3
- * Class to maintain the image formats
4
- * @deprecated not used anymore. Kept for backwards compatibility.
5
- */
6
- let ProductImageFormats = /*#__PURE__*/function () {
7
- /**
8
- * Constructor.
9
- */
10
- function ProductImageFormats() {
11
- this.formats = [];
12
- this.map = new Map();
13
- }
14
-
15
- /**
16
- * Returns all formats.
17
- * @returns {Array}
18
- */
19
- var _proto = ProductImageFormats.prototype;
20
- _proto.getAllUniqueFormats = function getAllUniqueFormats() {
21
- const hashes = [];
22
- return Array.from(this.map.values()).reduce((prev, val) => [].concat(prev, val), []).filter(val => {
23
- const hash = JSON.stringify(val);
24
- if (hashes.indexOf(hash) === -1) {
25
- hashes.push(hash);
26
- return true;
27
- }
28
- return false;
29
- });
30
- }
31
-
32
- /**
33
- * @param {string} key key of format to get
34
- * @returns {Object} format
35
- */;
36
- _proto.get = function get(key) {
37
- return this.map.get(key);
38
- }
39
-
40
- /**
41
- * @param {string} key key of format
42
- * @param {Object} value value of format
43
- * @returns {Object}
44
- */;
45
- _proto.set = function set(key, value) {
46
- return this.map.set(key, value);
47
- }
48
-
49
- /**
50
- * Removes a format from the list of persisted formats.
51
- * @param {string} key The key of the format to remove.
52
- * @returns {ProductImageFormats}
53
- */;
54
- _proto.remove = function remove(key) {
55
- this.map.remove(key);
56
- return this;
57
- };
58
- return ProductImageFormats;
59
- }();
60
- /**
61
- * @deprecated
62
- */
63
- export default new ProductImageFormats();
@@ -1 +0,0 @@
1
- export { default as productImageFormats } from "./ProductImageFormats";