@akinon/projectzero 1.92.0-rc.32 → 1.92.0-rc.34
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 +4 -0
- package/app-template/CHANGELOG.md +52 -0
- package/app-template/package.json +20 -20
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +17 -4
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +12 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +29 -11
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +12 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +28 -10
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.92.0-rc.34
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0ad91bbd: ZERO-3489: Improve error handling in data fetching across multiple pages and server functions
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [0ad91bbd]
|
|
12
|
+
- @akinon/next@1.92.0-rc.34
|
|
13
|
+
- @akinon/pz-akifast@1.92.0-rc.34
|
|
14
|
+
- @akinon/pz-b2b@1.92.0-rc.34
|
|
15
|
+
- @akinon/pz-basket-gift-pack@1.92.0-rc.34
|
|
16
|
+
- @akinon/pz-bkm@1.92.0-rc.34
|
|
17
|
+
- @akinon/pz-checkout-gift-pack@1.92.0-rc.34
|
|
18
|
+
- @akinon/pz-click-collect@1.92.0-rc.34
|
|
19
|
+
- @akinon/pz-credit-payment@1.92.0-rc.34
|
|
20
|
+
- @akinon/pz-gpay@1.92.0-rc.34
|
|
21
|
+
- @akinon/pz-hepsipay@1.92.0-rc.34
|
|
22
|
+
- @akinon/pz-masterpass@1.92.0-rc.34
|
|
23
|
+
- @akinon/pz-one-click-checkout@1.92.0-rc.34
|
|
24
|
+
- @akinon/pz-otp@1.92.0-rc.34
|
|
25
|
+
- @akinon/pz-pay-on-delivery@1.92.0-rc.34
|
|
26
|
+
- @akinon/pz-saved-card@1.92.0-rc.34
|
|
27
|
+
- @akinon/pz-similar-products@1.92.0-rc.34
|
|
28
|
+
- @akinon/pz-tabby-extension@1.92.0-rc.34
|
|
29
|
+
- @akinon/pz-tamara-extension@1.92.0-rc.34
|
|
30
|
+
|
|
31
|
+
## 1.92.0-rc.33
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [59b275c]
|
|
36
|
+
- @akinon/pz-similar-products@1.92.0-rc.33
|
|
37
|
+
- @akinon/next@1.92.0-rc.33
|
|
38
|
+
- @akinon/pz-akifast@1.92.0-rc.33
|
|
39
|
+
- @akinon/pz-b2b@1.92.0-rc.33
|
|
40
|
+
- @akinon/pz-basket-gift-pack@1.92.0-rc.33
|
|
41
|
+
- @akinon/pz-bkm@1.92.0-rc.33
|
|
42
|
+
- @akinon/pz-checkout-gift-pack@1.92.0-rc.33
|
|
43
|
+
- @akinon/pz-click-collect@1.92.0-rc.33
|
|
44
|
+
- @akinon/pz-credit-payment@1.92.0-rc.33
|
|
45
|
+
- @akinon/pz-gpay@1.92.0-rc.33
|
|
46
|
+
- @akinon/pz-hepsipay@1.92.0-rc.33
|
|
47
|
+
- @akinon/pz-masterpass@1.92.0-rc.33
|
|
48
|
+
- @akinon/pz-one-click-checkout@1.92.0-rc.33
|
|
49
|
+
- @akinon/pz-otp@1.92.0-rc.33
|
|
50
|
+
- @akinon/pz-pay-on-delivery@1.92.0-rc.33
|
|
51
|
+
- @akinon/pz-saved-card@1.92.0-rc.33
|
|
52
|
+
- @akinon/pz-tabby-extension@1.92.0-rc.33
|
|
53
|
+
- @akinon/pz-tamara-extension@1.92.0-rc.33
|
|
54
|
+
|
|
3
55
|
## 1.92.0-rc.32
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.92.0-rc.
|
|
3
|
+
"version": "1.92.0-rc.34",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,24 +24,24 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "1.92.0-rc.
|
|
28
|
-
"@akinon/pz-akifast": "1.92.0-rc.
|
|
29
|
-
"@akinon/pz-b2b": "1.92.0-rc.
|
|
30
|
-
"@akinon/pz-basket-gift-pack": "1.92.0-rc.
|
|
31
|
-
"@akinon/pz-bkm": "1.92.0-rc.
|
|
32
|
-
"@akinon/pz-checkout-gift-pack": "1.92.0-rc.
|
|
33
|
-
"@akinon/pz-click-collect": "1.92.0-rc.
|
|
34
|
-
"@akinon/pz-credit-payment": "1.92.0-rc.
|
|
35
|
-
"@akinon/pz-gpay": "1.92.0-rc.
|
|
36
|
-
"@akinon/pz-hepsipay": "1.92.0-rc.
|
|
37
|
-
"@akinon/pz-masterpass": "1.92.0-rc.
|
|
38
|
-
"@akinon/pz-one-click-checkout": "1.92.0-rc.
|
|
39
|
-
"@akinon/pz-otp": "1.92.0-rc.
|
|
40
|
-
"@akinon/pz-pay-on-delivery": "1.92.0-rc.
|
|
41
|
-
"@akinon/pz-saved-card": "1.92.0-rc.
|
|
42
|
-
"@akinon/pz-similar-products": "1.92.0-rc.
|
|
43
|
-
"@akinon/pz-tabby-extension": "1.92.0-rc.
|
|
44
|
-
"@akinon/pz-tamara-extension": "1.92.0-rc.
|
|
27
|
+
"@akinon/next": "1.92.0-rc.34",
|
|
28
|
+
"@akinon/pz-akifast": "1.92.0-rc.34",
|
|
29
|
+
"@akinon/pz-b2b": "1.92.0-rc.34",
|
|
30
|
+
"@akinon/pz-basket-gift-pack": "1.92.0-rc.34",
|
|
31
|
+
"@akinon/pz-bkm": "1.92.0-rc.34",
|
|
32
|
+
"@akinon/pz-checkout-gift-pack": "1.92.0-rc.34",
|
|
33
|
+
"@akinon/pz-click-collect": "1.92.0-rc.34",
|
|
34
|
+
"@akinon/pz-credit-payment": "1.92.0-rc.34",
|
|
35
|
+
"@akinon/pz-gpay": "1.92.0-rc.34",
|
|
36
|
+
"@akinon/pz-hepsipay": "1.92.0-rc.34",
|
|
37
|
+
"@akinon/pz-masterpass": "1.92.0-rc.34",
|
|
38
|
+
"@akinon/pz-one-click-checkout": "1.92.0-rc.34",
|
|
39
|
+
"@akinon/pz-otp": "1.92.0-rc.34",
|
|
40
|
+
"@akinon/pz-pay-on-delivery": "1.92.0-rc.34",
|
|
41
|
+
"@akinon/pz-saved-card": "1.92.0-rc.34",
|
|
42
|
+
"@akinon/pz-similar-products": "1.92.0-rc.34",
|
|
43
|
+
"@akinon/pz-tabby-extension": "1.92.0-rc.34",
|
|
44
|
+
"@akinon/pz-tamara-extension": "1.92.0-rc.34",
|
|
45
45
|
"@hookform/resolvers": "2.9.0",
|
|
46
46
|
"@next/third-parties": "14.1.0",
|
|
47
47
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"yup": "0.32.11"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.
|
|
67
|
+
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.34",
|
|
68
68
|
"@semantic-release/changelog": "6.0.2",
|
|
69
69
|
"@semantic-release/exec": "6.0.3",
|
|
70
70
|
"@semantic-release/git": "10.0.1",
|
|
@@ -2,12 +2,25 @@ import { getCategoryData } from '@akinon/next/data/server';
|
|
|
2
2
|
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
3
|
import { PageProps } from '@akinon/next/types';
|
|
4
4
|
import CategoryLayout from '@theme/views/category/layout';
|
|
5
|
+
import { notFound } from 'next/navigation';
|
|
5
6
|
|
|
6
7
|
async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
let categoryData;
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
categoryData = await getCategoryData({
|
|
12
|
+
pk: params.pk,
|
|
13
|
+
searchParams
|
|
14
|
+
});
|
|
15
|
+
} catch (error) {
|
|
16
|
+
return notFound();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!categoryData || !categoryData.data) {
|
|
20
|
+
return notFound();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const { data, breadcrumbData } = categoryData;
|
|
11
24
|
|
|
12
25
|
return (
|
|
13
26
|
<>
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { getFlatPageData } from '@akinon/next/data/server';
|
|
2
2
|
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
3
|
import { PageProps } from '@akinon/next/types';
|
|
4
|
+
import { notFound } from 'next/navigation';
|
|
4
5
|
|
|
5
6
|
async function Page({ params }: PageProps<{ pk: number }>) {
|
|
6
|
-
|
|
7
|
+
let data;
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
data = await getFlatPageData({ pk: params.pk });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return notFound();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (!data || !data.flat_page) {
|
|
16
|
+
return notFound();
|
|
17
|
+
}
|
|
7
18
|
|
|
8
19
|
return (
|
|
9
20
|
<div className="container mx-auto py-6">
|
|
@@ -4,6 +4,7 @@ import { getProductData, getWidgetData } from '@akinon/next/data/server';
|
|
|
4
4
|
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
5
5
|
import { PageProps, Metadata } from '@akinon/next/types';
|
|
6
6
|
import { generateJsonLd } from '@theme/utils/generate-jsonld';
|
|
7
|
+
import { notFound } from 'next/navigation';
|
|
7
8
|
|
|
8
9
|
export async function generateMetadata({
|
|
9
10
|
params,
|
|
@@ -12,14 +13,19 @@ export async function generateMetadata({
|
|
|
12
13
|
let result: Metadata = {};
|
|
13
14
|
|
|
14
15
|
try {
|
|
15
|
-
const {
|
|
16
|
-
data: { product }
|
|
17
|
-
} = await getProductData({
|
|
16
|
+
const productData = await getProductData({
|
|
18
17
|
pk: params.pk,
|
|
19
18
|
searchParams,
|
|
20
19
|
groupProduct: true
|
|
21
20
|
});
|
|
22
21
|
|
|
22
|
+
// If product data is not found, return empty metadata
|
|
23
|
+
if (!productData || !productData.data || !productData.data.product) {
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { product } = productData.data;
|
|
28
|
+
|
|
23
29
|
result = {
|
|
24
30
|
title: product.name,
|
|
25
31
|
description: String(product.attributes.description),
|
|
@@ -42,15 +48,27 @@ export async function generateMetadata({
|
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
let productData;
|
|
52
|
+
let deliveryReturn;
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
[productData, deliveryReturn] = await Promise.all([
|
|
56
|
+
getProductData({
|
|
57
|
+
pk: params.pk,
|
|
58
|
+
searchParams,
|
|
59
|
+
groupProduct: true
|
|
60
|
+
}),
|
|
61
|
+
getWidgetData({ slug: 'product-delivery-returns' })
|
|
62
|
+
]);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
return notFound();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!productData || !productData.data || !productData.data.product) {
|
|
68
|
+
return notFound();
|
|
69
|
+
}
|
|
53
70
|
|
|
71
|
+
const { data, breadcrumbData } = productData;
|
|
54
72
|
const jsonLd = generateJsonLd(data.product);
|
|
55
73
|
|
|
56
74
|
return (
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { getLandingPageData } from '@akinon/next/data/server';
|
|
2
2
|
import { withSegmentDefaults } from '@akinon/next/hocs/server';
|
|
3
3
|
import { PageProps } from '@akinon/next/types';
|
|
4
|
+
import { notFound } from 'next/navigation';
|
|
4
5
|
|
|
5
6
|
async function Page({ params }: PageProps<{ pk: number }>) {
|
|
6
|
-
|
|
7
|
+
let data;
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
data = await getLandingPageData({ pk: params.pk });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return notFound();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (!data || !data.landing_page) {
|
|
16
|
+
return notFound();
|
|
17
|
+
}
|
|
7
18
|
|
|
8
19
|
const content = data.landing_page;
|
|
9
20
|
|
|
@@ -4,6 +4,7 @@ import { PageProps, Metadata } from '@akinon/next/types';
|
|
|
4
4
|
import { generateJsonLd } from '@theme/utils/generate-jsonld';
|
|
5
5
|
import { AccordionWrapper, ProductInfo } from '@theme/views/product';
|
|
6
6
|
import ProductLayout from '@theme/views/product/layout';
|
|
7
|
+
import { notFound } from 'next/navigation';
|
|
7
8
|
|
|
8
9
|
export async function generateMetadata({
|
|
9
10
|
params,
|
|
@@ -12,13 +13,17 @@ export async function generateMetadata({
|
|
|
12
13
|
let result: Metadata = {};
|
|
13
14
|
|
|
14
15
|
try {
|
|
15
|
-
const {
|
|
16
|
-
data: { product }
|
|
17
|
-
} = await getProductData({
|
|
16
|
+
const productData = await getProductData({
|
|
18
17
|
pk: params.pk,
|
|
19
18
|
searchParams
|
|
20
19
|
});
|
|
21
20
|
|
|
21
|
+
if (!productData || !productData.data || !productData.data.product) {
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const { product } = productData.data;
|
|
26
|
+
|
|
22
27
|
result = {
|
|
23
28
|
title: product.name,
|
|
24
29
|
description: String(product.attributes.description),
|
|
@@ -41,14 +46,27 @@ export async function generateMetadata({
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
let productData;
|
|
50
|
+
let deliveryReturn;
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
[productData, deliveryReturn] = await Promise.all([
|
|
54
|
+
getProductData({
|
|
55
|
+
pk: params.pk,
|
|
56
|
+
searchParams
|
|
57
|
+
}),
|
|
58
|
+
getWidgetData({ slug: 'product-delivery-returns' })
|
|
59
|
+
]);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
return notFound();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// If product data is not found, return 404
|
|
65
|
+
if (!productData || !productData.data || !productData.data.product) {
|
|
66
|
+
return notFound();
|
|
67
|
+
}
|
|
51
68
|
|
|
69
|
+
const { data, breadcrumbData } = productData;
|
|
52
70
|
const jsonLd = generateJsonLd(data.product);
|
|
53
71
|
|
|
54
72
|
return (
|
|
@@ -4,9 +4,20 @@ import { PageProps } from '@akinon/next/types';
|
|
|
4
4
|
import CategoryLayout from '@theme/views/category/layout';
|
|
5
5
|
import SpecialPageBanner from '@theme/widgets/special-page-banner';
|
|
6
6
|
import SpecialPageCarousel from '@theme/widgets/special-page-carousel';
|
|
7
|
+
import { notFound } from 'next/navigation';
|
|
7
8
|
|
|
8
9
|
async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
|
|
9
|
-
|
|
10
|
+
let data;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
data = await getSpecialPageData({ pk: params.pk, searchParams });
|
|
14
|
+
} catch (error) {
|
|
15
|
+
return notFound();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (!data) {
|
|
19
|
+
return notFound();
|
|
20
|
+
}
|
|
10
21
|
|
|
11
22
|
return (
|
|
12
23
|
<>
|