ublo-lib 1.21.1 → 1.21.3

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.
@@ -2,32 +2,32 @@ import getConfig from "next/config";
2
2
  // import * as Fetcher from "ublo-lib/es/common/utils/fetcher";
3
3
  import * as Fetcher from "../../../common/utils/fetcher";
4
4
  const { publicRuntimeConfig } = getConfig();
5
- const { lumiplanApiV2 } = publicRuntimeConfig;
5
+ const { lumiplanApi } = publicRuntimeConfig;
6
6
  export async function getResortOpening(resort) {
7
- const endpoint = `${lumiplanApiV2}/resort-opening`;
7
+ const endpoint = `${lumiplanApi}/resort-opening`;
8
8
  return Fetcher.get(endpoint, { resort });
9
9
  }
10
10
  export async function getWeather(resort) {
11
- const endpoint = `${lumiplanApiV2}/weather`;
11
+ const endpoint = `${lumiplanApi}/weather`;
12
12
  return Fetcher.get(endpoint, { resort });
13
13
  }
14
14
  export async function getSnow(resort) {
15
- const endpoint = `${lumiplanApiV2}/snow`;
15
+ const endpoint = `${lumiplanApi}/snow`;
16
16
  return Fetcher.get(endpoint, { resort });
17
17
  }
18
18
  export async function getResortAccess(resort) {
19
- const endpoint = `${lumiplanApiV2}/resort-access`;
19
+ const endpoint = `${lumiplanApi}/resort-access`;
20
20
  return Fetcher.get(endpoint, { resort });
21
21
  }
22
22
  export async function getSlopes(resort) {
23
- const endpoint = `${lumiplanApiV2}/slopes`;
23
+ const endpoint = `${lumiplanApi}/slopes`;
24
24
  return Fetcher.get(endpoint, { resort });
25
25
  }
26
26
  export async function getLifts(resort) {
27
- const endpoint = `${lumiplanApiV2}/lifts`;
27
+ const endpoint = `${lumiplanApi}/lifts`;
28
28
  return Fetcher.get(endpoint, { resort });
29
29
  }
30
30
  export async function getPois(resort) {
31
- const endpoint = `${lumiplanApiV2}/pois`;
31
+ const endpoint = `${lumiplanApi}/pois`;
32
32
  return Fetcher.get(endpoint, { resort });
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,8EAkMR,CAAC;AAIH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,8EAgLR,CAAC;AAIH,eAAe,IAAI,CAAC"}
@@ -61,12 +61,12 @@ const TRAIL_ICONS = {
61
61
  DEFAULT: TrailIcons.SkiAlpin,
62
62
  };
63
63
  const { publicRuntimeConfig } = getConfig();
64
- const { lumiplanApiV2 } = publicRuntimeConfig;
64
+ const { lumiplanApi } = publicRuntimeConfig;
65
65
  const SPECIAL_TRAILS = {
66
- "Labell'glisse": `${lumiplanApiV2}/pistes-ludiques/labell-glisse.png`,
67
- Waouland: `${lumiplanApiV2}/pistes-ludiques/waouland.png`,
68
- Opoualand: `${lumiplanApiV2}/pistes-ludiques/opoualand.png`,
69
- "The Flying Donuts": `${lumiplanApiV2}/pistes-ludiques/flying-donuts.png`,
66
+ "Labell'glisse": `${lumiplanApi}/pistes-ludiques/labell-glisse.png`,
67
+ Waouland: `${lumiplanApi}/pistes-ludiques/waouland.png`,
68
+ Opoualand: `${lumiplanApi}/pistes-ludiques/opoualand.png`,
69
+ "The Flying Donuts": `${lumiplanApi}/pistes-ludiques/flying-donuts.png`,
70
70
  };
71
71
  const Pois = React.forwardRef(({ pois }, ref) => {
72
72
  const { lang } = useUbloContext();
@@ -107,26 +107,10 @@ const Pois = React.forwardRef(({ pois }, ref) => {
107
107
  ? `(${t(lang, `pois.trailLevels.${trailLevel}`)})`
108
108
  : null;
109
109
  const specialTrail = Object.keys(SPECIAL_TRAILS).find((key) => name.includes(key));
110
- // TMP
111
- const isEven = Number(id) % 2 === 0;
112
- const mockMessage = {
113
- id: "mock",
114
- type: "TEXT",
115
- title: "messagePoi",
116
- data: [
117
- {
118
- language: "fr_FR",
119
- data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
120
- },
121
- ],
122
- };
123
- // TMP
124
110
  const message = messagePoi?.data?.find(({ language }) => {
125
111
  const _lang = lang === "fr" ? "fr_FR" : "en_US";
126
112
  return language === _lang;
127
- }) || isEven
128
- ? mockMessage.data[0]
129
- : undefined;
113
+ });
130
114
  const hasGroomingStatus = groomingStatus !== undefined && groomingStatus !== "UNDEF";
131
115
  const hasSnowQuality = snowQuality !== undefined && snowQuality !== "UNDEF";
132
116
  const classes = classNames(css.poi, {
@@ -4,9 +4,9 @@ import getConfig from "next/config";
4
4
  import T from "../i18n/translations";
5
5
  import css from "./avalanche-risk.module.css";
6
6
  const { publicRuntimeConfig } = getConfig();
7
- const { lumiplanApiV2 } = publicRuntimeConfig;
7
+ const { lumiplanApi } = publicRuntimeConfig;
8
8
  export default function AvalancheRisk({ avalancheRisk }) {
9
9
  if (!avalancheRisk || avalancheRisk === "UNDEF")
10
10
  return null;
11
- return (_jsxs("div", { className: css.avalancheRisk, children: [_jsxs("b", { children: [_jsx(T, { id: "weather.avalanche-risk.title" }), " :"] }), _jsx(Image, { src: `${lumiplanApiV2}/avalanche/${avalancheRisk}.svg`, width: 20, height: 20, alt: "" }), _jsx("span", { children: _jsx(T, { id: `weather.avalanche-risk.states.${avalancheRisk}` }) })] }));
11
+ return (_jsxs("div", { className: css.avalancheRisk, children: [_jsxs("b", { children: [_jsx(T, { id: "weather.avalanche-risk.title" }), " :"] }), _jsx(Image, { src: `${lumiplanApi}/avalanche/${avalancheRisk}.svg`, width: 20, height: 20, alt: "" }), _jsx("span", { children: _jsx(T, { id: `weather.avalanche-risk.states.${avalancheRisk}` }) })] }));
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.21.1",
3
+ "version": "1.21.3",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.1.5",
6
6
  "leaflet": "^1.9.1",