Skip to content

Commit 5d380d4

Browse files
authored
Merge pull request #2299 from DivanteLtd/hotfix/v1.7.2
Hotfix/v1.7.2
2 parents 29c0953 + fb0e89a commit 5d380d4

File tree

13 files changed

+131
-45
lines changed

13 files changed

+131
-45
lines changed

CHANGELOG.md

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,89 @@ All notable changes to this project will be documented in this file.
44
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

7-
## [Unreleased]
7+
## [1.7.2] - 2019.01.28
8+
### Fixed
9+
- clear search filters on mobile - @patzick (#2282)
10+
- SSR problem on checkout page on reload - @vue-kacper (#2220)
11+
- Improved offline mode handlers - @pkarw (#2217)
12+
- url_key adjustment after m2vs fix - @pkarw (#2215)
13+
- Service worker removed from dev mode because of the side effects - @pkarw
14+
- `networkFirst` first caching strategy for /api/catalog - @pkarw
15+
- Special price dates checking - backport of @igloczek's (#2245)
16+
- SSR detection in components - @patzick (#2173)
817

918
### Changed
10-
- IndexedDb changed to LocalStorage + ServiceWorker native caching (#2112)
19+
- compress banner images - @patzick (#2280)
1120
- Dynamic attributes loader (#2137)
1221
- Dynamic categories prefetching (#2076)
1322
- New payment's module architecture (#2135)
23+
- Support regional characters in urls - Backport of @aekal's (#2243)
24+
25+
### Added
26+
- Translations of banners - @patzick (#2276)
27+
- Banners title background on mobile - @patzick (#2272)
28+
- New main site look - @patzick (#2266)
29+
30+
## [1.7.1] - 2019.01.15
31+
### Fixed
32+
- Corrected scrolled sidebar menu position
33+
34+
## [1.7.0] - 2019.01.15
35+
### Added
36+
- Dynamic categories prefetching — @pkarw #2100
37+
- Per-route codesplitting for SSR pages — @patzick #2068
38+
- async/await support — @patzick #2092
39+
- IndexedDB replacement and new caching mechanism — @pkarw #2112
40+
- Web Share module — @filrak #2143
41+
- Backward compatibility option for dynamic attribute loader — @pkarw #2137
42+
- Japanese translation — @moksahero #2150
43+
- Dutch translation — @StefGeraets #2163
44+
- Using meta_title and meta_description fields from Magento on product/category page — @qiqqq #2158
45+
- Color mapping feature — @pkarw #2175
46+
- Out of the box GZIP compression and sourcemap removal in prod mode — @patzick #2186
47+
48+
### Changed / Improved
49+
- Invalidate output cache using POST - @Cyclonecode #2084
50+
- NGNIX installation improvements for docs — @janmyszkier #2080
51+
- HTML semantics improvements — @patzick #2094
52+
- Lazy loading of non-critical third party libs and vendor optimization — @patzick @filrak @qiqqq
53+
- Extra NL translation keys — @nlekv #2104
54+
- Optimization for the number of attributes to be stored in Vuex store — @pkarw #1654
55+
- Service Worker registration from any route — @patzick #2070
56+
- Production setup docs improvements — @janmyszkier #2126
57+
- Various changes and additions to our docs by @NataliaTepluhina
58+
- Payment docs update — @pkarw #2135
59+
- Added bash command for collecting i18n phrases to docs — @qbo-tech #2149
60+
- SEO and scrolling performance fixes — @filrak #2066
1461
- Established Vuex naming conventions. TLDR - we strongly recommend to use vuex getters instead of mapping state itself (#2069)
62+
- IndexedDb changed to LocalStorage + ServiceWorker native caching (#2112)
1563

16-
## [1.6.0] - 2018.12.05
64+
### Fixed
65+
- Fix Notification.vue compiling issue on prod - @ladrua #2079
66+
- Fix wishlist toggle bug — @shkodasv #2086
67+
- findConfigurableChildAsync — fix checking stock for configurable child — @afirlejczyk #2097
68+
- Fix cart synchronization — @valeriish #2106
69+
- Fix hydration issue for lazy loaded chunks — @patzick #2115
70+
- Clear missing fields after user logout — @sniffy1988 #2117
71+
- Fix AMP naming ( ^^ ) for docs -@pgol #2118
72+
- Fix Cart Configurable Item pulled from Magento — @valeriish #2119
73+
- Fix product configuration after cart items server pull — @valeriish #2122
74+
- Fix gallery switching when entering product — @vue-kacper #2123
75+
- Fix multiple placing order invocation after changing payment methods — @patzick #2133
76+
- Remove extra space after every comma for non-(multi)select product attributes — @patzick #2133
77+
- Fix side-menu scrolling — @patzick #2140
78+
- Fix back button not properly working from a configurable product page — @qiqqq #2151
79+
- Fix submenu not visible on a deeper level — @patzick #2152
80+
- vue-carousel removed from homepage - @patzick #2153 #2154
81+
- Use localized routes for redirects to home page and account page — @grimasod #2157
82+
- ProductLinks fixed in Related products component — @pkarw #2168
83+
- Fix Cart Configurable Item pulled from Magento loaded as Simple — @pkarw @valeriish #2169 #2181
84+
85+
### Depreciated
86+
- extendStore depreciation - @filrak #2143
87+
- ValidationError class depreciation - @filrak #2143
1788

89+
## [1.6.0] - 2018.12.05
1890
### Added
1991
- Lazy loading for SSR and non-SSR routes
2092
- app splitted into modules
@@ -24,10 +96,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2496

2597
### Changed
2698
- There is new config option `config.orders.directBackendSync` that changes the behavior of placing an order. Please do read [more on this change](https://github.com/DivanteLtd/vue-storefront/commit/e73f2ca19a5d33a39f8b0fd6346543eced24167e) and [more on vue-storefront-api change](https://github.com/DivanteLtd/vue-storefront-api/commit/80c497f72362c72983db4fdcac14c8ba6f8729a8)
27-
- ProductSlider, ProductLinks, ProductListing moved to theme.
99+
- ProductSlider, ProductLinks, ProductListing moved to theme.
28100
- Many theme-related logic moved to theme (+ deleted empty core components just with `name`)
29101
- Components required for backward compatibility moved to `compatibility` folder. For all this files you just need to add `compatibility` after `core` in import path to make them work like before.
30-
- Better Vuex extensibility with modules
102+
- Better Vuex extensibility with modules
31103
- VSModule `store` object changed to fulfil need of multiple vuex modules (see modules docs)
32104
- UI Store logic for Microcart moved to cart module
33105
- Extensions are now depreciated, theme-level extensions removed and src-level extension to be depreciated in 1.7
@@ -288,30 +360,3 @@ Please keep an eye on the **[UPGRADE NOTES](https://github.com/DivanteLtd/vue-st
288360
## [0.2.0-alpha.0] - 2017-11-15
289361
### Fixed
290362
- Lazy loaded blocks size fixed
291-
292-
293-
[Unreleased]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.5...HEAD
294-
295-
[1.0.5]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.4...v1.0.5
296-
297-
[1.0.4]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.3...v1.0.4
298-
299-
[1.0.3]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.2...v1.0.3
300-
301-
[1.0.2]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.1...v1.0.2
302-
303-
[1.0.1]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.0...v1.0.1
304-
305-
[1.0.0]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.0-rc.3...v1.0.0
306-
307-
[1.0.0-rc.3]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.0-rc.2...v1.0.0-rc.3
308-
309-
[1.0.0-rc.2]: https://github.com/DivanteLtd/vue-storefront/compare/v1.0.0-rc.0...v1.0.0-rc.2
310-
311-
[1.0.0-rc.0]: https://github.com/DivanteLtd/vue-storefront/compare/v0.4.0...v1.0.0-rc.0
312-
313-
[0.4.0]: https://github.com/DivanteLtd/vue-storefront/compare/v0.3.0...v0.4.0
314-
315-
[0.3.0]: https://github.com/DivanteLtd/vue-storefront/compare/v0.2.1-alpha.0...v0.0.3
316-
317-
[0.2.1-alpha.0]: https://github.com/DivanteLtd/vue-storefront/compare/v0.2.0-alpha.0...v0.2.1-alpha.0

core/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Store } from 'vuex'
22
import RootState from '@vue-storefront/store/types/RootState'
33
import Vue from 'vue'
44
import buildTimeConfig from 'config'
5+
import { isServer } from '@vue-storefront/core/helpers'
56

67
// Plugins
78
import i18n from '@vue-storefront/i18n'
@@ -119,7 +120,7 @@ const createApp = async (ssrContext, config): Promise<{app: Vue, router: VueRou
119120
const app = new Vue(vueOptions)
120121

121122
const appContext = {
122-
isServer: typeof window !== 'undefined',
123+
isServer,
123124
ssrContext
124125
}
125126

core/helpers/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import rootStore from '@vue-storefront/store'
22
import SearchQuery from '@vue-storefront/store/lib/search/searchQuery'
3+
import { remove as removeAccents } from 'remove-accents'
34

45
/**
56
* Create slugify -> "create-slugify" permalink of text
67
* @param {String} text
78
*/
89
export function slugify (text) {
9-
return text.toString().toLowerCase()
10+
// remove regional characters
11+
text = removeAccents(text)
12+
13+
return text
14+
.toString()
15+
.toLowerCase()
1016
.replace(/\s+/g, '-') // Replace spaces with -
1117
.replace(/&/g, '-and-') // Replace & with 'and'
1218
.replace(/[^\w-]+/g, '') // Remove all non-word chars

core/helpers/log.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { isServer } from '@vue-storefront/core/helpers'
2+
13
/**
24
* @param {string} level available options: 'no-console', 'only-errors', 'all'
35
*/
46
export function takeOverConsole (level = 'no-console') {
5-
const console = typeof window !== 'undefined' ? window.console : global.console
7+
const console = !isServer ? window.console : global.console
68
if (!console) return
79

810
function intercept (method) {

core/lib/logger.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { isServer } from '@vue-storefront/core/helpers'
2+
13
/** VS message logger. By default works only on dev mode */
24
const Logger = {
35
/**
@@ -9,7 +11,7 @@ const Logger = {
911
* @param context meaningful data related to this message
1012
*/
1113
info : function (message: string, tag: string = null, context: any = null) : () => void {
12-
if (typeof window !== 'undefined') {
14+
if (!isServer) {
1315
if (tag) {
1416
let msg ='%cVSF%c %c' + tag +'%c ' + message
1517
return console.log.bind(window.console, '%cVSF%c %c' + tag +'%c ' + message, bgColorStyle('green'), 'color: inherit', bgColorStyle('gray'), 'font-weight: bold', { context });
@@ -29,7 +31,7 @@ const Logger = {
2931
* @param context meaningful data related to this message
3032
*/
3133
warn: function (message: string, tag: string = null, context: any = null) : () => void {
32-
if (typeof window !== 'undefined') {
34+
if (!isServer) {
3335
if (tag) {
3436
return console.warn.bind(window.console, '%cVSF%c %c' + tag +'%c ' + message, bgColorStyle('orange'), 'color: inherit', bgColorStyle('gray'), 'font-weight: bold', { context });
3537
} else {
@@ -48,7 +50,7 @@ const Logger = {
4850
* @param context meaningful data related to this message
4951
*/
5052
error: function (message: string, tag: string = null, context: any = null) : () => void {
51-
if (typeof window !== 'undefined') {
53+
if (!isServer) {
5254
if (tag) {
5355
return console.error.bind(window.console, '%cVSF%c %c' + tag +'%c ' + message, bgColorStyle('red'), 'color: inherit', bgColorStyle('gray'), 'font-weight: bold', { context });
5456
} else {

core/lib/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import rootStore from '@vue-storefront/store'
77
import { Logger } from '@vue-storefront/core/lib/logger'
88
import { setupMultistoreRoutes } from '@vue-storefront/store/lib/multistore'
99
import { router } from '@vue-storefront/core/app'
10+
import { isServer } from '@vue-storefront/core/helpers'
1011

1112
export interface VueStorefrontModuleConfig {
1213
key: string;
@@ -85,7 +86,6 @@ export class VueStorefrontModule {
8586
}
8687

8788
if (isUnique) {
88-
const isServer = typeof window === undefined
8989
if (this._c.beforeRegistration) this._c.beforeRegistration(Vue, rootStore.state.config, rootStore, isServer)
9090
if (this._c.store) VueStorefrontModule._extendStore(rootStore, this._c.store.modules, this._c.store.plugin)
9191
if (this._c.router) VueStorefrontModule._extendRouter(router, this._c.router.routes, this._c.router.beforeEach, this._c.router.afterEach)

core/modules/catalog/helpers/tax.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
function isSpecialPriceActive(fromDate, toDate) {
2+
const now = new Date()
3+
fromDate = new Date(fromDate) || false
4+
toDate = new Date(toDate) || false
5+
6+
if (fromDate && toDate) {
7+
return fromDate < now && toDate > now
8+
}
9+
10+
if (fromDate && !toDate) {
11+
return fromDate < now
12+
}
13+
14+
if (!fromDate && toDate) {
15+
return toDate > now
16+
}
17+
}
18+
119
export function updateProductPrices (product, rate, sourcePriceInclTax = false) {
220
const rateFactor = parseFloat(rate.rate) / 100
321
product.price = parseFloat(product.price)
@@ -22,7 +40,7 @@ export function updateProductPrices (product, rate, sourcePriceInclTax = false)
2240
product.specialPriceInclTax = specialPriceExclTax + product.specialPriceTax
2341

2442
if (product.special_price && (product.special_price < product.price)) {
25-
if ((product.special_to_date && new Date(product.special_to_date) < new Date()) || (product.special_from_date && new Date(product.special_from_date) > new Date())) {
43+
if (!isSpecialPriceActive(product.special_from_date, product.special_to_date)) {
2644
product.special_price = 0 // out of the dates period
2745
} else {
2846
product.originalPrice = priceExclTax
@@ -67,7 +85,7 @@ export function updateProductPrices (product, rate, sourcePriceInclTax = false)
6785
configurableChild.specialPriceInclTax = specialPriceExclTax + configurableChild.specialPriceTax
6886

6987
if (configurableChild.special_price && (configurableChild.special_price < configurableChild.price)) {
70-
if ((configurableChild.special_to_date && new Date(configurableChild.special_to_date) < new Date()) || (configurableChild.special_from_date && new Date(configurableChild.special_from_date) > new Date())) {
88+
if (!isSpecialPriceActive(configurableChild.special_from_date, configurableChild.special_to_date)) {
7189
configurableChild.special_price = 0 // out of the dates period
7290
} else {
7391
configurableChild.originalPrice = priceExclTax

core/modules/social-share/components/WebShare.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
</template>
88

99
<script>
10+
import { isServer } from '@vue-storefront/core/helpers'
11+
1012
export default {
1113
name: 'WebShare',
1214
props: {
@@ -25,7 +27,7 @@ export default {
2527
},
2628
computed: {
2729
isSupported () {
28-
return typeof window !== 'undefined' && navigator.share
30+
return !isServer && navigator.share
2931
}
3032
},
3133
methods: {

core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"lodash-es": "^4.17.10",
1818
"lru-cache": "^4.0.1",
1919
"redis-tag-cache": "^1.2.1",
20+
"remove-accents": "^0.4.2",
2021
"vue": "^2.5.17",
2122
"vue-carousel": "^0.6.9",
2223
"vue-i18n": "^8.0.0",

core/pages/Checkout.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import VueOfflineMixin from 'vue-offline/mixin'
55

66
import Composite from '@vue-storefront/core/mixins/composite'
77
import { currentStoreView } from '@vue-storefront/store/lib/multistore'
8+
import { isServer } from '@vue-storefront/core/helpers'
89

910
export default {
1011
name: 'Checkout',
@@ -218,7 +219,7 @@ export default {
218219
return isValid
219220
},
220221
activateHashSection () {
221-
if (typeof window !== 'undefined') {
222+
if (!isServer) {
222223
var urlStep = window.location.hash.replace('#', '')
223224
if (this.activeSection.hasOwnProperty(urlStep) && this.activeSection[urlStep] === false) {
224225
this.activateSection(urlStep)
@@ -237,7 +238,7 @@ export default {
237238
this.activeSection[section] = false
238239
}
239240
this.activeSection[sectionToActivate] = true
240-
if (typeof window !== 'undefined') window.location.href = window.location.origin + window.location.pathname + '#' + sectionToActivate
241+
if (!isServer) window.location.href = window.location.origin + window.location.pathname + '#' + sectionToActivate
241242
},
242243
// This method checks if there exists a mapping of chosen payment method to one of Magento's payment methods.
243244
getPaymentMethod () {

0 commit comments

Comments
 (0)