OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
GNU Lesser General Public License v3.0
415 stars 40 forks source link

front: adapt updating train tsv2 #7876

Open achrafmohye opened 1 week ago

achrafmohye commented 1 week ago

Closes #7488

codecov-commenter commented 1 week ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.49%. Comparing base (67d4eb3) to head (d45469f). Report is 3 commits behind head on dev.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #7876 +/- ## ============================================= + Coverage 28.42% 87.49% +59.06% ============================================= Files 1264 31 -1233 Lines 155099 1535 -153564 Branches 3053 0 -3053 ============================================= - Hits 44085 1343 -42742 + Misses 109193 192 -109001 + Partials 1821 0 -1821 ``` | [Flag](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [core](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `?` | | | [editoast](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `?` | | | [front](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `?` | | | [gateway](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `?` | | | [railjson_generator](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `87.49% <ø> (ø)` | | | [tests](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

emersion commented 3 days ago

Seems like the TypeScript build is failing!

[front]        |  ERROR(TypeScript)  Property 'ch' does not exist on type '{ secondary_code?: string | null | undefined; uic: number; } & { deleted?: boolean | undefined; id: string; }'.
[front]        |  FILE  /app/src/applications/operationalStudies/hooks.ts:120:94
[front]        | 
[front]        |     118 |                 const correspondingOp = suggestedOperationalPoints.find(
[front]        |     119 |                   (suggestedOp) =>
[front]        |   > 120 |                     'uic' in step && suggestedOp.uic === step.uic && suggestedOp.ch === step.ch
[front]        |         |                                                                                              ^^
[front]        |     121 |                 );
[front]        |     122 |
[front]        |     123 |                 const correspondingSchedule = trainSchedule.schedule?.find(
[front]        | 
[front]        |  ERROR(TypeScript)  Type 'number | undefined' is not assignable to type 'number'.
[front]        |   Type 'undefined' is not assignable to type 'number'.
[front]        |  FILE  /app/src/applications/operationalStudies/views/v2/ScenarioV2.tsx:313:42
[front]        | 
[front]        |     311 |                 displayTrainScheduleManagement === MANAGE_TRAIN_SCHEDULE_TYPES.edit) && (
[front]        |     312 |                 <div className="scenario-managetrainschedule">
[front]        |   > 313 |                   <ManageTrainScheduleV2 trainIdToEdit={trainIdToEdit} />
[front]        |         |                                          ^^^^^^^^^^^^^
[front]        |     314 |                 </div>
[front]        |     315 |               )}
[front]        |     316 |               {displayTrainScheduleManagement === MANAGE_TRAIN_SCHEDULE_TYPES.import && (
[front]        | 
[front]        | [TypeScript] Found 2 errors. Watching for file changes.
emersion commented 3 days ago

It seems like the names of the waypoints are missing when editing:

out

Same for the rolling stock:

out