Skip to content

Commit

Permalink
Merge branch 'develop' into feature/#2773
Browse files Browse the repository at this point in the history
  • Loading branch information
pkarw committed Jun 29, 2019
2 parents ceb14c3 + bb45ea1 commit e87795c
Show file tree
Hide file tree
Showing 41 changed files with 241 additions and 95 deletions.
25 changes: 23 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [1.11.0-rc.1] - UNRELEASED

### Added
- Apache2 proxy header support for store based on host - @resubaka (#3143)
- Items count badges for Compare products and wishlist icons at header - @vishal-7037 (#3047)

### Fixed
- Fixed product link in wishlist and microcart - @michasik (#2987)
- Resolve problem with getting CMS block from cache - @qiqqq (#2499)

### Changed / Improved
- Shipping address is saved as default when not logged in user chooses to create account during checkout - @iwonapiotrowska (#2636)
- Can set transition style for Modal content - @grimasod (#3146)

## [1.10.0-rc.2] - UNRELEASED

### Fixed
- Fixed wrong meta description attribute by page overwrite - @przspa (#3091)

## [1.10.0-rc.1] - 2019.06.19

### Added
- Cast cart_id as string - Order schema expects string, Magento does not generate a string as cart id in every case - @DaanKouters (#3097)
- Make installer work for windows - @Flyingmana (#2616)
- "Clear cart" button in the cart - @jablpiotrek (#2587)
- Global config api path under `api.url` - @BartoszLiburski (#2622)
Expand Down Expand Up @@ -98,8 +119,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Product video - retrieve video id from 'video_id' field (if set) instead of 'id' - @afirlejczyk
- Webpack config improvement - @yogeshsuhagiya (#2689)
- BaseSelect input event - @ResuBaka (#2683)
- Fixed static file handler to immediately return 404 status for missing files - @grimason (#2685)
- Fixed maxAge Response Header for static files and Content-Type for Service Worker - @grimason (#2686)
- Fixed static file handler to immediately return 404 status for missing files - @grimasod (#2685)
- Fixed maxAge Response Header for static files and Content-Type for Service Worker - @grimasod (#2686)
- Default log verbosity is changed to show only errors - @lromanowicz (#2717)
- Remembering last search query - @webdiver, @patzick (#2787)
- Extracted ProductImage component to support faster images loading - @przemyslawspaczek (#2925)
Expand Down
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,53 @@ Vue Storefront is a Community effort brought to You by our great Core Team and s
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.novusweb.com/">
<img
src="https://divante.co/partners/Vue-Storefront/blue_novusweb.png"
alt="Novusweb"
height="30"
>
</a>
</td>
<td align="center" valign="middle">
<a href="www.trellis.co">
<img
src="https://divante.co/partners/Vue-Storefront/trellis.png"
alt="Trellis"
height="30"
>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://ittweb.net/it?utm_source=referral&utm_medium=vsf&utm_campaign=partners">
<img
src="https://divante.co/partners/Vue-Storefront/ITTweb.png"
alt="ITT Web"
height="40"
>
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.yireo.com/">
<img
src="https://divante.co/partners/Vue-Storefront/yireo-logo-trans-520x520.png"
alt="Yireo"
height="40"
>
</a>
</td>
<td align="center" valign="middle">
<a href="">
<img
src=""
alt=""
height="40"
>
</a>
</td>
<td align="center" valign="middle">
<a href="">
<img
src=""
Expand Down
2 changes: 1 addition & 1 deletion core/i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/i18n",
"version": "1.10.0-rc.1",
"version": "1.11.0-rc.1",
"description": "Vue Storefront i18n",
"license": "MIT",
"main": "index.ts",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/resource/i18n/en-US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@
"Quantity must be above 0","Quantity must be above 0"
"Error: Error while adding products","Error: Error while adding products"
"Unexpected authorization error. Check your Network conection.","Unexpected authorization error. Check your Network conection."
"You are going to pay for this order upon delivery.","You are going to pay for this order upon delivery."
5 changes: 2 additions & 3 deletions core/lib/multistore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface LocalizedRoute {
path?: string,
name?: string,
hash?: string,
params?: object,
params?: { [key: string]: unknown },
fullPath?: string,
host?: string
}
Expand Down Expand Up @@ -160,9 +160,8 @@ export function localizedDispatcherRoute (routeObj: LocalizedRoute | string, sto

export function localizedRoute (routeObj: LocalizedRoute | string | RouteConfig | RawLocation, storeCode: string): any {
if (routeObj && (routeObj as LocalizedRoute).fullPath && config.seo.useUrlDispatcher) {
return localizedDispatcherRoute(Object.assign({}, routeObj, { params: null }) as LocalizedRoute, storeCode)
return localizedDispatcherRoute(Object.assign({}, routeObj) as LocalizedRoute, storeCode)
}

if (storeCode && routeObj && config.defaultStoreCode !== storeCode && config.storeViews[storeCode].appendStoreCode) {
if (typeof routeObj === 'object') {
if (routeObj.name) {
Expand Down
36 changes: 26 additions & 10 deletions core/modules/checkout/components/OrderReview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,41 @@ export const OrderReview = {
},
computed: {
...mapGetters({
isVirtualCart: 'cart/isVirtualCart'
isVirtualCart: 'cart/isVirtualCart',
getShippingDetails: 'checkout/getShippingDetails',
getPersonalDetails: 'checkout/getPersonalDetails'
})
},
methods: {
placeOrder () {
if (this.$store.state.checkout.personalDetails.createAccount) {
if (this.getPersonalDetails.createAccount) {
this.register()
} else {
this.$bus.$emit('checkout-before-placeOrder')
}
},
async register () {
this.$bus.$emit('notification-progress-start', i18n.t('Registering the account ...'))
this.$store.dispatch('user/register', {
email: this.$store.state.checkout.personalDetails.emailAddress,
password: this.$store.state.checkout.personalDetails.password,
firstname: this.$store.state.checkout.personalDetails.firstName,
lastname: this.$store.state.checkout.personalDetails.lastName
}).then(async (result) => {

try {
const result = await this.$store.dispatch('user/register', {
email: this.getPersonalDetails.emailAddress,
password: this.getPersonalDetails.password,
firstname: this.getPersonalDetails.firstName,
lastname: this.getPersonalDetails.lastName,
addresses: [{
firstname: this.getShippingDetails.firstName,
lastname: this.getShippingDetails.lastName,
street: [this.getShippingDetails.streetAddress, this.getShippingDetails.apartmentNumber],
city: this.getShippingDetails.city,
...(this.getShippingDetails.state ? { region: { region: this.getShippingDetails.state } } : {}),
country_id: this.getShippingDetails.country,
postcode: this.getShippingDetails.zipCode,
...(this.getShippingDetails.phoneNumber ? { telephone: this.getShippingDetails.phoneNumber } : {}),
default_shipping: true
}]
})

this.$bus.$emit('notification-progress-stop')
if (result.code !== 200) {
this.onFailure(result)
Expand All @@ -56,10 +72,10 @@ export const OrderReview = {
this.$bus.$emit('checkout-before-placeOrder', result.result.id)
this.onSuccess()
}
}).catch(err => {
} catch (err) {
this.$bus.$emit('notification-progress-stop')
Logger.error(err, 'checkout')()
})
}
}
}
}
17 changes: 6 additions & 11 deletions core/modules/cms/store/block/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ const actions: ActionTree<CmsBlockState, RootState> = {
*/
single (context, { key = 'identifier', value, excludeFields = null, includeFields = null, skipCache = false }) {
const state = context.state
if (skipCache || (!state.items || state.items.length === 0)) {
let cmsBlock = []
if (state.items && state.items.length > 0) {
cmsBlock = state.items.filter(item => item[key] === value)
}
if (skipCache || cmsBlock.length === 0) {
let query = new SearchQuery()
if (value) {
query = query.applyFilter({key: key, value: {'like': value}})
Expand All @@ -69,16 +73,7 @@ const actions: ActionTree<CmsBlockState, RootState> = {
})
} else {
return new Promise((resolve, reject) => {
if (state.items.length > 0) {
let cmsBlock = state.items.find((itm) => { return itm[key] === value })
if (cmsBlock) {
resolve(cmsBlock)
} else {
reject(new Error('CMS block query returned empty result ' + key + ' = ' + value))
}
} else {
resolve()
}
resolve(cmsBlock[0])
})
}
},
Expand Down
9 changes: 5 additions & 4 deletions core/modules/compare/store/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import RootState from '@vue-storefront/core/types/RootState';
import CompareState from '../types/CompareState';

const getters: GetterTree<CompareState, RootState> = {
isEmpty: state => state.items.length === 0,
isToCompare: state => product => state.items.find(p => p.sku === product.sku),
isCompareLoaded: state => state.loaded
};
isEmpty: (state) => state.items.length === 0,
isOnCompare: (state) => (product) => state.items.find(p => p.sku === product.sku),
isCompareLoaded: state => state.loaded,
getCompareProductsCount: (state) => state.items.length
}

export default getters;
5 changes: 3 additions & 2 deletions core/modules/url/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ export function formatProductLink (
url_path?: string,
type_id: string,
slug: string,
configurable_children: []
options?: [],
configurable_children?: []
},
storeCode
): string | LocalizedRoute {
if (config.seo.useUrlDispatcher && product.url_path) {
let routeData: LocalizedRoute;
if (product.configurable_children && product.configurable_children.length > 0) {
if ((product.options && product.options.length > 0) || (product.configurable_children && product.configurable_children.length > 0)) {
routeData = {
fullPath: product.url_path,
params: { childSku: product.sku }
Expand Down
4 changes: 2 additions & 2 deletions core/modules/user/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const actions: ActionTree<UserState, RootState> = {
/**
* Login user and return user profile and current token
*/
async register (context, { email, firstname, lastname, password }) {
async register (context, { email, firstname, lastname, password, addresses }) {
let url = config.users.create_endpoint
if (config.storeViews.multistore) {
url = adjustMultistoreApiUrl(url)
Expand All @@ -109,7 +109,7 @@ const actions: ActionTree<UserState, RootState> = {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
body: JSON.stringify({ customer: { email: email, firstname: firstname, lastname: lastname }, password: password })
body: JSON.stringify({ customer: { email, firstname, lastname, addresses }, password })
}).then(resp => { return resp.json() })
},

Expand Down
7 changes: 7 additions & 0 deletions core/modules/wishlist/components/WishlistButton.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import wishlistMountedMixin from '@vue-storefront/core/modules/wishlist/mixins/wishlistMountedMixin'
import { mapGetters } from 'vuex'

export const WishlistButton = {
mixins: [wishlistMountedMixin],
computed: {
...mapGetters('wishlist', ['getWishlistItemsCount'])
},
methods: {
toggleWishlist () {
this.$store.dispatch('ui/toggleWishlist')
Expand Down
3 changes: 2 additions & 1 deletion core/modules/wishlist/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const module: Module<WishlistState, RootState> = {
actions,
mutations,
getters: {
isWishlistLoaded: state => state.loaded
isWishlistLoaded: state => state.loaded,
getWishlistItemsCount: (state) => state.items.length
}
}
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/core",
"version": "1.10.0-rc.1",
"version": "1.11.0-rc.1",
"description": "Vue Storefront Core",
"license": "MIT",
"main": "app.js",
Expand Down
2 changes: 1 addition & 1 deletion core/pages/Category.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default {
}
],
title: htmlDecode(this.category.meta_title || this.categoryName),
meta: this.category.meta_description ? [{ vmid: 'description', description: htmlDecode(this.category.meta_description) }] : []
meta: this.category.meta_description ? [{ vmid: 'description', name: 'description', content: htmlDecode(this.category.meta_description) }] : []
}
}
}
4 changes: 2 additions & 2 deletions core/pages/Checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default {
prepareOrder () {
this.order = {
user_id: this.$store.state.user.current ? this.$store.state.user.current.id.toString() : '',
cart_id: this.$store.state.cart.cartServerToken ? this.$store.state.cart.cartServerToken : '',
cart_id: this.$store.state.cart.cartServerToken ? this.$store.state.cart.cartServerToken.toString() : '',
products: this.$store.state.cart.cartItems,
addressInformation: {
billingAddress: {
Expand Down Expand Up @@ -337,7 +337,7 @@ export default {
metaInfo () {
return {
title: this.$route.meta.title || i18n.t('Checkout'),
meta: this.$route.meta.description ? [{ vmid: 'description', description: this.$route.meta.description }] : []
meta: this.$route.meta.description ? [{ vmid: 'description', name: 'description', content: this.$route.meta.description }] : []
}
},
asyncData ({ store, route, context }) { // this is for SSR purposes to prefetch data
Expand Down
2 changes: 1 addition & 1 deletion core/pages/CmsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
metaInfo () {
return {
title: htmlDecode(this.pageTitle || this.$route.meta.title),
meta: this.$route.meta.description ? [{ vmid: 'description', description: htmlDecode(this.$route.meta.description) }] : []
meta: this.$route.meta.description ? [{ vmid: 'description', name: 'description', content: htmlDecode(this.$route.meta.description) }] : []
}
}
}
2 changes: 1 addition & 1 deletion core/pages/Error.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
metaInfo () {
return {
title: this.$route.meta.title || i18n.t('Internal Server Error 500'),
meta: this.$route.meta.description ? [{ vmid: 'description', description: this.$route.meta.description }] : []
meta: this.$route.meta.description ? [{ vmid: 'description', name: 'description', content: this.$route.meta.description }] : []
}
}
}
2 changes: 1 addition & 1 deletion core/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
metaInfo () {
return {
title: this.$route.meta.title || i18n.t('Home Page'),
meta: this.$route.meta.description ? [{ vmid: 'description', description: this.$route.meta.description }] : []
meta: this.$route.meta.description ? [{ vmid: 'description', name: 'description', content: this.$route.meta.description }] : []
}
}
}
2 changes: 1 addition & 1 deletion core/pages/MyAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
metaInfo () {
return {
title: this.$route.meta.title || i18n.t('My Account'),
meta: this.$route.meta.description ? [{ vmid: 'description', description: this.$route.meta.description }] : []
meta: this.$route.meta.description ? [{ vmid: 'description', name: 'description', content: this.$route.meta.description }] : []
}
},
asyncData ({ store, route, context }) { // this is for SSR purposes to prefetch data
Expand Down
2 changes: 1 addition & 1 deletion core/pages/PageNotFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
metaInfo () {
return {
title: this.$route.meta.title || i18n.t('404 Page Not Found'),
meta: this.$route.meta.description ? [{ vmid: 'description', description: this.$route.meta.description }] : []
meta: this.$route.meta.description ? [{ vmid: 'description', name: 'description', content: this.$route.meta.description }] : []
}
}
}
2 changes: 1 addition & 1 deletion core/pages/Product.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default {
}
],
title: htmlDecode(this.product.meta_title || this.productName),
meta: this.product.meta_description ? [{ vmid: 'description', description: htmlDecode(this.product.meta_description) }] : []
meta: this.product.meta_description ? [{ vmid: 'description', name: 'description', content: htmlDecode(this.product.meta_description) }] : []
}
}
}
Loading

0 comments on commit e87795c

Please sign in to comment.