Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit adb4aa0

Browse files
author
Marcin Kwiatkowski
authored
chore: release 1.0.0-rc.10 (#27)
1 parent a7985d7 commit adb4aa0

File tree

148 files changed

+2413
-984
lines changed

Some content is hidden

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

148 files changed

+2413
-984
lines changed

components/AppHeader.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@
1212
</template>
1313
<template #aside>
1414
<div class="sf-header__switchers">
15-
<CurrencySelector class="smartphone-only" />
16-
<StoreSwitcher class="smartphone-only" />
15+
<CurrencySelector
16+
v-if="hasCurrencyToSelect"
17+
class="smartphone-only"
18+
/>
19+
<StoreSwitcher
20+
v-if="hasStoresToSelect"
21+
class="smartphone-only"
22+
/>
1723
</div>
1824
</template>
1925
<template #header-icons="{ activeIcon }">
@@ -96,6 +102,7 @@
96102
v-if="isSearchOpen"
97103
:visible="isSearchOpen"
98104
:search-results="productSearchResults"
105+
@close="isSearchOpen = false"
99106
/>
100107
<SfOverlay :visible="isSearchOpen" />
101108
</div>
@@ -126,22 +133,21 @@ import { useWishlist } from '~/modules/wishlist/composables/useWishlist';
126133
import { useUser } from '~/modules/customer/composables/useUser';
127134
import { useWishlistStore } from '~/modules/wishlist/store/wishlistStore';
128135
import type { CategoryTree, ProductInterface } from '~/modules/GraphQL/types';
129-
import CurrencySelector from '~/components/CurrencySelector.vue';
130136
import HeaderLogo from '~/components/HeaderLogo.vue';
131137
import SvgImage from '~/components/General/SvgImage.vue';
132-
import StoreSwitcher from '~/components/StoreSwitcher.vue';
138+
import { useTopBar } from './TopBar/useTopBar';
133139
134140
export default defineComponent({
135141
components: {
136142
HeaderNavigation,
137143
SfHeader,
138144
SfOverlay,
139-
CurrencySelector,
140145
HeaderLogo,
141-
StoreSwitcher,
142146
SvgImage,
143147
SfButton,
144148
SfBadge,
149+
CurrencySelector: () => import('~/components/CurrencySelector.vue'),
150+
StoreSwitcher: () => import('~/components/StoreSwitcher.vue'),
145151
SearchBar: () => import('~/components/Header/SearchBar/SearchBar.vue'),
146152
SearchResults: () => import(
147153
/* webpackPrefetch: true */ '~/components/Header/SearchBar/SearchResults.vue'
@@ -157,6 +163,8 @@ export default defineComponent({
157163
const { loadItemsCount: loadWishlistItemsCount } = useWishlist();
158164
const { categories: categoryList, load: categoriesListLoad } = useCategory();
159165
166+
const { hasCurrencyToSelect, hasStoresToSelect } = useTopBar();
167+
160168
const isSearchOpen = ref(false);
161169
const productSearchResults = ref<ProductInterface[] | null>(null);
162170
@@ -204,6 +212,8 @@ export default defineComponent({
204212
toggleWishlistSidebar,
205213
wishlistHasProducts,
206214
wishlistItemsQty,
215+
hasCurrencyToSelect,
216+
hasStoresToSelect,
207217
};
208218
},
209219
});

components/BottomNavigation.vue

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<SfBottomNavigationItem
55
:class="{ 'sf-bottom-navigation__item--active': $route.name && $route.name.startsWith('home') }"
66
label="Home"
7-
@click="$router.push(app.localePath('/')) && (isMobileMenuOpen ? toggleMobileMenu() : false)"
7+
data-testid="bottom-navigation-home"
8+
@click="handleHomeClick"
89
>
910
<template #icon>
1011
<SvgImage
@@ -17,6 +18,7 @@
1718
</SfBottomNavigationItem>
1819
<SfBottomNavigationItem
1920
label="Menu"
21+
data-testid="bottom-navigation-menu"
2022
@click="loadCategoryMenu"
2123
>
2224
<template #icon>
@@ -31,6 +33,7 @@
3133
<SfBottomNavigationItem
3234
v-if="isAuthenticated"
3335
label="Wishlist"
36+
data-testid="bottom-navigation-wishlist"
3437
@click="toggleWishlistSidebar"
3538
>
3639
<template #icon>
@@ -44,6 +47,7 @@
4447
</SfBottomNavigationItem>
4548
<SfBottomNavigationItem
4649
label="Account"
50+
data-testid="bottom-navigation-account"
4751
@click="handleAccountClick"
4852
>
4953
<template #icon>
@@ -56,11 +60,12 @@
5660
</template>
5761
</SfBottomNavigationItem>
5862
<SfBottomNavigationItem
59-
:label="$route.name && $route.name.startsWith('product') ? 'Add to Cart' : 'Basket'"
63+
:label="$t('Cart')"
64+
data-testid="bottom-navigation-cart"
6065
@click="toggleCartSidebar"
6166
>
6267
<template #icon>
63-
<SfCircleIcon aria-label="Add to cart">
68+
<SfCircleIcon aria-label="Go to cart">
6469
<SvgImage
6570
icon="add_to_cart"
6671
width="25"
@@ -78,14 +83,15 @@
7883
<script lang="ts">
7984
import { SfBottomNavigation, SfCircleIcon } from '@storefront-ui/vue';
8085
import { defineComponent, useRouter, useContext } from '@nuxtjs/composition-api';
81-
import { useUiState } from '~/composables';
86+
import { useUiState } from '~/composables/useUiState';
8287
import { useUser } from '~/modules/customer/composables/useUser';
8388
import SvgImage from '~/components/General/SvgImage.vue';
8489
import { useCategoryStore } from '~/modules/catalog/category/stores/category';
8590
8691
const MobileCategorySidebar = () => import('~/modules/catalog/category/components/sidebar/MobileCategorySidebar/MobileCategorySidebar.vue');
8792
8893
export default defineComponent({
94+
name: 'BottomNavigation',
8995
components: {
9096
SfBottomNavigation,
9197
SfCircleIcon,
@@ -103,6 +109,15 @@ export default defineComponent({
103109
const { isAuthenticated } = useUser();
104110
const router = useRouter();
105111
const { app } = useContext();
112+
113+
const handleHomeClick = async () => {
114+
const homePath = app.localeRoute({ name: 'home' });
115+
await router.push(homePath);
116+
if (isMobileMenuOpen.value) {
117+
toggleMobileMenu();
118+
}
119+
};
120+
106121
const handleAccountClick = async () => {
107122
if (isAuthenticated.value) {
108123
await router.push(app.localeRoute({ name: 'customer' }));
@@ -127,7 +142,7 @@ export default defineComponent({
127142
toggleMobileMenu,
128143
loadCategoryMenu,
129144
handleAccountClick,
130-
app,
145+
handleHomeClick,
131146
};
132147
},
133148
});

components/CartSidebar.vue

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<SfCollectedProduct
9393
v-for="product in products"
9494
:key="product.product.original_sku"
95+
:has-more-actions="false"
9596
data-testid="cart-sidebar-collected-product"
9697
:image="cartGetters.getItemImage(product)"
9798
:title="cartGetters.getItemName(product)"
@@ -293,7 +294,7 @@ import {
293294
useContext,
294295
onMounted,
295296
} from '@nuxtjs/composition-api';
296-
import _debounce from 'lodash.debounce';
297+
import { debounce } from 'lodash-es';
297298
import { cartGetters } from '~/getters';
298299
import {
299300
useUiState,
@@ -396,7 +397,7 @@ export default defineComponent({
396397
title: 'Product removed',
397398
});
398399
};
399-
const delayedUpdateItemQty = _debounce(
400+
const delayedUpdateItemQty = debounce(
400401
(params) => updateItemQty(params),
401402
1000,
402403
);
@@ -548,31 +549,12 @@ export default defineComponent({
548549
}
549550
}
550551
551-
&__actions {
552-
transition: opacity 150ms ease-in-out;
553-
}
554-
555-
&__save,
556-
&__compare {
557-
--button-padding: 0;
558-
559-
&:focus {
560-
--cp-save-opacity: 1;
561-
--cp-compare-opacity: 1;
562-
}
563-
}
564-
565-
&__save {
566-
opacity: var(--cp-save-opacity, 0);
567-
}
568-
569-
&__compare {
570-
opacity: var(--cp-compare-opacity, 0);
552+
::v-deep .sf-collected-product__actions {
553+
display: none;
571554
}
572555
573556
&:hover {
574-
--cp-save-opacity: 1;
575-
--cp-compare-opacity: 1;
557+
--collected-product-configuration-display: initial;
576558
@include for-desktop {
577559
.collected-product__properties {
578560
display: none;

components/Checkout/UserBillingAddresses.vue

Lines changed: 0 additions & 111 deletions
This file was deleted.

components/CurrencySelector/CurrenciesModal.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export default defineComponent({
4848
},
4949
props: {
5050
isModalOpen: Boolean,
51-
selectedCurrency: String,
51+
selectedCurrency: {
52+
type: String,
53+
default: '',
54+
},
5255
},
5356
emits: ['closeModal'],
5457
setup() {
@@ -58,7 +61,7 @@ export default defineComponent({
5861
load: loadCurrencies,
5962
} = useCurrency();
6063
61-
const availableCurrencies = computed(() => currencies.value?.available_currency_codes || []);
64+
const availableCurrencies = computed<string[]>(() => currencies.value?.available_currency_codes || []);
6265
6366
onMounted(() => {
6467
if (currencies.value && currencies.value?.available_currency_codes) return;

0 commit comments

Comments
 (0)