Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a3cae98
adjust changes to lru bc
Apr 15, 2020
b35bc20
update changelog
Apr 15, 2020
29e7b6d
Merge branch 'hotfix/v1.11.3' of github.com:DivanteLtd/vue-storefront…
Apr 15, 2020
e1c77ad
Merge branch 'hotfix/v1.11.4' into bugfix/lru-cache
May 5, 2020
c4c2c67
Fix options undefined bug
SDLyu May 5, 2020
14106a7
Fix typo
ThermScissorpunch May 6, 2020
76de366
exit from errorHandler after redirection
May 7, 2020
7acf483
Merge pull request #4343 from ThermScissorpunch/patch-2
May 7, 2020
40d6f4d
Merge branch 'hotfix/v1.11.4' into bugfix/undefined_options
May 7, 2020
01e5ddd
Merge branch 'hotfix/v1.11.4' into bugfix/lru-cache
May 7, 2020
9704c8a
Merge pull request #4336 from SDLyu/bugfix/undefined_options
May 7, 2020
dbb7232
Merge branch 'hotfix/v1.11.4' into bugfix/lru-cache
May 7, 2020
6fcc089
Merge pull request #4248 from gibkigonzo/bugfix/lru-cache
May 7, 2020
c164e0b
use yarn in cli installer
Apr 27, 2020
d28fab6
update changelog
May 7, 2020
9925a09
Merge branch 'hotfix/v1.11.4' of github.com:DivanteLtd/vue-storefront…
May 7, 2020
0bcb307
update changelog
May 7, 2020
3e8add5
Fixes problems related to tax calculation and price filter in multist…
May 12, 2020
918f7a7
Blank order details page fix
mdanilowicz May 12, 2020
0e6d71d
upadate cart hash after sync with backend
May 12, 2020
14e13bb
upadate tests
May 12, 2020
8fe0eed
update changelog
May 12, 2020
b406da4
Merge pull request #4378 from juho-jaakkola/bugfix/4376-multistore
May 13, 2020
c0cf14e
Merge branch 'hotfix/v1.11.4' into bugfix/#4382-1.11.4
May 13, 2020
a9ca912
Broken Key Event Listener on Sidemenu
mdanilowicz May 14, 2020
cee9b9a
Broken Key Event Listener on Sidemenu
mdanilowicz May 14, 2020
050a24d
Merge branch 'hotfix/v1.11.4' into bugfix/#4393
mdanilowicz May 14, 2020
e675c3f
Merge branch 'hotfix/v1.11.4' into bugfix/update-cart-hash
May 14, 2020
d7af163
Merge pull request #4385 from mdanilowicz/bugfix/#4382-1.11.4
May 14, 2020
d69a415
Merge branch 'hotfix/v1.11.4' into bugfix/#4393
May 14, 2020
41be56a
Merge pull request #4396 from mdanilowicz/bugfix/#4393
May 14, 2020
af9ef81
Merge branch 'hotfix/v1.11.4' into bugfix/update-cart-hash
May 14, 2020
aa8026f
Merge pull request #4387 from gibkigonzo/bugfix/update-cart-hash
May 14, 2020
9b8ff38
Merge branch 'hotfix/v1.11.4' into bugfix/4246
May 14, 2020
3b35242
Merge pull request #4345 from gibkigonzo/bugfix/4246
May 14, 2020
9fafce7
Merge branch 'hotfix/v1.11.4' into bugfix/4275
May 14, 2020
c1c7e6e
Merge pull request #4292 from gibkigonzo/bugfix/4275
May 14, 2020
84b32ad
disable out of stock notification when config.stock.allowOutOfStockIn…
May 20, 2020
3869b28
changelog
May 20, 2020
9b2c63f
add redirection in component for simple product related to configurab…
May 20, 2020
5b89b8e
update changelog
May 20, 2020
9b427c2
check parent only if product isn't visible
May 20, 2020
41c791b
use findConfigurableParent instead of checkConfigurableParent
May 20, 2020
68b0a4b
change skus to add proper configuration
May 20, 2020
56f7a84
Merge pull request #4425 from gibkigonzo/feature/4340
May 21, 2020
fc56390
Merge branch 'hotfix/v1.11.4' into bugfix/4359
May 21, 2020
f6956b7
Merge pull request #4426 from gibkigonzo/bugfix/4359
May 21, 2020
a34b9a2
dont add shipping codes for virtual product
May 25, 2020
7f9955a
change required to sameAs for checkbox
May 25, 2020
84511e9
adjust carousel to new api
May 25, 2020
016ce62
update changelog
May 25, 2020
7a90e83
add alpha validators
May 25, 2020
f8647da
add alpha validators
May 25, 2020
8f91b34
Merge pull request #4455 from gibkigonzo/bugfix/pre-release-tests-1.11.4
May 25, 2020
510af03
fix typo
May 25, 2020
1e83e7c
wait for configuration
May 25, 2020
107ea80
update changelog
May 26, 2020
158f53c
Merge pull request #4461 from gibkigonzo/bugfix/pre-release-tests-1.1…
May 26, 2020
8a12906
update workflow
May 26, 2020
19671b1
update bash
May 26, 2020
8769235
use env specific config
May 26, 2020
ad66d2b
Merge pull request #4462 from gibkigonzo/update-workflow
May 26, 2020
6f6dfce
build config for cloud in build step
May 26, 2020
007c787
Merge pull request #4464 from gibkigonzo/bugfix/build-config-cloud
May 26, 2020
9b4c165
update version 1.11.4
May 26, 2020
daa61c0
Merge pull request #4467 from gibkigonzo/update-version-1.11.4
May 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/deploy-storefrontcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: "10.x"
- name: Create config file
run: |
echo '{"server":{"useOutputCacheTagging":true,"useOutputCache":true,"dynamicConfigReload":true},"api":{"url":"https://demo.storefrontcloud.io"}}' > config/local-cloud-demo.json
echo '{"server":{"useOutputCacheTagging":true,"useOutputCache":true,"dynamicConfigReload":true},"api":{"url":"https://demo.storefrontcloud.io"}}' > config/local-cloud-next.json
echo '{"server":{"useOutputCacheTagging":true,"useOutputCache":true,"dynamicConfigReload":true},"api":{"url":"https://test.storefrontcloud.io"}}' > config/local-cloud-test.json
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@master
with:
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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.4] - 2020.05.26

