@akinon/next 1.125.0 → 1.126.0-rc.1

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.126.0-rc.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 0cf9ea23: BRDG-16491: Prevent redirect when iframe payment is active
8
+
9
+ ## 1.126.0-rc.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ZERO-4160: Enhance oauth-login middleware with improved request handling and logging
14
+ - b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
15
+ - 760258c1: ZERO-4160: Enhance oauth-login middleware to handle fetch errors and improve response handling
16
+ - 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
17
+ - 9f8cd3bc: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
18
+ - bfafa3f4: ZERO-4160: Refactor oauth-login middleware to use fetchCommerce for API calls and improve cookie handling
19
+ - d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
20
+ - 591e345e: ZERO-3855: Enhance credit card payment handling in checkout middlewares
21
+ - 4de5303c: ZERO-2504: add cookie filter to api client request
22
+ - 95b139dc: ZERO-3795: Remove duplicate entry for SavedCard in PluginComponents map
23
+ - 3909d322: Edit the duplicate Plugin.SimilarProducts in the plugin-module.
24
+ - e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
25
+
3
26
  ## 1.125.0
4
27
 
5
28
  ### Minor Changes
@@ -114,7 +114,6 @@ const PluginComponents = new Map([
114
114
  ]
115
115
  ],
116
116
  [Plugin.SavedCard, [Component.SavedCard, Component.IyzicoSavedCard]],
117
- [Plugin.SavedCard, [Component.SavedCard]],
118
117
  [Plugin.FlowPayment, [Component.FlowPayment]],
