@lancom/shared 0.0.260 → 0.0.262

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.
Files changed (49) hide show
  1. package/assets/js/api/admin.js +11 -11
  2. package/assets/js/constants/country.js +1 -1
  3. package/assets/scss/ui_kit/_forms.scss +2 -2
  4. package/assets/scss/ui_kit/_tooltip.scss +1 -3
  5. package/assets/scss/variables/_theme.scss +3 -3
  6. package/components/asides/contact_us/contact-us.vue +6 -0
  7. package/components/checkout/cart/cart.mixin.js +5 -5
  8. package/components/checkout/cart/cart_price_info/cart-price-info.vue +2 -2
  9. package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
  10. package/components/checkout/order/address-form/address-form.vue +3 -4
  11. package/components/checkout/order/order-shipping-method/order-shipping-method.vue +2 -2
  12. package/components/checkout/order/order.vue +1 -1
  13. package/components/common/contacts-phone.vue +46 -0
  14. package/components/common/payment/payment_card/pinpayment/pinpayment.vue +5 -34
  15. package/components/common/postcode_select/postcode-select.vue +1 -5
  16. package/components/common/products_total_pricing/products-total-pricing.vue +1 -5
  17. package/components/design/approve_design_header/approve-design-header.vue +1 -1
  18. package/components/editor/editor.vue +2 -8
  19. package/components/editor/editor_pricing/editor-pricing.vue +2 -2
  20. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +7 -8
  21. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +5 -13
  22. package/components/editor/editor_product_details/editor-product-details.scss +0 -6
  23. package/components/editor/editor_product_details/editor-product-details.vue +2 -12
  24. package/components/faq/faq.vue +2 -2
  25. package/components/modals/order_modal/order-modal.vue +3 -17
  26. package/components/order/order_price/order-price.vue +3 -5
  27. package/components/order/order_prints_groups/order-prints-groups.vue +1 -3
  28. package/components/order/order_products_groups/order-products-groups.vue +1 -3
  29. package/components/order/order_refund_view/order-refund-view.vue +3 -5
  30. package/components/order/order_setup_groups/order-setup-groups.vue +2 -4
  31. package/components/order/order_sku_groups/order-sku-groups.vue +1 -3
  32. package/components/order/order_view/order-view.vue +6 -10
  33. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -3
  34. package/components/pricing/pricing_example/pricing-example.vue +3 -3
  35. package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.vue +2 -7
  36. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +2 -2
  37. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -3
  38. package/components/product/product_price_range/product-price-range.vue +5 -6
  39. package/components/product/product_prints_price_info/product-prints-price-info.vue +2 -2
  40. package/components/products/products_autocomplete/products-autocomplete.scss +12 -10
  41. package/components/quotes/quote_request/quote-request.vue +12 -5
  42. package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +4 -5
  43. package/components/subscribe/subscribe.vue +10 -1
  44. package/mixins/meta-info.js +1 -4
  45. package/mixins/products-price.js +2 -3
  46. package/package.json +1 -1
  47. package/store/cart.js +6 -7
  48. package/store/index.js +4 -15
  49. package/store/product.js +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.260",
3
+ "version": "0.0.262",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/cart.js CHANGED
@@ -148,9 +148,9 @@ export const actions = {
148
148
  await api.saveCart(payload, shop._id);
149
149
  commit('setEntities', entities);
150
150
  },
