@sonic-equipment/ui 258.0.2 → 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://localhost:8000/api/v1/bff',
27
- COOKIE_DOMAIN: '.insitesandbox.com',
28
- HOME_PAGE_URL: 'https://localhost:8000/',
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://localhost:8000',
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://localhost:8000',
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
@@ -153,6 +153,7 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
153
153
  catch (error) {
154
154
  logger.error(error);
155
155
  invalidateCurrentCart();
156
+ onProcessing(false);
156
157
  }
157
158
  finally {
158
159
  onProcessing(false);
@@ -175,6 +176,7 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
175
176
  logger.error(error);
176
177
  setPaymentError(error);
177
178
  invalidateCurrentCart();
179
+ onProcessing(false);
178
180
  }
179
181
  finally {
180
182
  onProcessing(false);
@@ -207,6 +209,7 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
207
209
  }
208
210
  catch (error) {
209
211
  logger.error(error);
212
+ onProcessing(false);
210
213
  setAPIError(error);
211
214
  }
212
215
  finally {
@@ -215,10 +218,10 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
215
218
  }
216
219
  }, [onPaymentComplete, onPlaceOrderCompleted, onProcessing, placeOrder]);
217
220
  const onError = useCallback((error, result) => {
218
- onProcessing(false);
219
221
  invalidateAdyen();
220
222
  setPaymentError(error);
221
223
  logger.error(error);
224
+ onProcessing(false);
222
225
  _onError?.(error, result);
223
226
  }, [_onError, invalidateAdyen, onProcessing]);
224
227
  return (jsxs(Form, { className: styles['payment-form'], "data-test-selector": "paymentForm", id: form, onSubmit: e => {
@@ -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(hasReturnedFromAdyen ?? false);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "258.0.2",
3
+ "version": "258.0.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {