Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions drivers/place/bookings.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ class Place::Bookings < PlaceOS::Driver
room_image: "https://domain.com/room_image.svg",
_sensor_mac: "device-mac",

show_tentative_meetings: false,
hide_meeting_details: false,
hide_meeting_title: false,
enable_end_meeting_button: false,
show_tentative_meetings: false,
hide_meeting_details: false,
hide_meeting_title: false,
enable_end_meeting_button: false,
show_timeline: false,
# one of: left, right, bottom, floating-left, floating-bottom
timeline_position: "bottom",
max_user_search_results: 20,
poll_x_seconds_after_booking: 2,

Expand Down Expand Up @@ -195,6 +198,9 @@ class Place::Bookings < PlaceOS::Driver
self[:max_duration] = setting?(Int32, :max_duration) || 480

self[:enable_end_meeting_button] = setting?(Bool, :enable_end_meeting_button) || false

self[:show_timeline] = setting?(Bool, :show_timeline) || false
self[:timeline_position] = setting?(String, :timeline_position) || "bottom"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unvalidated timeline position setting

timeline_position publishes any configured string even though the setting documents a finite set of supported values. An empty value or configuration typo therefore reaches the booking panel instead of falling back to a supported position, leaving the consumer to handle an undocumented state.

end

# This is how we check the rooms status
Expand Down
3 changes: 3 additions & 0 deletions drivers/place/bookings_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ DriverSpecs.mock_driver "Place::Bookings" do
bookings = status[:bookings].as_a
bookings.size.should eq(4)

status[:show_timeline].should eq(false)
status[:timeline_position].should eq("bottom")

sleep 200.milliseconds

status[:booked].should eq(true)
Expand Down
Loading