@lancom/shared 0.0.447 → 0.0.449

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.
@@ -2,6 +2,8 @@ import { mapGetters } from 'vuex';
2
2
  import ImageViewer from '@lancom/shared/components/common/image_viewer/image-viewer';
3
3
  import { staticLink } from '@lancom/shared/assets/js/utils/filters';
4
4
  import { getProductColorImages } from '@lancom/shared/assets/js/utils/product';
5
+ import { isValidImageType } from '@lancom/shared/assets/js/utils/colors';
6
+ import { COLORS_IMAGES_TYPES } from '@lancom/shared/assets/js/constants/colors';
5
7
 
6
8
  export default {
7
9
  props: {
@@ -40,6 +42,12 @@ export default {
40
42
  images() {
41
43
  return getProductColorImages(this.group, this.group.color);
42
44
  },
45
+ hasFrontImage() {
46
+ return this.images.some(image => isValidImageType(image, COLORS_IMAGES_TYPES.FRONT));
47
+ },
48
+ hasBackImage() {
49
+ return this.images.some(image => isValidImageType(image, COLORS_IMAGES_TYPES.BACK));
50
+ },
43
51
  product() {
44
52
  return this.group.product;
45
53
  },
@@ -59,7 +67,7 @@ export default {
59
67
  }, 0);
60
68
  },
61
69
  simpleProductWithInvalidStock() {
62
- return this.simpleProductsWithAmount.filter(({ amount, quantityStock }) => amount > quantityStock)
70
+ return this.simpleProductsWithAmount.filter(({ amount, quantityStock }) => amount > quantityStock);
63
71
  }
64
72
  },
65
73
  methods: {
@@ -7,6 +7,7 @@
7
7
  </div>
8
8
  <div class="CartEntityColorSimpleProducts__image-wrapper">
9
9
  <div
10
+ v-if="hasFrontImage"
10
11
  class="CartEntityColorSimpleProducts__image"
11
12
  @click="showImage(images, 0)">
12
13
  <product-side-with-print
@@ -17,7 +18,7 @@
17
18
  size="medium" />
18
19
  </div>
19
20
  <div
20
- v-if="entity && entity.printsThumbnails && entity.printsThumbnails.back"
21
+ v-if="entity && entity.printsThumbnails && entity.printsThumbnails.back && hasBackImage"
21
22
  class="CartEntityColorSimpleProducts__image"
22
23
  @click="showImage(images, 1)">
23
24
  <product-side-with-print
@@ -46,7 +46,7 @@
46
46
  <div>{{ rate.name }}</div>
47
47
  <div
48
48
  v-if="rate.note"
49
- class="lc_regular10">
49
+ class="lc_regular12">
50
50
  {{ rate.note }}
51
51
  </div>
52
52
  </div>
@@ -30,7 +30,7 @@
30
30
  <div
31
31
  v-if="!isAvailableForPickupSomeProducts"
32
32
  class="CartShipping__pickup-warnings">
33
- Pickup only available for "Code Red" brand
33
+ Pickup only available for "{{ pickupBrand }}" brand
34
34
  </div>
35
35
  <div
36
36
  v-if="visiblePickupError && hasNotValidProductsPickup"
@@ -84,6 +84,9 @@ export default {
84
84
  'cartPricing',
85
85
  'cartPricingError'
86
86
  ]),
87
+ pickupBrand() {
88
+ return this.SETTINGS.DEFAULT_PICKUP_BRAND || 'Code Red';
89
+ },
87
90
  postcodeInfoLabel() {
88
91
  return this.MESSAGES.CART_POSTCODE_INFO || 'Enter postcode to calculate shipping';
89
92
  },
@@ -122,7 +125,7 @@ export default {
122
125
  return this.notValidProductsPickupBySKU.length === 0 || this.notValidProductsPickupBySKU.length !== grouped?.length;
123
126
  }
124
127
  },
125
- mounted() {
128
+ created() {
126
129
  if (!this.isAvailableForPickupSomeProducts) {
127
130
  this.wantsToPickup = false;
128
131
  }
@@ -27,12 +27,25 @@
27
27
  }
28
28
  }
29
29
  }
