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

Commit 36989bd

Browse files
authored
Merge pull request #1886 from DivanteLtd/develop
Release 1.5.0
2 parents 3ddfacf + 2b900ac commit 36989bd

File tree

221 files changed

+1681
-1722
lines changed

Some content is hidden

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

221 files changed

+1681
-1722
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
core/build/*.js
22
node_modules
3-
core/modules/**/test
3+
core/modules/**/tests

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ 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+
13+
### Changed
14+
- 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
15+
16+
### Fixed
17+
- The `regionId` field added to Order interface - #1258 - Jim Hil @jimcreate78
18+
- SSR Memory leaks fixed - #1882 Tomasz Duda @tomasz-duda
19+
- E2E tests fixed - #1861 - Patryk Tomczyk @patzik
20+
- UI animations - #1857 - Javier Villanueva @jahvi
21+
- Disabled buttons fixed - #1852 - Patryk Tomczyk @patzik
22+
- Mailchimp / Newsletter modules rebuilt - Filip Rakowski @filrak
23+
- Search component UX fixes - #1862 - Adrian Cagaanan @diboy2
24+
725
## [1.4.0] - 2018.10.05
826

927
### Added

PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
### Screenshot of passed e2e tests (if you are using our standard setup as a backend)
1414

15-
(run `yarn tests:e2e` and paste the results. If you are not using our standard backend setup or demo.vuestorefront.io you can ommit this step)
15+
(run `yarn test:e2e` and paste the results. If you are not using our standard backend setup or demo.vuestorefront.io you can ommit this step)
1616

1717
### Upgrade Notes and Changelog
1818

1919
- [x] No upgrade steps required (100% backward compatibility)
2020
- [ ] I've updated the [Upgrade notes](https://github.com/DivanteLtd/vue-storefront/blob/develop/doc/Upgrade%20notes.md) and [Changelog](https://github.com/DivanteLtd/vue-storefront/blob/develop/CHANGELOG.md) on how to port existing VS sites with this new feature
2121

