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

Commit fdcc5c7

Browse files
committed
after merge
2 parents 96e9e22 + 661b30b commit fdcc5c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4111
-342
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ 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+
## [1.5.0] - 2018.10.22
8+
9+
### Added
10+
- Contact form mailer - #1875 - Akbar Abdrakhmanov @akbarik
11+
- oauth2 configuration in setup - #1865 - Krister Andersson @Cyclonecode
12+
- GraphQL schema extendibility in the API - Yoann Vié
13+
- A lot of new docs - Natalia Tepluhina @NataliTepluhina
14+
- Magento2 integrated importer
15+
16+
### Changed
17+
- New Modules API, and base modules (cart, wishlist, newsletter ...) refactored [read more...](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/api-modules/about-modules.md) - Filip Rakowski @filrak
18+
19+
### Fixed
20+
- The `regionId` field added to Order interface - #1258 - Jim Hil @jimcreate78
21+
- SSR Memory leaks fixed - #1882 Tomasz Duda @tomasz-duda
22+
- E2E tests fixed - #1861 - Patryk Tomczyk @patzik
23+
- UI animations - #1857 - Javier Villanueva @jahvi
24+
- Disabled buttons fixed - #1852 - Patryk Tomczyk @patzik
25+
- Mailchimp / Newsletter modules rebuilt - Filip Rakowski @filrak
26+
- Search component UX fixes - #1862 - Adrian Cagaanan @diboy2
27+
728
## [1.4.0] - 2018.10.05
829

930
### Added

PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323

2424
- [ ] I read and followed [contribution rules](https://github.com/DivanteLtd/vue-storefront/blob/master/CONTRIBUTING.md)
2525
- [ ] I read the [TypeScript Action Plan](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/TypeScript%20Action%20Plan.md) and adjusted my PR according to it
26-
- [ ] I read about [Vue Storefront Modules](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/api-modules/about-modules.md) and [refactoring plan for them](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/api-modules/refactoring-to-modules.md)
26+
- [ ] I read about [Vue Storefront Modules](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/api-modules/about-modules.md) and I am aware that every new feature should be a module

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ Vue Storefront is a Community effort brought to You by our great Core Team and s
205205
<td align="center" valign="middle">
206206
<a href="https://divante.co/">
207207
<img
208-
src="https://divante.co/static/img/logo.svg"
208+
src="https://divante.co/about us/LOGO.png"
209209
alt="Divante"
210-
height="50"
210+
width="120"
211211
>
212212
</a>
213213
</td>
@@ -436,6 +436,53 @@ Vue Storefront is a Community effort brought to You by our great Core Team and s
436436
</a>
437437
</td>
438438
</tr>
439+
<tr>
440+
<td align="center" valign="middle">
441+
<a href="http://copex.io/">
442+
<img
443+
src="https://divante.co/partners/Vue-Storefront/copex-io-logo.png"
444+
alt="Copex.io"
445+
height="50"
446+
>
447+
</a>
448+
</td>
449+
<td align="center" valign="middle">
450+
<a href="https://www.badger.blue/">
451+
<img
452+
src="https://divante.co/partners/Vue-Storefront/BlueBadger-Logo.png"
453+
alt="Badger Blue"
454+
height="50"
455+
>
456+
</a>
457+
</td>
458+
<td align="center" valign="middle">
459+
<a href="">
460+
<img
461+
src=""
462+
alt=""
463+
height="50"
464+
>
465+
</a>
466+
</td>
467+
<td align="center" valign="middle">
468+
<a href="">
469+
<img
470+
src=""
471+
alt=""
472+
height="50"
473+
>
474+
</a>
475+
</td>
476+
<td align="center" valign="middle">
477+
<a href="">
478+
<img
479+
src=""
480+
alt=""
481+
height="50"
482+
>
483+
</a>
484+
</td>
485+
</tr>
439486
</tbody>
440487
</table>
441488

config/default.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@
274274
"endpoint": "http://localhost:8080/api/ext/mailchimp-subscribe/subscribe"
275275
},
276276
"mailer": {
277-
"endpoint": "http://localhost:8080/api/ext/mail-service/send-email",
277+
"endpoint": {
278+
"send": "http://localhost:8080/api/ext/mail-service/send-email",
279+
"token": "http://localhost:8080/api/ext/mail-service/get-token"
280+
},
278281
"contactAddress": "[email protected]",
279282
"sendConfirmation": true
280283
},

core/app.ts

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import App from 'theme/App.vue'
2020
import themeModules from 'theme/store'
2121
import themeExtensionEntryPoints from 'theme/extensions'
2222
import extensionEntryPoints from 'src/extensions'
23+
import { once } from './helpers'
2324

