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.) |
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