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: add checks for input size in the scenario modal #7920

Open theocrsb opened 2 days ago

theocrsb commented 2 days ago

close #5935

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 96 lines in your changes missing coverage. Please review.

Project coverage is 28.39%. Comparing base (c61b95f) to head (40ef040).

Files Patch % Lines
front/src/modules/project/utils.ts 0.00% 18 Missing and 1 partial :warning:
...dules/project/components/AddOrEditProjectModal.tsx 0.00% 18 Missing :warning:
front/src/modules/study/utils.ts 0.00% 17 Missing :warning:
...c/modules/study/components/AddOrEditStudyModal.tsx 0.00% 16 Missing :warning:
...les/scenario/components/AddOrEditScenarioModal.tsx 0.00% 13 Missing :warning:
front/src/modules/scenario/utils.ts 0.00% 12 Missing and 1 partial :warning:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #7920 +/- ## ============================================ - Coverage 28.42% 28.39% -0.03% Complexity 2059 2059 ============================================ Files 1264 1266 +2 Lines 155100 155174 +74 Branches 3053 3055 +2 ============================================ - Hits 44082 44060 -22 - Misses 109197 109291 +94 - Partials 1821 1823 +2 ``` | [Flag](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7920/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/7920/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `75.00% <ø> (ø)` | | | [editoast](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7920/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `71.56% <ø> (-0.08%)` | :arrow_down: | | [front](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7920/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `9.98% <0.00%> (-0.01%)` | :arrow_down: | | [gateway](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7920/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/7920/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/7920/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.

theocrsb commented 15 hours ago

Nice job :) I left a comment on project, but you can do the same for study and scenario

Thank you for your feedback !

theocrsb commented 14 hours ago

Almost perfect, can you just rename the functions checkFields => checkProjectFields, checkScenarioFields, checkStudyFields ? Otherwise we have 3 functions checkFields which are exported, it's not very practical

Of course it's done