Skip to content

Commit a7c9601

Browse files
authored
Merge pull request #194 from Lemoncode/feature/188-add-the-location-to-the-reservoirs
Feature/188 add the location to the reservoirs
2 parents 205bc1d + fdcfd11 commit a7c9601

7 files changed

Lines changed: 2088 additions & 1190 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import type { Media } from '@content-island/api-client';
1+
import type { Media } from "@content-island/api-client";
22
export interface ReservoirInfo {
33
id: string;
4-
language: 'es';
4+
language: "es";
55
lastUpdate: string; // Stores the date in ISO 8601 format. For example: 2021-09-10T19:30:00.000Z
66
slug: string;
77
name: string;
88
mainPicture: Media;
99
author?: string;
1010
authorUrl?: string;
1111
description: string;
12+
mapUrl?: string;
1213
}

front/src/pods/embalse/embalse.component.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ export const Embalse: React.FC<Props> = (props) => {
2929
<ReservoirCardInfo reservoirInfo={reservoirData.reservoirInfo} />
3030
</div>
3131
)}
32+
33+
{reservoirData.datosEmbalse.mapUrl && (
34+
<div className="card bg-base-100 mx-auto w-full max-w-[400px] items-center gap-6 rounded-2xl p-4 shadow-lg md:order-4 md:max-w-[900px]">
35+
<iframe
36+
title={`Mapa del embalse ${reservoirData.nombre}`}
37+
src={reservoirData.datosEmbalse.mapUrl}
38+
width="100%"
39+
height="300"
40+
className="rounded-lg border-0"
41+
></iframe>
42+
</div>
43+
)}
44+
3245
<div className="card bg-base-100 mx-auto w-full max-w-[400px] items-center gap-6 rounded-2xl p-4 shadow-lg md:order-2 md:w-[calc(50%-16px)]">
3346
<ReservoirCardDetail datosEmbalse={reservoirData.datosEmbalse} />
3447
</div>

front/src/pods/embalse/embalse.mapper.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ describe("mapEmbalseToReservoirData", () => {
166166
measurementDate: "15/06/2024",
167167
datosEmbalse: {
168168
cuenca: "Mediterránea",
169+
mapUrl: "",
169170
provincia: "Málaga",
170171
uso: "",
171172
},

front/src/pods/embalse/embalse.mapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export function mapEmbalseToReservoirData(
4242
cuenca: embalse.cuenca?.nombre ?? "",
4343
provincia: embalse.provincia ?? "",
4444
uso: embalse.uso ?? "",
45+
mapUrl: embalseInfo?.mapUrl ?? "",
4546
},
4647
reservoirInfo: embalseInfo
4748
? mapReservoirInfoFromContentIslandToViewModel(embalseInfo)

front/src/pods/embalse/embalse.vm.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface DatosEmbalse {
55
cuenca: string;
66
provincia: string;
77
uso: string;
8+
mapUrl: string;
89
}
910

1011
export interface ReservoirInfo {
@@ -15,6 +16,7 @@ export interface ReservoirInfo {
1516
author?: string;
1617
authorUrl?: string;
1718
description: string;
19+
mapUrl?: string;
1820
}
1921

2022
export interface ReservoirData {

front/tsconfig.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)