feat(principal): map CalDAV room metadata properties - #8263
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Extend the principal model to extract room-seating-capacity, room-type, room-features, room-building-address, and room-building-room-number from CalDAV principal responses. These properties are defined in the CalDAV standard and already served by Nextcloud room backends, but not yet used by the Calendar frontend. Mapping them into the principal model makes them available for any future UI improvement (e.g. a browsable room finder) without changing how principals are fetched. Backward compatible: properties default to null when not provided by the backend. Also derives roomBuildingName from the building address (first segment) and constructs a roomAddress string suitable for the event LOCATION field. Signed-off-by: Rik Dekker <rik@rikdekker.nl>
e87c932 to
a66d94f
Compare
|
Hi @Rikdekker Thank you for the PR. I will review it as soon as I can. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
Proposing #8693 to supersede this PR. Nothing really wrong here except some misalignment with type-safety, type-conversion and modeling. |
|
@Rikdekker While reviewing this I was noticing small differences between data assumed here and data I would assume coming from https://github.com/nextcloud/calendar_resource_management. I guess test data in this PR is data that could come from rooms managed in https://github.com/nextcloud/RoomVox. If you up for it, I'd like to collect the difference with you as you seem very knowledgeable about it. This is what I noticed so far:
For me it to boils down too try to introduce |
|
Thanks for picking this up @odzhychko — happy to have #8693 supersede this one; the stricter typing and validating as early as possible are clear improvements. Answers to your table:
Import whitespace / leading commas — you're right that it doesn't belong in the frontend. It came from a real dataset: an MS365 room export with empty Building and Floor columns, which produced values like
Building name — fully agree it's a heuristic. RoomVox writes the building name as the first segment of One mismatch I ran into while checking this: I'll rebase the room finder UI on top of #8693 ( 🤖 AI (if applicable)
|
Summary
Extend the principal model in
src/models/principal.jsto extract room-specific properties from CalDAV principal responses. These properties are defined in the CalDAV standard and already served by Nextcloud room backends, but are not yet used by the Calendar frontend.Mapping them into the principal model makes them available for any future UI improvement (such as the room finder in the follow-up PR) without changing how principals are fetched.
What
Adds 7 new properties to the principal object (defaults
nullfor non-room principals):roomSeatingCapacityroomSeatingCapacityroomTyperoomTyperoomFeaturesroomFeaturesroomBuildingAddressroomBuildingAddressroomBuildingNameroomBuildingAddress(first segment before comma)roomNumberroomBuildingRoomNumberroomAddressThe string sanitization (leading comma strip, trim) handles edge cases like CSV-imported room data with empty building-name fields, e.g.
, Science Park 140, 1098 XG, Amsterdam→Science Park 140, 1098 XG, Amsterdam.Why
This change is part of splitting #7996 into focused, reviewable PRs as suggested by @nimishavijay. The principal mapping has no UI impact and is fully backward compatible (defaults
null), so it can be reviewed and merged independently of the visual room finder that depends on it.Scope
src/models/principal.jsnullTests
tests/javascript/unit/models/principal.test.js— 10 tests pass, including a new test verifying thatroomBuildingAddressis correctly stripped of leading commas/whitespace.Related
Test plan
nullfor room propertiesroomBuildingName,roomAddress, etc.roomBuildingAddressis sanitizednpm run test:unitpasses