@akinon/next 1.71.0-rc.1 → 1.71.0-rc.3
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 +12 -0
- package/components/web-vitals.tsx +4 -2
- package/data/client/checkout.ts +1 -1
- package/package.json +2 -2
- package/types/index.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.71.0-rc.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3344bca: ZERO-3013: Enable web vitals tracking in settings.js
|
|
8
|
+
|
|
9
|
+
## 1.71.0-rc.2
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 56cdddc: ZERO-0000: SHOP-78125: Change unpaid_amount with total_amount_with_interest
|
|
14
|
+
|
|
3
15
|
## 1.71.0-rc.1
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -3,24 +3,26 @@
|
|
|
3
3
|
import { useReportWebVitals } from 'next/web-vitals';
|
|
4
4
|
import { useSelectedLayoutSegment } from 'next/navigation';
|
|
5
5
|
import { usePathname } from 'next/navigation';
|
|
6
|
+
import settings from 'settings';
|
|
6
7
|
|
|
7
8
|
export function WebVitals() {
|
|
8
9
|
let layoutSegment = useSelectedLayoutSegment();
|
|
9
10
|
const pathname = usePathname();
|
|
11
|
+
const { enabled } = settings.webVitals || { enabled: false };
|
|
10
12
|
|
|
11
13
|
if (pathname === '/' && layoutSegment === null) {
|
|
12
14
|
layoutSegment = 'home';
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
useReportWebVitals((metric) => {
|
|
16
|
-
if (process.env.NODE_ENV !== 'development') {
|
|
18
|
+
if (process.env.NODE_ENV !== 'development' || !enabled) {
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const { name, value, rating } = metric;
|
|
21
23
|
const page = layoutSegment || 'unknown';
|
|
22
24
|
|
|
23
|
-
fetch(
|
|
25
|
+
fetch(`/api/web-vitals`, {
|
|
24
26
|
method: 'POST',
|
|
25
27
|
headers: {
|
|
26
28
|
'Content-Type': 'application/json'
|
package/data/client/checkout.ts
CHANGED
|
@@ -106,7 +106,7 @@ const completeMasterpassPayment = async (
|
|
|
106
106
|
referenceNo,
|
|
107
107
|
merchantId: credentials?.merchant_id ?? null,
|
|
108
108
|
msisdn,
|
|
109
|
-
amount: preOrder?.
|
|
109
|
+
amount: preOrder?.total_amount_with_interest?.replace('.', '') ?? '',
|
|
110
110
|
additionalParams: additionalParams ?? extras?.additionalParams,
|
|
111
111
|
language,
|
|
112
112
|
installmentCount: preOrder?.installment?.installment_count ?? 1
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.71.0-rc.
|
|
4
|
+
"version": "1.71.0-rc.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"set-cookie-parser": "2.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@akinon/eslint-plugin-projectzero": "1.71.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.71.0-rc.3",
|
|
34
34
|
"@types/react-redux": "7.1.30",
|
|
35
35
|
"@types/set-cookie-parser": "2.4.7",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|