-
Notifications
You must be signed in to change notification settings - Fork 46
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 macro trainruns frequencies #10448
Conversation
978af53
to
6dff182
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #10448 +/- ##
=======================================
Coverage 81.87% 81.88%
=======================================
Files 1077 1078 +1
Lines 107088 107144 +56
Branches 724 724
=======================================
+ Hits 87681 87736 +55
- Misses 19367 19368 +1
Partials 40 40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9eefc97
to
e947e07
Compare
Depends on #10486 |
1857f69
to
2c1f9f5
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.
Works great just some questions :)
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
It seems like this feature got lost in #9105. I think this PR still creates |
The former feature allowed, for instance, |
Yeah, what I meant was that I think |
I'm not a huge fan of the RegExp-based label parsing. (BTW, it's also used in Maybe this can all be consolidated in a single function, used everywhere instead of the RegExp and string checks? const frequencyIdFromLabel = (label: string) => {
if (!label.startsWith('frequency::')) return null;
const n = parseInt(label.split('::', 2)[1], 10);
const frequency = DEFAULT_TRAINRUN_FREQUENCIES.find((freq) => freq.frequency === n);
return frequency?.id ?? null;
}; |
front/src/applications/operationalStudies/components/MacroEditor/osrdToNge.ts
Outdated
Show resolved
Hide resolved
d08cdd0
to
ae0c6c3
Compare
Because I found this bug on the way, i'm also fixing it in a separate commit : #10552 |
fd7b6a4
to
c8d9bd3
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 and tested, good job :)
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, tested.
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, tested.
Signed-off-by: Louis Greiner <[email protected]>
Signed-off-by: Louis Greiner <[email protected]>
Signed-off-by: Louis Greiner <[email protected]>
c8d9bd3
to
c9c33f8
Compare
After #9105, we've lost the feature the macro trainrun frequencies
This way of handling macro train frequencies will be revamp during https://github.com/osrd-project/osrd-confidential/issues/779
Closes #10389
Closes #10552