Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: manage error lifecycle on editor's form #7921

Merged
merged 1 commit into from
Jul 24, 2024
Merged

front: manage error lifecycle on editor's form #7921

merged 1 commit into from
Jul 24, 2024

Conversation

sim51
Copy link
Contributor

@sim51 sim51 commented Jul 2, 2024

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.

@sim51 sim51 requested a review from a team as a code owner July 2, 2024 13:53
@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2024

⚠️ 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 ⚠️
.../pointEdition/components/PointEditionLeftPanel.tsx 0.00% 11 Missing ⚠️
...cations/editor/tools/pointEdition/tool-factory.tsx 0.00% 4 Missing ⚠️
.../src/applications/editor/components/EditorForm.tsx 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@             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 Coverage Δ
core 75.00% <ø> (+0.04%) ⬆️
editoast 71.65% <ø> (-0.03%) ⬇️
front 9.97% <0.00%> (-0.03%) ⬇️
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.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SharglutDev SharglutDev requested a review from clarani July 3, 2024 09:09
Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have a weird behaviour when I reset the track form:
image

To reproduce:

  • click on the track tool
  • create a line by clicking on the map
  • try to save
  • the errors are shown
  • reset the form
  • new errors are displayed

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.
Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅ tested

@sim51 sim51 added this pull request to the merge queue Jul 24, 2024
Merged via the queue into dev with commit 4070d78 Jul 24, 2024
17 checks passed
@sim51 sim51 deleted the bsi/issue-7446 branch July 24, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

front: in the infra editor, when adding a new object, the form is completely red
3 participants