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: editor: add selection in search params #6175

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

SharglutDev
Copy link
Contributor

@SharglutDev SharglutDev commented Dec 20, 2023

close #5956

  • When selecting an object or many objects, the url gets updated with the objtype and its id
  • if we share an url containing selection of objects, these get selected
  • if the url is invalid, display error message to the user and redirect to the editor home page

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

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

Comparison is base (e5390a5) 27.71% compared to head (61d4f41) 27.91%.
Report is 6 commits behind head on dev.

Files Patch % Lines
front/src/applications/editor/Editor.tsx 0.00% 102 Missing ⚠️
front/src/applications/editor/tools/utils.ts 0.00% 56 Missing and 1 partial ⚠️
...applications/editor/tools/selection/components.tsx 0.00% 26 Missing and 1 partial ⚠️
...or/components/InfraErrors/InfraErrorMapControl.tsx 0.00% 8 Missing ⚠️
...c/common/BootstrapSNCF/ModalSNCF/ModalProvider.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #6175      +/-   ##
============================================
+ Coverage     27.71%   27.91%   +0.19%     
  Complexity     2165     2165              
============================================
  Files          1003     1006       +3     
  Lines        126630   126831     +201     
  Branches       2580     2581       +1     
============================================
+ Hits          35093    35400     +307     
+ Misses        90047    89940     -107     
- Partials       1490     1491       +1     
Flag Coverage Δ
core 78.58% <ø> (ø)
editoast 75.47% <ø> (+0.01%) ⬆️
front 8.68% <0.00%> (+0.31%) ⬆️
gateway 2.50% <ø> (ø)
railjson_generator 87.44% <ø> (ø)
tests 81.95% <ø> (ø)

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.

@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch 2 times, most recently from 2bc41f8 to 8e5bbbd Compare December 21, 2023 18:29
@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch from 8e5bbbd to 6b411a8 Compare January 3, 2024 12:42
@SharglutDev SharglutDev changed the title front: editor: select object from url params front: editor: add selection in search params Jan 3, 2024
@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch 2 times, most recently from d2daa51 to 5eeceee Compare January 3, 2024 15:04
@SharglutDev SharglutDev marked this pull request as ready for review January 3, 2024 15:04
@SharglutDev SharglutDev requested a review from a team as a code owner January 3, 2024 15:04
@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch 2 times, most recently from 96cd827 to c888157 Compare January 3, 2024 16:38
@sim51
Copy link
Contributor

sim51 commented Jan 5, 2024

It works great with some elements in the selection, well done !

But we have an issue when have many (a lot) elements in the selection, the url is too long, and so if we refresh the page we have a 431 . I forgot that we have the 'square' selection tool ... and with it, it's easy to reproduce the issue, just select the Paris area with the tool. I don't know (for now) how to handle that.

There is an other issue : if I do a selection, and then press the "back" button of my browser, the url changed but not the selection. There is 2 solutions for this issue : when we set the url with the new parameter, we should replace it in the history instead of doing a push.
The other solution is to to listen to the change of the query parameter in the editor.tsx and sync the selection with it.

@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch from c888157 to 31c00c1 Compare January 8, 2024 08:16
@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch 2 times, most recently from ceae927 to 7436942 Compare January 24, 2024 10:50
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.

I've reviewed all the files ✅

@SharglutDev SharglutDev force-pushed the pfn/front/infra-editor-routing branch from 4f4cfbc to 61d4f41 Compare January 25, 2024 12: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, nice PR ✅

@SharglutDev SharglutDev added this pull request to the merge queue Jan 25, 2024
Merged via the queue into dev with commit a93fe8f Jan 25, 2024
20 checks passed
@SharglutDev SharglutDev deleted the pfn/front/infra-editor-routing branch January 25, 2024 14:18
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.

Per-object urls in the infrastructure editor
3 participants