@sonic-equipment/ui 258.0.3 → 258.0.4
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
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
|
|
@@ -31,7 +31,7 @@ function PaymentPageContent({ atp, cart, formId, hasAtp, isProcessing, onPayment
|
|
|
31
31
|
], "data-test-selector": "paymentPage", title: t('Review and payment'), children: jsxs(CheckoutPageLayout, { actions: {
|
|
32
32
|
primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_placeOrder", form: formId, isDisabled: isProcessing, isLoading: isProcessing ? jsx(FormattedMessage, { id: "Processing" }) : false, type: "submit", children: cart.paymentMethod?.name === 'PBI' ? (jsx(FormattedMessage, { id: "Finalize order" })) : (jsx(FormattedMessage, { id: "Finalize payment" })) })),
|
|
33
33
|
}, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: cart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, deliveryDate: hasAtp ? undefined : cart.requestedDeliveryDate, fulfillmentMethod: cart.fulfillmentMethod, isPayByInvoice: (cart.paymentOptions?.paymentMethods?.length || 1) <= 1 &&
|
|
34
|
-
cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing,
|
|
34
|
+
cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing, onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date ?? null, href: cartLine.productUri, image: {
|
|
35
35
|
fit: 'contain',
|
|
36
36
|
image: {
|
|
37
37
|
'1': cartLine.smallImagePath,
|
|
@@ -21,17 +21,11 @@ function PaymentPage({ hasReturnedFromAdyen, }) {
|
|
|
21
21
|
const { data: atp, isLoading: isAtpLoading } = useFetchCurrentCheckoutAtp();
|
|
22
22
|
const hasAtp = atp !== undefined && atp.length > 1;
|
|
23
23
|
const isLoading = isLoadingCart || isAtpLoading;
|
|
24
|
-
const [isProcessing, setIsProcessing] = useState(
|
|
24
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
25
25
|
const { isNavigating, navigate } = useNavigate();
|
|
26
26
|
const onPaymentComplete = useCallback(({ cartId }) => {
|
|
27
27
|
navigate(`${paths.ORDER_CONFIRMATION}?cartId=${cartId}`);
|
|
28
28
|
}, [navigate, paths]);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
const setProcessingOn = async () => setIsProcessing(true);
|
|
31
|
-
if (hasReturnedFromAdyen) {
|
|
32
|
-
setProcessingOn();
|
|
33
|
-
}
|
|
34
|
-
}, [hasReturnedFromAdyen, setIsProcessing]);
|
|
35
29
|
useEffect(() => {
|
|
36
30
|
if (isNavigating)
|
|
37
31
|
return;
|
|
@@ -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;
|