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: fix slopes editor form validation #5581

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

Wadjetz
Copy link
Member

@Wadjetz Wadjetz commented Nov 2, 2023

close #3479

  • Make the field optional
  • Graph modifications
Capture d’écran 2023-11-15 à 17 47 20

No value
Capture d’écran 2023-11-15 à 17 47 33

Zero
Capture d’écran 2023-11-15 à 17 52 49
Capture d’écran 2023-11-17 à 09 27 22

@Wadjetz Wadjetz self-assigned this Nov 2, 2023
@Wadjetz Wadjetz changed the title front: editor-slopes-fix-form-validation front: fix slopes editor form validation Nov 2, 2023
@Wadjetz Wadjetz marked this pull request as ready for review November 2, 2023 16:16
@Wadjetz Wadjetz requested a review from a team as a code owner November 2, 2023 16:16
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Attention: 77 lines in your changes are missing coverage. Please review.

Comparison is base (59b59b5) 19.45% compared to head (355f023) 19.45%.

Files Patch % Lines
...editor/components/LinearMetadata/FormComponent.tsx 0.00% 44 Missing ⚠️
front/src/common/IntervalsDataViz/IntervalItem.tsx 0.00% 19 Missing ⚠️
front/src/common/IntervalsDataViz/data.ts 0.00% 5 Missing ⚠️
front/src/types/editor.ts 0.00% 3 Missing ⚠️
...tions/editor/components/LinearMetadata/tooltip.tsx 0.00% 2 Missing ⚠️
...rc/applications/editor/tools/trackEdition/utils.ts 0.00% 2 Missing ⚠️
.../src/applications/editor/components/EditorForm.tsx 0.00% 1 Missing ⚠️
front/src/common/IntervalsDataViz/dataviz.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #5581      +/-   ##
============================================
- Coverage     19.45%   19.45%   -0.01%     
  Complexity     2326     2326              
============================================
  Files           907      907              
  Lines        106891   106911      +20     
  Branches       2579     2579              
============================================
  Hits          20795    20795              
- Misses        84584    84604      +20     
  Partials       1512     1512              
Flag Coverage Δ
front 8.32% <0.00%> (-0.01%) ⬇️

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.

@Wadjetz Wadjetz added area:front Work on Standard OSRD Interface modules kind:bug Something isn't working module:infra-editor Infra Edition labels Nov 2, 2023
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from cf04158 to f4b8f9d Compare November 3, 2023 13:23
@Wadjetz Wadjetz marked this pull request as draft November 3, 2023 14:10
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from f4b8f9d to ec3cda6 Compare November 6, 2023 13:41
@Wadjetz Wadjetz marked this pull request as ready for review November 6, 2023 13:59
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from ec3cda6 to 296a08b Compare November 6, 2023 14:18
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Good job for the catch of this customOnChange !

Tested in local and everything seems to be working as expected. Tried also the forms for signals, detectors, switches, buffer stops and seen nothing strange.

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 ✅

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.

We need to wait for Giuliana's point of view

@Wadjetz Wadjetz marked this pull request as draft November 8, 2023 14:46
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch 4 times, most recently from b7b7a83 to 7e347db Compare November 9, 2023 15:13
@Wadjetz Wadjetz marked this pull request as ready for review November 9, 2023 15:13
@Wadjetz Wadjetz requested a review from clarani November 9, 2023 15:13
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Take you for the changes. As checked with you, I think the curves and slopes values should be set to 0 as soon as we enter in the form.

Otherwise, I think it's strange that if the value is at 0, we see a - when hovering the interval editor. It might mislead the user as it's the same behavior than the undefined one.

image

Also you have some warnings in the file

@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from 7e347db to 770d97a Compare November 13, 2023 13:05
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Thank you for the changes.
When I try to create a new tracksection, after drawing it and fill the required inputs, doesn't work. Its saying that curves and slopes are required properties even though gradiant and radius are set to 0 when entering the form.

image

On the other hand, the behavior when editing a track section with unspecified gradiants or radius is great, they are set automatically to 0, good job !

@flomonster flomonster marked this pull request as draft November 14, 2023 08:37
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from 2626b06 to 0124cd5 Compare November 14, 2023 14:26
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch 5 times, most recently from c2d9163 to 091fb50 Compare November 16, 2023 14:45
@Wadjetz Wadjetz marked this pull request as ready for review November 16, 2023 14:47
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Great job for this PR, thank you ! Tested and everything works as expected.

Left some naming comments. As I will be away the next 2 business days, I'll let @clarani resolve those so you are not blocked to merge the PR.

@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from 091fb50 to 8598ceb Compare November 17, 2023 08:32
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.

Thanks for this PR, almost there :)

@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from 544b021 to 2976e4c Compare November 17, 2023 14:49
@Wadjetz Wadjetz requested a review from clarani November 17, 2023 15:36
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 and tested ! Nice job, thank you very much 🙏 🎉

@Wadjetz Wadjetz added this pull request to the merge queue Nov 17, 2023
@Wadjetz Wadjetz removed this pull request from the merge queue due to a manual request Nov 17, 2023
make slopes and curves value optional
improve chart
@Wadjetz Wadjetz force-pushed the ebe/fix-slopes-gradient-form-validation branch from 2976e4c to 355f023 Compare November 17, 2023 15:59
@Wadjetz Wadjetz added this pull request to the merge queue Nov 17, 2023
Merged via the queue into dev with commit e451124 Nov 17, 2023
@Wadjetz Wadjetz deleted the ebe/fix-slopes-gradient-form-validation branch November 17, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules kind:bug Something isn't working module:infra-editor Infra Edition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor : slopes with no gradient values can be save
3 participants