@lancom/shared 0.0.249 → 0.0.251

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.
@@ -132,34 +132,34 @@ export default {
132
132
  return _post(`admin/orders/pick-pdf`, { orders });
133
133
  },
134
134
  saveOrderSubsequentInvoice(order, invoice) {
135
- return invoice._id ? _put(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice/${invoice._id}`, invoice) : _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice`, invoice);
135
+ return invoice._id ? _put(`admin/shop/${order.shop}/order/${order._id}/invoice/${invoice._id}`, invoice) : _post(`admin/shop/${order.shop}/order/${order._id}/invoice`, invoice);
136
136
  },
137
137
  sendOrderSubsequentInvoice(order, invoice) {
138
- return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice/${invoice}/send`);
138
+ return _post(`admin/shop/${order.shop}/order/${order._id}/invoice/${invoice}/send`);
139
139
  },
140
- exportOrderToShippingService(order, shipment) {
141
- return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-shipping-service`, shipment);
140
+ exportOrderToStarshipit(order, shipment) {
141
+ return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-starshipit`, shipment);
142
142
  },
143
143
  markShipmentAsDispatched(order, shipment) {
144
- return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
144
+ return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
145
145
  },
146
146
  markSubOrderAsDispatched(order, subOrder) {
147
- return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/sub-order/${subOrder._id}/dispatched`, subOrder);
147
+ return _post(`admin/shop/${order.shop}/order/${order._id}/sub-order/${subOrder._id}/dispatched`, subOrder);
148
148
  },
149
149
  generateDuplicateOrderCode(order) {
150
150
  return _get(`admin/order/${order}/duplicate-code`);
151
151
  },
152
152
  sendShipmentTracking(order, shipment, tracking) {
153
- return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
153
+ return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
154
154
  },
