Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 1202f53

Browse files
authored
Merge pull request #367 from DivanteLtd/develop
Release v1.0.0-rc.2
2 parents 85e1f35 + 90ec32d commit 1202f53

18 files changed

+87
-80
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Support for Storefront UI v0.7.8
12+
- Support for Storefront UI v0.7.10 (#360)
1313

1414
### Changed / Improved
1515

@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- Show login modal for my account link in footer (#325)
2222
- Tabs on the product page are not reset properly (#228)
2323
- Add changelog (#345)
24+
- Support discount coupons in mobile view (#361)
2425

2526
## [1.0.0-rc.1] - 2020-04-27
2627

components/atoms/a-account-icon.vue

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
<template>
2-
<SfIcon
3-
icon="profile"
4-
size="xs"
5-
class="sf-header__icon a-account-icon"
6-
:class="{
7-
'sf-header__icon--is-active': isLoggedIn
8-
}"
9-
role="button"
10-
aria-label="account"
2+
<SfButton
3+
class="sf-button--pure a-account-icon"
114
@click="goToAccount"
12-
/>
5+
>
6+
<SfIcon
7+
icon="account"
8+
size="xs"
9+
class="sf-header__icon"
10+
:class="{
11+
'sf-header__icon--is-active': isLoggedIn
12+
}"
13+
/>
14+
</SfButton>
1315
</template>
1416

1517
<script>
16-
import { SfIcon } from '@storefront-ui/vue';
18+
import { SfIcon, SfButton } from '@storefront-ui/vue';
1719
import { mapGetters, mapActions } from 'vuex';
1820
import { ModalList } from 'theme/store/ui/modals'
1921
2022
export default {
21-
components: { SfIcon },
23+
components: { SfIcon, SfButton },
2224
computed: {
2325
...mapGetters('user', ['isLoggedIn'])
2426
},
@@ -30,7 +32,7 @@ export default {
3032
if (this.isLoggedIn) {
3133
this.$router.push(this.localizedRoute('/my-account'))
3234
} else {
33-
this.openModal({name: ModalList.Auth, payload: 'login'})
35+
this.openModal({ name: ModalList.Auth, payload: 'login' })
3436
}
3537
}
3638
}

components/atoms/a-microcart-icon.vue

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
<template>
2-
<div class="a-microcart-icon">
2+
<SfButton
3+
class="sf-button--pure a-microcart-icon"
4+
@click="openMicrocart"
5+
>
36
<SfIcon
47
size="xs"
58
:icon="floatingIcon ? 'add_to_cart' : 'empty_cart'"
69
:class="floatingIcon ? 'sf-bottom-navigation__floating-icon' : 'sf-header__icon'"
7-
role="button"
810
:aria-label="$t('Open microcart')"
9-
@click="openMicrocart"
10-
/>
11-
<SfBadge v-show="!floatingIcon && totalQuantity" class="badge">
12-
{{ totalQuantity }}
13-
</SfBadge>
14-
</div>
11+
>
12+
<template #badge>
13+
<SfBadge v-show="!floatingIcon && totalQuantity" class="sf-icon__badge sf-badge--number">
14+
{{ totalQuantity }}
15+
</SfBadge>
16+
</template>
17+
</SfIcon>
18+
</SfButton>
1519
</template>
1620

1721
<script>
1822
import { mapGetters, mapActions } from 'vuex';
19-
import { SfIcon, SfBadge } from '@storefront-ui/vue';
23+
import { SfIcon, SfButton, SfBadge } from '@storefront-ui/vue';
2024
2125
export default {
22-
components: { SfIcon, SfBadge },
26+
components: { SfIcon, SfButton, SfBadge },
2327
props: {
2428
floatingIcon: {
2529
type: Boolean,
@@ -46,14 +50,4 @@ export default {
4650
cursor: pointer;
4751
}
4852
}
49-
.badge {
50-
position: absolute;
51-
bottom: 2.2em;
52-
left: 4.2em;
53-
font-size: 0.6em;
54-
padding: 0.3em 0;
55-
border-radius: 100%;
56-
width: 2.2em;
57-
min-height: 2.2em;
58-
}
5953
</style>

components/molecules/m-menu.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="m-menu">
2+
<div class="m-menu sf-mega-menu">
33
<SfMegaMenu
44
:title="title || currentCategoryTitle"
55
:visible="visible"
@@ -106,6 +106,7 @@ export default {
106106
<style lang="scss" scoped>
107107
@import "~@storefront-ui/shared/styles/helpers/breakpoints";
108108
.m-menu {
109+
padding: 0;
109110
position: absolute;
110111
left: 0;
111112
width: 100%;

components/molecules/m-price-summary.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
:class="{'sf-property--large': isLarge}"
3333
/>
3434
<SfButton
35-
v-if="allowPromoCodeRemoval"
3635
class="sf-button sf-button--outline promo-code__button"
3736
@click="removeCoupon"
3837
>
@@ -63,10 +62,6 @@ export default {
6362
isLarge: {
6463
type: Boolean,
6564
default: false
66-
},
67-
allowPromoCodeRemoval: {
68-
type: Boolean,
69-
default: false
7065
}
7166
},
7267
computed: {

components/molecules/m-product-additional-info.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<SfTabs
33
class="m-product-additional-info product__tabs"
4-
:open-tab="openTab"
5-
:key="product.id"
64
id="m-product-additional-info"
5+
ref="productTabs"
6+
@toggle="onToggle"
77
>
88
<SfTab :title="$t('Description')">
99
<div itemprop="description" v-html="product.description" />
@@ -15,7 +15,7 @@
1515
class="product__property"
1616
/>
1717
</SfTab>
18-
<SfTab :title="$t('Read reviews')">
18+
<SfTab :title="$t('Read reviews')" ref="reviewTab">
1919
<div class="review-header">
2020
<SfHeading
2121
:title="$t('{count} Reviews', { count: reviewsCount })"
@@ -37,7 +37,7 @@
3737

3838
<script>
3939
import { ModalList } from 'theme/store/ui/modals';
40-
import { mapActions } from 'vuex';
40+
import { mapState, mapActions } from 'vuex';
4141
import { SfHeading, SfTabs, SfDivider } from '@storefront-ui/vue';
4242
import AProductRating from 'theme/components/atoms/a-product-rating';
4343
import AProductAttribute from 'theme/components/atoms/a-product-attribute';
@@ -68,22 +68,32 @@ export default {
6868
}
6969
},
7070
computed: {
71-
openTab () {
72-
return this.$store.state.ui.activeProductTab
73-
},
71+
...mapState({
72+
isReviewProductTab: state => state.ui.isReviewProductTab
73+
}),
7474
reviewsCount () {
75-
return this.reviews.length
75+
return this.reviews.length;
76+
}
77+
},
78+
watch: {
79+
isReviewProductTab (value) {
80+
if (value && !this.$refs.reviewTab.isActive) {
81+
this.$refs.productTabs.toggle(this.$refs.reviewTab._uid);
82+
}
7683
}
7784
},
7885
beforeDestroy () {
79-
this.$store.commit('ui/setActiveProductTab', 1);
86+
this.$store.commit('ui/setReviewProductTab', false);
8087
},
8188
methods: {
8289
...mapActions('ui', {
8390
openModal: 'openModal'
8491
}),
8592
handleOpenReviewModal () {
86-
this.openModal({name: ModalList.Review, payload: this.product.id})
93+
this.openModal({ name: ModalList.Review, payload: this.product.id })
94+
},
95+
onToggle (id) {
96+
this.$store.commit('ui/setReviewProductTab', id === this.$refs.reviewTab._uid);
8797
}
8898
}
8999
};

components/molecules/m-product-short-info.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default {
6464
},
6565
methods: {
6666
openReviewsTab () {
67-
this.$store.commit('ui/setActiveProductTab', 2);
67+
this.$store.commit('ui/setReviewProductTab', true);
6868
6969
const reviewsEl = document.querySelector('#m-product-additional-info');
7070
if (!reviewsEl) return;

components/molecules/m-review-list.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666
immediate: true,
6767
handler (to, from) {
6868
if (to.query.reviewPage) {
69-
this.setCurrentPage(to.query.reviewPage);
69+
this.setCurrentPage(parseInt(to.query.reviewPage) || 1);
7070
}
7171
}
7272
}

components/organisms/o-confirm-order.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
</SfCheckbox>
224224
</div>
225225
</div>
226+
<APromoCode class="mobile-only" :allow-promo-code-removal="false" />
226227
<div class="characteristics mobile-only">
227228
<SfCharacteristic
228229
v-for="characteristic in characteristics"
@@ -253,7 +254,7 @@
253254
</SfCheckbox>
254255
<APromoCode :allow-promo-code-removal="false" />
255256
</div>
256-
<MPriceSummary class="totals__element" :allow-promo-code-removal="true" />
257+
<MPriceSummary class="totals__element" />
257258
</div>
258259
<div class="actions">
259260
<SfButton
@@ -407,7 +408,7 @@ export default {
407408
});
408409
},
409410
openTermsAndConditionsModal () {
410-
this.openModal({name: ModalList.TermsAndConditions})
411+
this.openModal({ name: ModalList.TermsAndConditions })
411412
}
412413
},
413414
mounted () {
@@ -593,4 +594,10 @@ a {
593594
.no-flex {
594595
flex: unset;
595596
}
597+
.promo-code {
598+
&.mobile-only {
599+
max-width: 100%;
600+
width: 20rem;
601+
}
602+
}
596603
</style>

components/organisms/o-header.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
/>
88
<SfHeader
99
:active-icon="activeIcon"
10-
:is-sticky="isSearchPanelVisible"
11-
:has-mobile-search="isSearchPanelVisible"
10+
:class="{
11+
'sf-header--has-mobile-search': isSearchPanelVisible,
12+
'sf-header--is-sticky': isSearchPanelVisible
13+
}"
14+
:style="{'z-index': isHoveredMenu ? 2 : 1}"
1215
>
1316
<template #logo>
1417
<ALogo />
@@ -48,8 +51,8 @@
4851
</template>
4952
<template #header-icons>
5053
<div class="sf-header__icons">
51-
<AAccountIcon />
52-
<AMicrocartIcon />
54+
<AAccountIcon class="sf-header__action" />
55+
<AMicrocartIcon class="sf-header__action" />
5356
</div>
5457
</template>
5558
</SfHeader>
@@ -148,7 +151,7 @@ export default {
148151
z-index: 1;
149152
}
150153
.o-header {
151-
--header-navigation-item-margin: 0 3rem 0 0;
154+
--header-navigation-item-margin: 0 2rem 0 0;
152155
box-sizing: border-box;
153156
a {
154157
&.active {
@@ -192,9 +195,6 @@ export default {
192195
cursor: pointer;
193196
}
194197
}
195-
&__icons > :first-child {
196-
margin: 0;
197-
}
198198
}
199199
}
200200
</style>

0 commit comments

Comments
 (0)