ctt-babylon 0.11.5 → 0.11.6

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.
@@ -4355,6 +4355,40 @@ class MapperService {
4355
4355
  };
4356
4356
  }
4357
4357
  mapStaticFooter(props) {
4358
+ // Funcion temporal hasta que el back devuelva la lista de hoteles
4359
+ const dynamicHotelsAdresses = () => {
4360
+ const addressesMap = {};
4361
+ if (!props?.texts)
4362
+ return;
4363
+ Object.keys(props.texts).forEach((key) => {
4364
+ if (key.startsWith('addresslist')) {
4365
+ const match = key.match(/addresslist(\d+)(.*)/);
4366
+ if (match) {
4367
+ const index = match[1];
4368
+ const field = match[2];
4369
+ if (!addressesMap[index]) {
4370
+ addressesMap[index] = {
4371
+ id: parseInt(index, 10).toString(),
4372
+ };
4373
+ }
4374
+ const value = props.texts[key];
4375
+ switch (field) {
4376
+ case 'Title':
4377
+ addressesMap[index].name = value;
4378
+ break;
4379
+ case 'Address':
4380
+ addressesMap[index].address = value;
4381
+ addressesMap[index].full_address = value;
4382
+ break;
4383
+ case 'Telf':
4384
+ addressesMap[index].phone = value;
4385
+ break;
4386
+ }
4387
+ }
4388
+ }
4389
+ });
4390
+ return Object.values(addressesMap);
4391
+ };
4358
4392
  return {
4359
4393
  title: typeof props?.texts?.title === 'string'
4360
4394
  ? props?.texts?.title
@@ -4402,7 +4436,8 @@ class MapperService {
4402
4436
  full_address: address.fullAddress,
4403
4437
  }))
4404
4438
  : [],
4405
- addressHotels: Array.isArray(props?.addressHotels)
4439
+ addressHotels: Array.isArray(props?.addressHotels) &&
4440
+ props.addressHotels.length > 0
4406
4441
  ? props.addressHotels.map((address) => ({
4407
4442
  id: address.id,
4408
4443
  name: address.name,
@@ -4416,7 +4451,12 @@ class MapperService {
4416
4451
  email: address.email,
4417
4452
  full_address: address.fullAddress,
4418
4453
  }))
4419
- : undefined,
4454
+ : (() => {
4455
+ const dynamicAddresses = dynamicHotelsAdresses();
4456
+ return dynamicAddresses && dynamicAddresses.length > 0
4457
+ ? dynamicAddresses
4458
+ : undefined;
4459
+ })(),
4420
4460
  socialMedia: props?.socialMedia?.map((link) => ({
4421
4461
  icon: `babylon-${link.name?.toLowerCase()}`,
4422
4462
  url: link.url,