@graphcommerce/magento-product 9.0.0-canary.56 → 9.0.0-canary.58
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/CHANGELOG.md +58 -93
- package/components/ProductFiltersPro/ProductFiltersProAggregations.tsx +17 -9
- package/components/ProductListFilters/ProductListFilters.tsx +13 -19
- package/components/ProductListItems/ProductFilterTypes.graphql +8 -0
- package/components/ProductListItems/filterTypes.tsx +0 -2
- package/components/ProductListItems/filteredProductList.tsx +9 -9
- package/components/ProductListItems/getFilterTypes.ts +33 -4
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 9.0.0-canary.58
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2328](https://github.com/graphcommerce-org/graphcommerce/pull/2328) [`ee04368`](https://github.com/graphcommerce-org/graphcommerce/commit/ee04368444f732e5541a595db6e2ef66d15add68) - Move to attributesList to get a list of filterable attributes instead of using an introspection query. `productFiltersProSectionRenderer` and `productFiltersProChipRenderer` keys now now one of `AttributeFrontendInputEnum`. ([@paales](https://github.com/paales))
|
8
|
+
|
9
|
+
## 9.0.0-canary.57
|
10
|
+
|
3
11
|
## 9.0.0-canary.56
|
4
12
|
|
5
13
|
## 9.0.0-canary.55
|
@@ -14,8 +22,7 @@
|
|
14
22
|
|
15
23
|
### Minor Changes
|
16
24
|
|
17
|
-
- [#2322](https://github.com/graphcommerce-org/graphcommerce/pull/2322) [`4d08a2b`](https://github.com/graphcommerce-org/graphcommerce/commit/4d08a2bd8c1919bd85b18e8e856775d18fb67e00) - Rename configurable_customizable back to customizable_options
|
18
|
-
([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
25
|
+
- [#2322](https://github.com/graphcommerce-org/graphcommerce/pull/2322) [`4d08a2b`](https://github.com/graphcommerce-org/graphcommerce/commit/4d08a2bd8c1919bd85b18e8e856775d18fb67e00) - Rename configurable_customizable back to customizable_options ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
19
26
|
|
20
27
|
## 8.1.0-canary.50
|
21
28
|
|
@@ -39,9 +46,7 @@
|
|
39
46
|
|
40
47
|
### Patch Changes
|
41
48
|
|
42
|
-
- [#2242](https://github.com/graphcommerce-org/graphcommerce/pull/2242) [`a4cce76`](https://github.com/graphcommerce-org/graphcommerce/commit/a4cce76ca37af2bec604e953ada4bb11bd91f55d) - Add option to show an extended version of the pagination component. Configurable via the "productListPaginationVariant" key in your graphcommerce.config.js
|
43
|
-
COMPACT means: "< Page X of Y >"
|
44
|
-
EXTENDED means: "< 1 2 ... [5] ... 10 11 >" ([@FrankHarland](https://github.com/FrankHarland))
|
49
|
+
- [#2242](https://github.com/graphcommerce-org/graphcommerce/pull/2242) [`a4cce76`](https://github.com/graphcommerce-org/graphcommerce/commit/a4cce76ca37af2bec604e953ada4bb11bd91f55d) - Add option to show an extended version of the pagination component. Configurable via the "productListPaginationVariant" key in your graphcommerce.config.js COMPACT means: "< Page X of Y >" EXTENDED means: "< 1 2 ... [5] ... 10 11 >" ([@FrankHarland](https://github.com/FrankHarland))
|
45
50
|
|
46
51
|
## 8.1.0-canary.40
|
47
52
|
|
@@ -73,8 +78,7 @@
|
|
73
78
|
|
74
79
|
### Minor Changes
|
75
80
|
|
76
|
-
- [#2273](https://github.com/graphcommerce-org/graphcommerce/pull/2273) [`77955c5`](https://github.com/graphcommerce-org/graphcommerce/commit/77955c56ac8633ab1c5e0f3ddb25e3a87236e2bb) - Improve Breadcrumbs on Category and Product pages
|
77
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
81
|
+
- [#2273](https://github.com/graphcommerce-org/graphcommerce/pull/2273) [`77955c5`](https://github.com/graphcommerce-org/graphcommerce/commit/77955c56ac8633ab1c5e0f3ddb25e3a87236e2bb) - Improve Breadcrumbs on Category and Product pages ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
78
82
|
|
79
83
|
## 8.1.0-canary.26
|
80
84
|
|
@@ -110,8 +114,7 @@
|
|
110
114
|
|
111
115
|
### Patch Changes
|
112
116
|
|
113
|
-
- [#2255](https://github.com/graphcommerce-org/graphcommerce/pull/2255) [`679d07d`](https://github.com/graphcommerce-org/graphcommerce/commit/679d07dad5b5e2dab3c0f3d537716b6115af8ef7) - make the ProductPageMeta fragment injectable
|
114
|
-
([@carlocarels90](https://github.com/carlocarels90))
|
117
|
+
- [#2255](https://github.com/graphcommerce-org/graphcommerce/pull/2255) [`679d07d`](https://github.com/graphcommerce-org/graphcommerce/commit/679d07dad5b5e2dab3c0f3d537716b6115af8ef7) - make the ProductPageMeta fragment injectable ([@carlocarels90](https://github.com/carlocarels90))
|
115
118
|
|
116
119
|
## 8.1.0-canary.10
|
117
120
|
|
@@ -127,15 +130,13 @@
|
|
127
130
|
|
128
131
|
### Patch Changes
|
129
132
|
|
130
|
-
- [#2224](https://github.com/graphcommerce-org/graphcommerce/pull/2224) [`4dd2d01`](https://github.com/graphcommerce-org/graphcommerce/commit/4dd2d01b3e14e3107ee3e337bef2a8528d654e75) - When applying a filter it would not always scroll to the #products.
|
131
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
133
|
+
- [#2224](https://github.com/graphcommerce-org/graphcommerce/pull/2224) [`4dd2d01`](https://github.com/graphcommerce-org/graphcommerce/commit/4dd2d01b3e14e3107ee3e337bef2a8528d654e75) - When applying a filter it would not always scroll to the #products. ([@FrankHarland](https://github.com/FrankHarland))
|
132
134
|
|
133
135
|
## 8.0.6-canary.4
|
134
136
|
|
135
137
|
### Patch Changes
|
136
138
|
|
137
|
-
- [#2227](https://github.com/graphcommerce-org/graphcommerce/pull/2227) [`d597719`](https://github.com/graphcommerce-org/graphcommerce/commit/d597719baaabbe079660ac063fd021d871831511) - Added option to change sort order (ASC / DESC) for sort options (Name, price, position etc) on catalog and search pages.
|
138
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
139
|
+
- [#2227](https://github.com/graphcommerce-org/graphcommerce/pull/2227) [`d597719`](https://github.com/graphcommerce-org/graphcommerce/commit/d597719baaabbe079660ac063fd021d871831511) - Added option to change sort order (ASC / DESC) for sort options (Name, price, position etc) on catalog and search pages. ([@FrankHarland](https://github.com/FrankHarland))
|
139
140
|
|
140
141
|
## 8.0.6-canary.3
|
141
142
|
|
@@ -143,11 +144,9 @@
|
|
143
144
|
|
144
145
|
### Patch Changes
|
145
146
|
|
146
|
-
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`0767bc4`](https://github.com/graphcommerce-org/graphcommerce/commit/0767bc40f7b596209f24ca4e745ff0441f3275c9) - Upgrade input components to no longer use muiRegister, which improves INP scores
|
147
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
147
|
+
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`0767bc4`](https://github.com/graphcommerce-org/graphcommerce/commit/0767bc40f7b596209f24ca4e745ff0441f3275c9) - Upgrade input components to no longer use muiRegister, which improves INP scores ([@FrankHarland](https://github.com/FrankHarland))
|
148
148
|
|
149
|
-
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`43bd04a`](https://github.com/graphcommerce-org/graphcommerce/commit/43bd04a777c5800cc7e01bee1e123a5aad82f194) - Prevent BillingPage query from rerunning on each mutation
|
150
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
149
|
+
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`43bd04a`](https://github.com/graphcommerce-org/graphcommerce/commit/43bd04a777c5800cc7e01bee1e123a5aad82f194) - Prevent BillingPage query from rerunning on each mutation ([@FrankHarland](https://github.com/FrankHarland))
|
151
150
|
|
152
151
|
## 8.0.6-canary.1
|
153
152
|
|
@@ -155,15 +154,13 @@
|
|
155
154
|
|
156
155
|
### Patch Changes
|
157
156
|
|
158
|
-
- [#2196](https://github.com/graphcommerce-org/graphcommerce/pull/2196) [`84c50e4`](https://github.com/graphcommerce-org/graphcommerce/commit/84c50e49a1a7f154d4a8f4045c37e773e20283ad) - Allow Lingui to use linguiLocale with country identifiers like `en-us`, it would always load `en` in this case. Introced a new `useLocale` hook to use the correct locale string to use in Intl methods.
|
159
|
-
([@paales](https://github.com/paales))
|
157
|
+
- [#2196](https://github.com/graphcommerce-org/graphcommerce/pull/2196) [`84c50e4`](https://github.com/graphcommerce-org/graphcommerce/commit/84c50e49a1a7f154d4a8f4045c37e773e20283ad) - Allow Lingui to use linguiLocale with country identifiers like `en-us`, it would always load `en` in this case. Introced a new `useLocale` hook to use the correct locale string to use in Intl methods. ([@paales](https://github.com/paales))
|
160
158
|
|
161
159
|
## 8.0.5
|
162
160
|
|
163
161
|
### Patch Changes
|
164
162
|
|
165
|
-
- [#2239](https://github.com/graphcommerce-org/graphcommerce/pull/2239) [`a2a6e78`](https://github.com/graphcommerce-org/graphcommerce/commit/a2a6e78291ab978f4ef1236a4476b4d54555af7f) - Prices of products are now updated when customizable options are selected
|
166
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
163
|
+
- [#2239](https://github.com/graphcommerce-org/graphcommerce/pull/2239) [`a2a6e78`](https://github.com/graphcommerce-org/graphcommerce/commit/a2a6e78291ab978f4ef1236a4476b4d54555af7f) - Prices of products are now updated when customizable options are selected ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
167
164
|
|
168
165
|
## 8.0.5-canary.10
|
169
166
|
|
@@ -173,8 +170,7 @@
|
|
173
170
|
|
174
171
|
### Patch Changes
|
175
172
|
|
176
|
-
- [#2239](https://github.com/graphcommerce-org/graphcommerce/pull/2239) [`a2a6e78`](https://github.com/graphcommerce-org/graphcommerce/commit/a2a6e78291ab978f4ef1236a4476b4d54555af7f) - Prices of products are now updated when customizable options are selected
|
177
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
173
|
+
- [#2239](https://github.com/graphcommerce-org/graphcommerce/pull/2239) [`a2a6e78`](https://github.com/graphcommerce-org/graphcommerce/commit/a2a6e78291ab978f4ef1236a4476b4d54555af7f) - Prices of products are now updated when customizable options are selected ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
178
174
|
|
179
175
|
## 8.0.5-canary.7
|
180
176
|
|
@@ -202,15 +198,13 @@
|
|
202
198
|
|
203
199
|
### Patch Changes
|
204
200
|
|
205
|
-
- [#2217](https://github.com/graphcommerce-org/graphcommerce/pull/2217) [`2b750da`](https://github.com/graphcommerce-org/graphcommerce/commit/2b750da77723d37485da01df05f52d19b80cc90c) - fix for breadcrumbs on pdp when no category attached to product
|
206
|
-
([@JoshuaS98](https://github.com/JoshuaS98))
|
201
|
+
- [#2217](https://github.com/graphcommerce-org/graphcommerce/pull/2217) [`2b750da`](https://github.com/graphcommerce-org/graphcommerce/commit/2b750da77723d37485da01df05f52d19b80cc90c) - fix for breadcrumbs on pdp when no category attached to product ([@JoshuaS98](https://github.com/JoshuaS98))
|
207
202
|
|
208
203
|
## 8.0.3-canary.6
|
209
204
|
|
210
205
|
### Patch Changes
|
211
206
|
|
212
|
-
- [#2217](https://github.com/graphcommerce-org/graphcommerce/pull/2217) [`2b750da`](https://github.com/graphcommerce-org/graphcommerce/commit/2b750da77723d37485da01df05f52d19b80cc90c) - fix for breadcrumbs on pdp when no category attached to product
|
213
|
-
([@JoshuaS98](https://github.com/JoshuaS98))
|
207
|
+
- [#2217](https://github.com/graphcommerce-org/graphcommerce/pull/2217) [`2b750da`](https://github.com/graphcommerce-org/graphcommerce/commit/2b750da77723d37485da01df05f52d19b80cc90c) - fix for breadcrumbs on pdp when no category attached to product ([@JoshuaS98](https://github.com/JoshuaS98))
|
214
208
|
|
215
209
|
## 8.0.3-canary.5
|
216
210
|
|
@@ -228,15 +222,13 @@
|
|
228
222
|
|
229
223
|
### Patch Changes
|
230
224
|
|
231
|
-
- [#2201](https://github.com/graphcommerce-org/graphcommerce/pull/2201) [`e16fea4`](https://github.com/graphcommerce-org/graphcommerce/commit/e16fea4b0ff9661fd15a32089fbfc0c6a1c903fe) - Fix issue where patches would not be applied correctly on the AddProductsAddToCartForm
|
232
|
-
([@paales](https://github.com/paales))
|
225
|
+
- [#2201](https://github.com/graphcommerce-org/graphcommerce/pull/2201) [`e16fea4`](https://github.com/graphcommerce-org/graphcommerce/commit/e16fea4b0ff9661fd15a32089fbfc0c6a1c903fe) - Fix issue where patches would not be applied correctly on the AddProductsAddToCartForm ([@paales](https://github.com/paales))
|
233
226
|
|
234
227
|
## 8.0.2-canary.3
|
235
228
|
|
236
229
|
### Patch Changes
|
237
230
|
|
238
|
-
- [#2201](https://github.com/graphcommerce-org/graphcommerce/pull/2201) [`e16fea4`](https://github.com/graphcommerce-org/graphcommerce/commit/e16fea4b0ff9661fd15a32089fbfc0c6a1c903fe) - Fix issue where patches would not be applied correctly on the AddProductsAddToCartForm
|
239
|
-
([@paales](https://github.com/paales))
|
231
|
+
- [#2201](https://github.com/graphcommerce-org/graphcommerce/pull/2201) [`e16fea4`](https://github.com/graphcommerce-org/graphcommerce/commit/e16fea4b0ff9661fd15a32089fbfc0c6a1c903fe) - Fix issue where patches would not be applied correctly on the AddProductsAddToCartForm ([@paales](https://github.com/paales))
|
240
232
|
|
241
233
|
## 8.0.2-canary.2
|
242
234
|
|
@@ -260,60 +252,43 @@
|
|
260
252
|
|
261
253
|
### Major Changes
|
262
254
|
|
263
|
-
- [#2041](https://github.com/graphcommerce-org/graphcommerce/pull/2041) [`bc3a833`](https://github.com/graphcommerce-org/graphcommerce/commit/bc3a8339b0b0f15b4d5cb014d4f95e6ea28c2cfe) - Removed the `legacyProductRoute` configuration option from GraphCommerce
|
264
|
-
([@paales](https://github.com/paales))
|
255
|
+
- [#2041](https://github.com/graphcommerce-org/graphcommerce/pull/2041) [`bc3a833`](https://github.com/graphcommerce-org/graphcommerce/commit/bc3a8339b0b0f15b4d5cb014d4f95e6ea28c2cfe) - Removed the `legacyProductRoute` configuration option from GraphCommerce ([@paales](https://github.com/paales))
|
265
256
|
|
266
257
|
### Minor Changes
|
267
258
|
|
268
|
-
- [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added new `<LazyHydrate/>` component to improve the Total Blocking Time and implemented them in, `<RowRenderer/>`, `<ProductListItemBase/>`, `<Footer/>` and for the `<NavigationProvider/>`. Reduced the TBT by 50% on the homepage and other pages.
|
269
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
259
|
+
- [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added new `<LazyHydrate/>` component to improve the Total Blocking Time and implemented them in, `<RowRenderer/>`, `<ProductListItemBase/>`, `<Footer/>` and for the `<NavigationProvider/>`. Reduced the TBT by 50% on the homepage and other pages. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
270
260
|
|
271
|
-
- [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Support for all customizable product options (except file upload) on the product pages and in the cart.
|
272
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
261
|
+
- [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Support for all customizable product options (except file upload) on the product pages and in the cart. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
273
262
|
|
274
|
-
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`13e23e4`](https://github.com/graphcommerce-org/graphcommerce/commit/13e23e4265bac70fb4d0830e4661019e71ce299f) - Wishlist will now support configurable products and uses the `<ActionCardLayout/>`
|
275
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
263
|
+
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`13e23e4`](https://github.com/graphcommerce-org/graphcommerce/commit/13e23e4265bac70fb4d0830e4661019e71ce299f) - Wishlist will now support configurable products and uses the `<ActionCardLayout/>` ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
276
264
|
|
277
265
|
### Patch Changes
|
278
266
|
|
279
|
-
- [#2083](https://github.com/graphcommerce-org/graphcommerce/pull/2083) [`ca493c7`](https://github.com/graphcommerce-org/graphcommerce/commit/ca493c7b208b8526c1109695d54bad7b2956a8bd) - Filters which are not yet applied and all options have 0 results, will not be shown anymore.
|
280
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
267
|
+
- [#2083](https://github.com/graphcommerce-org/graphcommerce/pull/2083) [`ca493c7`](https://github.com/graphcommerce-org/graphcommerce/commit/ca493c7b208b8526c1109695d54bad7b2956a8bd) - Filters which are not yet applied and all options have 0 results, will not be shown anymore. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
281
268
|
|
282
|
-
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`89b58be`](https://github.com/graphcommerce-org/graphcommerce/commit/89b58be9812e1e515b6996b2f5ce67ab8a596980) - The ProductFilters and ProductList queries would only run after the hygraphPageContent query would be resolved, although they don't depend on each other, now they run in parallel.
|
283
|
-
([@paales](https://github.com/paales))
|
269
|
+
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`89b58be`](https://github.com/graphcommerce-org/graphcommerce/commit/89b58be9812e1e515b6996b2f5ce67ab8a596980) - The ProductFilters and ProductList queries would only run after the hygraphPageContent query would be resolved, although they don't depend on each other, now they run in parallel. ([@paales](https://github.com/paales))
|
284
270
|
|
285
|
-
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`8d4f1ef`](https://github.com/graphcommerce-org/graphcommerce/commit/8d4f1ef00bd7a8b8ca3be46302ce3959eae33a23) - When a product has a discount price, render that on the product page
|
286
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
271
|
+
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`8d4f1ef`](https://github.com/graphcommerce-org/graphcommerce/commit/8d4f1ef00bd7a8b8ca3be46302ce3959eae33a23) - When a product has a discount price, render that on the product page ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
287
272
|
|
288
|
-
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - Accessibility improvements for the frontend: Added skip content link. Removed empty buttons from tab flow. Gave focus to elements (such as the menu) that appear when after clicking a button. Improved aria labels where needed
|
289
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
273
|
+
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - Accessibility improvements for the frontend: Added skip content link. Removed empty buttons from tab flow. Gave focus to elements (such as the menu) that appear when after clicking a button. Improved aria labels where needed ([@FrankHarland](https://github.com/FrankHarland))
|
290
274
|
|
291
|
-
- [#2058](https://github.com/graphcommerce-org/graphcommerce/pull/2058) [`16dc488`](https://github.com/graphcommerce-org/graphcommerce/commit/16dc4889543106238b1a87694e75586e4c1a787c) - Provide instant feedback on availble attribute options when making a selection on a configurable product
|
292
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
275
|
+
- [#2058](https://github.com/graphcommerce-org/graphcommerce/pull/2058) [`16dc488`](https://github.com/graphcommerce-org/graphcommerce/commit/16dc4889543106238b1a87694e75586e4c1a787c) - Provide instant feedback on availble attribute options when making a selection on a configurable product ([@FrankHarland](https://github.com/FrankHarland))
|
293
276
|
|
294
|
-
- [#2164](https://github.com/graphcommerce-org/graphcommerce/pull/2164) [`5224755`](https://github.com/graphcommerce-org/graphcommerce/commit/522475503fd40e4718fd4d7d33f8164c01588c0c) - The filter bar would completely disappear when there were no items returned.
|
295
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
277
|
+
- [#2164](https://github.com/graphcommerce-org/graphcommerce/pull/2164) [`5224755`](https://github.com/graphcommerce-org/graphcommerce/commit/522475503fd40e4718fd4d7d33f8164c01588c0c) - The filter bar would completely disappear when there were no items returned. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
296
278
|
|
297
|
-
- [#2150](https://github.com/graphcommerce-org/graphcommerce/pull/2150) [`59844cd`](https://github.com/graphcommerce-org/graphcommerce/commit/59844cdd8adfaf03d22b04b9082552e22f386fb6) - Solved an issue where the same product could not be added multiple times to the cart without reloading the page.
|
298
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
279
|
+
- [#2150](https://github.com/graphcommerce-org/graphcommerce/pull/2150) [`59844cd`](https://github.com/graphcommerce-org/graphcommerce/commit/59844cdd8adfaf03d22b04b9082552e22f386fb6) - Solved an issue where the same product could not be added multiple times to the cart without reloading the page. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
299
280
|
|
300
|
-
- [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`0d2cb22`](https://github.com/graphcommerce-org/graphcommerce/commit/0d2cb22a58451d40102981263209aacb93016c76) - Removed unwanted space below <ProductListItem/> images caused by line-height. Images are now perfectly square as expected.
|
301
|
-
([@bramvanderholst](https://github.com/bramvanderholst))
|
281
|
+
- [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`0d2cb22`](https://github.com/graphcommerce-org/graphcommerce/commit/0d2cb22a58451d40102981263209aacb93016c76) - Removed unwanted space below <ProductListItem/> images caused by line-height. Images are now perfectly square as expected. ([@bramvanderholst](https://github.com/bramvanderholst))
|
302
282
|
|
303
|
-
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`154cd12`](https://github.com/graphcommerce-org/graphcommerce/commit/154cd12438f6cb30638e37b9a76a0649992b90f4) - The name of the product in the `<ProductListItem/>` would break words in the middle of a word instead of using a normal word break.
|
304
|
-
([@paales](https://github.com/paales))
|
283
|
+
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`154cd12`](https://github.com/graphcommerce-org/graphcommerce/commit/154cd12438f6cb30638e37b9a76a0649992b90f4) - The name of the product in the `<ProductListItem/>` would break words in the middle of a word instead of using a normal word break. ([@paales](https://github.com/paales))
|
305
284
|
|
306
|
-
- [#2007](https://github.com/graphcommerce-org/graphcommerce/pull/2007) [`f59c276`](https://github.com/graphcommerce-org/graphcommerce/commit/f59c276605f9ed649d1197a9ba0e3f12d7c6d026) - Crosssell behavior now properly shows for the latest added product. Added latest submitted variables to be retrieved when using the useFormGql hook.
|
307
|
-
([@JoshuaS98](https://github.com/JoshuaS98))
|
285
|
+
- [#2007](https://github.com/graphcommerce-org/graphcommerce/pull/2007) [`f59c276`](https://github.com/graphcommerce-org/graphcommerce/commit/f59c276605f9ed649d1197a9ba0e3f12d7c6d026) - Crosssell behavior now properly shows for the latest added product. Added latest submitted variables to be retrieved when using the useFormGql hook. ([@JoshuaS98](https://github.com/JoshuaS98))
|
308
286
|
|
309
|
-
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`0335dd9`](https://github.com/graphcommerce-org/graphcommerce/commit/0335dd9417b8fe1c4f1009dad354b9edab892b9f) - The product page will now also load all information that a ProductListItem will load
|
310
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
287
|
+
- [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`0335dd9`](https://github.com/graphcommerce-org/graphcommerce/commit/0335dd9417b8fe1c4f1009dad354b9edab892b9f) - The product page will now also load all information that a ProductListItem will load ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
311
288
|
|
312
|
-
- [#2076](https://github.com/graphcommerce-org/graphcommerce/pull/2076) [`f860e68`](https://github.com/graphcommerce-org/graphcommerce/commit/f860e68603526a15dcf2567f4ca57230423ef5c3) - Forward the maxWidth prop to the `<ColumnTwoWithTop />` component from the `<ProductPageDescription maxWidth='lg'/>` component.
|
313
|
-
([@StefanAngenent](https://github.com/StefanAngenent))
|
289
|
+
- [#2076](https://github.com/graphcommerce-org/graphcommerce/pull/2076) [`f860e68`](https://github.com/graphcommerce-org/graphcommerce/commit/f860e68603526a15dcf2567f4ca57230423ef5c3) - Forward the maxWidth prop to the `<ColumnTwoWithTop />` component from the `<ProductPageDescription maxWidth='lg'/>` component. ([@StefanAngenent](https://github.com/StefanAngenent))
|
314
290
|
|
315
|
-
- [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`5f4455b`](https://github.com/graphcommerce-org/graphcommerce/commit/5f4455b1cccddf1501f0279e5ca2d9277a07ff07) - New `<ProductListItemSkeleton />` component and added support to the productListRenderer. Used for the new Recently Viewed Products feature.
|
316
|
-
([@bramvanderholst](https://github.com/bramvanderholst))
|
291
|
+
- [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`5f4455b`](https://github.com/graphcommerce-org/graphcommerce/commit/5f4455b1cccddf1501f0279e5ca2d9277a07ff07) - New `<ProductListItemSkeleton />` component and added support to the productListRenderer. Used for the new Recently Viewed Products feature. ([@bramvanderholst](https://github.com/bramvanderholst))
|
317
292
|
|
318
293
|
## 8.0.0-canary.100
|
319
294
|
|
@@ -345,8 +320,7 @@
|
|
345
320
|
|
346
321
|
### Patch Changes
|
347
322
|
|
348
|
-
- [#2168](https://github.com/graphcommerce-org/graphcommerce/pull/2168) [`986dc96`](https://github.com/graphcommerce-org/graphcommerce/commit/986dc96e6e88b58471dfcccf952d99bbb8a81884) - Added schema-dts as a dependency, so it isn't required in the example
|
349
|
-
([@paales](https://github.com/paales))
|
323
|
+
- [#2168](https://github.com/graphcommerce-org/graphcommerce/pull/2168) [`986dc96`](https://github.com/graphcommerce-org/graphcommerce/commit/986dc96e6e88b58471dfcccf952d99bbb8a81884) - Added schema-dts as a dependency, so it isn't required in the example ([@paales](https://github.com/paales))
|
350
324
|
|
351
325
|
## 8.0.0-canary.86
|
352
326
|
|
@@ -358,15 +332,13 @@
|
|
358
332
|
|
359
333
|
### Patch Changes
|
360
334
|
|
361
|
-
- [#2164](https://github.com/graphcommerce-org/graphcommerce/pull/2164) [`5224755`](https://github.com/graphcommerce-org/graphcommerce/commit/522475503fd40e4718fd4d7d33f8164c01588c0c) - Fixed filters dissapearing when no items are found with applied filters
|
362
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
335
|
+
- [#2164](https://github.com/graphcommerce-org/graphcommerce/pull/2164) [`5224755`](https://github.com/graphcommerce-org/graphcommerce/commit/522475503fd40e4718fd4d7d33f8164c01588c0c) - Fixed filters dissapearing when no items are found with applied filters ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
363
336
|
|
364
337
|
## 8.0.0-canary.82
|
365
338
|
|
366
339
|
### Patch Changes
|
367
340
|
|
368
|
-
- [#2150](https://github.com/graphcommerce-org/graphcommerce/pull/2150) [`59844cd`](https://github.com/graphcommerce-org/graphcommerce/commit/59844cdd8adfaf03d22b04b9082552e22f386fb6) - Fixed a bug which caused the default values of the productAddToCartForm to be overwritten if the selected configurable option of a product contained a visible simple product. Before the fix you could not add the same product twice without reloading the page.
|
369
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
341
|
+
- [#2150](https://github.com/graphcommerce-org/graphcommerce/pull/2150) [`59844cd`](https://github.com/graphcommerce-org/graphcommerce/commit/59844cdd8adfaf03d22b04b9082552e22f386fb6) - Fixed a bug which caused the default values of the productAddToCartForm to be overwritten if the selected configurable option of a product contained a visible simple product. Before the fix you could not add the same product twice without reloading the page. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
370
342
|
|
371
343
|
## 8.0.0-canary.81
|
372
344
|
|
@@ -380,8 +352,7 @@
|
|
380
352
|
|
381
353
|
### Patch Changes
|
382
354
|
|
383
|
-
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info)
|
384
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
355
|
+
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info) ([@FrankHarland](https://github.com/FrankHarland))
|
385
356
|
|
386
357
|
## 8.0.0-canary.76
|
387
358
|
|
@@ -389,18 +360,15 @@
|
|
389
360
|
|
390
361
|
### Patch Changes
|
391
362
|
|
392
|
-
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`89b58be`](https://github.com/graphcommerce-org/graphcommerce/commit/89b58be9812e1e515b6996b2f5ce67ab8a596980) - The ProductFilters and ProductList queries would only run after the hygraphPageContent query would be resolved, although they don't depend on each other, now they run in parallel.
|
393
|
-
([@paales](https://github.com/paales))
|
363
|
+
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`89b58be`](https://github.com/graphcommerce-org/graphcommerce/commit/89b58be9812e1e515b6996b2f5ce67ab8a596980) - The ProductFilters and ProductList queries would only run after the hygraphPageContent query would be resolved, although they don't depend on each other, now they run in parallel. ([@paales](https://github.com/paales))
|
394
364
|
|
395
|
-
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`154cd12`](https://github.com/graphcommerce-org/graphcommerce/commit/154cd12438f6cb30638e37b9a76a0649992b90f4) - Do not break words when wrapping
|
396
|
-
([@paales](https://github.com/paales))
|
365
|
+
- [#2160](https://github.com/graphcommerce-org/graphcommerce/pull/2160) [`154cd12`](https://github.com/graphcommerce-org/graphcommerce/commit/154cd12438f6cb30638e37b9a76a0649992b90f4) - Do not break words when wrapping ([@paales](https://github.com/paales))
|
397
366
|
|
398
367
|
## 8.0.0-canary.74
|
399
368
|
|
400
369
|
### Minor Changes
|
401
370
|
|
402
|
-
- [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added lazy hydration to improve total blocking time. Added LazyHydrate component which can be wrapped around other components you want to lazy hydrate.
|
403
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
371
|
+
- [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added lazy hydration to improve total blocking time. Added LazyHydrate component which can be wrapped around other components you want to lazy hydrate. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
404
372
|
|
405
373
|
## 8.0.0-canary.73
|
406
374
|
|
@@ -410,8 +378,7 @@
|
|
410
378
|
|
411
379
|
### Minor Changes
|
412
380
|
|
413
|
-
- [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Created UI for all customizable options except for the file upload customizable option
|
414
|
-
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
381
|
+
- [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Created UI for all customizable options except for the file upload customizable option ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
415
382
|
|
416
383
|
## 8.0.0-canary.70
|
417
384
|
|
@@ -419,8 +386,7 @@
|
|
419
386
|
|
420
387
|
### Major Changes
|
421
388
|
|
422
|
-
- [#2041](https://github.com/graphcommerce-org/graphcommerce/pull/2041) [`bc3a833`](https://github.com/graphcommerce-org/graphcommerce/commit/bc3a8339b0b0f15b4d5cb014d4f95e6ea28c2cfe) - Removed legacyProductRoute from GraphCommerce
|
423
|
-
([@paales](https://github.com/paales))
|
389
|
+
- [#2041](https://github.com/graphcommerce-org/graphcommerce/pull/2041) [`bc3a833`](https://github.com/graphcommerce-org/graphcommerce/commit/bc3a8339b0b0f15b4d5cb014d4f95e6ea28c2cfe) - Removed legacyProductRoute from GraphCommerce ([@paales](https://github.com/paales))
|
424
390
|
|
425
391
|
## 7.1.0-canary.68
|
426
392
|
|
@@ -428,8 +394,7 @@
|
|
428
394
|
|
429
395
|
### Patch Changes
|
430
396
|
|
431
|
-
- [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`6f214fb`](https://github.com/graphcommerce-org/graphcommerce/commit/6f214fbfd8ef24cc6dcba72f403bdcb1d8a5ed8a) - Remove marginBottom from ProductScroller by default and let implementor set the margin
|
432
|
-
([@StefanAngenent](https://github.com/StefanAngenent))
|
397
|
+
- [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`6f214fb`](https://github.com/graphcommerce-org/graphcommerce/commit/6f214fbfd8ef24cc6dcba72f403bdcb1d8a5ed8a) - Remove marginBottom from ProductScroller by default and let implementor set the margin ([@StefanAngenent](https://github.com/StefanAngenent))
|
433
398
|
|
434
399
|
## 7.1.0-canary.66
|
435
400
|
|
@@ -1999,31 +1964,31 @@
|
|
1999
1964
|
All occurences of `<Trans>` and `t` need to be replaced:
|
2000
1965
|
|
2001
1966
|
```tsx
|
2002
|
-
import { Trans, t } from
|
1967
|
+
import { Trans, t } from '@lingui/macro'
|
2003
1968
|
|
2004
1969
|
function MyComponent() {
|
2005
|
-
const foo =
|
1970
|
+
const foo = 'bar'
|
2006
1971
|
return (
|
2007
1972
|
<div aria-label={t`Account ${foo}`}>
|
2008
1973
|
<Trans>My Translation {foo}</Trans>
|
2009
1974
|
</div>
|
2010
|
-
)
|
1975
|
+
)
|
2011
1976
|
}
|
2012
1977
|
```
|
2013
1978
|
|
2014
1979
|
Needs to be replaced with:
|
2015
1980
|
|
2016
1981
|
```tsx
|
2017
|
-
import { Trans } from
|
2018
|
-
import { i18n } from
|
1982
|
+
import { Trans } from '@lingui/react'
|
1983
|
+
import { i18n } from '@lingui/core'
|
2019
1984
|
|
2020
1985
|
function MyComponent() {
|
2021
|
-
const foo =
|
1986
|
+
const foo = 'bar'
|
2022
1987
|
return (
|
2023
1988
|
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
2024
|
-
<Trans key=
|
1989
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
2025
1990
|
</div>
|
2026
|
-
)
|
1991
|
+
)
|
2027
1992
|
}
|
2028
1993
|
```
|
2029
1994
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { AttributeFrontendInputEnum } from '@graphcommerce/graphql-mesh'
|
1
2
|
import { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
2
3
|
import { ProductFilterEqualChip } from './ProductFilterEqualChip'
|
3
4
|
import { ProductFilterEqualSection } from './ProductFilterEqualSection'
|
@@ -11,20 +12,24 @@ export type FilterProps = {
|
|
11
12
|
aggregation: NonNullable<NonNullable<ProductListFiltersFragment['aggregations']>[number]>
|
12
13
|
}
|
13
14
|
|
14
|
-
export type FilterRenderer = Record<
|
15
|
+
export type FilterRenderer = Record<AttributeFrontendInputEnum, React.FC<FilterProps>>
|
15
16
|
|
16
17
|
export type ProductFiltersProAggregationsProps = {
|
17
|
-
renderer?: FilterRenderer
|
18
|
+
renderer?: Partial<FilterRenderer>
|
18
19
|
}
|
19
20
|
|
20
|
-
export const productFiltersProSectionRenderer = {
|
21
|
-
|
22
|
-
|
21
|
+
export const productFiltersProSectionRenderer: Partial<FilterRenderer> = {
|
22
|
+
SELECT: ProductFilterEqualSection,
|
23
|
+
MULTISELECT: ProductFilterEqualSection,
|
24
|
+
BOOLEAN: ProductFilterEqualSection,
|
25
|
+
PRICE: ProductFilterRangeSection,
|
23
26
|
}
|
24
27
|
|
25
|
-
export const productFiltersProChipRenderer = {
|
26
|
-
|
27
|
-
|
28
|
+
export const productFiltersProChipRenderer: Partial<FilterRenderer> = {
|
29
|
+
SELECT: ProductFilterEqualChip,
|
30
|
+
MULTISELECT: ProductFilterEqualChip,
|
31
|
+
BOOLEAN: ProductFilterEqualChip,
|
32
|
+
PRICE: ProductFilterRangeChip,
|
28
33
|
}
|
29
34
|
|
30
35
|
export function ProductFiltersProAggregations(props: ProductFiltersProAggregationsProps) {
|
@@ -36,7 +41,10 @@ export function ProductFiltersProAggregations(props: ProductFiltersProAggregatio
|
|
36
41
|
{excludeCategory(applyAggregationCount(aggregations, appliedAggregations, params)).map(
|
37
42
|
(aggregation) => {
|
38
43
|
const filterType = filterTypes[aggregation.attribute_code]
|
39
|
-
if (!filterType)
|
44
|
+
if (!filterType) {
|
45
|
+
console.log('Filter not recognized', aggregation.attribute_code, filterTypes)
|
46
|
+
return null
|
47
|
+
}
|
40
48
|
|
41
49
|
const Component = renderer?.[filterType]
|
42
50
|
if (!Component) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ChipMenuProps } from '@graphcommerce/next-ui'
|
2
|
-
import { FilterTypes } from '../ProductListItems/
|
2
|
+
import { FilterTypes } from '../ProductListItems/getFilterTypes'
|
3
3
|
import { FilterCheckboxType } from './FilterCheckboxType'
|
4
4
|
import { FilterEqualType } from './FilterEqualType'
|
5
5
|
import { FilterRangeType } from './FilterRangeType'
|
@@ -23,22 +23,16 @@ export function ProductListFilters(props: ProductFiltersProps) {
|
|
23
23
|
return null
|
24
24
|
|
25
25
|
switch (filterTypes[aggregation.attribute_code]) {
|
26
|
-
case '
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
{...aggregation}
|
37
|
-
{...chipMenuProps}
|
38
|
-
/>
|
39
|
-
)
|
40
|
-
}
|
41
|
-
|
26
|
+
case 'BOOLEAN':
|
27
|
+
return (
|
28
|
+
<FilterCheckboxType
|
29
|
+
key={aggregation.attribute_code}
|
30
|
+
{...aggregation}
|
31
|
+
{...chipMenuProps}
|
32
|
+
/>
|
33
|
+
)
|
34
|
+
case 'SELECT':
|
35
|
+
case 'MULTISELECT':
|
42
36
|
return (
|
43
37
|
<FilterEqualType
|
44
38
|
key={aggregation.attribute_code}
|
@@ -46,8 +40,7 @@ export function ProductListFilters(props: ProductFiltersProps) {
|
|
46
40
|
{...chipMenuProps}
|
47
41
|
/>
|
48
42
|
)
|
49
|
-
|
50
|
-
case 'FilterRangeTypeInput':
|
43
|
+
case 'PRICE':
|
51
44
|
return (
|
52
45
|
<FilterRangeType
|
53
46
|
key={aggregation.attribute_code}
|
@@ -56,6 +49,7 @@ export function ProductListFilters(props: ProductFiltersProps) {
|
|
56
49
|
/>
|
57
50
|
)
|
58
51
|
}
|
52
|
+
|
59
53
|
// console.log(
|
60
54
|
// 'Filter not recognized',
|
61
55
|
// aggregation.attribute_code,
|
@@ -67,8 +67,6 @@ export function isFilterTypeRange(filter: AnyFilterType): filter is FilterRangeT
|
|
67
67
|
)
|
68
68
|
}
|
69
69
|
|
70
|
-
export type FilterTypes = Partial<Record<string, string>>
|
71
|
-
|
72
70
|
export function toProductListParams(params: ProductFilterParams): ProductListParams {
|
73
71
|
const { sort, dir, filters, ...rest } = params
|
74
72
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import type {
|
2
2
|
FilterEqualTypeInput,
|
3
|
-
FilterMatchTypeInput,
|
4
3
|
FilterRangeTypeInput,
|
5
4
|
SortEnum,
|
6
5
|
} from '@graphcommerce/graphql-mesh'
|
7
|
-
import { useRouter } from 'next/router'
|
8
|
-
import { FilterTypes, ProductListParams } from './filterTypes'
|
9
6
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
10
7
|
import { equal } from '@wry/equality'
|
8
|
+
import { useRouter } from 'next/router'
|
9
|
+
import { ProductListParams } from './filterTypes'
|
10
|
+
import { FilterTypes } from './getFilterTypes'
|
11
11
|
|
12
12
|
export function parseParams(
|
13
13
|
url: string,
|
@@ -44,20 +44,20 @@ export function parseParams(
|
|
44
44
|
|
45
45
|
const [from, to] = value.split('-')
|
46
46
|
switch (typeMap[param]) {
|
47
|
-
case '
|
48
|
-
|
47
|
+
case 'BOOLEAN':
|
48
|
+
case 'SELECT':
|
49
|
+
case 'MULTISELECT':
|
50
|
+
categoryVariables.filters[param] = { in: value.split(',') } as FilterEqualTypeInput
|
49
51
|
return undefined
|
50
|
-
case '
|
52
|
+
case 'PRICE':
|
51
53
|
categoryVariables.filters[param] = {
|
52
54
|
...(from !== '*' && { from }),
|
53
55
|
...(to !== '*' && { to }),
|
54
56
|
} as FilterRangeTypeInput
|
55
57
|
return undefined
|
56
|
-
case 'FilterEqualTypeInput':
|
57
|
-
categoryVariables.filters[param] = { in: value.split(',') } as FilterEqualTypeInput
|
58
|
-
return undefined
|
59
58
|
}
|
60
59
|
|
60
|
+
// console.log('Filter not recognized', param, typeMap[param])
|
61
61
|
error = true
|
62
62
|
return undefined
|
63
63
|
}, undefined)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { gql, ApolloClient, NormalizedCacheObject, TypedDocumentNode } from '@graphcommerce/graphql'
|
2
|
-
import type { Exact } from '@graphcommerce/graphql-mesh'
|
2
|
+
import type { AttributeFrontendInputEnum, Exact } from '@graphcommerce/graphql-mesh'
|
3
|
+
import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
|
4
|
+
import { ProductFilterTypesDocument } from './ProductFilterTypes.gql'
|
3
5
|
|
4
6
|
type FilterInputTypesQueryVariables = Exact<{ [key: string]: never }>
|
5
7
|
|
@@ -25,13 +27,40 @@ const FilterInputTypesDocument = gql`
|
|
25
27
|
}
|
26
28
|
` as TypedDocumentNode<FilterInputTypesQuery, FilterInputTypesQueryVariables>
|
27
29
|
|
30
|
+
export type FilterTypes = Partial<Record<string, AttributeFrontendInputEnum>>
|
31
|
+
|
28
32
|
export async function getFilterTypes(
|
29
33
|
client: ApolloClient<NormalizedCacheObject>,
|
30
|
-
|
34
|
+
isSearch: boolean = false,
|
35
|
+
): Promise<FilterTypes> {
|
36
|
+
if (import.meta.graphCommerce.magentoVersion >= 247) {
|
37
|
+
const types = await client.query({
|
38
|
+
query: ProductFilterTypesDocument,
|
39
|
+
variables: {
|
40
|
+
filters: isSearch ? { is_filterable_in_search: true } : {},
|
41
|
+
},
|
42
|
+
})
|
43
|
+
|
44
|
+
const typeMap: FilterTypes = Object.fromEntries(
|
45
|
+
filterNonNullableKeys(types.data.attributesList?.items, ['frontend_input'])
|
46
|
+
.map((i) => [i.code, i.frontend_input])
|
47
|
+
.filter(nonNullable),
|
48
|
+
)
|
49
|
+
|
50
|
+
return typeMap
|
51
|
+
}
|
52
|
+
|
31
53
|
const filterInputTypes = await client.query({ query: FilterInputTypesDocument })
|
32
54
|
|
33
|
-
const typeMap:
|
34
|
-
filterInputTypes.data?.__type.inputFields
|
55
|
+
const typeMap: FilterTypes = Object.fromEntries(
|
56
|
+
filterInputTypes.data?.__type.inputFields
|
57
|
+
.map<[string, AttributeFrontendInputEnum] | undefined>((field) => {
|
58
|
+
if (field.type.name === 'FilterEqualTypeInput') return [field.name, 'SELECT']
|
59
|
+
if (field.type.name === 'FilterRangeTypeInput') return [field.name, 'PRICE']
|
60
|
+
if (field.type.name === 'FilterMatchTypeInput') return [field.name, 'TEXT']
|
61
|
+
return undefined
|
62
|
+
})
|
63
|
+
.filter(nonNullable),
|
35
64
|
)
|
36
65
|
|
37
66
|
return typeMap
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "9.0.0-canary.
|
5
|
+
"version": "9.0.0-canary.58",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -15,22 +15,22 @@
|
|
15
15
|
"schema-dts": "^1.1.2"
|
16
16
|
},
|
17
17
|
"devDependencies": {
|
18
|
-
"typescript": "5.
|
18
|
+
"typescript": "5.5.3"
|
19
19
|
},
|
20
20
|
"peerDependencies": {
|
21
|
-
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
23
|
-
"@graphcommerce/framer-next-pages": "^9.0.0-canary.
|
24
|
-
"@graphcommerce/framer-scroller": "^9.0.0-canary.
|
25
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
26
|
-
"@graphcommerce/graphql-mesh": "^9.0.0-canary.
|
27
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
28
|
-
"@graphcommerce/magento-cart": "^9.0.0-canary.
|
29
|
-
"@graphcommerce/magento-category": "^9.0.0-canary.
|
30
|
-
"@graphcommerce/magento-store": "^9.0.0-canary.
|
31
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
32
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
33
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
21
|
+
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.58",
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.58",
|
23
|
+
"@graphcommerce/framer-next-pages": "^9.0.0-canary.58",
|
24
|
+
"@graphcommerce/framer-scroller": "^9.0.0-canary.58",
|
25
|
+
"@graphcommerce/graphql": "^9.0.0-canary.58",
|
26
|
+
"@graphcommerce/graphql-mesh": "^9.0.0-canary.58",
|
27
|
+
"@graphcommerce/image": "^9.0.0-canary.58",
|
28
|
+
"@graphcommerce/magento-cart": "^9.0.0-canary.58",
|
29
|
+
"@graphcommerce/magento-category": "^9.0.0-canary.58",
|
30
|
+
"@graphcommerce/magento-store": "^9.0.0-canary.58",
|
31
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.58",
|
32
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.58",
|
33
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.58",
|
34
34
|
"@lingui/core": "^4.2.1",
|
35
35
|
"@lingui/macro": "^4.2.1",
|
36
36
|
"@lingui/react": "^4.2.1",
|