Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 740f326

Browse files
authored
Merge branch 'develop' into filrak-patch-1
2 parents 36899d3 + 2add511 commit 740f326

File tree

21 files changed

+311
-96
lines changed

21 files changed

+311
-96
lines changed

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [1.8.3] - 2019.02.27
8+
9+
10+
# Added
11+
- New reactive helper to check online state. Usage: `import { onlineHelper } from '@vue-storefront/core/helpers'` and then `onlineHelper.isOnline` - @patzick (#2510)
12+
813
### Fixed
914
- Problem with placing second order (unbinding payment methods after first order) - @patzick (#2195, #2503)
15+
- Remaking order on user orders page - @patzick (#2480)
16+
- Validation in the Myprofile section for postcode field - @pkarw (#1317)
17+
- Non-integer qty of product added to the cart - @pkarw (#2517)
1018

1119
### Changed / Improved
1220
- Fixed an issue where the correct image for a product configuration wasn't set on the product page image carousel. Also added the fix on the productcarousel in the zoom component - @DaanKouters (#2419)
@@ -19,8 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1927
- Added video support in Product Gallery component. - @rain2o (#2433)
2028
- Improved product quantity change component in product and cart - @patzick (#2398, #2437)
2129
- Updated to Vue 2.6.6 - @filrak (#2456)
22-
- Null sidebar menu data on static page fixed - @filrak (#2449, ##2441)
23-
- Fix cannot edit previous steps in checkout - @filrak (##2438)
30+
- Null sidebar menu data on static page fixed - @filrak (#2449, #2441)
31+
- Fix cannot edit previous steps in checkout - @filrak, @patzick (#2438)
2432
- Fixed route guard ssr problem - @vue-kacper (#2364)
2533
- Fix links in footer to static pages bug - @filrak (#2452)
2634
- Fix links at docs, Basics/Configuration file explained - @daksamit (#2490)
@@ -30,9 +38,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3038
- add cart count config, allows you to display the item count instead of a sum of the item quantities - @pauluse (#2483)
3139
- improved product gallery load view, shows correct image on reload - @patzick (#2481, #2482, #2488, #2501)
3240
- Fix an issue where the index.html template within a theme is ignored - @EnthrallRecords (#2489)
41+
- Added async sidebar component with async off-screen components error handling and fetch retrying after coming back online - @filrak (#2408, #2451)
3342
- Inconsistent filters behaviour - clear filters on page load - @patzick (#2435)
3443
- fix price is never below 0 and user can't add 0 or below 0 products to cart @RakowskiPrzemyslaw (#2437)
3544
- Check for placing single order in case of error in any payment module - @patzick (#2409)
45+
- Display prices in products added in offline mode. - @patzick (#2450)
3646

3747
### Deprecated / Removed
3848
- `@vue-storefront/store` package deprecated - @filrak

core/helpers/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import rootStore from '@vue-storefront/core/store'
22
import SearchQuery from '@vue-storefront/core/lib/search/searchQuery'
33
import { remove as removeAccents } from 'remove-accents'
44
import { Logger } from '@vue-storefront/core/lib/logger'
5+
import Vue from 'vue'
56

67
/**
78
* Create slugify -> "create-slugify" permalink of text
@@ -159,3 +160,10 @@ export function once (key, fn) {
159160
}
160161

161162
export const isServer: boolean = typeof window === 'undefined'
163+
164+
// Online/Offline helper
165+
export const onlineHelper = Vue.observable({
166+
isOnline: isServer || navigator.onLine
167+
})
168+
!isServer && window.addEventListener('online', () => onlineHelper.isOnline = true)
169+
!isServer && window.addEventListener('offline', () => onlineHelper.isOnline = false)

core/lib/multistore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface StoreView {
3333
}
3434

3535
export function currentStoreView () : StoreView {
36+
// TODO: Change to getter all along our code
3637
return rootStore.state.storeView
3738
}
3839

core/modules/cart/store/actions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ const actions: ActionTree<CartState, RootState> = {
227227
let productIndex = 0
228228
for (let product of productsToAdd) {
229229
if (typeof product === 'undefined' || product === null) continue
230+
if (product.qty && typeof product.qty !== 'number') product.qty = parseInt(product.qty)
230231
if ((rootStore.state.config.useZeroPriceProduct)? product.priceInclTax < 0 : product.priceInclTax <= 0 ) {
231232
rootStore.dispatch('notification/spawnNotification', {
232233
type: 'error',
@@ -399,7 +400,7 @@ const actions: ActionTree<CartState, RootState> = {
399400
country: country,
400401
method_code: shipping ? shipping.method_code : null,
401402
carrier_code: shipping ? shipping.carrier_code : null,
402-
payment_method: payment.code
403+
payment_method: payment ? payment.code : null
403404
}
404405
}
405406
if (methodsData.country && methodsData.carrier_code) {

core/modules/cart/store/getters.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import i18n from '@vue-storefront/i18n'
44
import CartState from '../types/CartState'
55
import RootState from '@vue-storefront/core/types/RootState'
66
import AppliedCoupon from '../types/AppliedCoupon'
7+
import { onlineHelper } from '@vue-storefront/core/helpers'
78

89
const getters: GetterTree<CartState, RootState> = {
910
totals (state) {
10-
if (state.platformTotalSegments) {
11+
if (state.platformTotalSegments && onlineHelper.isOnline) {
1112
return state.platformTotalSegments
1213
} else {
1314
let shipping = state.shipping instanceof Array ? state.shipping[0] : state.shipping

core/modules/cart/store/mutations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const mutations: MutationTree<CartState> = {
1414
if (!record) {
1515
let item = {
1616
...product,
17-
qty: product.qty ? product.qty : 1
17+
qty: parseInt(product.qty ? product.qty : 1)
1818
}
1919
Vue.prototype.$bus.$emit('cart-before-add', { product: item })
2020
state.cartItems.push(item)
@@ -43,7 +43,7 @@ const mutations: MutationTree<CartState> = {
4343

4444
if (record) {
4545
Vue.prototype.$bus.$emit('cart-before-update', { product: record })
46-
record.qty = qty
46+
record.qty = parseInt(qty)
4747
Vue.prototype.$bus.$emit('cart-after-update', { product: record })
4848
state.cartSavedAt = Date.now()
4949
}

core/modules/checkout/components/Payment.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const Payment = {
5353
edit () {
5454
if (this.isFilled) {
5555
this.$bus.$emit('checkout-before-edit', 'payment')
56-
this.isFilled = false
5756
}
5857
},
5958
hasBillingData () {

core/modules/checkout/components/Shipping.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export const Shipping = {
7979
edit () {
8080
if (this.isFilled) {
8181
this.$bus.$emit('checkout-before-edit', 'shipping')
82-
this.isFilled = false
8382
}
8483
},
8584
hasShippingDetails () {

core/modules/order/components/UserOrders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const UserOrders = {
1313
}
1414
},
1515
methods: {
16-
reorder (products) {
16+
remakeOrder (products) {
1717
products.forEach(item => {
1818
this.$store.dispatch('product/single', { options: { sku: item.sku }, setCurrentProduct: false, selectDefaultVariant: false }).then((product) => {
1919
product.qty = item.qty_ordered

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"commander": "^2.18.0",
9999
"cross-env": "^3.1.4",
100100
"css-loader": "^1.0.0",
101-
"cypress": "^3.0.2",
101+
"cypress": "^3.1.5",
102102
"d3-dsv": "^1.0.8",
103103
"detect-installed": "^2.0.4",
104104
"empty-dir": "^1.0.0",

0 commit comments

Comments
 (0)