2425
// Declare Apollo graphql client
2526
import ApolloClient from 'apollo-client'
@@ -32,13 +33,15 @@ import { enabledModules } from './modules-entry'
3233
import { takeOverConsole } from '@vue-storefront/core/helpers/log'
3334

3435
if (buildTimeConfig.console.verbosityLevel !== 'display-everything') {
35-
takeOverConsole(buildTimeConfig.console.verbosityLevel)
36+
once('__TAKE_OVER_CONSOLE__', () => {
37+
takeOverConsole(buildTimeConfig.console.verbosityLevel)
38+
})
3639
}
3740

3841

3942
export function createApp (ssrContext, config): { app: Vue, router: any, store: any } {
4043
sync(store, router)
41-
store.state.version = '1.4.0'
44+
store.state.version = '1.5.0'
4245
store.state.config = config
4346
store.state.__DEMO_MODE__ = (config.demomode === true) ? true : false
4447
if(ssrContext) Vue.prototype.$ssrRequestContext = ssrContext
@@ -50,43 +53,47 @@ export function createApp (ssrContext, config): { app: Vue, router: any, store:
5053
console.debug('Registering Vuex module', moduleName)
5154
store.registerModule(moduleName, storeModules[moduleName])
5255
}
53-
56+
5457
const storeView = prepareStoreView(null) // prepare the default storeView
5558
store.state.storeView = storeView
5659
// store.state.shipping.methods = shippingMethods
57-
60+
5861
Vue.use(Vuelidate)
5962
Vue.use(VueLazyload, {attempt: 2})
6063
Vue.use(Meta)
6164
Vue.use(VueObserveVisibility)
62-
63-
require('theme/plugins')
64-
const pluginsObject = plugins()
65-
Object.keys(pluginsObject).forEach(key => {
66-
Vue.use(pluginsObject[key])
67-
})
68-
69-
const mixinsObject = mixins()
70-
Object.keys(mixinsObject).forEach(key => {
71-
Vue.mixin(mixinsObject[key])
65+
66+
once('__VUE_EXTEND__', () => {
67+
console.debug('Registering Vue plugins')
68+
require('theme/plugins')
69+
const pluginsObject = plugins()
70+
Object.keys(pluginsObject).forEach(key => {
71+
Vue.use(pluginsObject[key])
72+
})
73+
74+
console.debug('Registering Vue mixins')
75+
const mixinsObject = mixins()
76+
Object.keys(mixinsObject).forEach(key => {
77+
Vue.mixin(mixinsObject[key])
78+
})
7279
})
73-
80+
7481
const filtersObject = filters()
7582
Object.keys(filtersObject).forEach(key => {
7683
Vue.filter(key, filtersObject[key])
7784
})
7885
const httpLink = new HttpLink({
7986
uri: store.state.config.graphql.host.indexOf('://') >= 0 ? store.state.config.graphql.host : (store.state.config.server.protocol + '://' + store.state.config.graphql.host + ':' + store.state.config.graphql.port + '/graphql')
8087
})
81-
88+
8289
const apolloClient = new ApolloClient({
8390
link: httpLink,
8491
cache: new InMemoryCache(),
8592
connectToDevTools: true
8693
})
87-
94+
8895
let loading = 0
89-
96+
9097
const apolloProvider = new VueApollo({
9198
clients: {
9299
a: apolloClient
@@ -104,9 +111,9 @@ export function createApp (ssrContext, config): { app: Vue, router: any, store:
104111
console.error(error)
105112
}
106113
})
107-
114+
108115
Vue.use(VueApollo)
109-
// End declare Apollo graphql client
116+
// End declare Apollo graphql client
110117
const app = new Vue({
111118
router,
112119
store,

core/components/Notification.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ export default {
2121
this.action('close', this.notifications.length - 1)
2222
}, data.timeToLive || 5000)
2323
},
24-
action (action, id) {
25-
this.$bus.$emit('notification-after-' + action, id)
24+
action (action, id, notification) {
25+
this.$bus.$emit('notification-after-' + action, notification)
2626
switch (action) {
27-
case 'close':
28-
this.notifications.splice(id, 1)
29-
break
3027
case 'goToCheckout':
3128
this.$router.push(this.localizedRoute('/checkout'))
3229
this.notifications.splice(id, 1)
3330
break
31+
default:
32+
this.notifications.splice(id, 1)
3433
}
3534
}
3635
}

core/components/blocks/Checkout/Shipping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default {
137137
},
138138
getCurrentShippingMethod () {
139139
let shippingCode = this.shipping.shippingMethod
140-
let currentMethod = this.shippingMethods.find(item => item.method_code === shippingCode)
140+
let currentMethod = this.shippingMethods ? this.shippingMethods.find(item => item.method_code === shippingCode) : {}
141141
return currentMethod
142142
},
143143
changeShippingMethod () {

core/helpers/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ export function slugify (text) {
99
.replace(/[^\w-]+/g, '') // Remove all non-word chars
1010
.replace(/--+/g, '-') // Replace multiple - with single -
1111
}
12+
13+
export function once (key, fn) {
14+
const { process = {} } = global
15+
const processKey = key + '__ONCE__'
16+
if (!process.hasOwnProperty(processKey)) {
17+
console.debug(`Once ${key}`)
18+
process[processKey] = true
19+
fn()
20+
}
21+
}

core/helpers/log.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @param {string} level available options: 'no-console', 'only-errors', 'all'
33
*/
44
export function takeOverConsole (level = 'no-console') {
5-
var console = typeof window !== 'undefined' ? window.console : global.console
5+
const console = typeof window !== 'undefined' ? window.console : global.console
66
if (!console) return
77

88
function intercept (method) {
@@ -26,7 +26,7 @@ export function takeOverConsole (level = 'no-console') {
2626
original.apply(console, arguments)
2727
} else {
2828
// Do this for IE
29-
var message = Array.prototype.slice.apply(arguments).join(' ')
29+
const message = Array.prototype.slice.apply(arguments).join(' ')
3030
original(message)
3131
}
3232
}

core/modules/cart/store/actions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,13 @@ const actions: ActionTree<CartState, RootState> = {
609609
Vue.prototype.$bus.$emit('servercart-after-diff', { diffLog: diffLog, serverItems: serverItems, clientItems: clientItems, dryRun: event.dry_run, event: event }) // send the difflog
610610
console.log('Server sync diff', diffLog)
611611
} else {
612-
console.error(event.result)
612+
console.error(event.result) // override with guest cart
613+
if (rootStore.state.cart.bypassCount < MAX_BYPASS_COUNT) {
614+
console.log('Bypassing with guest cart', rootStore.state.cart.bypassCount)
615+
rootStore.state.cart.bypassCount = rootStore.state.cart.bypassCount + 1
616+
rootStore.dispatch('cart/serverCreate', { guestCart: true }, { root: true })
617+
console.error(event.result)
618+
}
613619
}
614620
},
615621
servercartAfterItemUpdated (context, event) {

core/modules/cart/store/mutations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const mutations: MutationTree<CartState> = {
6666
state.cartIsLoaded = true
6767
state.cartSavedAt = Date.now()
6868

69-
Vue.prototype.$bus.$emit('order/PROCESS_QUEUE', { config: rootStore.state.config }) // process checkout queue
69+
// Vue.prototype.$bus.$emit('order/PROCESS_QUEUE', { config: rootStore.state.config }) // process checkout queue
7070
Vue.prototype.$bus.$emit('sync/PROCESS_QUEUE', { config: rootStore.state.config }) // process checkout queue
7171
Vue.prototype.$bus.$emit('application-after-loaded')
7272
Vue.prototype.$bus.$emit('cart-after-loaded')

core/modules/mailer/components/EmailForm.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,22 @@ export const EmailForm = {
99
},
1010
methods: {
1111
sendEmail (letter: MailItem, success, failure) {
12-
this.$store.dispatch('mailer/getToken')
12+
this.$store.dispatch('mailer/sendEmail', letter)
1313
.then(res => {
1414
if (res.ok) {
15-
return res.json()
16-
}
17-
throw new Error()
18-
})
19-
.then(tokenResponse => {
20-
this.token = tokenResponse.result
21-
return this.$store.dispatch('mailer/sendEmail', { ...letter, token: this.token })
22-
})
23-
.then(res => {
24-
if (res.ok) {
25-
success(i18n.t('Email has successfully been sent'))
26-
this.$store.dispatch('mailer/sendConfirmation', { ...letter, token: this.token })
15+
if (success) success(i18n.t('Email has successfully been sent'))
2716
} else {
2817
return res.json()
2918
}
3019
})
3120
.then(errorResponse => {
3221
if (errorResponse) {
3322
const errorMessage = errorResponse.result
34-
failure(i18n.t(errorMessage))
23+
if (failure) failure(i18n.t(errorMessage))
3524
}
3625
})
3726
.catch(() => {
38-
failure(i18n.t('Could not send an email. Please try again later.'))
27+
if (failure) failure(i18n.t('Could not send an email. Please try again later.'))
3928
})
4029
}
4130
}

0 commit comments

Comments
 (0)