155
- removeShipment(order, shipment) {
156
- return _delete(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
155
+ removeShipmentFromStarshipit(order, shipment) {
156
+ return _delete(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
157
157
  },
158
158
  calculateShipmentRates(order, shipment) {
159
- return _get(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/calculate-shipping`);
159
+ return _get(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/calculate-shipping`);
160
160
  },
161
161
  createPrintLabels(order, shipment, rate) {
162
- return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/print-labels`, rate);
162
+ return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/print-labels`, rate);
163
163
  },
164
164
  createOrderRefund(order, refund, shop) {
165
165
  return _post(`shop/${shop}/order/${order}/refund`, refund);
@@ -1,4 +1,4 @@
1
1
  export const COUNTRIES_CODES = {
2
2
  Australia: 'AU',
3
- 'United Kingdom': 'GB'
3
+ 'United Kingdom': 'UK'
4
4
  };
@@ -177,7 +177,7 @@ html[dir=rtl] .form-icon-left {
177
177
  height: 50px;
178
178
  border-width: 1px;
179
179
  border-style: solid;
180
- border-color: $grey_3;
180
+ border-color: #EFF1F2;
181
181
  border-radius: 5px;
182
182
  font-style: normal;
183
183
  font-weight: normal;
@@ -424,7 +424,7 @@ html[dir=rtl] .textarea {
424
424
  }
425
425
  &__tags {
426
426
  min-height: 50px;
427
- border: 1px solid $grey_3;
427
+ border: 1px solid #e5e5e5;
428
428
  border-radius: 8px !important;
429
429
  padding: 19px 3px 4px 20px;
430
430
  }
@@ -1,5 +1,3 @@
1
- @import "@/assets/scss/variables";
2
-
3
1
  .tooltip {
4
2
  display: block !important;
5
3
  z-index: 10000;
@@ -27,7 +25,7 @@
27
25
  &.white &-inner {
28
26
  background: #FFF !important;
29
27
  color: #575872 !important;
30
- border: 1px solid $grey_3 !important;
28
+ border: 1px solid #EFF1F2 !important;
31
29
  }
32
30
  &.white &-arrow {
33
31
  border-color: #FFF !important;
@@ -15,7 +15,7 @@ $white_high_emphasis: #FFFFFF;
15
15
  $white_medium_emphasis: rgba(255, 255, 255, .66);
16
16
  $gray: #575872 !default;
17
17
  $medium_gray: #B0B0BA !default;
18
- $light_gray: #F9F9FC;
18
+ $light_gray: #F9F9FC !default;
19
19
  $link: #5D89A9;
20
20
  $error: #E44868;
21
21
  $secondary_900: #20303C;
@@ -52,8 +52,8 @@ $black: #343750 !default;
52
52
  $gray_main: #616277 !default;
53
53
  $grey_1: #616277 !default;
54
54
  $grey_2: #B0B0BA !default;
55
- $grey_3: #EFF1F2;
56
- $grey_4: #F9F9FC;
55
+ $grey_3: #EFF1F2 !default;
56
+ $grey_4: #F9F9FC !default;
57
57
  $grey_5: #9898A5 !default;
58
58
 
59
59
  $white: #fff;
@@ -203,7 +203,7 @@
203
203
  <input
204
204
  id="country"
205
205
  ref="country"
206
- :value="address.country === 'Australia' ? 'Only Australia' : address.country"
206
+ value="Only Australia"
207
207
  name="country"
208
208
  type="country"
209
209
  class="form-field filled labelless"
@@ -296,7 +296,6 @@ export default {
296
296
  this.$set(this.address, 'state', suburb.state);
297
297
  this.$set(this.address, 'postcode', suburb.postcode);
298
298
  this.$set(this.address, 'city', suburb.locality);
299
- this.$set(this.address, 'country', suburb.country);
300
299
  }
301
300
  },
302
301
  handleSuburbChange(suburb) {
@@ -98,7 +98,7 @@ export default {
98
98
  company: null,
99
99
  additionalInfo: null,
100
100
  suburb: null,
101
- country: null,
101
+ country: 'Australia',
102
102
  state: null,
103
103
  postcode: null
104
104
  };
@@ -86,8 +86,6 @@
86
86
  </template>
87
87
 
88
88
  <script>
89
- let interval = null;
90
-
91
89
  export default {
92
90
  name: 'Payment',
93
91
  props: {
@@ -110,17 +108,14 @@ export default {
110
108
  fields: null
111
109
  };
112
110
  },
113
- async mounted() {
111
+ mounted() {
114
112
  this.loading = true;
115
-
116
- await this.preloadPinpayments();
117
-
118
113
  if (window.HostedFields) {
119
- await this.initHostedPayment();
114
+ this.initHostedPayment();
120
115
  } else {
121
- window.addEventListener('load', async () => {
116
+ window.addEventListener('load', () => {
122
117
  if (!this.fields) {
123
- await this.initHostedPayment();
118
+ this.initHostedPayment();
124
119
  }
125
120
  });
126
121
  }
@@ -199,31 +194,7 @@ export default {
199
194
  }
200
195
  );
201
196
  });
202
- },
203
- async preloadPinpayments() {
204
- if (!window.HostedFields) {
205
- clearInterval(interval);
206
- await this.loadPinpayments();
207
- await new Promise((resolve, reject) => {
208
- interval = setInterval(() => {
209
- if (window.HostedFields) {
210
- clearInterval(interval);
211
- resolve()
212
- }
213
- }, 100);
214
- });
215
- }
216
- },
217
- loadPinpayments() {
218
- return new Promise((resolve) => {
219
- const script = document.createElement('script');
220
- script.type = "text/javascript";
221
- script.src = 'https://cdn.pinpayments.com/pin.hosted_fields.v1.js';
222
- script.onload = () => resolve();
223
- const body = document.getElementsByTagName('body')[0];
224
- body.appendChild(script);
225
- });
226
- }
197
+ }
227
198
  }
228
199
  };
229
200
  </script>
@@ -88,9 +88,6 @@ export default {
88
88
  },
89
89
  filters: { highlight },
90
90
  props: {
91
- country: {
92
- type: Object
93
- },
94
91
  value: {
95
92
  type: String
96
93
  },
@@ -150,8 +147,7 @@ export default {
150
147
  async handleSearch(query) {
151
148
  if (query.length) {
152
149
  this.isLoading = true;
153
- const country = this.country ? (this.country.isoCode === 'GB' ? 'England' : (this.country.name || this.country)) : 'Australia';
154
- this.suburbs = await api.fetchSuburbs({ query, country });
150
+ this.suburbs = await api.fetchSuburbs({ query });
155
151
  this.options = this.suburbs.map(this.createOptionFromSuburb);
156
152
  this.isLoading = false;
157
153
  } else {
@@ -36,7 +36,7 @@
36
36
  {{ order.postcode }},
37
37
  {{ order.state }},
38
38
  {{ order.city }},
39
- {{ order.country || 'Australia'}}
39
+ Australia
40
40
  </span>
41
41
  </div>
42
42
  </div>
@@ -18,9 +18,7 @@
18
18
  </component>
19
19
  </template>
20
20
  </tabs>
21
- <div
22
- v-if="productAvailableInCurrentCountry"
23
- class="Editor__footer">
21
+ <div class="Editor__footer">
24
22
  <btn
25
23
  btn-label="Start again"
26
24
  btn-class="white"
@@ -137,12 +135,8 @@ export default {
137
135
  ...mapGetters('layers', [
138
136
  'layerThumbnails'
139
137
  ]),
140
- productAvailableInCurrentCountry() {
141
- const { countries } = this.product;
142
- return !(countries || []).length || countries.includes(this.country._id);
143
- },
144
138
  addToCartDisabled() {
145
- return !this.usedSimpleProducts.length || (this.product.printOnly && !this.template.layers.length);
139
+ return !(this.template.layers.length && this.usedSimpleProducts.length);
146
140
  }
147
141
  },
148
142
  watch: {
@@ -47,10 +47,4 @@
47
47
  text-align: center;
48
48
  }
49
49
  }
50
- &__available-warning {
51
- background-color: $error;
52
- color: $white;
53
- padding: 10px;
54
- margin-top: 10px;
55
- }
56
50
  }
@@ -61,13 +61,8 @@
61
61
  </div>
62
62
  </div>
63
63
  </div>
64
- <div
65
- v-if="!productAvailableInCurrentCountry"
66
- class="EditorProductDetails__available-warning">
67
- Product Not Available in {{ country.name }}
68
- </div>
69
64
  <fragment
70
- v-if="productDetailsLoaded && productAvailableInCurrentCountry">
65
+ v-if="productDetailsLoaded">
71
66
  <div class="EditorProductDetails__section">
72
67
  <product-colors-selector />
73
68
  </div>
@@ -117,13 +112,8 @@ export default {
117
112
  'layerThumbnails'
118
113
  ]),
119
114
  ...mapGetters([
120
- 'pricingSettings',
121
- 'country'
115
+ 'pricingSettings'
122
116
  ]),
123
- productAvailableInCurrentCountry() {
124
- const { countries } = this.product;
125
- return !(countries || []).length || countries.includes(this.country._id);
126
- },
127
117
  productLink() {
128
118
  return generateProductLink(this.product);
129
119
  },
@@ -111,7 +111,7 @@ export default {
111
111
  </script>
112
112
 
113
113
  <style lang="scss">
114
- @import "@/assets/scss/variables";
114
+ @import "@lancom/shared/assets/scss/variables";
115
115
  $types: delivery, general, other, printing, garments;
116
116
  .FAQ {
117
117
  &__wrapper {
@@ -218,7 +218,7 @@ $types: delivery, general, other, printing, garments;
218
218
  &-body {
219
219
  padding: 6px 30px 24px 30px;
220
220
  line-height: 27px;
221
- color: $grey_1;
221
+ color: $gray;
222
222
  overflow: hidden;
223
223
  @import "@lancom/shared/assets/scss/normalize";
224
224
  }
@@ -127,11 +127,11 @@
127
127
  {{ errors[0] }}
128
128
  </span>
129
129
  </validation-provider>
130
- <div v-if="suburb" class="form-row">
130
+ <div class="form-row">
131
131
  <input
132
132
  id="country"
133
133
  ref="country"
134
- :value="suburb.country"
134
+ value="Only Australia"
135
135
  name="country"
136
136
  type="country"
137
137
  class="form-field filled labelless"
@@ -303,9 +303,6 @@ export default {
303
303
  mounted() {
304
304
  if (this.orderData) {
305
305
  this.form = {
306
- state: null,
307
- country: null,
308
- postcode: null,
309
306
  city: this.orderData.city,
310
307
  phone: this.orderData.phone,
311
308
  addressLine1: this.orderData.addressLine1,
@@ -328,18 +325,8 @@ export default {
328
325
  ...mapActions('cart', [
329
326
  'calculateCartPrice'
330
327
  ]),
331
- setAddressSuburb(suburb) {
332
- this.$set(this.form, 'suburb', suburb);
333
- if (suburb) {
334
- this.$set(this.form, 'state', suburb.state);
335
- this.$set(this.form, 'postcode', suburb.postcode);
336
- this.$set(this.form, 'city', suburb.locality);
337
- this.$set(this.form, 'country', suburb.country);
338
- }
339
- },
340
328
  handleSuburbChange(suburb) {
341
329
  this.form.suburb = suburb;
342
- this.setAddressSuburb(suburb);
343
330
  this.setSuburb(suburb);
344
331
  this.calculateCartPrice({ shop: this.shop });
345
332
  },
@@ -348,7 +335,6 @@ export default {
348
335
  },
349
336
  async submit() {
350
337
  try {
351
- debugger;
352
338
  this.processing = true;
353
339
  const recaptchaToken = await this.getRecaptcha('create_order');
354
340
  await this.createOrder({
@@ -10,21 +10,20 @@
10
10
  right: 0;
11
11
  top: 41px;
12
12
  padding: 10px;
13
- background-color: white;
14
- border: 1px solid $medium_gray;
15
- z-index: 999;
13
+ background-color: $black;
14
+ color: $white;
16
15
  }
17
16
  &__result-item {
18
17
  padding-bottom: 10px;
19
18
  margin-bottom: 10px;
20
- border-bottom: 1px solid $medium_gray;
19
+ border-bottom: 1px solid $gray_main;
21
20
  &:last-child {
22
21
  border-bottom: none;
23
22
  margin-bottom: 0px;
24
23
  }
25
24
  ::v-deep {
26
25
  a {
27
- color: $gray_main;
26
+ color: $white;
28
27
  font-size: 13px;
29
28
  text-decoration: none;
30
29
  }
@@ -34,22 +33,24 @@
34
33
  padding: 10px;
35
34
  text-align: center;
36
35
  display: block;
37
- background-color: $black;
38
- color: $white !important;
36
+ background-color: $white;
39
37
  &:hover {
40
- background-color: $white;
41
- color: $black !important;
38
+ background-color: $black;
39
+ color: $white;
42
40
  }
43
41
  }
44
42
  }
45
43
  &__input {
46
44
  input {
47
- border-color: $medium_gray;
45
+ background-color: #535353;
46
+ border: none;
48
47
  border-radius: 0px;
48
+ color: $white;
49
49
  height: 41px;
50
50
  position: relative;
51
51
  z-index: 1;
52
52
  &::placeholder {
53
+ font-weight: 600;
53
54
  font-size: 14px;
54
55
  color: $grey_3;
55
56
  }
@@ -60,6 +61,7 @@
60
61
  right: 10px;
61
62
  font-size: 17px;
62
63
  pointer-events: none;
64
+ color: $white;
63
65
  &.icon-search {
64
66
  z-index: 2;
65
67
  pointer-events: all;
@@ -354,7 +354,7 @@ export default {
354
354
  email: '',
355
355
  phone: '',
356
356
  suburb: null,
357
- country: null
357
+ country: 'Australia'
358
358
  },
359
359
  expectedItemsQuantity: null,
360
360
  description: '',
@@ -2,10 +2,7 @@ async function googleLocalShoppingFeed(axios, config, availableStores) {
2
2
  const result = await googleShoppingFeed(axios, config, availableStores);
3
3
 
4
4
  const fields = [
5
- // 'title',
6
- // 'description',
7
5
  'g:availability',
8
- // 'g:link_template',
9
6
  'g:id',
10
7
  'g:pickup_method',
11
8
  'g:pickup_sla',
@@ -14,11 +11,7 @@ async function googleLocalShoppingFeed(axios, config, availableStores) {
14
11
  'g:store_code'
15
12
  ];
16
13
  result.rss.channel.item = result.rss.channel.item
17
- .map(i => fields
18
- .reduce((item, field) => ({
19
- ...item,
20
- [field]: i[field],
21
- }), {}));
14
+ .map(i => fields.reduce((item, field) => ({ ...item, [field]: i[field] }), {}));
22
15
  return result;
23
16
  }
24
17
  async function googleShoppingFeed(axios, config, availableStores) {
@@ -34,10 +34,7 @@ const metaInfo = {
34
34
  }
35
35
  },
36
36
  head() {
37
- const hasQueryParams = Object
38
- .keys(this.$route.query || {})
39
- .filter(key => !['color', 'store'].includes(`${key || ''}`.toLowerCase()))
40
- .length > 0;
37
+ const hasQueryParams = Object.keys(this.$route.query || {}).length > 0;
41
38
 
42
39
  const { short_text: shortText, image, meta = {} } = this.routeInfo || {};
43
40
  const pageItemMeta = this.pageItem?.meta || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.249",
3
+ "version": "0.0.251",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
@@ -1,4 +1,6 @@
1
1
  module.exports = function (req, res, next) {
2
- res.setHeader('Cache-Control', `max-age=${86400}`); // 1 day
2
+ if (!/auth\=/.test(req.headers?.cookie || '')) {
3
+ res.setHeader('Cache-Control', `max-age=${86400}`); // 1 day
4
+ }
3
5
  next();
4
6
  };
package/store/product.js CHANGED
@@ -160,7 +160,6 @@ export const actions = {
160
160
  commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize });
161
161
  }
162
162
  } catch (e) {
163
- console.log(e);
164
163
  const { status, data } = e?.response || {};
165
164
  const statusCode = status || 500;
166
165
  commit('setLoadError', {