Repository navigation
Read the stored parking type instead of guessing it from the vehicle types - #1773
Merged
Merged
Conversation
teppope
force-pushed
the
fix/parking-read-stored-type
branch
2 times, most recently
from
October 2, 2026 10:39
ed743e7 to
7a3a3b2
Compare
2 tasks done
teppope
force-pushed
the
fix/parking-read-stored-type
branch
from
October 9, 2026 13:54
02a5747 to
8e60c35
Compare
teppope
marked this pull request as ready for review
October 12, 2026 08:26
1 task done
teppope
force-pushed
the
fix/parking-read-stored-type
branch
from
October 13, 2026 09:20
8a3e05e to
7891d5d
Compare
a-limyr
requested changes
Oct 16, 2026
a-limyr
left a comment
Contributor
There was a problem hiding this comment.
Nice work. Splitting parkingType into hasFullFieldSet and isForPedalCycle makes the model much clearer, and the tests cover the cases well. A few things before merge:
- New registeredDisabled: 0 entry on save. Bicycle parkings with a stored type now get the full field set. toClient() gives numberOfSpacesForRegisteredDisabledUserType: 0 when the entry doesn't exist, and mergeParkingSpaces keeps 0. So every save of such a parking adds a registeredDisabled entry that wasn't there before. Could a missing entry map to undefined instead?
- Save path uses a different rule than the editor. mapToQueryVariables.js:414 still checks parkingType === BIKE_PARKING. Could it use !source.hasFullFieldSet, so the same predicate decides both what's shown and what's saved?
- isParkAndRide is now just another name for hasFullFieldSet. Can we remove it and use hasFullFieldSet in toClient()?
- StopPlaceView.tsx:121: please use the PARKING_TYPE constants instead of the "bikeParking"/"parkAndRide" strings.
I think 1 and 2 should be looked at. 3 and 4 are nice to haves.
Collaborator
Author
Thanks, I've pushed a fix to all four. |
Contributor
|
Thanks, all four points from the previous review are fixed. One thing before merge:
|
a-limyr
approved these changes
Oct 23, 2026
a-limyr
left a comment
Contributor
There was a problem hiding this comment.
Approved pending rebase with master.
…types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ields by the editor's rule Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
teppope
force-pushed
the
fix/parking-read-stored-type
branch
from
October 23, 2026 07:05
fea614d to
1a6f82b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The editor shows every field of a
pedalCycleparking that Tiamat stores asparkAndRide. Abzu guessed the type and showed a name and a total capacity only.parkingType, and splits the old guess into four answers:hasFullFieldSetisForPedalCycle, from the vehicle typesparkingType === bikeParkinghasFullFieldSet, the same rule as the editormotorcyclelabel.0. A save adds no zero entry the parking did not hold.Type of change
Issue
Data with no stored type behaves as before. Two visible changes follow:
parkAndRidetype andpedalCyclevehicles now has the park-and-ride title. The icon still shows the bicycle.carandpedalCycleand no stored type now shows the bicycle icon and title. This combination is likely to be rare.Unit tests
Parking.jsfrom master, 13 of the 20 tests insrc/test/parkingType.spec.jsfail.motorcycletest fails without the new key withexpected 'motorcycle' to be 'Moottoripyörä'.mapToClient.jschange withexpected undefined to be trueandexpected undefined to be false.parkingSaveCapacity.spec.jsfail without the review fixes. Two save an extra zero entry. One drops a capacity edit.Verification
vitest runnpx tsc --noEmitnpm run check(Prettier)VerboseParkingcopiesdiffparkAndRide, modern editor, master and this branch