@sonic-equipment/ui 258.1.0 → 258.1.2
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/dist/config.js +8 -8
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page.js +1 -14
- package/dist/pages/checkout/payment-page/payment-page.js +3 -1
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +7 -0
- package/dist/shared/utils/environment.js +1 -1
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -23,15 +23,15 @@ const configPerEnvironment = {
|
|
|
23
23
|
ALGOLIA_API_KEY: 'e0edf30798a6b2e4e44fd25f0f2f9646',
|
|
24
24
|
ALGOLIA_APP_ID: 'testing9VXJ0U4GSV',
|
|
25
25
|
ALGOLIA_HOST: 'sonicequipment.commerce.insitesandbox.com',
|
|
26
|
-
BFF_API_URL: 'https://
|
|
27
|
-
COOKIE_DOMAIN: '.
|
|
28
|
-
HOME_PAGE_URL: 'https://
|
|
26
|
+
BFF_API_URL: 'https://sonic.local.com/api/v1/bff',
|
|
27
|
+
COOKIE_DOMAIN: '.local.com',
|
|
28
|
+
HOME_PAGE_URL: 'https://sonic-marketing.local.com/',
|
|
29
29
|
SHOP_API_URL:
|
|
30
30
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
31
|
-
env?.VITE_SHOP_API_URL || 'https://
|
|
31
|
+
env?.VITE_SHOP_API_URL || 'https://sonicshopapi.local.com/',
|
|
32
32
|
SHOP_URL:
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
34
|
-
env?.VITE_SHOP_URL || 'https://
|
|
34
|
+
env?.VITE_SHOP_URL || 'https://sonic.local.com:3000/',
|
|
35
35
|
}),
|
|
36
36
|
'next-development': () => ({
|
|
37
37
|
// @ts-expect-error: process is not defined in the browser
|
|
@@ -70,7 +70,7 @@ const configPerEnvironment = {
|
|
|
70
70
|
production: () => ({
|
|
71
71
|
ALGOLIA_API_KEY: 'e31a3a53449eceb4d0f9273b9bcd9759',
|
|
72
72
|
ALGOLIA_APP_ID: '14CUFCVMAD',
|
|
73
|
-
ALGOLIA_HOST: '
|
|
73
|
+
ALGOLIA_HOST: 'shop.sonic-equipment.com',
|
|
74
74
|
BFF_API_URL: 'https://shopapi.sonic-equipment.com/api/v1/bff',
|
|
75
75
|
COOKIE_DOMAIN: '.sonic-equipment.com',
|
|
76
76
|
HOME_PAGE_URL: 'https://sonic-equipment.com/',
|
|
@@ -81,10 +81,10 @@ const configPerEnvironment = {
|
|
|
81
81
|
ALGOLIA_API_KEY: 'e0edf30798a6b2e4e44fd25f0f2f9646',
|
|
82
82
|
ALGOLIA_APP_ID: 'testing9VXJ0U4GSV',
|
|
83
83
|
ALGOLIA_HOST: 'shop.accept-sonic-equipment.com',
|
|
84
|
-
BFF_API_URL: 'https://
|
|
84
|
+
BFF_API_URL: 'https://shopapi.accept-sonic-equipment.com/api/v1/bff',
|
|
85
85
|
COOKIE_DOMAIN: '.accept-sonic-equipment.com',
|
|
86
86
|
HOME_PAGE_URL: 'https://accept-sonic-equipment.com/',
|
|
87
|
-
SHOP_API_URL: 'https://
|
|
87
|
+
SHOP_API_URL: 'https://shopapi.accept-sonic-equipment.com',
|
|
88
88
|
SHOP_URL: 'https://shop.accept-sonic-equipment.com',
|
|
89
89
|
}),
|
|
90
90
|
'sandbox-reverse-proxy': () => ({
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
3
|
import { LoadingPage } from '../../loading-page/loading-page.js';
|
|
5
4
|
import { useIsAuthenticated } from '../../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
|
|
6
5
|
import { useFetchCartById } from '../../../shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js';
|
|
7
6
|
import { useNavigate } from '../../../shared/routing/use-navigate.js';
|
|
8
|
-
import { usePaths } from '../../../shared/routing/use-paths.js';
|
|
9
7
|
import { hasNo } from '../../../shared/utils/types.js';
|
|
10
8
|
import { ErrorPage } from '../../error-page/error-page.js';
|
|
11
9
|
import { OrderConfirmationPageContent } from './order-confirmation-page-content.js';
|
|
12
10
|
|
|
13
11
|
function OrderConfirmationPage({ cartId }) {
|
|
14
|
-
const paths = usePaths();
|
|
15
12
|
const isAuthenticated = useIsAuthenticated();
|
|
16
|
-
const { isNavigating
|
|
13
|
+
const { isNavigating } = useNavigate();
|
|
17
14
|
const { data: cart, error, isLoading: cartIsLoading, } = useFetchCartById({
|
|
18
15
|
id: cartId,
|
|
19
16
|
});
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (!cart)
|
|
22
|
-
return;
|
|
23
|
-
if (isAuthenticated === undefined)
|
|
24
|
-
return;
|
|
25
|
-
if (!isAuthenticated)
|
|
26
|
-
return navigate(paths.CART);
|
|
27
|
-
if (cart.status === 'Cart')
|
|
28
|
-
navigate(paths.CART);
|
|
29
|
-
}, [cart, navigate, isAuthenticated, paths]);
|
|
30
17
|
if (error)
|
|
31
18
|
return jsx(ErrorPage, { error: error });
|
|
32
19
|
if (cartIsLoading || isNavigating)
|
|
@@ -24,7 +24,9 @@ function PaymentPage({ hasReturnedFromAdyen, }) {
|
|
|
24
24
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
25
25
|
const { isNavigating, navigate } = useNavigate();
|
|
26
26
|
const onPaymentComplete = useCallback(({ cartId }) => {
|
|
27
|
-
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
navigate(`${paths.ORDER_CONFIRMATION}?cartId=${cartId}`);
|
|
29
|
+
}, 500);
|
|
28
30
|
}, [navigate, paths]);
|
|
29
31
|
useEffect(() => {
|
|
30
32
|
if (isNavigating)
|
|
@@ -85,6 +85,13 @@ function ReadOnlyAddresses({ billTo, cartId, countries, currentCountry, isLoadin
|
|
|
85
85
|
});
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
|
+
default:
|
|
89
|
+
onSubmit({
|
|
90
|
+
notes: notes === formData.get('notes')
|
|
91
|
+
? undefined
|
|
92
|
+
: formData.get('notes')?.toString() || '',
|
|
93
|
+
});
|
|
94
|
+
break;
|
|
88
95
|
}
|
|
89
96
|
};
|
|
90
97
|
return (jsxs(Form, { id: EDIT_ADDRESS_FORM_ID, onSubmit: onSubmitHandler, children: [jsx(CheckoutPageSection, { title: jsx(FormattedMessage, { id: "Billing address" }), children: jsxs(CheckoutPageSectionContent, { children: [billTo && (jsx(AddressInfoDisplay, { address: {
|
|
@@ -12,7 +12,7 @@ const environments = [
|
|
|
12
12
|
];
|
|
13
13
|
const marketingLocal = /marketing.local.com/i;
|
|
14
14
|
const storybookUrls = /localhost:6006|storybook.sonic.local.com/i;
|
|
15
|
-
const localUrls = /sonic.local.com/i;
|
|
15
|
+
const localUrls = /sonic.local.com/i; // used for detecting old Spire local development environment, new NextJS local environment uses next-development
|
|
16
16
|
const reverseProxyUrls = /sonic-equipment.workers.dev/i;
|
|
17
17
|
const sandboxUrls = /local|insitesandbox.com|azurestaticapps|ui.sonic-equipment.com|sandbox|accept|test/i;
|
|
18
18
|
const productionUrls = /sonic-equipment.com|production/i;
|