Skip to content

Edit parking cycle storage in the modern editor - #1791

Draft
teppope wants to merge 4 commits into
entur:masterfrom
tmfg:feat/parking-cycle-storage
Draft

teppope wants to merge 4 commits into
entur:masterfrom
tmfg:feat/parking-cycle-storage

Conversation

@teppope

@teppope teppope commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Needs entur/tiamat#505 merged and deployed first. The editor sends the cycle storage equipment id, which only #505 accepts.

Summary

The modern editor shows and edits the cycle storage of every parking.

  • Each entry is a row with a type, a number of spaces and a delete button. A user adds and deletes rows.
  • The type menu offers the NeTEx Nordic values racks, bars and railings.
  • A stored cycleScheme or other value shows as its label. A save keeps it.
  • An entry may have no number of spaces.
  • A save sends placeEquipments only after a cycle storage edit. It then sends every equipment kind with its id.
  • An agent wrote the fi, sv, nb and fr translations. Native speakers should check them.

Type of change

  • New feature (non-breaking change which adds functionality)

Issue

Tiamat exposes cycle storage on a parking since #465. No editor showed it.

Unit tests

See Verification.

Verification

Check Result
Model tests in parkingCycleStorage.spec.js (18) ✅ On the base the spec fails at import. With only the new model file, 16 of 18 fail with Cannot read properties of undefined (reading 'cycleStorageEquipment'). The unchanged-save guard and the type-list test pass
Component tests in CycleStorageFields.spec.tsx (8) ✅ All 8 fail on the base: expected [] to have a length of 2 but got +0
Type menu offers only three values ✅ Fails without the fix: expected [ Array(4) ] to deeply equal [ 'Racks', 'Bars', 'Railings' ]
Keyboard use of the menu with a stored value outside it ✅ Fails without the fix: the listbox stays open
An unchanged parking sends no placeEquipments ✅ Fails when the flag condition goes: expected {...} to not have property "placeEquipments"
npx vitest run ✅ 45 files, 364 tests pass
npx tsc --noEmit and npm run check ✅ Clean
Identity with #505 ✅ An unchanged save keeps the cycle storage id. A save that changes an entry keeps the id of the old entry
Migrated bicycle parking ✅ One row Bars, empty spaces. An unchanged save sends no placeEquipments
Add an entry and save ✅ Two entries stored, the old id kept, the new entry racks with 10 spaces
Clear a count and save ✅ The save succeeds and Tiamat stores no count
Remove the last entry and save ✅ GraphQL returns an empty cycleStorageEquipment list
Car park-and-ride parking ✅ The section renders. Tiamat stores an entry racks with 6 spaces
Stored cycleScheme ✅ The label Cycle scheme shows. The menu lists Racks, Bars and Railings. A save keeps cycleScheme
Parking with a shelterEquipment ✅ After a cycle storage change, the shelter keeps its id and count
New parking ✅ The first save stores the entry. GraphQL returns racks with 12 spaces
Legacy editor ✅ The legacy view does not change. A legacy save keeps the cycle storage entry

Each screenshot shows the base on the left and this PR on the right.

after-m2-bike-bars-modern.png
after-m3-bike-two-modern.png
after-m6-car-modern.png

Known limitations

  • The NeTEx Nordic profile requires NumberOfSpaces. The editor accepts an entry without it, because migrated data has none.
  • A user cannot choose cycleScheme or other.

teppope and others added 4 commits October 27, 2026 19:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e outside it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…torage

# Conflicts:
#	src/static/lang/en.json
#	src/static/lang/fi.json
#	src/static/lang/fr.json
#	src/static/lang/nb.json
#	src/static/lang/sv.json

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant