Skip to content

Commit

Permalink
Merge pull request #2630 from szafran89/feature/bus-removal
Browse files Browse the repository at this point in the history
Event bus import removal
  • Loading branch information
patzick committed Apr 1, 2019
2 parents 6519c14 + 3c592c5 commit 8b3a1c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved visibility of product SKU in wishlist - @PanMisza (#2606)
- Instant focus to search input field after click on search icon in navbar - @ca1zr (#2608)
- Added support for the newest node version - @gdomiciano (#2669)
- Used `$bus` plugin instead of EventBus import - @szafran89 (#2630)

## [1.9.0-rc.2] - UNRELEASED

Expand Down
2 changes: 1 addition & 1 deletion core/pages/Category.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default {
})
}
this.$store.dispatch('category/products', this.getCurrentCategoryProductQuery)
EventBus.$emitFilter('category-after-load', { store: this.$store, route: route })
this.$bus.$emitFilter('category-after-load', { store: this.$store, route: route })
}
}).catch(err => {
if (err.message.indexOf('query returned empty result') > 0) {
Expand Down
4 changes: 2 additions & 2 deletions core/pages/Product.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default {
this.$forceUpdate()
},
onAfterFilterChanged (filterOption) {
EventBus.$emit('product-before-configure', { filterOption: filterOption, configuration: this.configuration })
this.$bus.$emit('product-before-configure', { filterOption: filterOption, configuration: this.configuration })
const prevOption = this.configuration[filterOption.attribute_code]
this.configuration[filterOption.attribute_code] = filterOption
this.$forceUpdate() // this is to update the available options regarding current selection
Expand Down Expand Up @@ -213,7 +213,7 @@ export default {
onUserPricesRefreshed () {
if (this.$route.params.parentSku) {
this.$store.dispatch('product/reset')
EventBus.$emit('product-before-load', { store: this.$store, route: this.$route })
this.$bus.$emit('product-before-load', { store: this.$store, route: this.$route })
this.$store.dispatch('product/single', {
options: {
sku: this.$route.params.parentSku,
Expand Down
7 changes: 3 additions & 4 deletions src/themes/default/layouts/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

<script>
import { mapState } from 'vuex'
import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus'
import AsyncSidebar from 'theme/components/theme/blocks/AsyncSidebar/AsyncSidebar.vue'
import MainHeader from 'theme/components/core/blocks/Header/Header.vue'
import MainFooter from 'theme/components/core/blocks/Footer/Footer.vue'
Expand Down Expand Up @@ -83,7 +82,7 @@ export default {
onOrderConfirmation (payload) {
this.loadOrderConfirmation = true
this.ordersData = payload
EventBus.$emit('modal-show', 'modal-order-confirmation')
this.$bus.$emit('modal-show', 'modal-order-confirmation')
},
fetchMenuData () {
return this.$store.dispatch('category/list', { level: this.$store.state.config.entities.category.categoriesDynamicPrefetch && this.$store.state.config.entities.category.categoriesDynamicPrefetchLevel ? this.$store.state.config.entities.category.categoriesDynamicPrefetchLevel : null, includeFields: this.$store.state.config.entities.optimize && isServer ? this.$store.state.config.entities.category.includeFields : null, skipCache: isServer })
Expand All @@ -102,10 +101,10 @@ export default {
this.$router.afterEach((to, from) => {
this.$Progress.finish()
})
EventBus.$on('offline-order-confirmation', this.onOrderConfirmation)
this.$bus.$on('offline-order-confirmation', this.onOrderConfirmation)
},
beforeDestroy () {
EventBus.$off('offline-order-confirmation', this.onOrderConfirmation)
this.$bus.$off('offline-order-confirmation', this.onOrderConfirmation)
},
metaInfo: Head,
components: {
Expand Down

0 comments on commit 8b3a1c5

Please sign in to comment.