osrd icon indicating copy to clipboard operation
osrd copied to clipboard

front: adapt updating train tsv2

Open achrafmohye opened this issue 1 year ago • 3 comments

Closes #7488

achrafmohye avatar Jun 27 '24 15:06 achrafmohye

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

Codecov Report

Attention: Patch coverage is 2.48227% with 275 lines in your changes missing coverage. Please review.

Project coverage is 28.07%. Comparing base (bea61b1) to head (868a4a5). Report is 3 commits behind head on dev.

Files Patch % Lines
...alStudies/hooks/useSetupItineraryForTrainUpdate.ts 0.00% 76 Missing :warning:
...anageTrainSchedule/hooks/useUpdateTrainSchedule.ts 0.00% 73 Missing and 1 partial :warning:
...s/operationalStudies/hooks/useSimulationResults.ts 0.00% 52 Missing and 1 partial :warning:
...geTrainSchedule/TimetableManageTrainScheduleV2.tsx 0.00% 26 Missing :warning:
...ainSchedule/helpers/adjustConfWithTrainToModify.ts 0.00% 11 Missing :warning:
...rationalStudies/views/v2/ManageTrainScheduleV2.tsx 0.00% 10 Missing :warning:
...cations/operationalStudies/views/v2/ScenarioV2.tsx 0.00% 6 Missing :warning:
...ainschedule/components/TimetableV2/TimetableV2.tsx 0.00% 6 Missing :warning:
front/src/utils/date.ts 40.00% 6 Missing :warning:
...le/components/TimetableV2/TimetableTrainCardV2.tsx 0.00% 3 Missing :warning:
... and 3 more

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

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #7876      +/-   ##
============================================
- Coverage     28.12%   28.07%   -0.06%     
  Complexity     2075     2075              
============================================
  Files          1285     1289       +4     
  Lines        157442   157734     +292     
  Branches       3117     3121       +4     
============================================
- Hits          44279    44278       -1     
- Misses       111290   111579     +289     
- Partials       1873     1877       +4     
Flag Coverage Δ
core 75.03% <ø> (ø)
editoast 70.82% <ø> (-0.03%) :arrow_down:
front 9.94% <2.48%> (-0.02%) :arrow_down:
gateway 2.34% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 72.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

codecov-commenter avatar Jun 27 '24 15:06 codecov-commenter

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 avatar Jul 04 '24 14:07 emersion

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

out

Same for the rolling stock:

out

emersion avatar Jul 04 '24 15:07 emersion

Seems like there are conflicts with the dev branch, this PR needs a rebase.

emersion avatar Jul 10 '24 12:07 emersion

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

I've tested locally again this PR and this ^ is now fixed.

emersion avatar Jul 10 '24 15:07 emersion