ERSAD: Add information display and information desk inputs#1652
ERSAD: Add information display and information desk inputs#1652a-limyr merged 2 commits intoentur:masterfrom
Conversation
a-limyr
left a comment
There was a problem hiding this comment.
This is a well-structured implementation that follows established patterns. The code is clean, properly integrated across all layers and moves the application towards TypeScript. I found a type issue and some other minor things that might not be an issue.
Good job!
src/models/Facilities.ts
Outdated
| export interface SiteFacilitySet { | ||
| mobilityFacilityList: MobilityFacility[]; | ||
| passengerInformationFacilityList: PassengerInformationFacility[]; | ||
| passengerInformationEquipmentList: PassengerInformationEquipment | null; |
There was a problem hiding this comment.
Is this supposed to be a list also? If not then perhaps the name should be passengerInformationEquipment?
There was a problem hiding this comment.
Good catch! This was originally due to backend's netex model (part that is bound to external library) having it as a single value (despite name suggesting it's a list), but since in the end I made it so that tiamat's own netex model has it as a real list, I think I forgot to tune up this spot along
src/modelUtils/facilitiesHelpers.js
Outdated
| } | ||
| : { ...defaultSiteFacilitySet, ...state }; | ||
| updatedEntity.quays[id].facilities = [newSiteFacilitySet]; | ||
| } else { |
There was a problem hiding this comment.
Would it be an idea to have a else if here to verify that the type is stopPlace? And not just assume? At least it would be more readable.
There was a problem hiding this comment.
Not sure, the "entity" usually implied that it's either a quay or stopPlace (e.g. type EntityType in model), so if a method was about updating an entity, maybe there aren't other use cases coming around 🤔 But then I do remember that in the UI components there been some places where the value of "type" that can be a "parking"...
There was a problem hiding this comment.
But maybe for the sake of readability "else if" would make it more clear, I'll add it
| STOP_TIMETABLE = "stopTimetable", | ||
| JOURNEY_PLANNING = "journeyPlanning", | ||
| INTERACTIVE_KIOSK = "interactiveKiosk", | ||
| INFORMATION_DESK = "informationDesk", |
There was a problem hiding this comment.
This is the only enum in use from this set of enums. Is this intentional or have you forgotten to add support for the other enums in the UI? If it is there for future implementations it is fine.
There was a problem hiding this comment.
These just tagged along from the backend, could be used in future (currently only info desk is) but not yet (and probably won't be done by us)
| export enum PassengerInformationFacility { | ||
| NEXT_STOP_INDICATOR = "nextStopIndicator", | ||
| STOP_ANNOUNCEMENTS = "stopAnnouncements", | ||
| PASSENGER_INFORMATION_DISPLAY = "passengerInformationDisplay", |
There was a problem hiding this comment.
This is the only enum in use from this set of enums. Is this intentional or have you forgotten to add support for the other enums in the UI? If it is there for future implementations it is fine.
There was a problem hiding this comment.
These just tagged along from the backend, could be used in future (currently only passengerInformationDisplay is) but not yet (and probably won't be done by us)
|
@a-limyr, thank you for the review, great points! The changes been made, I'll ping once the backend is merged |
|
@a-limyr, the backend is now merged 🚀 |
|
I have tested this. I get the UI working fine, but I have issues when I try to save changes in these fields I get the following error from Tiamat: Any idea why this is happening? |
|
Thank you for catching this! I think I may have introduced a small bug in the last round of the after-review changes in the Tiamat's PR for this feature. I pushed a fix, will ping once it's merged 🚀 |
|
@a-limyr the backend fix for this has now been merged! 🚀 |
Summary
In facilities tab: new information display input.
In assistance tab: new information desk input.
Both are defined on a stop place level only.
Issue
The XML behind:
Unit tests