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: avoid useless query on editor for switch types and infra #7904

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

sim51
Copy link
Contributor

@sim51 sim51 commented Jul 1, 2024

Fix #6971

@sim51 sim51 requested a review from a team as a code owner July 1, 2024 14:36
@sim51 sim51 marked this pull request as draft July 1, 2024 14:36
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 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 168 lines in your changes missing coverage. Please review.

Project coverage is 28.51%. Comparing base (7353c7a) to head (d553c1b).
Report is 5 commits behind head on dev.

Files Patch % Lines
...tions/editor/tools/switchEdition/useSwitchTypes.ts 0.00% 53 Missing and 1 partial ⚠️
...c/applications/editor/tools/switchEdition/utils.ts 0.00% 50 Missing and 1 partial ⚠️
front/src/modules/infra/useInfra.ts 0.00% 46 Missing and 1 partial ⚠️
front/src/applications/editor/Editor.tsx 0.00% 5 Missing ⚠️
front/src/applications/editor/Home.tsx 0.00% 2 Missing and 1 partial ⚠️
front/src/applications/editor/Map.tsx 0.00% 2 Missing ⚠️
...tor/tools/rangeEdition/speedSection/SwitchList.tsx 0.00% 2 Missing ⚠️
...plications/editor/tools/switchEdition/useSwitch.ts 0.00% 2 Missing ⚠️
...s/switchEdition/components/SwitchEditionLayers.tsx 0.00% 1 Missing ⚠️
...witchEdition/components/SwitchEditionLeftPanel.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    #7904      +/-   ##
============================================
- Coverage     28.54%   28.51%   -0.04%     
  Complexity     2059     2059              
============================================
  Files          1249     1251       +2     
  Lines        154182   154232      +50     
  Branches       3036     3038       +2     
============================================
- Hits          44009    43972      -37     
- Misses       108363   108448      +85     
- Partials       1810     1812       +2     
Flag Coverage Δ
core 74.95% <ø> (ø)
editoast 71.64% <ø> (-0.04%) ⬇️
front 9.99% <0.00%> (-0.01%) ⬇️
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.

@sim51 sim51 force-pushed the bsi/issue-6971 branch 2 times, most recently from c90cb07 to dbd4ebd Compare July 1, 2024 16:03
@sim51 sim51 marked this pull request as ready for review July 1, 2024 16:03
@sim51
Copy link
Contributor Author

sim51 commented Jul 1, 2024

@emersion Thanks
I fixed all your feedback, and now the PR is ready to be tested

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 PR, left some comments.

Do you think we could also make an improvement when hovering a tracksection to avoid calling it each time ?

front/src/applications/editor/tools/useInfra.tsx Outdated Show resolved Hide resolved
front/src/applications/editor/tools/useInfra.tsx Outdated Show resolved Hide resolved
front/src/applications/editor/tools/useInfra.tsx Outdated Show resolved Hide resolved
front/src/applications/editor/tools/useInfra.tsx Outdated Show resolved Hide resolved
front/src/applications/editor/tools/switchEdition/types.ts Outdated Show resolved Hide resolved
front/src/applications/editor/tools/switchEdition/types.ts Outdated Show resolved Hide resolved
Fix #6971

Unsubscribe some RTK queries to avoid useless queries, by creating
wrapper for useInfra & useSwitchType.
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.

Haven't looked into all of the details, but couldn't spot anything else!

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.

Lgtm and tested

@SharglutDev SharglutDev added this pull request to the merge queue Jul 2, 2024
Merged via the queue into dev with commit 0dc83c3 Jul 2, 2024
17 checks passed
@SharglutDev SharglutDev deleted the bsi/issue-6971 branch July 2, 2024 14:34
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: useless request are sent on the infra editor
4 participants