-
Notifications
You must be signed in to change notification settings - Fork 45
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: nge saving node's positions #9105
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9105 +/- ##
==========================================
+ Coverage 80.10% 80.15% +0.04%
==========================================
Files 1054 1057 +3
Lines 105648 106171 +523
Branches 759 759
==========================================
+ Hits 84631 85100 +469
- Misses 20976 21029 +53
- Partials 41 42 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
3a13325
to
28830b5
Compare
26bed5f
to
10fbfa2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some very early comments. Please feel free to disregard the individual comments if you're going to change the underlying code anyways.
It appears like this contains a big refactoring together with a big new feature. This is very painful to review. Please split it up into logical commits (e.g. refactoring without any behavior change as a first commit, new feature as a second commit).
front/src/applications/operationalStudies/components/MacroEditor/OsrdNgeSync.tsx
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/MacroEditor/OsrdNgeSync.tsx
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/Scenario/ScenarioContent.tsx
Outdated
Show resolved
Hide resolved
9709bec
to
d15f8ea
Compare
d15f8ea
to
222242e
Compare
4ecb266
to
eff057d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on the editoast part! 😄 Here's a first pass of review.
I'm wondering if we really should build on top of the /project/id/study/id/...
API though. If I recall correctly, this URL scheme was chosen because we wanted to replace the IDs with slugs. But that was almost two years ago and we're not planning to implement this feature anytime soon as far as I know. And even if we had it, it's not great in terms of API design to not be able to access an object by its ID directly. (We're also likely to boil down to the resource ID for the permission checks anyway, so we might as well have the endpoint and redirect from the slug chain.)
I suggest getting rid of the prefixes and simply access these endpoints at /macro_node
and /macro_node/{id}
. This would simplify the implementation as well. Wdyt? (ping @flomonster)
Also is it OK to link |
@leovalais can you check again ? Normally I did all the requested changes. |
Tested the feature, a few questions:
This also has a side-effect: if you re-create the circulation, any metadata from the old nodes (tags, name) becomes automatically attached to the nodes of the new schedule.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few comments we've come up when reviewing with @clarani!
front/src/applications/operationalStudies/components/MacroEditor/osrdToNge.ts
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/MacroEditor/osrdToNge.ts
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/MacroEditor/osrdToNge.ts
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/MacroEditor/osrdToNge.ts
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/MacroEditor/osrdToNge.ts
Outdated
Show resolved
Hide resolved
bc52f12
to
3c6565b
Compare
9fefabc
to
ced2f26
Compare
I review the way how I stored the nodes in the state and their relative indices. Normally this refacto solved all your last comments, except two which are not critical, the index of labels and the rename of a field in the database. BTW, I found & fixed a bug when you want to delete a project or a study. |
ced2f26
to
36ac2b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some bugs:
- the created trigrams in NGE are not correctly displayed
- the positions of the nodes are not saved in the database
front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts
Outdated
Show resolved
Hide resolved
front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts
Show resolved
Hide resolved
Signed-off-by: Benoit Simard <contact@bsimard.com>
Signed-off-by: Benoit Simard <contact@bsimard.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Benoit Simard <contact@bsimard.com>
ba9764d
to
0cd0959
Compare
When calling the dtoImport, we ask the transchedule state to the database Signed-off-by: Benoit Simard <contact@bsimard.com>
0cd0959
to
84d327f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the changes!
Related to /~https://github.com/osrd-project/osrd-confidential/issues/597
What is done :
Close #9031