@graphcommerce/magento-product 9.1.0-canary.26 → 9.1.0-canary.29
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
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 9.1.0-canary.29
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#2525](https://github.com/graphcommerce-org/graphcommerce/pull/2525) [`2f66469`](https://github.com/graphcommerce-org/graphcommerce/commit/2f66469479689ceaf9983b51c77f082e3a44cf97) - Translate relevance sort option when a non translated value is communicated from algolia. ([@paales](https://github.com/paales))
|
8
|
+
|
9
|
+
## 9.1.0-canary.28
|
10
|
+
|
11
|
+
## 9.1.0-canary.27
|
12
|
+
|
3
13
|
## 9.1.0-canary.26
|
4
14
|
|
5
15
|
### Patch Changes
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { useWatch } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { useQuery } from '@graphcommerce/graphql'
|
3
3
|
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
4
|
-
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
4
|
+
import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
|
5
5
|
import { i18n } from '@lingui/core'
|
6
6
|
import { useMemo } from 'react'
|
7
7
|
import type { CategoryDefaultFragment } from '../ProductListItems/CategoryDefault.gql'
|
8
|
-
import type { ProductFilterParams } from '../ProductListItems/filterTypes'
|
9
8
|
import type { ProductListSortFragment } from '../ProductListSort'
|
10
9
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
11
10
|
import type { ProductListActionSortProps } from './ProductFiltersProSortChip'
|
@@ -26,7 +25,7 @@ export function useProductFiltersProSort(props: ProductListActionSortProps) {
|
|
26
25
|
const sortFields = useMemo(
|
27
26
|
() =>
|
28
27
|
filterNonNullableKeys(sort_fields?.options).map((o) =>
|
29
|
-
!category?.uid && o.value === 'position'
|
28
|
+
(!category?.uid && o.value === 'position') || o.value === 'relevance'
|
30
29
|
? { value: 'relevance', label: i18n._(/* i18n*/ 'Relevance') }
|
31
30
|
: o,
|
32
31
|
),
|
@@ -35,11 +34,14 @@ export function useProductFiltersProSort(props: ProductListActionSortProps) {
|
|
35
34
|
const availableSortBy = category?.available_sort_by ?? sortFields.map((o) => o.value)
|
36
35
|
|
37
36
|
const conf = useQuery(StoreConfigDocument).data?.storeConfig
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
|
38
|
+
const maybeDefaults = [
|
39
|
+
category?.default_sort_by,
|
40
|
+
conf?.catalog_default_sort_by,
|
41
|
+
'position',
|
42
|
+
'relevance',
|
43
|
+
].filter(nonNullable)
|
44
|
+
const defaultSortBy = maybeDefaults.find((v) => availableSortBy.includes(v)) ?? availableSortBy[0]
|
43
45
|
|
44
46
|
const formSort = useWatch({ control, name: 'sort' })
|
45
47
|
const formDirection = useWatch({ control, name: 'dir' })
|
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.1.0-canary.
|
5
|
+
"version": "9.1.0-canary.29",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -18,18 +18,18 @@
|
|
18
18
|
"typescript": "5.7.2"
|
19
19
|
},
|
20
20
|
"peerDependencies": {
|
21
|
-
"@graphcommerce/ecommerce-ui": "^9.1.0-canary.
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^9.1.0-canary.
|
23
|
-
"@graphcommerce/framer-next-pages": "^9.1.0-canary.
|
24
|
-
"@graphcommerce/framer-scroller": "^9.1.0-canary.
|
25
|
-
"@graphcommerce/graphql": "^9.1.0-canary.
|
26
|
-
"@graphcommerce/graphql-mesh": "^9.1.0-canary.
|
27
|
-
"@graphcommerce/image": "^9.1.0-canary.
|
28
|
-
"@graphcommerce/magento-cart": "^9.1.0-canary.
|
29
|
-
"@graphcommerce/magento-store": "^9.1.0-canary.
|
30
|
-
"@graphcommerce/next-ui": "^9.1.0-canary.
|
31
|
-
"@graphcommerce/prettier-config-pwa": "^9.1.0-canary.
|
32
|
-
"@graphcommerce/typescript-config-pwa": "^9.1.0-canary.
|
21
|
+
"@graphcommerce/ecommerce-ui": "^9.1.0-canary.29",
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^9.1.0-canary.29",
|
23
|
+
"@graphcommerce/framer-next-pages": "^9.1.0-canary.29",
|
24
|
+
"@graphcommerce/framer-scroller": "^9.1.0-canary.29",
|
25
|
+
"@graphcommerce/graphql": "^9.1.0-canary.29",
|
26
|
+
"@graphcommerce/graphql-mesh": "^9.1.0-canary.29",
|
27
|
+
"@graphcommerce/image": "^9.1.0-canary.29",
|
28
|
+
"@graphcommerce/magento-cart": "^9.1.0-canary.29",
|
29
|
+
"@graphcommerce/magento-store": "^9.1.0-canary.29",
|
30
|
+
"@graphcommerce/next-ui": "^9.1.0-canary.29",
|
31
|
+
"@graphcommerce/prettier-config-pwa": "^9.1.0-canary.29",
|
32
|
+
"@graphcommerce/typescript-config-pwa": "^9.1.0-canary.29",
|
33
33
|
"@lingui/core": "^4.2.1",
|
34
34
|
"@lingui/macro": "^4.2.1",
|
35
35
|
"@lingui/react": "^4.2.1",
|