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: initialize stdcm v2 #7414

Merged
merged 1 commit into from
May 31, 2024
Merged

front: initialize stdcm v2 #7414

merged 1 commit into from
May 31, 2024

Conversation

kmer2016
Copy link
Contributor

@kmer2016 kmer2016 commented May 15, 2024

Closes #7015

Implementation of STDCM V2

Completed Tasks:

  • Implemented the first screen to fill in parameters.
  • Store simulation parameters in memory
  • Implemented start simulation mode (disabled all inputs while the simulation is pending).
  • Implemented the switch to enable V1 or V2.

Fixes #7409

Key Highlights:

  • Extracted the logic for searching the operational point into a hook, useSearchOperationalPoint. This hook is now used in both MapSearchOperationalPoint and StdcmOperationalPoint.
  • Refactored the sort function in useSearchOperationalPoint to prevent changes to the CH code of main operational points (BV, 00). Selecting an empty CH code in StdcmOperationalPoint resets the search.
  • Extracted functions to launch, cancel, and handle the result of STDCM into useStdcm. These functions are reused in StdcmViewV1 and StdcmViewV2.

Next Steps:

  • Use the new Select component.
  • Use the new DatePicker component.
  • Use the new TimePicker component.
  • Use the new MarginPicker component.
  • Implement simulation results.
  • Improve the overall style.
  • Use the ui-core font.

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2024

Codecov Report

Attention: Patch coverage is 5.06058% with 1332 lines in your changes are missing coverage. Please review.

Project coverage is 28.98%. Comparing base (9549537) to head (3fcc337).

Files Patch % Lines
front/src/applications/stdcm/hooks/useStdcm.tsx 0.00% 185 Missing and 1 partial ⚠️
...tions/stdcmV2/components/StdcmOperationalPoint.tsx 0.00% 173 Missing and 1 partial ⚠️
...c/applications/stdcmV2/components/StdcmConsist.tsx 0.00% 135 Missing and 1 partial ⚠️
...dules/rollingStock/hooks/useFilterRollingStock.tsx 30.64% 119 Missing and 10 partials ⚠️
...rc/common/Map/Search/useSearchOperationalPoint.tsx 0.00% 115 Missing and 1 partial ⚠️
...ont/src/applications/stdcmV2/views/StdcmViewV2.tsx 0.00% 95 Missing and 1 partial ⚠️
...plications/stdcmV2/components/StdcmSuggestions.tsx 0.00% 77 Missing and 1 partial ⚠️
...rc/applications/stdcmV2/components/StdcmOrigin.tsx 0.00% 56 Missing and 1 partial ⚠️
...rc/applications/stdcmV2/components/StdcmLoader.tsx 0.00% 38 Missing and 1 partial ⚠️
...plications/stdcmV2/components/StdcmDestination.tsx 0.00% 35 Missing and 1 partial ⚠️
... and 30 more

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

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #7414      +/-   ##
============================================
- Coverage     29.15%   28.98%   -0.17%     
  Complexity     2021     2021              
============================================
  Files          1210     1223      +13     
  Lines        148187   149045     +858     
  Branches       2915     2934      +19     
============================================
+ Hits          43202    43207       +5     
- Misses       103264   104098     +834     
- Partials       1721     1740      +19     
Flag Coverage Δ
core 74.99% <ø> (ø)
editoast 71.92% <ø> (-0.05%) ⬇️
front 9.98% <5.06%> (-0.07%) ⬇️
gateway 2.41% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 71.85% <ø> (ø)

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.

@kmer2016 kmer2016 force-pushed the sba-cnh/stdcm/implementV2-7015 branch 6 times, most recently from b2eff15 to 537f7eb Compare May 22, 2024 06:00
@kmer2016 kmer2016 marked this pull request as ready for review May 22, 2024 06:33
@kmer2016 kmer2016 requested a review from a team as a code owner May 22, 2024 06:33
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.

Use const instead of function in all the files to be coherent with the existing code base

front/src/applications/stdcm/Home.tsx Outdated Show resolved Hide resolved
front/src/applications/stdcmV2/views/StdcmViewV2.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@Akctarus Akctarus left a comment