151
- async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, commit }, { shop, country }) {
151
+ async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, commit }, { shop }) {
152
152
  const selectedSuppliersWithRates = cartPricing?.shipping?.suppliersWithRates;
153
- const payload = generateCalculatePriceData(entities, suburb, null, coupon, selectedSuppliersWithRates, country);
153
+ const payload = generateCalculatePriceData(entities, suburb, null, coupon, selectedSuppliersWithRates);
154
154
  try {
155
155
  commit('setCartPricingCalculating', true);
156
156
  const response = await api.calculateProductPrice(payload, shop._id);
@@ -179,7 +179,7 @@ export const actions = {
179
179
  clearCart({ commit }) {
180
180
  commit('clearCart');
181
181
  },
182
- async selectRate({ state: { cartPricing, entities, suburb, coupon }, commit }, { supplier, rate, shop, country }) {
182
+ async selectRate({ state: { cartPricing, entities, suburb, coupon }, commit }, { supplier, rate, shop }) {
183
183
  const suppliersWithRates = cartPricing.shipping.suppliersWithRates
184
184
  .map(supplierWithRates => ({
185
185
  ...(
@@ -190,7 +190,7 @@ export const actions = {
190
190
  })
191
191
  : supplierWithRates)
192
192
  }));
193
- const payload = generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, null, country);
193
+ const payload = generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon);
194
194
  try {
195
195
  commit('setCartPricingCalculating', true);
196
196
  const response = await api.calculateProductPrice(payload, shop._id);
@@ -245,7 +245,7 @@ export const mutations = {
245
245
  }
246
246
  };
247
247
 
248
- function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, selectedSuppliersWithRates, country) {
248
+ function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, selectedSuppliersWithRates) {
249
249
  const getSimpleObj = i => i && ({ _id: i._id, name: i.name });
250
250
  return {
251
251
  entities: entities.map(({ _id, guid, prints, simpleProducts, product }) => ({
@@ -285,7 +285,6 @@ function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon
285
285
  address: suburb ? [suburb.locality, suburb.state, suburb.postcode].filter(i => !!i).join(', ') : null,
286
286
  coupon,
287
287
  suppliersWithRates,
288
- selectedSuppliersWithRates,
289
- country: country?._id
288
+ selectedSuppliersWithRates
290
289
  };
291
290
  }
package/store/index.js CHANGED
@@ -35,7 +35,6 @@ export const getters = {
35
35
  pricingSettings: ({ pricing }) => pricing || {},
36
36
  orderSettings: ({ orderInfo }) => orderInfo || {},
37
37
  gstTax: ({ pricing }) => pricing?.gstTax || 0,
38
- taxName: ({ pricing }) => pricing?.taxName || 'GST',
39
38
  displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
40
39
  screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
41
40
  depositInfo: ({ depositInfo }) => depositInfo || {}
@@ -56,14 +55,13 @@ export const actions = {
56
55
  commit('setCountry', settings.country);
57
56
  commit('setCurrency', settings.currency);
58
57
 
59
- const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
60
-
61
58
  if (process.env.PINPAYMENT_PUBLISHABLE_API_KEY) {
62
59
  commit('setPayment', {
63
60
  type: 'pinpayment',
64
61
  clientKey: process.env.PINPAYMENT_PUBLISHABLE_API_KEY
65
62
  });
66
63
  } else {
64
+ const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
67
65
  const countrySetting = countrySettings.settings.find(s => !!s.settings.app.STRIPE_PUBLIC_KEY);
68
66
  if (countrySetting) {
69
67
  commit('setPayment', {
@@ -73,13 +71,6 @@ export const actions = {
73
71
  }
74
72
  }
75
73
 
76
-
77
- const pricingSetting = (countrySettings?.settings || []).find(s => !!s.settings.pricing);
78
- commit('setPricing', {
79
- ...shop.settings.pricing,
80
- ...(pricingSetting?.settings?.pricing || {})
81
- });
82
-
83
74
  // }
84
75
  try {
85
76
  if (req.headers.cookie) {
@@ -108,7 +99,7 @@ export const actions = {
108
99
  commit('cart/setCoupon', coupon);
109
100
  } catch (e) {}
110
101
  }
111
- dispatch('cart/calculateCartPrice', { shop, country });
102
+ dispatch('cart/calculateCartPrice', { shop });
112
103
  }
113
104
  }
114
105
  const closedNotification = localStorage.getItem(CLOSED_NOTIFICATION);
@@ -130,17 +121,15 @@ export const mutations = {
130
121
  setPayment(state, payment) {
131
122
  state.payment = payment;
132
123
  },
133
- setPricing(state, pricing) {
134
- state.pricing = pricing;
135
- },
136
124
  setCountry(state, country) {
137
125
  state.country = country;
138
126
  },
139
127
  setCurrency(state, currency) {
140
128
  state.currency = currency;
141
129
  },
142
- setSettings(state, { contacts, notificationBar, discountPopup, order, depositInfo }) {
130
+ setSettings(state, { contacts, pricing, notificationBar, discountPopup, order, depositInfo }) {
143
131
  state.contacts = contacts;
132
+ state.pricing = pricing;
144
133
  state.orderInfo = order;
145
134
  state.notificationBar = notificationBar;
146
135
  state.discountPopup = discountPopup;
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', {
@@ -200,10 +199,10 @@ export const actions = {
200
199
  async updatePriceIncludeGST({ commit }, value) {
201
200
  commit('setPriceIncludeGST', value);
202
201
  },
203
- async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, { shop, country }) {
202
+ async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, shop) {
204
203
  commit('setCalculatingPrice', true);
205
204
  const entities = getProductsForCalculatePricing(product, getters.usedSimpleProducts, template.layers, isPrintPricing, true);
206
- const response = await api.calculateProductPrice({ entities, country: country?._id }, shop._id);
205
+ const response = await api.calculateProductPrice({ entities }, shop._id);
207
206
  commit('setProductPricing', response);
208
207
  commit('setCalculatingPrice', false);
209
208
  },