Skip to content

Commit d0040da

Browse files
committed
front: bump ui from 0.0.59 to 0.0.61 except ui core
Signed-off-by: theocrsb <theo_crosbie@yahoo.fr>
1 parent 38f11bd commit d0040da

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

front/package-lock.json

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@osrd-project/ui-manchette": "^0.0.61",
1414
"@osrd-project/ui-manchette-with-spacetimechart": "^0.0.61",
1515
"@osrd-project/ui-spacetimechart": "^0.0.61",
16-
"@osrd-project/ui-speedspacechart": "^0.0.59",
16+
"@osrd-project/ui-speedspacechart": "^0.0.61",
1717
"@react-pdf/renderer": "^4.1.6",
1818
"@redux-devtools/extension": "^3.3.0",
1919
"@reduxjs/toolkit": "^2.5.0",

front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ describe('formatStops', () => {
5151
weight: null,
5252
},
5353
];
54-
const expected = [{ position: { start: 0 }, value: 'name ch' }];
54+
const expected = [
55+
{
56+
position: { start: 0 },
57+
value: {
58+
name: 'name ch',
59+
weight: null,
60+
},
61+
},
62+
];
5563
expect(formatStops(operationalPoints)).toEqual(expected);
5664
});
5765
});

front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ const formatMrsp = (mrsp: SimulationResponseSuccess['mrsp']) => ({
101101
});
102102

103103
export const formatStops = (operationalPoints: PathPropertiesFormatted['operationalPoints']) =>
104-
operationalPoints.map(({ position, extensions: { identifier, sncf } = {} }) => ({
104+
operationalPoints.map(({ position, weight, extensions: { identifier, sncf } = {} }) => ({
105105
position: {
106106
start: mmToKm(position),
107107
},
108-
value: identifier ? `${identifier.name} ${sncf ? sncf.ch : ''}` : '',
108+
value: {
109+
name: identifier ? `${identifier.name} ${sncf ? sncf.ch : ''}` : '',
110+
weight: weight!,
111+
},
109112
}));
110113

111114
export const formatElectrifications = (
@@ -202,7 +205,9 @@ export const formatData = (
202205
const pathLength = simulation.base.positions[simulation.base.positions.length - 1];
203206
const speeds: LayerData<number>[] = formatSpeeds(simulation.base);
204207
const ecoSpeeds: LayerData<number>[] = formatSpeeds(simulation.final_output);
205-
const stops: LayerData<string>[] = formatStops(pathProperties!.operationalPoints);
208+
const stops: LayerData<{ name: string; weight: number }>[] = formatStops(
209+
pathProperties!.operationalPoints
210+
);
206211
const electrifications: LayerData<ElectrificationValues>[] = formatElectrifications(
207212
pathProperties!.electrifications
208213
);

0 commit comments

Comments
 (0)