Skip to content

feat(principal): map CalDAV room metadata properties#8263

Open
Rikdekker wants to merge 1 commit intonextcloud:mainfrom
Rikdekker:feature/room-metadata
Open

feat(principal): map CalDAV room metadata properties#8263
Rikdekker wants to merge 1 commit intonextcloud:mainfrom
Rikdekker:feature/room-metadata

Conversation

@Rikdekker
Copy link
Copy Markdown

Summary

Extend the principal model in src/models/principal.js to 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 null for non-room principals):

Property DAV source Notes
roomSeatingCapacity roomSeatingCapacity Number or string
roomType roomType Trimmed
roomFeatures roomFeatures Trimmed; comma-separated list
roomBuildingAddress roomBuildingAddress Stripped of leading/trailing whitespace and commas
roomBuildingName Derived from roomBuildingAddress (first segment before comma)
roomNumber roomBuildingRoomNumber Trimmed
roomAddress Constructed from above Used for event LOCATION field

The 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, AmsterdamScience 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

  • ~50 lines added to src/models/principal.js
  • Backward compatible: all new properties default to null
  • No template, style, or service changes
  • No new dependencies
  • No breaking changes to existing principal consumers

Tests

  • tests/javascript/unit/models/principal.test.js — 10 tests pass, including a new test verifying that roomBuildingAddress is correctly stripped of leading commas/whitespace.

Related

Test plan

  • Existing principals (users, groups, circles, resources, regular rooms without metadata) still map correctly with null for room properties
  • A room principal with all DAV properties set produces the expected roomBuildingName, roomAddress, etc.
  • A room principal with leading comma in roomBuildingAddress is sanitized
  • npm run test:unit passes

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/models/principal.js 80.95% 3 Missing and 1 partial ⚠️

📢 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>
@Rikdekker Rikdekker force-pushed the feature/room-metadata branch from e87c932 to a66d94f Compare May 5, 2026 20:46
@SebastianKrupinski
Copy link
Copy Markdown
Contributor

Hi @Rikdekker

Thank you for the PR. I will review it as soon as I can.

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.

2 participants