@jetshop/core 5.13.3-beta.0 → 5.13.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,13 +8,11 @@ export declare class ChannelHandler {
8
8
  recommendedChannel?: SelectedChannel;
9
9
  channels?: Channel[];
10
10
  getPrimaryRoutePath?: GetPrimaryRoutePath;
11
- selectedChannelGroup?: Channel[] | undefined;
12
11
  constructor(args?: {
13
12
  selectedChannel?: SelectedChannel;
14
13
  recommendedChannel?: SelectedChannel;
15
14
  channels?: Channel[];
16
15
  getPrimaryRoutePath?: GetPrimaryRoutePath;
17
- selectedChannelGroup?: Channel[] | undefined;
18
16
  });
19
17
  setGetPrimaryRoutePath: (getPrimaryRoutePath: GetPrimaryRoutePath) => GetPrimaryRoutePath;
20
18
  getSelectedChannel: () => SelectedChannel;
@@ -10,14 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import qs from 'qs';
13
- import { getChannelBasename, getChannelHeaders, getLanguageFromCulture, isInDev, getGroupedChannels } from './channelUtils';
13
+ import { getChannelBasename, getChannelHeaders, getLanguageFromCulture, isInDev } from './channelUtils';
14
14
  export class ChannelHandler {
15
15
  constructor(args = {
16
16
  selectedChannel: undefined,
17
17
  recommendedChannel: undefined,
18
18
  channels: undefined,
19
- getPrimaryRoutePath: undefined,
20
- selectedChannelGroup: undefined
19
+ getPrimaryRoutePath: undefined
21
20
  }) {
22
21
  this.setGetPrimaryRoutePath = (getPrimaryRoutePath) => (this.getPrimaryRoutePath = getPrimaryRoutePath);
23
22
  this.getSelectedChannel = () => this.selectedChannel;
@@ -30,10 +29,6 @@ export class ChannelHandler {
30
29
  this.getRecommendedChannel = () => this.recommendedChannel;
31
30
  this.setChannels = (channels) => {
32
31
  this.channels = channels;
33
- this.selectedChannelGroup = getGroupedChannels(channels, {
34
- // Selected channel here is based on the one returned in getSelectedAndRecommendedChannel
35
- groupName: this.selectedChannel.groupName
36
- });
37
32
  };
38
33
  this.getChannels = () => this.channels;
39
34
  this.getChannelHeaders = () => getChannelHeaders(this.selectedChannel);
@@ -95,12 +90,11 @@ export class ChannelHandler {
95
90
  .then((url) => window.location.assign(url))
96
91
  .catch((url) => window.location.assign(url));
97
92
  };
98
- const { selectedChannel, recommendedChannel, channels, getPrimaryRoutePath, selectedChannelGroup } = args;
93
+ const { selectedChannel, recommendedChannel, channels, getPrimaryRoutePath } = args;
99
94
  this.selectedChannel = selectedChannel;
100
95
  this.recommendedChannel = recommendedChannel;
101
96
  this.channels = channels;
102
97
  this.getPrimaryRoutePath = getPrimaryRoutePath;
103
- this.selectedChannelGroup = selectedChannelGroup;
104
98
  }
105
99
  getPathWithoutBasename(url) {
106
100
  const urlObject = new URL(url);
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelHandler.js","sourceRoot":"","sources":["ChannelHandler.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,EACP,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,OAAO,cAAc;IAOzB,YACE,OAMI;QACF,eAAe,EAAE,SAAS;QAC1B,kBAAkB,EAAE,SAAS;QAC7B,QAAQ,EAAE,SAAS;QACnB,mBAAmB,EAAE,SAAS;QAC9B,oBAAoB,EAAE,SAAS;KAChC;QAgBH,2BAAsB,GAAG,CAAC,mBAAwC,EAAE,EAAE,CACpE,CAAC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,CAAC;QAEnD,uBAAkB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC;QAEhD,uBAAkB,GAAG,CAAC,eAAgC,EAAE,EAAE;YACxD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACzC,CAAC,CAAC;QAEF,0BAAqB,GAAG,CAAC,kBAAmC,EAAE,EAAE;YAC9D,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC/C,CAAC,C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,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACpB,GAAG,IAAI,CAAC;QACT,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAiIO,sBAAsB,CAAC,GAAW;QACxC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC3C,MAAM,aAAa,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAC;QACjD,aAAa,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC;QAC9B,aAAa,CAAC,OAAO,CACnB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAC7D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -9,9 +9,6 @@ export interface QueryObject {
9
9
  redirectDisabled?: boolean;
10
10
  articlenumber?: string;
11
11
  }
12
- export declare const getGroupedChannels: (availableChannels: Channel[], { groupName }: {
13
- groupName: string;
14
- }) => Channel[];
15
12
  export declare const getURLBasename: (url: URL) => string;
16
13
  export declare const getURLLanguageBasename: ({ url, singleDomainMode }: {
17
14
  url: URL;
@@ -55,7 +52,6 @@ export declare function getSelectedAndRecommendedChannel({ url, singleDomainMode
55
52
  redirect: boolean;
56
53
  selectedChannel: SelectedChannel;
57
54
  recommendedChannel: SelectedChannel;
58
- channels: Channel[];
59
55
  };
60
56
  export declare function getChannelHeaders(channel?: SelectedChannel): {
61
57
  currency: string;
@@ -1,19 +1,5 @@
1
1
  import acceptLanguageParser from 'accept-language-parser';
2
2
  import qs from 'qs';
3
- const allChannelsGrouped = (availableChannels) => availableChannels.every((channel) => { var _a; return (_a = channel === null || channel === void 0 ? void 0 : channel.groupName) === null || _a === void 0 ? void 0 : _a.length; });
4
- export const getGroupedChannels = (availableChannels, { groupName }) => {
5
- const currentChannel = availableChannels.find((channel) => channel.groupName === groupName);
6
- if (!currentChannel) {
7
- return undefined;
8
- }
9
- const selectedChannelGroup = availableChannels.filter((channel) => channel.groupName === currentChannel.groupName);
10
- if (selectedChannelGroup) {
11
- return selectedChannelGroup;
12
- }
13
- else {
14
- return undefined;
15
- }
16
- };
17
3
  export const getURLBasename = (url) => {
18
4
  return url.pathname.split('/')[1];
19
5
  };
@@ -191,68 +177,8 @@ function setGeoIpAndAcceptLanguageCookies({ cookies, geoipCountry, acceptLanguag
191
177
  path: '/'
192
178
  });
193
179
  }
194
- function getGroupedChannelsByUrl({ url, channels, singleDomainMode, cookies, geoipCountry }) {
195
- const hasGroupedChannels = allChannelsGrouped(channels);
196
- if (!hasGroupedChannels) {
197
- return {
198
- hasGroupedChannels,
199
- groupByChannel: undefined
200
- };
201
- }
202
- switch (true) {
203
- case isInDev(url): {
204
- if (singleDomainMode) {
205
- const currentBaseUrl = getURLBasename(new URL(url));
206
- // -> se, de, dk, es etcetc
207
- return {
208
- hasGroupedChannels,
209
- groupByChannel: channels.find((channel) =>
210
- // We always split channel.url to consider if trailing slashes are added in as BaseUrl
211
- sanitizeURL(channel.url).split('/')[1] === currentBaseUrl)
212
- };
213
- }
214
- else {
215
- // Try to match with anything during development + non-singledomain,
216
- // this is b/c we can't match dev urls with any baseurl.
217
- // If one wan't to test it in dev one can use the ?channel=XX param.
218
- const { activeChannel, chosenChannel } = getCurrentChannel({
219
- url,
220
- singleDomainMode,
221
- channels,
222
- cookies,
223
- geoipCountry
224
- });
225
- return {
226
- hasGroupedChannels,
227
- // Active channel is given first priority. If it is null we are most likely in staging or development so chosenChannel or defaultChannel is used
228
- groupByChannel: activeChannel || chosenChannel || getDefaultChannel(channels)
229
- };
230
- }
231
- }
232
- case singleDomainMode: {
233
- const currentBaseUrl = sanitizeURL(url).split('/', 2);
234
- // -> se, de, dk, es etcetc
235
- return {
236
- hasGroupedChannels,
237
- groupByChannel: channels.find((channel) =>
238
- // We always split channel.url to consider if trailing slashes are added in as BaseUrl
239
- sanitizeURL(channel.url).split('/')[1] === currentBaseUrl[1]) || getDefaultChannel(channels)
240
- };
241
- }
242
- default: {
243
- const currentBaseUrl = sanitizeURL(url).split('/')[0];
244
- // -> domain.com
245
- return {
246
- hasGroupedChannels,
247
- groupByChannel: channels.find((channel) =>
248
- // We always split channel.url to consider if trailing slashes are added in as BaseUrl
249
- sanitizeURL(channel.url).split('/')[0] === currentBaseUrl)
250
- };
251
- }
252
- }
253
- }
254
- // Is where we determine current channel to get return values in getSelectedAndRecommendedChannel
255
- function getCurrentChannel({ url, singleDomainMode, channels, cookies, geoipCountry }) {
180
+ export function getSelectedAndRecommendedChannel({ url, singleDomainMode, channels, cookies, geoipCountry, acceptedLanguages, disableGeoRedirect }) {
181
+ setCookiesFromQueryString({ cookies, url });
256
182
  const { activeChannel, activeChannels } = getChannelFromPathOrUrl({
257
183
  url,
258
184
  singleDomainMode,
@@ -262,43 +188,11 @@ function getCurrentChannel({ url, singleDomainMode, channels, cookies, geoipCoun
262
188
  cookies,
263
189
  channels
264
190
  });
265
- const channelFromGeoIp = findChannelByCountry(geoipCountry || cookies.get('geoipCountry'), channels);
266
- // But have default channel as fallback,
267
191
  const defaultChannel = getDefaultChannel(channels);
268
- return {
269
- activeChannel,
270
- activeChannels,
271
- chosenChannel,
272
- channelFromGeoIp,
273
- defaultChannel
274
- };
275
- }
276
- export function getSelectedAndRecommendedChannel({ url, singleDomainMode, channels, cookies, geoipCountry, acceptedLanguages, disableGeoRedirect }) {
277
- setCookiesFromQueryString({ cookies, url });
278
- const { hasGroupedChannels, groupByChannel } = getGroupedChannelsByUrl({
279
- url,
280
- channels,
281
- singleDomainMode,
282
- cookies,
283
- geoipCountry
284
- });
285
- // If available, use channel group from here on
286
- // NB: All channels must be grouped and groupName is nullable.
287
- const availableChannels = hasGroupedChannels && (groupByChannel === null || groupByChannel === void 0 ? void 0 : groupByChannel.groupName)
288
- ? getGroupedChannels(channels, {
289
- groupName: groupByChannel.groupName
290
- })
291
- : channels;
292
- const { defaultChannel, chosenChannel, activeChannel, activeChannels, channelFromGeoIp } = getCurrentChannel({
293
- url,
294
- singleDomainMode,
295
- channels: availableChannels,
296
- cookies,
297
- geoipCountry
298
- });
299
192
  // Active channel is given first priority. If it is null we are most likely in staging or development so chosenChannel or defaultChannel is used
300
193
  const pureChannel = activeChannel || chosenChannel || defaultChannel;
301
194
  let redirect = false;
195
+ const channelFromGeoIp = findChannelByCountry(geoipCountry || cookies.get('geoipCountry'), channels);
302
196
  let pureRecommendedChannel;
303
197
  // If a channel has been chosen we want to redirect to it
304
198
  if (chosenChannel &&
@@ -309,7 +203,9 @@ export function getSelectedAndRecommendedChannel({ url, singleDomainMode, channe
309
203
  redirect = true;
310
204
  pureRecommendedChannel = chosenChannel;
311
205
  }
312
- else if (channelFromGeoIp && pureChannel.id !== channelFromGeoIp.id) {
206
+ else if (pureChannel &&
207
+ channelFromGeoIp &&
208
+ pureChannel.id !== channelFromGeoIp.id) {
313
209
  pureRecommendedChannel = channelFromGeoIp;
314
210
  redirect = !disableGeoRedirect && !chosenChannel;
315
211
  // this should happen when we can't find a matching channel from the url so we want to redirect such that the basename is included
@@ -354,9 +250,7 @@ export function getSelectedAndRecommendedChannel({ url, singleDomainMode, channe
354
250
  return {
355
251
  redirect,
356
252
  selectedChannel,
357
- recommendedChannel,
358
- // for testing purposes mainly
359
- channels: availableChannels
253
+ recommendedChannel
360
254
  };
361
255
  }
362
256
  export function getChannelHeaders(channel) {
@@ -1 +1 @@
1
- {"version":3,"file":"channelUtils.js","sourceRoot":"","s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;QAC/B,OAAO;QACP,YAAY;QACZ,qBAAqB;KACtB,CAAC,CAAC;IAEH,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAChE,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAEvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;QACjD,GAAG,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC;QACjB,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,qBAAqB,CAC3C,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,CACpB,CAAC;IAEF,IACE,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS;QACnC,sBAAsB,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC;YACtD,mBAAmB,EACrB;QACA,QAAQ,GAAG,IAAI,CAAC;QAChB,sBAAsB,GAAG,WAAW,CAAC;KACtC;IAED,MAAM,kBAAkB,GACtB,sBAAsB;QACtB,qBAAqB,CACnB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,CACpB,CAAC;IAEJ,OAAO;QACL,QAAQ;QACR,eAAe;QACf,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAyB;IACzD,OAAO,OAAO;QACZ,CAAC,CAAC;YACE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC7B,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO;YACjC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;YAC7B,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB;QACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC"}
@@ -10,12 +10,7 @@ import {
10
10
  import ApolloClient from 'apollo-client';
11
11
  import gql from 'graphql-tag';
12
12
  import { ChannelHandler } from './ChannelHandler';
13
- import {
14
- channels,
15
- singleDomainChannels,
16
- groupedChannels,
17
- groupedSingleDomainChannels
18
- } from '../test-utils/variables';
13
+ import { channels, singleDomainChannels } from '../test-utils/variables';
19
14
  import { Cookies } from 'react-cookie';
20
15
  import { primaryRouteForPathFetcher } from './redirectUtils';
21
16
  import PreserveRedirectRouteQuery from './PreserveRedirectRouteQuery.gql';
@@ -299,6 +294,7 @@ describe('Single domain mode', () => {
299
294
  expect(redirect).toBeFalsy();
300
295
  expect(recommendedChannel).toBeFalsy();
301
296
  });
297
+
302
298
  it('Will redirect when the url is at the wrong channel and the channel is default', () => {
303
299
  const cookies = new Cookies();
304
300
  const { recommendedChannel, redirect } = getSelectedAndRecommendedChannel({
@@ -310,6 +306,7 @@ describe('Single domain mode', () => {
310
306
  expect(redirect).toBe(true);
311
307
  expect(recommendedChannel.url).toBe(selectedChannelSingleDomain.url);
312
308
  });
309
+
313
310
  it('Will not redirect when the redirect is disabled', () => {
314
311
  const cookies = new Cookies();
315
312
  const { redirect } = getSelectedAndRecommendedChannel({
@@ -320,6 +317,7 @@ describe('Single domain mode', () => {
320
317
  });
321
318
  expect(redirect).toBe(false);
322
319
  });
320
+
323
321
  it('Will not when the url is at the right channel', () => {
324
322
  const cookies = new Cookies();
325
323
  const { redirect } = getSelectedAndRecommendedChannel({
@@ -330,6 +328,7 @@ describe('Single domain mode', () => {
330
328
  });
331
329
  expect(redirect).toBe(false);
332
330
  });
331
+
333
332
  it('Will redirect when the url is at the wrong channel', () => {
334
333
  const cookies = new Cookies();
335
334
  cookies.set('channel', singleDomainChannels[2].name);
@@ -342,6 +341,7 @@ describe('Single domain mode', () => {
342
341
  expect(redirect).toBe(true);
343
342
  expect(recommendedChannel.url).toBe('https://flight-m2.jetshop.se/uk');
344
343
  });
344
+
345
345
  it('Georedirect will respect single domain mode', () => {
346
346
  const cookies = new Cookies();
347
347
  const { redirect, recommendedChannel } = getSelectedAndRecommendedChannel({
@@ -354,6 +354,7 @@ describe('Single domain mode', () => {
354
354
  expect(redirect).toBe(true);
355
355
  expect(recommendedChannel.url).toBe('https://flight-m2.jetshop.se/uk');
356
356
  });
357
+
357
358
  it('Georedirect will respect single domain mode when there is a domain path', async () => {
358
359
  const urlToPreserve = '/accessories/orchid-peach-bag';
359
360
  const cookies = new Cookies();
@@ -373,6 +374,7 @@ describe('Single domain mode', () => {
373
374
  getPrimaryRoutePath,
374
375
  channels
375
376
  });
377
+
376
378
  const redirectUrl = channelHandler.getRedirectUrl({
377
379
  client,
378
380
  url: selectedChannelSingleDomain.url + urlToPreserve,
@@ -383,6 +385,7 @@ describe('Single domain mode', () => {
383
385
  'https://flight-m2.jetshop.se/uk/accessories/bags/orchid-peach-bag-uk?culture=sv-SE&channelCountry=UK&channel=UK'
384
386
  );
385
387
  });
388
+
386
389
  it('Redirect on single domain mode when the basename shows up in the url', async () => {
387
390
  const urlToPreserve = '/accessories/int/orchid-peach-bag';
388
391
  const cookies = new Cookies();
@@ -401,6 +404,7 @@ describe('Single domain mode', () => {
401
404
  getPrimaryRoutePath,
402
405
  channels
403
406
  });
407
+
404
408
  const redirectUrl = channelHandler.getRedirectUrl({
405
409
  client,
406
410
  url: channels[0].url + urlToPreserve,
@@ -411,6 +415,7 @@ describe('Single domain mode', () => {
411
415
  `https://flight-m2.jetshop.se/uk${urlToPreserve}?culture=sv-SE&channelCountry=UK&channel=UK`
412
416
  );
413
417
  });
418
+
414
419
  it('Redirect on single domain mode when there is a domain path but no basename', async () => {
415
420
  const urlToPreserve = '/accessories/orchid-peach-bag';
416
421
  const cookies = new Cookies();
@@ -429,6 +434,7 @@ describe('Single domain mode', () => {
429
434
  getPrimaryRoutePath,
430
435
  channels
431
436
  });
437
+
432
438
  const redirectUrl = channelHandler.getRedirectUrl({
433
439
  client,
434
440
  url: channels[0].url + urlToPreserve,
@@ -439,6 +445,7 @@ describe('Single domain mode', () => {
439
445
  `https://flight.jetshop.se/int${urlToPreserve}?culture=en-GB&channelCountry=US&channel=INT`
440
446
  );
441
447
  });
448
+
442
449
  it('Will set the appropriate language based on basename', async () => {
443
450
  const cookies = new Cookies();
444
451
  const { selectedChannel } = getSelectedAndRecommendedChannel({
@@ -448,6 +455,7 @@ describe('Single domain mode', () => {
448
455
  });
449
456
  expect(selectedChannel.language.culture).toBe('en-GB');
450
457
  });
458
+
451
459
  it('Will set the appropriate language based on basename in singledomain mode', async () => {
452
460
  const cookies = new Cookies();
453
461
  const { selectedChannel } = getSelectedAndRecommendedChannel({
@@ -458,6 +466,7 @@ describe('Single domain mode', () => {
458
466
  });
459
467
  expect(selectedChannel.language.culture).toBe('en-GB');
460
468
  });
469
+
461
470
  it('Will redirect to a new language basename based on cookies', async () => {
462
471
  const cookies = new Cookies();
463
472
  cookies.set('culture', 'en-GB');
@@ -484,6 +493,7 @@ describe('Single domain mode', () => {
484
493
  'https://flight-m2.jetshop.se/en/?culture=en-GB&channelCountry=SE&channel=SE'
485
494
  );
486
495
  });
496
+
487
497
  it('Will redirect to a new language basename based on cookies in single domain mode', async () => {
488
498
  const cookies = new Cookies();
489
499
  cookies.set('culture', 'en-GB');
@@ -15,7 +15,6 @@ export interface ChannelContextValues {
15
15
  channelsById?: {
16
16
  [key: string]: Channel;
17
17
  };
18
- selectedChannelGroup?: Channel[] | undefined;
19
18
  }
20
19
  declare const ChannelContext: import("react").Context<ChannelContextValues>;
21
20
  export default ChannelContext;
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelContext.js","sourceRoot":"","sources":["ChannelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAoBtC,MAAM,cAAc,GAAG,aAAa,CAClC,SAAS,CACV,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ChannelContext.js","sourceRoot":"","sources":["ChannelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAmBtC,MAAM,cAAc,GAAG,aAAa,CAClC,SAAS,CACV,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -3,7 +3,7 @@ import ChannelContext from './ChannelContext';
3
3
  import { useCookies } from 'react-cookie';
4
4
  const ChannelProvider = ({ channelHandler, children, config }) => {
5
5
  const [cookies] = useCookies(['culture']);
6
- const { channels, selectedChannel, recommendedChannel, selectedChannelGroup } = channelHandler;
6
+ const { channels, selectedChannel, recommendedChannel } = channelHandler;
7
7
  const value = useMemo(() => {
8
8
  const updateChannelSingleDomain = (newChannel) => {
9
9
  channelHandler.updateChannel({ config, newChannel });
@@ -27,7 +27,6 @@ const ChannelProvider = ({ channelHandler, children, config }) => {
27
27
  channelsById,
28
28
  setCultureForPreview,
29
29
  restoreCultureForPreview,
30
- selectedChannelGroup,
31
30
  basename: channelHandler.getChannelBasename() // TODO This isn't used anywhere?
32
31
  };
33
32
  }, [
@@ -36,8 +35,7 @@ const ChannelProvider = ({ channelHandler, children, config }) => {
36
35
  config,
37
36
  cookies.culture,
38
37
  recommendedChannel,
39
- selectedChannel,
40
- selectedChannelGroup
38
+ selectedChannel
41
39
  ]);
42
40
  return (React.createElement(ChannelContext.Provider, { value: value }, children));
43
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelProvider.js","sourceRoot":"","sources":["ChannelProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAmC,MAAM,kBAAkB,CAAC;AAInE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1C,MAAM,eAAe,GAAG,CAAC,EACvB,cAAc,EACd,QAAQ,EACR,MAAM,EACe,EAAE,EAAE;IACzB,MAAM,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1C,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACrB,GAAG,cAAc,CAAC;IAEnB,MAAM,KAAK,GAAG,O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AAiC;SAChF,CAAC;IACJ,CAAC,EAAE;QACD,cAAc;QACd,QAAQ;QACR,MAAM;QACN,OAAO,CAAC,OAAO;QACf,kBAAkB;QAClB,eAAe;KAChB,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAA2B,CAC5E,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -10,12 +10,8 @@ import { OpenGraphGeneralPageData } from '@jetshop/core/components/OpenGraph';
10
10
  import { useShopConfig } from '@jetshop/core/hooks/useShopConfig';
11
11
  import { getLanguageFromCulture } from '../ChannelHandler/channelUtils';
12
12
  import { SiteLinksSearchStructuredData } from './StructuredData';
13
- function renderAlternateRoutes(alternateRoute, channelsById, selectedChannelGroup = undefined) {
13
+ function renderAlternateRoutes(alternateRoute, channelsById) {
14
14
  const channel = channelsById[alternateRoute.channelId];
15
- // Only include alternate routes for this particular group if available
16
- if (selectedChannelGroup && !selectedChannelGroup.includes(channel.id)) {
17
- return null;
18
- }
19
15
  const url = channel.url;
20
16
  const route = alternateRoute.route;
21
17
  let languageBasename = '';
@@ -23,7 +19,7 @@ function renderAlternateRoutes(alternateRoute, channelsById, selectedChannelGrou
23
19
  languageBasename = `/${getLanguageFromCulture(alternateRoute.culture)}`;
24
20
  }
25
21
  const href = `${url}${languageBasename}${route}`;
26
- return (React.createElement("link", Object.assign({ key: href + alternateRoute.culture, rel: "alternate", href: href, hrefLang: alternateRoute.alias || alternateRoute.culture }, (channel.groupName && { 'data-group': channel.groupName }))));
22
+ return (React.createElement("link", { key: href + alternateRoute.culture, rel: "alternate", href: href, hrefLang: alternateRoute.alias || alternateRoute.culture }));
27
23
  }
28
24
  const queryParamsWhitelist = ['page'];
29
25
  const Head = ({ data, route }) => {
@@ -36,7 +32,7 @@ const Head = ({ data, route }) => {
36
32
  const whiteListedSearch = qs.stringify(queryStringObject, {
37
33
  addQueryPrefix: true
38
34
  });
39
- const { selectedChannel, channelsById, selectedChannelGroup } = useContext(ChannelContext);
35
+ const { selectedChannel, channelsById } = useContext(ChannelContext);
40
36
  const lang = selectedChannel.language.culture.split('-')[0];
41
37
  const metaTags = ((_a = data === null || data === void 0 ? void 0 : data.head) === null || _a === void 0 ? void 0 : _a.metaTags) || [];
42
38
  let languageBasename = '';
@@ -70,8 +66,7 @@ const Head = ({ data, route }) => {
70
66
  route &&
71
67
  isCurrentRouteCanonical &&
72
68
  route.alternateRoutes &&
73
- route.alternateRoutes.map((alternateRoute) => renderAlternateRoutes(alternateRoute, channelsById, selectedChannelGroup &&
74
- selectedChannelGroup.map((channel) => channel.id))),
69
+ route.alternateRoutes.map((alternateRoute) => renderAlternateRoutes(alternateRoute, channelsById)),
75
70
  href && React.createElement("link", { rel: "canonical", href: href })),
76
71
  !disableOpenGraphGeneralData && (React.createElement(OpenGraphGeneralPageData, { route: route, data: data })),
77
72
  (route === null || route === void 0 ? void 0 : route.canonicalPath) === '/' && React.createElement(SiteLinksSearchStructuredData, null)));
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sourceRoot":"","sources":["Head.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAWlE,OAAO,KAAK,EAAE,EAAM,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,eAAe,MAAM,0BAA0B,CAAC;AACvD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAA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AC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CACL;QACE,oBAAC,MAAM;YACL,8BAAM,IAAI,EAAE,IAAI,GAAI;YACnB,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,KAAI,mCAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAS;YAE9C,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACrB,8BAAM,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,GAAI,CAC9D,CAAC;YACD,KAAK;gBACJ,uBAAuB;gBACvB,KAAK,CAAC,eAAe;gBACrB,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE,CAC3C,qBAAqB,CAAC,cAAc,EAAE,YAAY,CAAC,CACpD;YACF,IAAI,IAAI,8BAAM,GAAG,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,GAAI,CACtC;QACR,CAAC,2BAA2B,IAAI,CAC/B,oBAAC,wBAAwB,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,CACvD;QACA,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,MAAK,GAAG,IAAI,oBAAC,6BAA6B,OAAG,CACjE,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -14,7 +14,6 @@ fragment ChannelsFragment on Channel {
14
14
  url
15
15
  isDefault
16
16
  displayName
17
- groupName
18
17
  url
19
18
  imageUrl
20
19
  requiresAuth
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetshop/core",
3
- "version": "5.13.3-beta.0",
3
+ "version": "5.13.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",