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: manage error lifecycle on editor's form #7921

Open sim51 opened 2 days ago

sim51 commented 2 days ago

Fix #7446

When the initialEntity ref changes in the editor context, we remount the form to reset its state (mainly its isSubmitted state). It avoids top errors to be displayed when they should not.

codecov-commenter commented 2 days ago

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

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.

Project coverage is 28.48%. Comparing base (c6498a4) to head (5124463). Report is 15 commits behind head on dev.

Files Patch % Lines
.../trackEdition/components/TrackEditionLeftPanel.tsx 0.00% 11 Missing and 1 partial :warning:
.../pointEdition/components/PointEditionLeftPanel.tsx 0.00% 11 Missing :warning:
...cations/editor/tools/pointEdition/tool-factory.tsx 0.00% 4 Missing :warning:
.../src/applications/editor/components/EditorForm.tsx 0.00% 1 Missing :warning:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #7921 +/- ## ============================================ - Coverage 28.54% 28.48% -0.07% Complexity 2059 2059 ============================================ Files 1249 1254 +5 Lines 154182 154493 +311 Branches 3036 3047 +11 ============================================ - Hits 44007 44001 -6 - Misses 108365 108677 +312 - Partials 1810 1815 +5 ``` | [Flag](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7921/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/7921/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `75.00% <ø> (+0.04%)` | :arrow_up: | | [editoast](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7921/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `71.65% <ø> (-0.03%)` | :arrow_down: | | [front](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7921/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `9.97% <0.00%> (-0.03%)` | :arrow_down: | | [gateway](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7921/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `2.34% <ø> (ø)` | | | [railjson_generator](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7921/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/7921/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `72.93% <ø> (ø)` | | 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.