-
Notifications
You must be signed in to change notification settings - Fork 44
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: select op with map when add train #9790
base: dev
Are you sure you want to change the base?
Conversation
5f47a24
to
3de78a8
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 #9790 +/- ##
===========================================
+ Coverage 79.94% 87.50% +7.56%
===========================================
Files 1057 31 -1026
Lines 106302 1537 -104765
Branches 724 0 -724
===========================================
- Hits 84982 1345 -83637
+ Misses 21278 192 -21086
+ Partials 42 0 -42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
635d7fa
to
b1c1b48
Compare
c0f0025
to
8bdbaf3
Compare
1030168
to
b4648bb
Compare
f323ca1
to
9a2eea0
Compare
import { | ||
osrdEditoastApi, | ||
type OperationalPoint, | ||
type OperationalPointReference, |
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.
OperationalPointReference is not used
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.
Done
.../modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/RenderPopup.tsx
Outdated
Show resolved
Hide resolved
9a2eea0
to
425029f
Compare
@@ -144,12 +145,12 @@ const Map = ({ | |||
|
|||
const onFeatureClick = (e: MapLayerMouseEvent) => { | |||
if (preventPointSelection) return; | |||
const result = getMapMouseEventNearestFeature(e, { layersId: ['chartis/tracks-geo/main'] }); | |||
const result = getMapMouseEventNearestFeature(e); |
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.
As you have removed the layers which are clickable, I can select all lines and points (signals, dectectors etc)
@@ -103,6 +103,7 @@ const Map = ({ | |||
|
|||
const [mapIsLoaded, setMapIsLoaded] = useState(false); | |||
|
|||
const [operationnalPointId, setOperationnalPointId] = useState<string | undefined>(undefined); |
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.
- add hovered in the name
- operational has only 1 n 😉
const [operationnalPointId, setOperationnalPointId] = useState<string | undefined>(undefined); | |
const [hoveredOperationalPointId, setHoveredOperationalPointId] = useState<string | undefined>(undefined); |
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.
Done
if (isOperationalPoint) { | ||
const trackId = featureInfoClick.feature.properties?.track_id; | ||
|
||
const clickedTrack = await getTrackEntity({ |
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.
Can you remove getTrackEntity by getInfraObjectEntity since you use it to fetch operational points and track sections ?
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.
Done
body: [trackId], | ||
}).unwrap(); | ||
|
||
const { parts } = result[0].railjson as OperationalPoint; |
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.
You can reuse this const l115 and 116 (we should avoid any
s ;) )
const { parts } = result[0].railjson as OperationalPoint; | |
const operationalPoint = result[0].railjson as OperationalPoint; |
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.
You're right, it's done
tracks: trackPartCoordinates, | ||
}); | ||
} else { | ||
setClickedOp(undefined); |
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 think it would be nice to reset clickedOp and offset before calling calculateOffset
in the hook.
Can you rename the function by the way ?
-bold pr on hover (for PRs on same track) -select pr on map and choose track Signed-off-by: theocrsb <[email protected]>
48a5197
to
192380d
Compare
-bold pr on hover (for PRs on same track)
-select pr on map and choose track
depends: #9800 and #10157
closes https://github.com/osrd-project/osrd-confidential/issues/777