@jetshop/template-trend 5.15.0-minor.d6073cd2 → 5.15.0

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.
@@ -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
- .RemoveItem_r1pz8l0y{grid-area:topright;text-align:right;}.RemoveItem_r1pz8l0y 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_r1pz8l0y svg{height:8px;width:8px;}
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;}
@@ -0,0 +1,3 @@
1
+ .RegionName_r1biyodf{text-transform:uppercase;font-size:1rem;line-height:1.5rem;font-weight:600;margin:1rem 0 0.5rem 0;}
2
+
3
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetshop/template-trend",
3
- "version": "5.15.0-minor.d6073cd2",
3
+ "version": "5.15.0",
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": "^5.15.0-minor.d6073cd2",
48
+ "@jetshop/core": "5.15.0-alpha.8e29bc11",
49
49
  "@jetshop/flight-shortcodes": "^2.0.10",
50
- "@jetshop/intl": "^5.15.0-minor.d6073cd2",
51
- "@jetshop/react-scripts": "^5.15.0-minor.d6073cd2",
52
- "@jetshop/ui": "^5.15.0-minor.d6073cd2",
50
+ "@jetshop/intl": "5.15.0-alpha.8e29bc11",
51
+ "@jetshop/react-scripts": "5.15.0-alpha.8e29bc11",
52
+ "@jetshop/ui": "5.15.0-alpha.8e29bc11",
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
@@ -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
- <AdjustQty>
201
- <button
202
- data-testid="decrement-quantity"
203
- disabled={item.quantity === 1}
204
- onClick={() =>
205
- item.quantity !== 1 && decrementQuantity({ itemId: item.id })
206
- }
207
- >
208
- -
209
- </button>
210
- <span data-testid="item-quantity">{item.quantity}</span>
211
- <button
212
- data-testid="increment-quantity"
213
- onClick={() => incrementQuantity({ itemId: item.id })}
214
- >
215
- +
216
- </button>
217
- </AdjustQty>
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}
@@ -57,6 +57,7 @@ fragment Cart on Cart {
57
57
  discounts {
58
58
  name
59
59
  description
60
+ type
60
61
  value {
61
62
  ...Price
62
63
  }
@@ -76,6 +76,7 @@ const config = {
76
76
  Page: [ContentPage]
77
77
  }
78
78
  },
79
- usePrimaryRouteForProducts: false
79
+ usePrimaryRouteForProducts: false,
80
+ useTrackingConsentAPI: true
80
81
  };
81
82
  export default config;
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "PSČ"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Je požadováno datum předběžné objednávky"
445
442
  },
@@ -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
  }
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Postleitzahl"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Vorbestelldatum erforderlich"
445
442
  },
@@ -194,6 +194,9 @@
194
194
  "free_for_your_order_34aba239": {
195
195
  "message": "Free for your order"
196
196
  },
197
+ "free_gift_c1c2ae5a": {
198
+ "message": "Free gift"
199
+ },
197
200
  "free_shipping_and_return_355b42d1": {
198
201
  "message": "Free shipping and return"
199
202
  },
@@ -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
  }
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Código postal"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Es necesaria una fecha de reserva"
445
442
  },
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Postiindeks"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Eeltellimuse kuupäev kohustuslik"
445
442
  },
@@ -787,5 +787,8 @@
787
787
  },
788
788
  "email_address_is_required_24d62494": {
789
789
  "message": "Sähköpostiosoite on tarpeen"
790
+ },
791
+ "free_gift_c1c2ae5a": {
792
+ "message": "Ilmainen lahja"
790
793
  }
791
794
  }
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Code postal"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Date de précommande requise"
445
442
  },
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Codice postale"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Data di preordine necessaria"
445
442
  },
@@ -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
  },
@@ -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
  }
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Postcode"
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 datum vereist"
445
442
  },
@@ -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
  },
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "Почтовый индекс"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Требуется дата предзаказа"
445
442
  },
@@ -437,9 +437,6 @@
437
437
  "post_code_e64b6004": {
438
438
  "message": "PSČ"
439
439
  },
440
- "powered_by_jetshop_a3e0968f": {
441
- "message": "Powered by Jetshop"
442
- },
443
440
  "pre_order_date_required_8c33e235": {
444
441
  "message": "Dátum predbežnej objednávky je povinný"
445
442
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "a_to_z_96baaedc": {
3
- "message": "A til Z"
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
  }