@akinon/next 1.1.1 → 1.2.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.
- package/CHANGELOG.md +5 -3
- package/components/selected-payment-option-view.tsx +3 -0
- package/data/client/product.ts +4 -5
- package/data/urls.ts +2 -2
- package/middlewares/pretty-url.ts +7 -1
- package/package.json +1 -1
- package/plugins.js +1 -0
- package/types/commerce/product.ts +1 -2
- package/types/index.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.2.0
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- Refactor Sentry
|
|
7
|
+
- Refactor Sentry config.
|
|
8
|
+
- Add localeIncludedPrettyUrlPattern option to settings.
|
|
9
|
+
- Refactor getRetailStoreStock mutation.
|
|
8
10
|
|
|
9
11
|
## 1.1.0
|
|
10
12
|
|
|
@@ -51,6 +51,9 @@ export default function SelectedPaymentOptionView() {
|
|
|
51
51
|
} else if (payment_option.payment_type === 'loyalty_money') {
|
|
52
52
|
promise = import(`views/checkout/steps/payment/options/loyalty`);
|
|
53
53
|
}
|
|
54
|
+
// else if (payment_option.payment_type === 'gpay') {
|
|
55
|
+
// promise = import(`views/checkout/steps/payment/options/gpay`);
|
|
56
|
+
// }
|
|
54
57
|
} catch (error) {}
|
|
55
58
|
|
|
56
59
|
return promise
|
package/data/client/product.ts
CHANGED
|
@@ -23,7 +23,7 @@ type GetProduct = {
|
|
|
23
23
|
pk: number;
|
|
24
24
|
searchParams?: URLSearchParams;
|
|
25
25
|
groupProduct?: boolean;
|
|
26
|
-
[key:string]: any;
|
|
26
|
+
[key: string]: any;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const productApi = api.injectEndpoints({
|
|
@@ -34,7 +34,7 @@ export const productApi = api.injectEndpoints({
|
|
|
34
34
|
})
|
|
35
35
|
}),
|
|
36
36
|
getProductByParams: build.query<ProductResult, GetProduct>({
|
|
37
|
-
query: ({pk, searchParams, groupProduct, ...params}) => {
|
|
37
|
+
query: ({ pk, searchParams, groupProduct, ...params }) => {
|
|
38
38
|
let url = groupProduct
|
|
39
39
|
? product.getGroupProductByPk(pk)
|
|
40
40
|
: product.getProductByPk(pk);
|
|
@@ -50,11 +50,10 @@ export const productApi = api.injectEndpoints({
|
|
|
50
50
|
}),
|
|
51
51
|
getRetailStoreStock: build.mutation<StockResultType, FindInStoreFormType>({
|
|
52
52
|
query: (body) => {
|
|
53
|
-
const { productPk,
|
|
54
|
-
const hasVariant = variant ? `&integration_beden=${variant}` : '';
|
|
53
|
+
const { productPk, queryString } = body;
|
|
55
54
|
return {
|
|
56
55
|
url: buildClientRequestUrl(
|
|
57
|
-
product.getRetailStoreStock(productPk,
|
|
56
|
+
product.getRetailStoreStock(productPk, queryString),
|
|
58
57
|
{
|
|
59
58
|
contentType: 'application/json'
|
|
60
59
|
}
|
package/data/urls.ts
CHANGED
|
@@ -116,8 +116,8 @@ export const product = {
|
|
|
116
116
|
installments: (productId: number) => `/payments/cards/product/${productId}`,
|
|
117
117
|
getProductByPk: (pk: number) => `/product/${pk}`,
|
|
118
118
|
getGroupProductByPk: (pk: number) => `/group-product/${pk}`,
|
|
119
|
-
getRetailStoreStock: (productPk: string,
|
|
120
|
-
`/retail_store_stock/${productPk}
|
|
119
|
+
getRetailStoreStock: (productPk: string, queryString: string) =>
|
|
120
|
+
`/retail_store_stock/${productPk}?${queryString}`,
|
|
121
121
|
addProduct: '/baskets/basket',
|
|
122
122
|
slug: (slug: string) => `/${slug}`,
|
|
123
123
|
categoryUrl: (pk: number) => `/products/${pk}/category_nodes/?limit=1`,
|
|
@@ -76,7 +76,13 @@ const withPrettyUrl =
|
|
|
76
76
|
return middleware(req, event);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
const prettyUrlResult = await resolvePrettyUrl(
|
|
79
|
+
const prettyUrlResult = await resolvePrettyUrl(
|
|
80
|
+
Settings.localization.localeIncludedPrettyUrlPattern?.test(
|
|
81
|
+
prettyUrlPathname
|
|
82
|
+
)
|
|
83
|
+
? url.pathname
|
|
84
|
+
: prettyUrlPathname
|
|
85
|
+
);
|
|
80
86
|
|
|
81
87
|
if (prettyUrlResult.matched) {
|
|
82
88
|
req.middlewareParams.rewrites.prettyUrl = prettyUrlResult.path;
|
package/package.json
CHANGED
package/plugins.js
CHANGED
package/types/index.ts
CHANGED
|
@@ -148,6 +148,20 @@ export interface Settings {
|
|
|
148
148
|
locale: string;
|
|
149
149
|
defaultCurrencyCode: string;
|
|
150
150
|
}) => string;
|
|
151
|
+
/**
|
|
152
|
+
* By default, pretty url resolver excludes locale from url.
|
|
153
|
+
* In some cases, you may want to create flatpages and include locale in urls.
|
|
154
|
+
* This is useful if you want to manage your flatpages for different countries by using locale value.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* // URL entered in Omnitron: /en-us/pages/about-us
|
|
158
|
+
* // Locale Strategy: LocaleUrlStrategy.ShowAllLocales
|
|
159
|
+
*
|
|
160
|
+
* // If you don't use this option, pretty url resolver will remove the locale and it will be resolved as '/pages/about-us' and you will get 404. Because there is no page with this url. But if you use this option, it will be resolved as '/en-us/pages/about-us' and you will get the page.
|
|
161
|
+
* // Following pattern will include locale for all urls including '/pages/'.
|
|
162
|
+
* localeIncludedPrettyUrlPattern: new RegExp('.+/pages/.+$')
|
|
163
|
+
*/
|
|
164
|
+
localeIncludedPrettyUrlPattern?: RegExp;
|
|
151
165
|
};
|
|
152
166
|
rewrites?: Array<{
|
|
153
167
|
source: string;
|