22-
### Contribution and curently important rules acceptance
22+
### Contribution and currently important rules acceptance
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

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
![Branch stable](https://img.shields.io/badge/stable%20branch-master-blue.svg)
55
![Branch Develop](https://img.shields.io/badge/dev%20branch-develop-blue.svg)
66
<a href="https://join.slack.com/t/vuestorefront/shared_invite/enQtMzA4MTM2NTE5NjM2LTI1M2RmOWIyOTk0MzFlMDU3YzJlYzcyYzNiNjUyZWJiMTZjZjc3MjRlYmE5ZWQ1YWRhNTQyM2ZjN2ZkMzZlNTg">![Branch Develop](https://img.shields.io/badge/community%20chat-slack-FF1493.svg)</a>
7-
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
87

98
Vue Storefront is a standalone PWA storefront for your eCommerce, possible to connect with any eCommerce backend (eg. Magento, <a href="https://github.com/DivanteLtd/pimcore2vuestorefront">Pimcore</a>, Prestashop or Shopware) through the API.
109

config/default.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"host": "localhost",
2121
"port": 6379,
2222
"db": 0
23-
},
23+
},
2424
"graphql":{
2525
"host": "localhost",
2626
"port": 8080
@@ -207,7 +207,6 @@
207207
"claims": "LOCALSTORAGE",
208208
"compare": "INDEXEDDB",
209209
"syncTasks": "INDEXEDDB",
210-
"newsletterPreferences": "INDEXEDDB",
211210
"ordersHistory": "INDEXEDDB",
212211
"checkoutFieldValues": "LOCALSTORAGE"
213212
}
@@ -274,6 +273,14 @@
274273
"mailchimp": {
275274
"endpoint": "http://localhost:8080/api/ext/mailchimp-subscribe/subscribe"
276275
},
276+
"mailer": {
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+
},
281+
"contactAddress": "[email protected]",
282+
"sendConfirmation": true
283+
},
277284
"theme": "@vue-storefront/theme-default",
278285
"analytics": {
279286
"id": false

core/app.ts

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,70 +20,80 @@ 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'
2627
import { HttpLink } from 'apollo-link-http'
2728
import { InMemoryCache } from 'apollo-cache-inmemory'
2829
import VueApollo from 'vue-apollo'
2930

31+
// core modules registration that'll be completely moved to theme TODO: move to accesibel entry point when ready
32+
import { enabledModules } from './modules-entry'
3033
import { takeOverConsole } from '@vue-storefront/core/helpers/log'
34+
3135
if (buildTimeConfig.console.verbosityLevel !== 'display-everything') {
32-
takeOverConsole(buildTimeConfig.console.verbosityLevel)
36+
once('__TAKE_OVER_CONSOLE__', () => {
37+
takeOverConsole(buildTimeConfig.console.verbosityLevel)
38+
})
3339
}
3440

41+
3542
export function createApp (ssrContext, config): { app: Vue, router: any, store: any } {
3643
sync(store, router)
37-
store.state.version = '1.4.0'
44+
store.state.version = '1.5.0'
3845
store.state.config = config
3946
store.state.__DEMO_MODE__ = (config.demomode === true) ? true : false
40-
4147
if(ssrContext) Vue.prototype.$ssrRequestContext = ssrContext
4248

4349
if (!store.state.config) store.state.config = buildTimeConfig // if provided from SSR, don't replace it
4450
const storeModules = Object.assign(coreModules, themeModules || {})
45-
51+
4652
for (const moduleName of Object.keys(storeModules)) {
4753
console.debug('Registering Vuex module', moduleName)
4854
store.registerModule(moduleName, storeModules[moduleName])
4955
}
50-
56+
5157
const storeView = prepareStoreView(null) // prepare the default storeView
5258
store.state.storeView = storeView
5359
// store.state.shipping.methods = shippingMethods
54-
60+
5561
Vue.use(Vuelidate)
5662
Vue.use(VueLazyload, {attempt: 2})
5763
Vue.use(Meta)
5864
Vue.use(VueObserveVisibility)
59-
60-
require('theme/plugins')
61-
const pluginsObject = plugins()
62-
Object.keys(pluginsObject).forEach(key => {
63-
Vue.use(pluginsObject[key])
64-
})
65-
66-
const mixinsObject = mixins()
67-
Object.keys(mixinsObject).forEach(key => {
68-
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+
})
6979
})
70-
80+
7181
const filtersObject = filters()
7282
Object.keys(filtersObject).forEach(key => {
7383
Vue.filter(key, filtersObject[key])
7484
})
7585
const httpLink = new HttpLink({
7686
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')
7787
})
78-
88+
7989
const apolloClient = new ApolloClient({
8090
link: httpLink,
8191
cache: new InMemoryCache(),
8292
connectToDevTools: true
8393
})
84-
94+
8595
let loading = 0
86-
96+
8797
const apolloProvider = new VueApollo({
8898
clients: {
8999
a: apolloClient
@@ -101,9 +111,9 @@ export function createApp (ssrContext, config): { app: Vue, router: any, store:
101111
console.error(error)
102112
}
103113
})
104-
114+
105115
Vue.use(VueApollo)
106-
// End declare Apollo graphql client
116+
// End declare Apollo graphql client
107117
const app = new Vue({
108118
router,
109119
store,
@@ -120,8 +130,7 @@ export function createApp (ssrContext, config): { app: Vue, router: any, store:
120130
ssrContext
121131
)
122132
registerTheme(buildTimeConfig.theme, app, router, store, store.state.config, ssrContext)
123-
133+
enabledModules.forEach(m => m.register())
124134
app.$emit('application-after-init', app)
125-
126135
return { app, router, store }
127136
}

core/components/AddToCart.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import { addToCart } from '@vue-storefront/core/modules/cart/features'
1+
import { AddToCart } from '@vue-storefront/core/modules/cart/components/AddToCart.ts'
22

33
export default {
44
name: 'AddToCart',
5-
props: {
6-
product: {
7-
type: Object,
8-
required: true
9-
}
10-
},
11-
mixins: [ addToCart ]
5+
mixins: [ AddToCart ]
126
}

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/ProductBundleOptions.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ export default {
4040
}
4141
}
4242
},
43+
computed: {
44+
/**
45+
* Error messages map for validation options.
46+
* TODO: Each option should be a separate component to avoid such complex logic.
47+
*/
48+
errorMessages () {
49+
let messages = {}
50+
Object.keys(this.validation.results).map(optionKey => {
51+
const validationResult = this.validation.results[optionKey]
52+
if (validationResult.error) {
53+
messages[optionKey] = validationResult.message
54+
}
55+
})
56+
return messages
57+
}
58+
},
4359
beforeMount () {
4460
rootStore.dispatch('product/addCustomOptionValidator', {
4561
validationRule: 'gtzero', // You may add your own custom fields validators elsewhere in the theme

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 () {

0 commit comments

Comments
 (0)