@jetshop/template-trend 5.15.0-minor.d6073cd2 → 5.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartItem.linaria.css +2 -1
- package/.linaria-cache/packages/ui/ChannelSelector/Region.linaria.css +3 -0
- package/package.json +5 -5
- package/schema.graphql +55 -2
- package/src/components/Cart/CartItem.js +44 -20
- package/src/components/Cart/queries/cartFragment.gql +1 -0
- package/src/shop.config.js +2 -1
- package/translations/cs.json +0 -3
- package/translations/da.json +3 -3
- package/translations/de.json +0 -3
- package/translations/default.json +3 -0
- package/translations/en.json +3 -3
- package/translations/es.json +0 -3
- package/translations/et.json +0 -3
- package/translations/fi.json +3 -0
- package/translations/fr.json +0 -3
- package/translations/it.json +0 -3
- package/translations/lv.json +0 -3
- package/translations/nb.json +3 -3
- package/translations/nl.json +0 -3
- package/translations/pl.json +0 -3
- package/translations/ru.json +0 -3
- package/translations/sk.json +0 -3
- package/translations/sv.json +4 -4
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
.ItemDetails_isr7kdh{grid-area:topleft;}
|
|
5
5
|
.LinePrice_l60fe7p{margin-top:1rem;grid-area:bottomright;font-weight:600;text-align:right;}
|
|
6
6
|
.AdjustQty_a38u2mt{margin-top:1rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;grid-area:bottomleft;}.AdjustQty_a38u2mt button{background:#f2f2f2;color:black;border-radius:50%;height:20px;width:20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.AdjustQty_a38u2mt button:focus{outline:none;}.AdjustQty_a38u2mt button:focus{outline:none;}.AdjustQty_a38u2mt span{margin:0 0.5rem;display:inline-block;}
|
|
7
|
-
.
|
|
7
|
+
.FreeGift_f1pz8l0y{margin-top:1rem;font-style:italic;grid-area:bottomleft;}.FreeGift_f1pz8l0y{margin-top:1rem;font-style:italic;grid-area:bottomleft;}
|
|
8
|
+
.RemoveItem_r1cc5ycq{grid-area:topright;text-align:right;}.RemoveItem_r1cc5ycq button{padding:0;width:1rem;height:1rem;border-radius:50%;outline:none;border:none;background:#8f8f8f;margin-left:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.RemoveItem_r1cc5ycq svg{height:8px;width:8px;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetshop/template-trend",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "react-scripts build",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@jetshop/core": "
|
|
48
|
+
"@jetshop/core": "5.16.0-alpha.86c426f4",
|
|
49
49
|
"@jetshop/flight-shortcodes": "^2.0.10",
|
|
50
|
-
"@jetshop/intl": "
|
|
51
|
-
"@jetshop/react-scripts": "
|
|
52
|
-
"@jetshop/ui": "
|
|
50
|
+
"@jetshop/intl": "5.16.0-alpha.86c426f4",
|
|
51
|
+
"@jetshop/react-scripts": "5.16.0-alpha.86c426f4",
|
|
52
|
+
"@jetshop/ui": "5.16.0-alpha.86c426f4",
|
|
53
53
|
"@react-google-maps/api": "~1.7.0",
|
|
54
54
|
"prop-types": "^15.6.2",
|
|
55
55
|
"react": "^16.9.0",
|
package/schema.graphql
CHANGED
|
@@ -745,10 +745,60 @@ type Discount {
|
|
|
745
745
|
externalId: ID
|
|
746
746
|
name: String
|
|
747
747
|
value: Price
|
|
748
|
+
type: DiscountType
|
|
748
749
|
description: String
|
|
749
750
|
campaign: Category
|
|
750
751
|
}
|
|
751
752
|
|
|
753
|
+
enum DiscountType {
|
|
754
|
+
"""No discount defined"""
|
|
755
|
+
UNDEFINED
|
|
756
|
+
|
|
757
|
+
"""Discount drops price of the order total by defined amount"""
|
|
758
|
+
FIXED_AMOUNT
|
|
759
|
+
|
|
760
|
+
"""Discount drops price of the product by X %"""
|
|
761
|
+
PERCENT
|
|
762
|
+
|
|
763
|
+
"""
|
|
764
|
+
Discount will get the amount of the cheapest product and use this as a discount
|
|
765
|
+
"""
|
|
766
|
+
ITEMS
|
|
767
|
+
|
|
768
|
+
"""
|
|
769
|
+
Discount drops total price of the product if there is at least X of them in cart
|
|
770
|
+
"""
|
|
771
|
+
ITEMS_PERCENTAGE_LIMIT
|
|
772
|
+
|
|
773
|
+
"""Only a collection of products"""
|
|
774
|
+
ONLY_USE_LANDING_PAGE
|
|
775
|
+
|
|
776
|
+
"""Discount drops price of the least expensive product in cart"""
|
|
777
|
+
PERCENT_ON_LEAST_EXPENSIVE_ITEM
|
|
778
|
+
|
|
779
|
+
"""Discount drops price of the most expensive product in cart"""
|
|
780
|
+
PERCENT_ON_MOST_EXPENSIVE_ITEM
|
|
781
|
+
|
|
782
|
+
"""Discount allows to get a free gift when the product is added"""
|
|
783
|
+
FREE_PRODUCT
|
|
784
|
+
|
|
785
|
+
"""Discount allows to get free shipping option for the product"""
|
|
786
|
+
FREE_SHIPPING
|
|
787
|
+
|
|
788
|
+
"""
|
|
789
|
+
Discount drops price for the package when all products in the package is added to cart
|
|
790
|
+
"""
|
|
791
|
+
PACKAGE_DISCOUNT
|
|
792
|
+
|
|
793
|
+
"""Discount on the order total from a voucher"""
|
|
794
|
+
BONUS_VOUCHER_DISCOUNT
|
|
795
|
+
|
|
796
|
+
"""
|
|
797
|
+
Discount allows to buy amount of X of the article, but pay only for amount of Y
|
|
798
|
+
"""
|
|
799
|
+
BUY_X_ARTICLES_PAY_Y_AMOUNT
|
|
800
|
+
}
|
|
801
|
+
|
|
752
802
|
interface Document {
|
|
753
803
|
head: HtmlHead
|
|
754
804
|
primaryRoute: Route
|
|
@@ -1055,10 +1105,10 @@ type Mutation {
|
|
|
1055
1105
|
|
|
1056
1106
|
"""
|
|
1057
1107
|
LoginMutation will log a user in.
|
|
1058
|
-
One of email, pid, externalId or
|
|
1108
|
+
One of email, pid, externalId, memberNumber or customerId is required, along with a password.
|
|
1059
1109
|
Returns an authorization token if the login was successful.
|
|
1060
1110
|
"""
|
|
1061
|
-
login(password: String, email: String, pid: String, externalId: String, memberNumber: String, externalHashId: String, timeStamp: String): LoginResponse
|
|
1111
|
+
login(password: String, email: String, pid: String, externalId: String, memberNumber: String, externalHashId: String, timeStamp: String, customerId: Int): LoginResponse
|
|
1062
1112
|
|
|
1063
1113
|
"""
|
|
1064
1114
|
Requires a valid email and returns boolean value if successful, otherwise an error will be thrown
|
|
@@ -1952,6 +2002,9 @@ type Query {
|
|
|
1952
2002
|
|
|
1953
2003
|
"""Fetches customer-unique offers"""
|
|
1954
2004
|
customerLoyalty: CustomerLoyalty
|
|
2005
|
+
|
|
2006
|
+
"""Lookup a customer by a mobile phone number"""
|
|
2007
|
+
customerLookup(phoneNumber: String): Customer
|
|
1955
2008
|
customer: Customer
|
|
1956
2009
|
|
|
1957
2010
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { styled } from 'linaria/react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
-
|
|
4
|
+
import t from '@jetshop/intl';
|
|
5
5
|
import useDecrementQuantity from '@jetshop/core/components/Mutation/useDecrementQuantity';
|
|
6
6
|
import useIncrementQuantity from '@jetshop/core/components/Mutation/useIncrementQuantity';
|
|
7
7
|
import useRemoveFromCart from '@jetshop/core/components/Mutation/useRemoveFromCart';
|
|
@@ -19,9 +19,11 @@ const Wrapper = styled('div')`
|
|
|
19
19
|
display: flex;
|
|
20
20
|
background: white;
|
|
21
21
|
margin-bottom: 0.5rem;
|
|
22
|
+
|
|
22
23
|
> :first-child {
|
|
23
24
|
flex: 1 1 25%;
|
|
24
25
|
}
|
|
26
|
+
|
|
25
27
|
> :last-child {
|
|
26
28
|
flex: 1 1 70%;
|
|
27
29
|
padding: 0.5rem;
|
|
@@ -31,9 +33,11 @@ const Wrapper = styled('div')`
|
|
|
31
33
|
const ProductName = styled('div')`
|
|
32
34
|
font-size: 0.875rem;
|
|
33
35
|
font-weight: normal;
|
|
36
|
+
|
|
34
37
|
a {
|
|
35
38
|
color: #828282;
|
|
36
39
|
}
|
|
40
|
+
|
|
37
41
|
.attribute {
|
|
38
42
|
display: block;
|
|
39
43
|
}
|
|
@@ -61,6 +65,7 @@ const AdjustQty = styled('div')`
|
|
|
61
65
|
display: flex;
|
|
62
66
|
grid-area: bottomleft;
|
|
63
67
|
/* Plus/minus buttons */
|
|
68
|
+
|
|
64
69
|
button {
|
|
65
70
|
background: #f2f2f2;
|
|
66
71
|
color: black;
|
|
@@ -70,20 +75,30 @@ const AdjustQty = styled('div')`
|
|
|
70
75
|
display: flex;
|
|
71
76
|
justify-content: center;
|
|
72
77
|
align-items: center;
|
|
78
|
+
|
|
73
79
|
:focus {
|
|
74
80
|
outline: none;
|
|
75
81
|
}
|
|
76
82
|
}
|
|
83
|
+
|
|
77
84
|
/* Count */
|
|
85
|
+
|
|
78
86
|
span {
|
|
79
87
|
margin: 0 0.5rem;
|
|
80
88
|
display: inline-block;
|
|
81
89
|
}
|
|
82
90
|
`;
|
|
83
91
|
|
|
92
|
+
const FreeGift = styled('div')`
|
|
93
|
+
margin-top: 1rem;
|
|
94
|
+
font-style: italic;
|
|
95
|
+
grid-area: bottomleft;
|
|
96
|
+
`;
|
|
97
|
+
|
|
84
98
|
const RemoveItem = styled('div')`
|
|
85
99
|
grid-area: topright;
|
|
86
100
|
text-align: right;
|
|
101
|
+
|
|
87
102
|
button {
|
|
88
103
|
padding: 0;
|
|
89
104
|
width: 1rem;
|
|
@@ -97,6 +112,7 @@ const RemoveItem = styled('div')`
|
|
|
97
112
|
justify-content: center;
|
|
98
113
|
align-items: center;
|
|
99
114
|
}
|
|
115
|
+
|
|
100
116
|
svg {
|
|
101
117
|
height: 8px;
|
|
102
118
|
width: 8px;
|
|
@@ -126,6 +142,11 @@ const CartItem = ({ item, className = '' }) => {
|
|
|
126
142
|
(value, index) => `${item.variantOptionNames[index]}: ${value}`
|
|
127
143
|
);
|
|
128
144
|
|
|
145
|
+
const isFreeItem =
|
|
146
|
+
item.discounts?.filter(d => {
|
|
147
|
+
return d.type === 'FREE_PRODUCT';
|
|
148
|
+
}).length > 0;
|
|
149
|
+
|
|
129
150
|
return (
|
|
130
151
|
<Wrapper className={className}>
|
|
131
152
|
<div>
|
|
@@ -197,25 +218,28 @@ const CartItem = ({ item, className = '' }) => {
|
|
|
197
218
|
</button>
|
|
198
219
|
</RemoveItem>
|
|
199
220
|
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
{!isFreeItem ? (
|
|
222
|
+
<AdjustQty>
|
|
223
|
+
<button
|
|
224
|
+
data-testid="decrement-quantity"
|
|
225
|
+
disabled={item.quantity === 1}
|
|
226
|
+
onClick={() =>
|
|
227
|
+
item.quantity !== 1 && decrementQuantity({ itemId: item.id })
|
|
228
|
+
}
|
|
229
|
+
>
|
|
230
|
+
-
|
|
231
|
+
</button>
|
|
232
|
+
<span data-testid="item-quantity">{item.quantity}</span>
|
|
233
|
+
<button
|
|
234
|
+
data-testid="increment-quantity"
|
|
235
|
+
onClick={() => incrementQuantity({ itemId: item.id })}
|
|
236
|
+
>
|
|
237
|
+
+
|
|
238
|
+
</button>
|
|
239
|
+
</AdjustQty>
|
|
240
|
+
) : (
|
|
241
|
+
<FreeGift>{t('Free gift')}</FreeGift>
|
|
242
|
+
)}
|
|
219
243
|
<LinePrice
|
|
220
244
|
data-testid="item-price"
|
|
221
245
|
price={item.total}
|
package/src/shop.config.js
CHANGED
package/translations/cs.json
CHANGED
package/translations/da.json
CHANGED
|
@@ -437,9 +437,6 @@
|
|
|
437
437
|
"post_code_e64b6004": {
|
|
438
438
|
"message": "Postnummer"
|
|
439
439
|
},
|
|
440
|
-
"powered_by_jetshop_a3e0968f": {
|
|
441
|
-
"message": "Powered by Jetshop"
|
|
442
|
-
},
|
|
443
440
|
"pre_order_date_required_8c33e235": {
|
|
444
441
|
"message": "Forudbestillingsdato er påkrævet"
|
|
445
442
|
},
|
|
@@ -794,5 +791,8 @@
|
|
|
794
791
|
|
|
795
792
|
"email_address_is_required_24d62494": {
|
|
796
793
|
"message": "E-mail-adresse er påkrævet"
|
|
794
|
+
},
|
|
795
|
+
"free_gift_c1c2ae5a": {
|
|
796
|
+
"message": "Gratis gave"
|
|
797
797
|
}
|
|
798
798
|
}
|
package/translations/de.json
CHANGED
package/translations/en.json
CHANGED
|
@@ -437,9 +437,6 @@
|
|
|
437
437
|
"post_code_e64b6004": {
|
|
438
438
|
"message": "Post code"
|
|
439
439
|
},
|
|
440
|
-
"powered_by_jetshop_a3e0968f": {
|
|
441
|
-
"message": "Powered by Jetshop"
|
|
442
|
-
},
|
|
443
440
|
"pre_order_date_required_8c33e235": {
|
|
444
441
|
"message": "Pre-order date required"
|
|
445
442
|
},
|
|
@@ -790,5 +787,8 @@
|
|
|
790
787
|
},
|
|
791
788
|
"the_price_has_not_changed_in_the_last_days_days_7f5c65f8": {
|
|
792
789
|
"message": "The price has not changed in the last { days } days"
|
|
790
|
+
},
|
|
791
|
+
"free_gift_c1c2ae5a": {
|
|
792
|
+
"message": "Free gift"
|
|
793
793
|
}
|
|
794
794
|
}
|
package/translations/es.json
CHANGED
package/translations/et.json
CHANGED
package/translations/fi.json
CHANGED
package/translations/fr.json
CHANGED
package/translations/it.json
CHANGED
package/translations/lv.json
CHANGED
|
@@ -437,9 +437,6 @@
|
|
|
437
437
|
"post_code_e64b6004": {
|
|
438
438
|
"message": "Pasta indekss"
|
|
439
439
|
},
|
|
440
|
-
"powered_by_jetshop_a3e0968f": {
|
|
441
|
-
"message": "Powered by Jetshop"
|
|
442
|
-
},
|
|
443
440
|
"pre_order_date_required_8c33e235": {
|
|
444
441
|
"message": "Nepieciešams iepriekšēja pasūtījuma datums"
|
|
445
442
|
},
|
package/translations/nb.json
CHANGED
|
@@ -437,9 +437,6 @@
|
|
|
437
437
|
"post_code_e64b6004": {
|
|
438
438
|
"message": "Postnummer"
|
|
439
439
|
},
|
|
440
|
-
"powered_by_jetshop_a3e0968f": {
|
|
441
|
-
"message": "Powered by Jetshop"
|
|
442
|
-
},
|
|
443
440
|
"pre_order_date_required_8c33e235": {
|
|
444
441
|
"message": "Dato for forhåndsbestilling påkrevd"
|
|
445
442
|
},
|
|
@@ -787,5 +784,8 @@
|
|
|
787
784
|
},
|
|
788
785
|
"email_address_is_required_24d62494": {
|
|
789
786
|
"message": "E-postadressen er nødvendig"
|
|
787
|
+
},
|
|
788
|
+
"free_gift_c1c2ae5a": {
|
|
789
|
+
"message": "Gratis gave"
|
|
790
790
|
}
|
|
791
791
|
}
|
package/translations/nl.json
CHANGED
package/translations/pl.json
CHANGED
|
@@ -437,9 +437,6 @@
|
|
|
437
437
|
"post_code_e64b6004": {
|
|
438
438
|
"message": "Kod pocztowy"
|
|
439
439
|
},
|
|
440
|
-
"powered_by_jetshop_a3e0968f": {
|
|
441
|
-
"message": "Powered by Jetshop"
|
|
442
|
-
},
|
|
443
440
|
"pre_order_date_required_8c33e235": {
|
|
444
441
|
"message": "Wymagana data zamówienia w przedsprzedaży"
|
|
445
442
|
},
|
package/translations/ru.json
CHANGED
package/translations/sk.json
CHANGED
package/translations/sv.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"a_to_z_96baaedc": {
|
|
3
|
-
"message": "A
|
|
3
|
+
"message": "A till Z"
|
|
4
4
|
},
|
|
5
5
|
"about_70c18bba": {
|
|
6
6
|
"message": "Om"
|
|
@@ -434,9 +434,6 @@
|
|
|
434
434
|
"post_code_e64b6004": {
|
|
435
435
|
"message": "Postnummer"
|
|
436
436
|
},
|
|
437
|
-
"powered_by_jetshop_a3e0968f": {
|
|
438
|
-
"message": "Powered by Jetshop"
|
|
439
|
-
},
|
|
440
437
|
"prev_f82cbc48": {
|
|
441
438
|
"message": "Föregående"
|
|
442
439
|
},
|
|
@@ -790,5 +787,8 @@
|
|
|
790
787
|
},
|
|
791
788
|
"view_price_history_8078c9af": {
|
|
792
789
|
"message": "Visa prishistorik"
|
|
790
|
+
},
|
|
791
|
+
"free_gift_c1c2ae5a": {
|
|
792
|
+
"message": "Gåva på köpet"
|
|
793
793
|
}
|
|
794
794
|
}
|