Skip to content

Commit

Permalink
Merge branch 'master' into refactor/product-price-displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
patzick committed May 9, 2022
2 parents 24c5bb0 + 435e2fe commit 51dcc60
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/templates/project-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@shopware-pwa/nuxt-module": "latest",
"@storefront-ui/vue": "0.12.3",
"@storefront-ui/vue": "0.13.1",
"@vue/test-utils": "^1.3.0",
"@vuelidate/core": "^2.0.0-alpha.35",
"@vuelidate/validators": "^2.0.0-alpha.27",
Expand Down
2 changes: 1 addition & 1 deletion packages/default-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@shopware-pwa/cli": "1.4.0",
"@shopware-pwa/theme-base": "1.4.0",
"@storefront-ui/vue": "0.12.3",
"@storefront-ui/vue": "0.13.1",
"@vuelidate/core": "^2.0.0-alpha.35",
"@vuelidate/validators": "^2.0.0-alpha.27",
"dayjs": "^1.10.8",
Expand Down
21 changes: 1 addition & 20 deletions packages/default-theme/src/components/SwCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@
<div v-if="count">
<SfProperty
:name="$t('Total price')"
class="
sf-property--full-width sf-property--large
my-cart__total-price
"
class="sf-property--full-width sf-property--large my-cart__total-price"
>
<template #value>
<SfPrice
Expand Down Expand Up @@ -99,10 +96,6 @@ import { computed, onMounted, ref, watch } from "@vue/composition-api"
import SwImage from "@/components/atoms/SwImage.vue"
import { usePriceFilter } from "@/logic/usePriceFilter.js"
import { disableBodyScroll, clearAllBodyScrollLocks } from "body-scroll-lock"
import {
mapMobileObserver,
unMapMobileObserver,
} from "@storefront-ui/vue/src/utilities/mobile-observer"
export default {
name: "SwCart",
Expand Down Expand Up @@ -159,20 +152,8 @@ export default {
filterPrice: usePriceFilter(),
}
},
computed: {
...mapMobileObserver(),
},
beforeDestroy() {
unMapMobileObserver()
},
watch: {
isSidebarOpen(val) {
// until it's fixed in the storefront-ui we need to disable body scroll lock on mobile
if (this.isMobile) {
setTimeout(() => {
clearAllBodyScrollLocks()
}, 0)
}
if (!val) {
this.$nextTick(() => {
clearAllBodyScrollLocks()
Expand Down
17 changes: 7 additions & 10 deletions packages/default-theme/src/components/SwSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import { ref, reactive, onMounted, computed } from "@vue/composition-api"
import { getSearchPageUrl } from "@/helpers"
import { SfSearchBar } from "@storefront-ui/vue"
import { useProductQuickSearch } from "@shopware-pwa/composables"
import {
mapMobileObserver,
unMapMobileObserver,
} from "@storefront-ui/vue/src/utilities/mobile-observer"
import { debounce } from "@shopware-pwa/helpers"
const SwSuggestSearch = () => import("@/components/SwSuggestSearch.vue")
Expand All @@ -55,17 +51,21 @@ export default {
}
}, 300)
// TODO: reactive observer
const isMobile = ref(true)
onMounted(() => {
isMobile.value = window?.innerWidth < 768
})
return {
getProducts,
getTotal,
isSuggestBoxOpen,
typingQuery,
performSuggestSearch,
isMobile,
}
},
computed: {
...mapMobileObserver(),
},
watch: {
$route(to, from) {
this.isSuggestBoxOpen = false
Expand All @@ -76,9 +76,6 @@ export default {
}
},
},
beforeDestroy() {
unMapMobileObserver()
},
methods: {
performSearch() {
if (this.typingQuery.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ export default function getPlaceholderImage(width, height) {
</linearGradient>
</svg>`

return `data:image/svg+xml;base64,${btoa(svgSource)}`
const buf = Buffer.from(svgSource, "utf8")

return `data:image/svg+xml;base64,${buf.toString("base64")}`
}
1 change: 1 addition & 0 deletions packages/nuxt-module/__tests__/module.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ describe("nuxt-module - ShopwarePWAModule runModule", () => {
await runModule(moduleObject, {});
expect(packages.useCorePackages).toBeCalledWith(moduleObject, [
"@shopware-pwa/composables",
"@shopware-pwa/commons",
"@shopware-pwa/helpers",
"@shopware-pwa/shopware-6-client",
"@storefront-ui/vue",
Expand Down
6 changes: 6 additions & 0 deletions packages/nuxt-module/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ export async function runModule(
// TODO: start - remove this, only for default-theme
moduleObject.options.build = moduleObject.options.build || {};
moduleObject.options.build.babel = moduleObject.options.build.babel || {};
// https://github.com/zloirock/core-js/issues/743
moduleObject.options.build.babel.exclude = [
/\bcore-js\b/,
/\bwebpack\/buildin\b/,
];
/* istanbul ignore next */
moduleObject.options.build.babel.presets = ({ isServer }) => {
return [
Expand All @@ -234,6 +239,7 @@ export async function runModule(

const corePackages: string[] = [
"@shopware-pwa/composables",
"@shopware-pwa/commons",
"@shopware-pwa/helpers",
"@shopware-pwa/shopware-6-client",
"@storefront-ui/vue",
Expand Down

0 comments on commit 51dcc60

Please sign in to comment.