### Added


### Changed / Improved

- use yarn in cli installer - @gibkigonzo (#4292)
- disable out of stock notification when config.stock.allowOutOfStockInCart is true - @gibigonzo (#4340)


### Fixed

- Use LRU as object contructor based on newest changes in module - @gibkigonzo (#4242)
- Fixed ESC button action (minicart, wishlist) - @mdanilowicz (#4393)
- Fixes problems related to tax calculation and price filter in multistore setup - @juho-jaakkola (#4376)
- Blank order details page - @mdanilowicz (#4382)
- upadate cart hash after sync with backend - @gibkigonzo (#4387)
- exit from errorHandler after redirection - @gibkigonzo (#4246)
- add redirection in component for simple product related to configurable product - @gibkigonzo (#4359)
- disable sending carrier_code or method_code for virtual products,
adjust vue-carousel and vuelidate to newest versions api,
add aplha validators for register fields - @gibkigonzo (#4455, #4461)

## [1.11.3] - 2020.04.27

### Changed / Improved
Expand Down
2 changes: 1 addition & 1 deletion core/compatibility/components/blocks/Wishlist/Wishlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
methods: {
// theme-specific
onEscapePress () {
this.closeWishlist()
this.$store.dispatch('ui/closeWishlist')
}
},
mixins: [ Wishlist, onEscapePress ]
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.11.3",
"version": "1.11.4",
"description": "Vue Storefront i18n",
"license": "MIT",
"main": "index.ts",
Expand Down
2 changes: 1 addition & 1 deletion core/lib/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Task from '@vue-storefront/core/lib/sync/types/Task'
import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus'
import { StorageManager } from '@vue-storefront/core/lib/storage-manager'

/** Syncs given task. If user is offline requiest will be sent to the server after restored connection */
/** Syncs given task. If user is offline request will be sent to the server after restored connection */
async function queue (task) {
const tasksCollection = StorageManager.get('syncTasks')
task = _prepareTask(task)
Expand Down
4 changes: 3 additions & 1 deletion core/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export interface StoreView {
index: string
},
tax: {
sourcePriceIncludesTax: boolean,
sourcePriceIncludesTax?: boolean,
finalPriceIncludesTax?: boolean,
deprecatedPriceFieldsSupport?: boolean,
defaultCountry: string,
defaultRegion: null | string,
calculateServerSide: boolean,
Expand Down
4 changes: 2 additions & 2 deletions core/modules/cart/helpers/createShippingInfoData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const createShippingInfoData = (methodsData) => ({
billingAddress: {
...(methodsData.billingAddress ? methodsData.billingAddress : {})
},
shippingCarrierCode: methodsData.carrier_code,
shippingMethodCode: methodsData.method_code
...(methodsData.carrier_code ? { shippingCarrierCode: methodsData.carrier_code } : {}),
...(methodsData.method_code ? { shippingMethodCode: methodsData.method_code } : {})
});

export default createShippingInfoData
4 changes: 2 additions & 2 deletions core/modules/cart/helpers/getProductConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const ATTRIBUTES = ['color', 'size']

const getProductConfiguration = (product: CartItem): ProductConfiguration => {
const options = getProductOptions(product)
const getAttributesFields = (attributeCode) =>
options[attributeCode].find(c => c.id === parseInt(product[attributeCode]))
const getAttributesFields = (attributeCode) =>
(options[attributeCode] || []).find(c => c.id === parseInt(product[attributeCode]))

if (!options) {
return null
Expand Down
3 changes: 2 additions & 1 deletion core/modules/cart/store/actions/itemActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
notifications
} from '@vue-storefront/core/modules/cart/helpers'
import { cartHooksExecutors } from './../../hooks'
import config from 'config'

const itemActions = {
async configureItem (context, { product, configuration }) {
Expand Down Expand Up @@ -62,7 +63,7 @@ const itemActions = {
if (errors.length === 0) {
const { status, onlineCheckTaskId } = await dispatch('checkProductStatus', { product })

if (status === 'volatile') {
if (status === 'volatile' && !config.stock.allowOutOfStockInCart) {
diffLog.pushNotification(notifications.unsafeQuantity())
}
if (status === 'out_of_stock') {
Expand Down
4 changes: 3 additions & 1 deletion core/modules/cart/store/actions/synchronizeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ const synchronizeActions = {

Logger.error(result, 'cart')
cartHooksExecutors.afterSync(result)
commit(types.CART_SET_ITEMS_HASH, getters.getCurrentCartHash)
return createDiffLog()
},
async stockSync ({ dispatch, commit }, stockTask) {
async stockSync ({ dispatch, commit, getters }, stockTask) {
const product = { sku: stockTask.product_sku }

const cartItem = await dispatch('getItem', { product })
Expand All @@ -102,6 +103,7 @@ const synchronizeActions = {
product: { info: { stock: i18n.t('In stock!') }, sku: stockTask.product_sku, is_in_stock: true }
})
EventBus.$emit('cart-after-itemchanged', { item: cartItem })
commit(types.CART_SET_ITEMS_HASH, getters.getCurrentCartHash)
}
}

Expand Down
13 changes: 13 additions & 0 deletions core/modules/cart/test/unit/helpers/createShippingInfoData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,17 @@ describe('Cart createShippingInfoData', () => {
shippingMethodCode: 'YY'
});
});

it('doesn\t add shippingCarrierCode or shippingMethodCode if missing carrier_code or method_code', async () => {
const methodsData = {
country: 'UK'
};
const shippingInfoData = createShippingInfoData(methodsData);
expect(shippingInfoData).toEqual({
billingAddress: {},
shippingAddress: {
countryId: 'UK'
}
});
});
});
6 changes: 5 additions & 1 deletion core/modules/cart/test/unit/store/synchronizeActions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ describe('Cart synchronizeActions', () => {
config.cart = {
synchronize: false
}
const contextMock = createContextMock();
const contextMock = createContextMock({
getters: {
getCurrentCartHash: 'zyx'
}
});

(contextMock.dispatch as jest.Mock).mockImplementationOnce(() => product)

Expand Down
6 changes: 3 additions & 3 deletions core/modules/catalog-next/store/category/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getFiltersFromQuery } from '../../helpers/filterHelpers'
import { Category } from '../../types/Category'
import { parseCategoryPath } from '@vue-storefront/core/modules/breadcrumbs/helpers'
import { _prepareCategoryPathIds, getSearchOptionsFromRouteParams } from '../../helpers/categoryHelpers';
import { removeStoreCodeFromRoute } from '@vue-storefront/core/lib/multistore'
import { currentStoreView, removeStoreCodeFromRoute } from '@vue-storefront/core/lib/multistore'
import cloneDeep from 'lodash-es/cloneDeep'

function mapCategoryProducts (productsFromState, productsData) {
Expand Down Expand Up @@ -77,8 +77,8 @@ const getters: GetterTree<CategoryState, RootState> = {
});
filters[attrToFilter] = filterOptions.sort(compareByLabel)
} else { // special case is range filter for prices
const storeView = rootState.storeView
const currencySign = storeView.i18n.currencySign
const currencySign = currentStoreView().i18n.currencySign

if (aggregations['agg_range_' + attrToFilter]) {
let index = 0
let count = aggregations['agg_range_' + attrToFilter].buckets.length
Expand Down
26 changes: 26 additions & 0 deletions core/modules/catalog/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus'
import { PRODUCT_SET_CURRENT_CONFIGURATION, PRODUCT_SET_CURRENT } from './store/product/mutation-types'
import omit from 'lodash-es/omit'
import config from 'config'
import { AsyncDataLoader } from '@vue-storefront/core/lib/async-data-loader';
import { currentStoreView } from '@vue-storefront/core/lib/multistore';
import { formatProductLink } from '@vue-storefront/core/modules/url/helpers';
import { Logger } from '@vue-storefront/core/lib/logger';
import { isServer } from '@vue-storefront/core/helpers';
import { router } from '@vue-storefront/core/app'

// Listeners moved from Product.js

Expand Down Expand Up @@ -110,3 +116,23 @@ export const onUserPricesRefreshed = async (store, router) => {
}, { root: true })
}
}

export const checkParentRedirection = (currentProduct, parentProduct) => {
if (parentProduct && parentProduct.id !== currentProduct.id && config.products.preventConfigurableChildrenDirectAccess) {
Logger.log('Redirecting to parent, configurable product', parentProduct.sku)()
parentProduct.parentSku = parentProduct.sku
parentProduct.sku = currentProduct.sku
const parentUrl = formatProductLink(parentProduct, currentStoreView().storeCode)
if (isServer) {
AsyncDataLoader.push({
execute: async ({ context }) => {
if (context && !context.url.includes(parentUrl)) {
context.server.response.redirect(301, parentUrl)
}
}
})
} else {
router.replace(parentUrl as string)
}
}
}
14 changes: 7 additions & 7 deletions core/modules/catalog/store/product/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus'
import { StorageManager } from '@vue-storefront/core/lib/storage-manager'
import { quickSearchByQuery } from '@vue-storefront/core/lib/search'
import { formatProductLink } from 'core/modules/url/helpers'
import { checkParentRedirection } from '@vue-storefront/core/modules/catalog/events'

const PRODUCT_REENTER_TIMEOUT = 20000

Expand Down Expand Up @@ -640,7 +641,12 @@ const actions: ActionTree<ProductState, RootState> = {
throw new Error(`Product query returned empty result product status = ${product.status}`)
}
if (product.visibility === 1) { // not visible individually (https://magento.stackexchange.com/questions/171584/magento-2-table-name-for-product-visibility)
throw new Error(`Product query returned empty result product visibility = ${product.visibility}`)
if (config.products.preventConfigurableChildrenDirectAccess) {
const parentProduct = await dispatch('findConfigurableParent', { product })
checkParentRedirection(product, parentProduct)
} else {
throw new Error(`Product query returned empty result product visibility = ${product.visibility}`)
}
}

await dispatch('loadProductAttributes', { product })
Expand All @@ -651,12 +657,6 @@ const actions: ActionTree<ProductState, RootState> = {
syncPromises.push(variantsFilter)
syncPromises.push(gallerySetup)
}
if (config.products.preventConfigurableChildrenDirectAccess) {
const parentChecker = dispatch('checkConfigurableParent', { product })
if (isServer) {
syncPromises.push(parentChecker)
}
}
await Promise.all(syncPromises)
await EventBus.$emitFilter('product-after-load', { store: rootStore, route: route })
return product
Expand Down
5 changes: 4 additions & 1 deletion core/modules/catalog/store/tax/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import config from 'config'
import { calculateProductTax } from '@vue-storefront/core/modules/catalog/helpers/taxCalc'
import { doPlatformPricesSync } from '@vue-storefront/core/modules/catalog/helpers'
import { catalogHooksExecutors } from './../../hooks'
import { currentStoreView } from '@vue-storefront/core/lib/multistore';

const actions: ActionTree<TaxState, RootState> = {
async list ({ state, commit, dispatch }, { entityType = 'taxrule' }) {
Expand Down Expand Up @@ -48,14 +49,16 @@ const actions: ActionTree<TaxState, RootState> = {
return doPlatformPricesSync(mutatedProducts)
}

let storeView = currentStoreView()

const tcs = await dispatch('list', {})
const {
defaultCountry,
defaultRegion,
sourcePriceIncludesTax,
finalPriceIncludesTax,
deprecatedPriceFieldsSupport
} = rootState.storeView.tax
} = storeView.tax

const recalculatedProducts = mutatedProducts.map(product =>
calculateProductTax({
Expand Down
3 changes: 2 additions & 1 deletion core/modules/catalog/store/tax/getters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GetterTree } from 'vuex'
import RootState from '@vue-storefront/core/types/RootState'
import TaxState from '../../types/TaxState'
import { currentStoreView } from '@vue-storefront/core/lib/multistore';

const getters: GetterTree<TaxState, RootState> = {
getRules: (state) => state.rules,
Expand All @@ -17,7 +18,7 @@ const getters: GetterTree<TaxState, RootState> = {
return currentUser.group_id
},
getIsUserGroupedTaxActive: (state, getters, rootState) => {
return typeof rootState.storeView.tax.userGroupId === 'number'
return typeof currentStoreView().tax.userGroupId === 'number'
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/core",
"version": "1.11.3",
"version": "1.11.4",
"description": "Vue Storefront Core",
"license": "MIT",
"main": "app.js",
Expand All @@ -16,7 +16,7 @@
"lean-he": "^2.0.0",
"localforage": "^1.7.2",
"lodash-es": "^4.17",
"lru-cache": "^4.0.1",
"lru-cache": "^5.1.1",
"query-string": "^6.2.0",
"redis-tag-cache": "^1.2.1",
"remove-accents": "^0.4.2",
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Manager extends installer.Manager {
*/
initStorefront () {
return this.storefront.goToDirectory()
.then(this.storefront.npmBuild.bind(this.storefront))
.then(this.storefront.depBuild.bind(this.storefront))
.then(this.storefront.runDevEnvironment.bind(this.storefront))
}

Expand Down
Loading