From 5e473cbb311b17008fd9349a0bdbca74b4131adc Mon Sep 17 00:00:00 2001 From: theocrsb Date: Thu, 9 Jan 2025 07:48:55 +0100 Subject: [PATCH] front: bump ui from 0.0.59 to 0.0.61 except ui core Signed-off-by: theocrsb --- front/package-lock.json | 2 ++ front/package.json | 2 +- .../SpeedSpaceChart/__tests__/helpers.spec.ts | 10 +++++++++- .../components/SpeedSpaceChart/helpers.ts | 11 ++++++++--- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/front/package-lock.json b/front/package-lock.json index c7265e98b4d..913b205ef9a 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -1970,6 +1970,7 @@ "version": "0.0.61", "resolved": "https://registry.npmjs.org/@osrd-project/ui-core/-/ui-core-0.0.61.tgz", "integrity": "sha512-NiOGAnfI74u6TaUAFUqh6LXHZxwlVJFeIE9tiP03GULLW05oMeWhbpS3cDpWPazpzYwqXR6ZoHRSdvfvVzkJeA==", + "license": "LGPL-3.0-or-later", "dependencies": { "classnames": "^2.5.1", "tailwindcss": "^3.4.1" @@ -2018,6 +2019,7 @@ "version": "0.0.61", "resolved": "https://registry.npmjs.org/@osrd-project/ui-spacetimechart/-/ui-spacetimechart-0.0.61.tgz", "integrity": "sha512-tBcCMl4gkAz4XLaYWdZkIRC5mm/ci8AI9+cc8H5q5qLppG9vlq8RyP3W4xwAH7VtJsExZdMHDXUqUditjGmmxA==", + "license": "LGPL-3.0-or-later", "dependencies": { "@types/chroma-js": "^3.1.0", "chroma-js": "^3.1.1", diff --git a/front/package.json b/front/package.json index 3adfaead16c..a42d371e6be 100644 --- a/front/package.json +++ b/front/package.json @@ -13,7 +13,7 @@ "@osrd-project/ui-manchette": "^0.0.61", "@osrd-project/ui-manchette-with-spacetimechart": "^0.0.61", "@osrd-project/ui-spacetimechart": "^0.0.61", - "@osrd-project/ui-speedspacechart": "^0.0.59", + "@osrd-project/ui-speedspacechart": "^0.0.61", "@react-pdf/renderer": "^4.1.6", "@redux-devtools/extension": "^3.3.0", "@reduxjs/toolkit": "^2.5.0", diff --git a/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts b/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts index d551a0eb0f3..84c313a92e8 100644 --- a/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts +++ b/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts @@ -51,7 +51,15 @@ describe('formatStops', () => { weight: null, }, ]; - const expected = [{ position: { start: 0 }, value: 'name ch' }]; + const expected = [ + { + position: { start: 0 }, + value: { + name: 'name ch', + weight: null, + }, + }, + ]; expect(formatStops(operationalPoints)).toEqual(expected); }); }); diff --git a/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts b/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts index a9df7c3313c..b8a34d7ed51 100644 --- a/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts +++ b/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts @@ -101,11 +101,14 @@ const formatMrsp = (mrsp: SimulationResponseSuccess['mrsp']) => ({ }); export const formatStops = (operationalPoints: PathPropertiesFormatted['operationalPoints']) => - operationalPoints.map(({ position, extensions: { identifier, sncf } = {} }) => ({ + operationalPoints.map(({ position, weight, extensions: { identifier, sncf } = {} }) => ({ position: { start: mmToKm(position), }, - value: identifier ? `${identifier.name} ${sncf ? sncf.ch : ''}` : '', + value: { + name: identifier ? `${identifier.name} ${sncf ? sncf.ch : ''}` : '', + weight: weight!, + }, })); export const formatElectrifications = ( @@ -202,7 +205,9 @@ export const formatData = ( const pathLength = simulation.base.positions[simulation.base.positions.length - 1]; const speeds: LayerData[] = formatSpeeds(simulation.base); const ecoSpeeds: LayerData[] = formatSpeeds(simulation.final_output); - const stops: LayerData[] = formatStops(pathProperties!.operationalPoints); + const stops: LayerData<{ name: string; weight: number }>[] = formatStops( + pathProperties!.operationalPoints + ); const electrifications: LayerData[] = formatElectrifications( pathProperties!.electrifications );