119
118
  [
120
119
  Plugin.VirtualTryOn,
package/data/urls.ts CHANGED
@@ -183,7 +183,11 @@ export const product = {
183
183
  breadcrumbUrl: (menuitemmodel: string) =>
184
184
  `/menus/generate_breadcrumb/?item=${menuitemmodel}&generator_name=menu_item`,
185
185
  bundleProduct: (productPk: string, queryString: string) =>
186
- `/bundle-product/${productPk}/?${queryString}`
186
+ `/bundle-product/${productPk}/?${queryString}`,
187
+ similarProducts: (params?: string) =>
188
+ `/similar-products${params ? `?${params}` : ''}`,
189
+ similarProductsList: (params?: string) =>
190
+ `/similar-product-list${params ? `?${params}` : ''}`
187
191
  };
188
192
 
189
193
  export const wishlist = {
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.125.0",
4
+ "version": "1.126.0-rc.1",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -35,7 +35,7 @@
35
35
  "set-cookie-parser": "2.6.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@akinon/eslint-plugin-projectzero": "1.125.0",
38
+ "@akinon/eslint-plugin-projectzero": "1.126.0-rc.1",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
package/plugins.d.ts CHANGED
@@ -37,6 +37,16 @@ declare module '@akinon/pz-cybersource-uc/src/redux/middleware' {
37
37
  export default middleware as any;
38
38
  }
39
39
 
40
+ declare module '@akinon/pz-apple-pay' {}
41
+
42
+ declare module '@akinon/pz-similar-products' {
43
+ export const SimilarProductsModal: any;
44
+ export const SimilarProductsFilterSidebar: any;
45
+ export const SimilarProductsResultsGrid: any;
46
+ export const SimilarProductsPlugin: any;
47
+ export const SimilarProductsButtonPlugin: any;
48
+ }
49
+
40
50
  declare module '@akinon/pz-cybersource-uc/src/redux/reducer' {
41
51
  export default reducer as any;
42
52
  }
package/plugins.js CHANGED
@@ -16,6 +16,7 @@ module.exports = [
16
16
  'pz-tabby-extension',
17
17
  'pz-apple-pay',
18
18
  'pz-tamara-extension',
19
+ 'pz-similar-products',
19
20
  'pz-cybersource-uc',
20
21
  'pz-hepsipay',
21
22
  'pz-flow-payment',
@@ -33,6 +33,21 @@ import { LocaleUrlStrategy } from '../../localization';
33
33
  import { showMobile3dIframe } from '../../utils/mobile-3d-iframe';
34
34
  import { showRedirectionIframe } from '../../utils/redirection-iframe';
35
35
 
36
+ const IFRAME_REDIRECTION_KEY = 'pz-iframe-redirection-active';
37
+
38
+ const isIframeRedirectionActive = () =>
39
+ typeof window !== 'undefined' &&
40
+ sessionStorage.getItem(IFRAME_REDIRECTION_KEY) === 'true';
41
+
42
+ const setIframeRedirectionActive = (active: boolean) => {
43
+ if (typeof window === 'undefined') return;
44
+ if (active) {
45
+ sessionStorage.setItem(IFRAME_REDIRECTION_KEY, 'true');
46
+ } else {
47
+ sessionStorage.removeItem(IFRAME_REDIRECTION_KEY);
48
+ }
49
+ };
50
+
36
51
  interface CheckoutResult {
37
52
  payload: {
38
53
  errors?: Record<string, string[]>;
@@ -69,7 +84,7 @@ export const redirectUrlMiddleware: Middleware = () => {
69
84
  const result: CheckoutResult = next(action);
70
85
  const redirectUrl = result?.payload?.redirect_url;
71
86
 
72
- if (redirectUrl) {
87
+ if (redirectUrl && !isIframeRedirectionActive()) {
73
88
  const currentLocale = getCookie('pz-locale');
74
89
 
75
90
  let url = redirectUrl;
@@ -134,6 +149,7 @@ export const contextListMiddleware: Middleware = ({
134
149
  if (isMobileDevice && isIframePaymentOptionIncluded) {
135
150
  showMobile3dIframe(urlObj.toString());
136
151
  } else if (isIframe) {
152
+ setIframeRedirectionActive(true);
137
153
  showRedirectionIframe(urlObj.toString());
138
154
  } else {
139
155
  window.location.href = urlObj.toString();
@@ -209,15 +225,25 @@ export const contextListMiddleware: Middleware = ({
209
225
  (ctx) => ctx.page_name === 'DeliveryOptionSelectionPage'
210
226
  )
211
227
  ) {
228
+ const isCreditCardPayment =
229
+ preOrder?.payment_option?.payment_type === 'credit_card' ||
230
+ preOrder?.payment_option?.payment_type === 'masterpass';
231
+
212
232
  if (context.page_context.card_type) {
213
233
  dispatch(setCardType(context.page_context.card_type));
234
+ } else if (isCreditCardPayment) {
235
+ dispatch(setCardType(null));
214
236
  }
215
237
 
216
238
  if (
217
239
  context.page_context.installments &&
218
240
  preOrder?.payment_option?.payment_type !== 'masterpass_rest'
219
241
  ) {
220
- dispatch(setInstallmentOptions(context.page_context.installments));
242
+ if (!isCreditCardPayment || context.page_context.card_type) {
243
+ dispatch(
244
+ setInstallmentOptions(context.page_context.installments)
245
+ );
246
+ }
221
247
  }
222
248
  }
223
249
 
@@ -14,9 +14,17 @@ export const installmentOptionMiddleware: Middleware = ({
14
14
  return result;
15
15
  }
16
16
 
17
- const { installmentOptions } = getState().checkout;
17
+ const { installmentOptions, cardType } = getState().checkout;
18
18
  const { endpoints: apiEndpoints } = checkoutApi;
19
19
 
20
+ const isCreditCardPayment =
21
+ preOrder?.payment_option?.payment_type === 'credit_card' ||
22
+ preOrder?.payment_option?.payment_type === 'masterpass';
23
+
24
+ if (isCreditCardPayment && !cardType) {
25
+ return result;
26
+ }
27
+
20
28
  if (
21
29
  !preOrder?.installment &&
22
30
  preOrder?.payment_option?.payment_type !== 'saved_card' &&
package/types/index.ts CHANGED
@@ -85,6 +85,12 @@ export interface Settings {
85
85
  };
86
86
  usePrettyUrlRoute?: boolean;
87
87
  commerceUrl: string;
88
+ /**
89
+ * This option allows you to track Sentry events on the client side, in addition to server and edge environments.
90
+ *
91
+ * It overrides process.env.NEXT_PUBLIC_SENTRY_DSN and process.env.SENTRY_DSN.
92
+ */
93
+ sentryDsn?: string;
88
94
  redis: {
89
95
  defaultExpirationTime: number;
90
96
  };