@lancom/shared 0.0.248 → 0.0.249
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.
- package/assets/js/api/admin.js +11 -11
- package/assets/js/constants/country.js +1 -1
- package/components/checkout/order/address-form/address-form.vue +2 -1
- package/components/checkout/order/order.vue +1 -1
- package/components/common/postcode_select/postcode-select.vue +5 -1
- package/components/design/approve_design_header/approve-design-header.vue +1 -1
- package/components/modals/order_modal/order-modal.vue +16 -2
- package/components/quotes/quote_request/quote-request.vue +1 -1
- package/feeds/google-shopping.js +8 -1
- package/package.json +1 -1
- package/plugins/cache-headers.js +4 -0
package/assets/js/api/admin.js
CHANGED
|
@@ -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}/order/${order._id}/invoice/${invoice._id}`, invoice) : _post(`admin/shop/${order.shop}/order/${order._id}/invoice`, 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);
|
|
136
136
|
},
|
|
137
137
|
sendOrderSubsequentInvoice(order, invoice) {
|
|
138
|
-
return _post(`admin/shop/${order.shop}/order/${order._id}/invoice/${invoice}/send`);
|
|
138
|
+
return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice/${invoice}/send`);
|
|
139
139
|
},
|
|
140
|
-
|
|
141
|
-
return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-
|
|
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);
|
|
142
142
|
},
|
|
143
143
|
markShipmentAsDispatched(order, shipment) {
|
|
144
|
-
return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
|
|
144
|
+
return _post(`admin/shop/${order.shop?._id || 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}/order/${order._id}/sub-order/${subOrder._id}/dispatched`, subOrder);
|
|
147
|
+
return _post(`admin/shop/${order.shop?._id || 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}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
|
|
153
|
+
return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
|
|
154
154
|
},
|
|
155
|
-
|
|
156
|
-
return _delete(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
|
|
155
|
+
removeShipment(order, shipment) {
|
|
156
|
+
return _delete(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
|
|
157
157
|
},
|
|
158
158
|
calculateShipmentRates(order, shipment) {
|
|
159
|
-
return _get(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/calculate-shipping`);
|
|
159
|
+
return _get(`admin/shop/${order.shop?._id || 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}/order/${order._id}/shipment/${shipment._id || shipment.guid}/print-labels`, rate);
|
|
162
|
+
return _post(`admin/shop/${order.shop?._id || 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);
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
<input
|
|
204
204
|
id="country"
|
|
205
205
|
ref="country"
|
|
206
|
-
value="Only Australia"
|
|
206
|
+
:value="address.country === 'Australia' ? 'Only Australia' : address.country"
|
|
207
207
|
name="country"
|
|
208
208
|
type="country"
|
|
209
209
|
class="form-field filled labelless"
|
|
@@ -296,6 +296,7 @@ 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);
|
|
299
300
|
}
|
|
300
301
|
},
|
|
301
302
|
handleSuburbChange(suburb) {
|
|
@@ -88,6 +88,9 @@ export default {
|
|
|
88
88
|
},
|
|
89
89
|
filters: { highlight },
|
|
90
90
|
props: {
|
|
91
|
+
country: {
|
|
92
|
+
type: Object
|
|
93
|
+
},
|
|
91
94
|
value: {
|
|
92
95
|
type: String
|
|
93
96
|
},
|
|
@@ -147,7 +150,8 @@ export default {
|
|
|
147
150
|
async handleSearch(query) {
|
|
148
151
|
if (query.length) {
|
|
149
152
|
this.isLoading = true;
|
|
150
|
-
this.
|
|
153
|
+
const country = this.country ? (this.country.isoCode === 'GB' ? 'England' : (this.country.name || this.country)) : 'Australia';
|
|
154
|
+
this.suburbs = await api.fetchSuburbs({ query, country });
|
|
151
155
|
this.options = this.suburbs.map(this.createOptionFromSuburb);
|
|
152
156
|
this.isLoading = false;
|
|
153
157
|
} else {
|
|
@@ -127,11 +127,11 @@
|
|
|
127
127
|
{{ errors[0] }}
|
|
128
128
|
</span>
|
|
129
129
|
</validation-provider>
|
|
130
|
-
<div class="form-row">
|
|
130
|
+
<div v-if="suburb" class="form-row">
|
|
131
131
|
<input
|
|
132
132
|
id="country"
|
|
133
133
|
ref="country"
|
|
134
|
-
value="
|
|
134
|
+
:value="suburb.country"
|
|
135
135
|
name="country"
|
|
136
136
|
type="country"
|
|
137
137
|
class="form-field filled labelless"
|
|
@@ -303,6 +303,9 @@ export default {
|
|
|
303
303
|
mounted() {
|
|
304
304
|
if (this.orderData) {
|
|
305
305
|
this.form = {
|
|
306
|
+
state: null,
|
|
307
|
+
country: null,
|
|
308
|
+
postcode: null,
|
|
306
309
|
city: this.orderData.city,
|
|
307
310
|
phone: this.orderData.phone,
|
|
308
311
|
addressLine1: this.orderData.addressLine1,
|
|
@@ -325,8 +328,18 @@ export default {
|
|
|
325
328
|
...mapActions('cart', [
|
|
326
329
|
'calculateCartPrice'
|
|
327
330
|
]),
|
|
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
|
+
},
|
|
328
340
|
handleSuburbChange(suburb) {
|
|
329
341
|
this.form.suburb = suburb;
|
|
342
|
+
this.setAddressSuburb(suburb);
|
|
330
343
|
this.setSuburb(suburb);
|
|
331
344
|
this.calculateCartPrice({ shop: this.shop });
|
|
332
345
|
},
|
|
@@ -335,6 +348,7 @@ export default {
|
|
|
335
348
|
},
|
|
336
349
|
async submit() {
|
|
337
350
|
try {
|
|
351
|
+
debugger;
|
|
338
352
|
this.processing = true;
|
|
339
353
|
const recaptchaToken = await this.getRecaptcha('create_order');
|
|
340
354
|
await this.createOrder({
|
package/feeds/google-shopping.js
CHANGED
|
@@ -2,7 +2,10 @@ 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',
|
|
5
7
|
'g:availability',
|
|
8
|
+
// 'g:link_template',
|
|
6
9
|
'g:id',
|
|
7
10
|
'g:pickup_method',
|
|
8
11
|
'g:pickup_sla',
|
|
@@ -11,7 +14,11 @@ async function googleLocalShoppingFeed(axios, config, availableStores) {
|
|
|
11
14
|
'g:store_code'
|
|
12
15
|
];
|
|
13
16
|
result.rss.channel.item = result.rss.channel.item
|
|
14
|
-
.map(i => fields
|
|
17
|
+
.map(i => fields
|
|
18
|
+
.reduce((item, field) => ({
|
|
19
|
+
...item,
|
|
20
|
+
[field]: i[field],
|
|
21
|
+
}), {}));
|
|
15
22
|
return result;
|
|
16
23
|
}
|
|
17
24
|
async function googleShoppingFeed(axios, config, availableStores) {
|
package/package.json
CHANGED