30
- &__clearance-message {
30
+ &__clearance-messages {
31
31
  padding: 10px;
32
32
  text-align: center;
33
33
  border-top: 1px solid #E5E5E5;
34
- font-size: 13px;
35
- color: #0b7d2f;
34
+ }
35
+ &__clearance-message {
36
+ background-color: #fff3cd;
37
+ color: #856404;
38
+ border: 1px solid #ffeaa7;
39
+ font-size: 14px;
40
+ font-weight: 500;
41
+ line-height: 20px;
42
+ padding: 4px 12px;
43
+ text-align: center;
44
+ border-radius: 4px;
45
+ margin-top: 5px;
46
+ display: flex;
47
+ flex-direction: column;
48
+ gap: 5px;
36
49
  }
37
50
  &__footer {
38
51
  background: $green;
@@ -70,14 +70,18 @@
70
70
  </div>
71
71
  </div>
72
72
  <div
73
- v-if="product.isClearance"
74
- class="EditorPricing__clearance-message">
75
- Product is non-returnable clearance product
76
- </div>
77
- <div
78
- v-if="clearanceColorsWithQty.length"
79
- class="EditorPricing__clearance-message">
80
- {{ clearanceColorsWithQty.length > 1 ? 'Colours' : 'Colour' }}: {{ clearanceColorsText }} {{ clearanceColorsWithQty.length > 1 ? 'are' : 'is' }} non-returnable clearance {{ clearanceColorsWithQty.length > 1 ? 'colours' : 'colour' }}
73
+ v-if="product.isClearance || clearanceColorsWithQty.length > 0"
74
+ class="EditorPricing__clearance-messages">
75
+ <div
76
+ v-if="product.isClearance"
77
+ class="EditorPricing__clearance-message">
78
+ Product is non-returnable clearance product
79
+ </div>
80
+ <div
81
+ v-if="clearanceColorsWithQty.length"
82
+ class="EditorPricing__clearance-message">
83
+ {{ clearanceColorsWithQty.length > 1 ? 'Colours' : 'Colour' }}: {{ clearanceColorsText }} {{ clearanceColorsWithQty.length > 1 ? 'are' : 'is' }} non-returnable clearance {{ clearanceColorsWithQty.length > 1 ? 'colours' : 'colour' }}
84
+ </div>
81
85
  </div>
82
86
  <div
83
87
  v-if="hasPricing"
@@ -55,7 +55,7 @@
55
55
  <div>{{ rate.name }}</div>
56
56
  <div
57
57
  v-if="rate.note"
58
- class="lc_regular10">
58
+ class="lc_regular12">
59
59
  {{ rate.note }}
60
60
  </div>
61
61
  </div>
@@ -125,7 +125,7 @@ export default {
125
125
  usedSimpleProducts: {
126
126
  handler() {
127
127
  const currentSignature = this.buildSignature();
128
- if (this.hasSelection && currentSignature !== this.lastUsedSimpleProductsSignature) {
128
+ if (this.hasSelection && currentSignature !== this.lastUsedSimpleProductsSignature && this.currentSignature?.length) {
129
129
  if (this.pricing) {
130
130
  this.recalcNeeded = true;
131
131
  } else {
@@ -138,7 +138,9 @@ export default {
138
138
  },
139
139
  value() {
140
140
  if (this.pricing) {
141
- this.recalcNeeded = true;
141
+ if (this.value?.size && this.value?.quantity) {
142
+ this.recalcNeeded = true;
143
+ }
142
144
  } else {
143
145
  this.calculateShipping();
144
146
  }
@@ -186,7 +188,6 @@ export default {
186
188
  currency: this.currency?._id
187
189
  };
188
190
  this.pricing = await api.calculateProductPrice(payload, this.shop._id);
189
- this.lastUsedSimpleProductsSignature = this.buildSignature(usedSimpleProducts);
190
191
  } catch (e) {
191
192
  this.pricing = null;
192
193
  } finally {
@@ -135,8 +135,8 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
135
135
  }
136
136
  }
137
137
 
138
- if (product.country) {
139
- info['g:shipping_label'] = product.country;
138
+ if (product.country || sp.shippingLabel) {
139
+ info['g:shipping_label'] = sp.shippingLabel || product.country;
140
140
  }
141
141
 
142
142
  if (allowSameDayDelivery && product.sameDayDelivery) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.447",
3
+ "version": "0.0.449",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {