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 the warning display above the GET #8880

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Conversation

clarani
Copy link
Contributor

@clarani clarani commented Sep 16, 2024

closes #8878

Add a new boolean allTrainsProjected and display the warning "Projecting..." only if this boolean is not truthy.

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 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 21 lines in your changes missing coverage. Please review.

Project coverage is 37.13%. Comparing base (8d1935a) to head (0bc4624).
Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
.../components/SpaceTimeChart/useLazyProjectTrains.ts 0.00% 8 Missing ⚠️
...ions/operationalStudies/hooks/useLazyLoadTrains.ts 0.00% 5 Missing ⚠️
...ons/operationalStudies/views/SimulationResults.tsx 0.00% 3 Missing ⚠️
...nalStudies/components/Scenario/ScenarioContent.tsx 0.00% 2 Missing ⚠️
...ations/operationalStudies/hooks/useScenarioData.ts 0.00% 2 Missing ⚠️
...ications/stdcm/hooks/useProjectedTrainsForStdcm.ts 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    #8880      +/-   ##
============================================
- Coverage     37.13%   37.13%   -0.01%     
  Complexity     2211     2211              
============================================
  Files          1260     1260              
  Lines        115076   115085       +9     
  Branches       3230     3230              
============================================
- Hits          42738    42735       -3     
- Misses        70405    70417      +12     
  Partials       1933     1933              
Flag Coverage Δ
core 74.67% <ø> (ø)
editoast 72.56% <ø> (-0.02%) ⬇️
front 15.20% <0.00%> (-0.01%) ⬇️
gateway 2.20% <ø> (ø)
osrdyne 2.60% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.46% <ø> (ø)

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.

@clarani clarani marked this pull request as ready for review September 18, 2024 08:11
@clarani clarani requested a review from a team as a code owner September 18, 2024 08:11
@emersion
Copy link
Member

emersion commented Sep 18, 2024

Could we instead use a useMemo with a callback checking shouldProjectIds.length === 0?

@anisometropie
Copy link
Contributor

it doesn’t go away after I just created 100 trains

Screenshot_20240918_134915

@anisometropie
Copy link
Contributor

anisometropie commented Sep 18, 2024

weirdly the too figures are not synchronized 40 on the left 30 on the right
Screenshot_20240918_135020

@clarani
Copy link
Contributor Author

clarani commented Sep 19, 2024

@anisometropie thanks for your review 🙏

  • thanks for the bug, I fixed it in the 3rd commit
  • for your 2nd remark, actually it's normal that the counters are de-synchronized, since the loading of the trains and the projection are done in parallel and projection is done after the loading

@emersion
Copy link
Member

Another way to fix this without a desync would be to subtract the number of invalid trains to the total number of simulated trains. But the current approach here looks fine to me as well.

Copy link
Contributor

@anisometropie anisometropie left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

LGTM regardless

Copy link
Contributor

@kmer2016 kmer2016 left a comment

Choose a reason for hiding this comment

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

LGTM

- Add a new boolean allTrainsProjected and display the warning "Projecting..." only if this boolean is not truthy.
- Transform trainIdsToProject into a set (instead of array)
@clarani clarani added this pull request to the merge queue Sep 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@clarani clarani added this pull request to the merge queue Sep 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@clarani clarani added this pull request to the merge queue Sep 20, 2024
Merged via the queue into dev with commit 03b957e Sep 20, 2024
23 checks passed
@clarani clarani deleted the cni/8878-fix-get-warning branch September 20, 2024 14:26
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: the warning above the GET doesn't disappear if a timetable has some invalid trains
5 participants