Choose a reason for hiding this comment

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

Good PR, thank you for the refactor. Tested and LGTM for the start of V2 implementation. Left few comments.

front/src/reducers/osrdconf/types.ts Outdated Show resolved Hide resolved
front/src/applications/stdcmV2/components/StdcmConsist.tsx Outdated Show resolved Hide resolved
front/src/common/BootstrapSNCF/SelectSNCF.tsx Outdated Show resolved Hide resolved
front/src/common/BootstrapSNCF/SelectImprovedSNCF.tsx Outdated Show resolved Hide resolved
front/src/common/BootstrapSNCF/NavBarSNCF.tsx Show resolved Hide resolved
front/src/assets/pictures/views/stdcm_v2_loader.jpg Outdated Show resolved Hide resolved
front/src/common/Map/Search/useSearchOperationalPoint.tsx Outdated Show resolved Hide resolved
front/src/common/Map/Search/useSearchOperationalPoint.tsx Outdated Show resolved Hide resolved
front/src/common/Map/Search/useSearchOperationalPoint.tsx Outdated Show resolved Hide resolved
front/src/common/Map/Search/useSearchOperationalPoint.tsx Outdated Show resolved Hide resolved
front/src/common/Map/Search/useSearchOperationalPoint.tsx Outdated Show resolved Hide resolved
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 this great PR. As there has been 2 review already, I just compared your UI to the one of the model and left some comments.

front/src/applications/stdcmV2/views/StdcmViewV2.tsx Outdated Show resolved Hide resolved
front/src/styles/scss/applications/stdcmV2/_card.scss Outdated Show resolved Hide resolved
front/src/applications/stdcmV2/components/StdcmOrigin.tsx Outdated Show resolved Hide resolved
front/src/styles/scss/applications/stdcmV2/_card.scss Outdated Show resolved Hide resolved
front/src/applications/stdcmV2/components/StdcmConsist.tsx Outdated Show resolved Hide resolved
@SarahBellaha SarahBellaha force-pushed the sba-cnh/stdcm/implementV2-7015 branch 2 times, most recently from ac29d70 to 22ebb2d Compare May 29, 2024 18:31
@kmer2016 kmer2016 force-pushed the sba-cnh/stdcm/implementV2-7015 branch 3 times, most recently from a0dc0cf to bd04690 Compare May 30, 2024 09:49
@flomonster flomonster force-pushed the sba-cnh/stdcm/implementV2-7015 branch from bd04690 to d434bf4 Compare May 30, 2024 10:32
@kmer2016 kmer2016 force-pushed the sba-cnh/stdcm/implementV2-7015 branch from d434bf4 to 37749cd Compare May 30, 2024 10:36
@clarani clarani changed the title front: initilize stdcm v2 front: initialize stdcm v2 May 30, 2024
@kmer2016 kmer2016 force-pushed the sba-cnh/stdcm/implementV2-7015 branch from 3bf5d6d to 0e6c3d8 Compare May 31, 2024 07:30
@SarahBellaha SarahBellaha force-pushed the sba-cnh/stdcm/implementV2-7015 branch 5 times, most recently from 740a796 to 94c1857 Compare May 31, 2024 13:03
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.

Almost good !

@SarahBellaha SarahBellaha force-pushed the sba-cnh/stdcm/implementV2-7015 branch from 94c1857 to 6994cf6 Compare May 31, 2024 14:03
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, thanks ✅

@clarani clarani added this pull request to the merge queue May 31, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch May 31, 2024
@kmer2016 kmer2016 force-pushed the sba-cnh/stdcm/implementV2-7015 branch from 6994cf6 to 3fcc337 Compare May 31, 2024 15:48
@kmer2016 kmer2016 added this pull request to the merge queue May 31, 2024
Merged via the queue into dev with commit 23ed3c3 May 31, 2024
17 checks passed
@kmer2016 kmer2016 deleted the sba-cnh/stdcm/implementV2-7015 branch May 31, 2024 17:02
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.

Uncaught TypeError: a.ch is null on infra without ch Implement STDCM UI v2
5 participants