Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement resources and rooms overview #5961

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Apr 26, 2024

Fix #3185

Requires nextcloud/cdav-library#890

Please checkout the above branch, build it and npm link it (@nextcloud/cdav-library).

TODO

  • Implement a list (modal?) that shows all available rooms
  • Add an action to show the free busy slots for a room (action/button?)

How to use

  1. Install https://github.com/nextcloud/calendar_resource_management
  2. Run the following script to add some rooms:
occ calendar-resource:building:create 'Arkham Asylum' \
    --address 'Amadeus Way, Gotham NG11 0AS' \
    --description 'Elizabeth Arkham Asylum for the Criminally Insane' \
    --wheelchair-accessible false
occ calendar-resource:story:create 1 '1st floor'
occ calendar-resource:story:create 1 '2nd floor'
occ calendar-resource:room:create 1 arkham_meeting_1 'The Joker' joker@arkham-asylum.com 'meeting-room' \
    --contact-person-user-id amadeus \
    --capacity 10 \
    --room-number 404 \
    --has-phone '+1 555 777 123' \
    --has-video-conferencing true \
    --has-tv false \
    --has-projector false \
    --has-whiteboard false \
    --wheelchair-accessible false
occ calendar-resource:room:create 2 arkham_meeting_2 'Bane' bane@arkham-asylum.com 'other'
  1. Run the cron job multiple times to update metadata: php -f [path_to_nextcloud]/cron.php

The data will be fetched automatically and is available via:

this.$store.getters.getRoomPrincipals // get an array room objects
this.$store.getters.getResourcePrincipals // get an array resources objects

Exemplary data

const someRoom = this.$store.getters.getRoomPrincipals[0]
someRoom.dav.roomAddress
someRoom.dav.roomBuildingAddress
someRoom.dav.roomBuildingRoomNumber
someRoom.dav.roomBuildingStory
someRoom.dav.roomFeatures
someRoom.dav.roomId
someRoom.dav.roomSeatingCapacity
someRoom.dav.roomType
// [...] etc.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny marked this pull request as draft April 26, 2024 11:46
Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 0.90090% with 110 lines in your changes are missing coverage. Please review.

Project coverage is 23.31%. Comparing base (4837945) to head (0f76ecc).
Report is 77 commits behind head on main.

Files Patch % Lines
...mponents/Editor/FreeBusy/RoomAvailabilityModal.vue 0.00% 69 Missing ⚠️
...rc/components/Editor/FreeBusy/RoomAvailability.vue 0.00% 22 Missing ⚠️
src/store/principals.js 0.00% 10 Missing and 1 partial ⚠️
...components/Editor/Resources/ResourceListSearch.vue 0.00% 7 Missing ⚠️
src/services/caldavService.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5961      +/-   ##
============================================
- Coverage     23.91%   23.31%   -0.61%     
  Complexity      455      455              
============================================
  Files           246      249       +3     
  Lines         11522    11825     +303     
  Branches       1938     2168     +230     
============================================
+ Hits           2756     2757       +1     
+ Misses         8766     8752      -14     
- Partials          0      316     +316     
Flag Coverage Δ
javascript 15.00% <0.90%> (-0.49%) ⬇️
php 58.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: greta <gretadoci@gmail.com>
Signed-off-by: greta <gretadoci@gmail.com>
Signed-off-by: greta <gretadoci@gmail.com>
Signed-off-by: greta <gretadoci@gmail.com>
@GretaD
Copy link
Contributor

GretaD commented May 24, 2024

not ready for review, i accidentally discarded my local changes and had to redo it :( so, i pushed not to lose this draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Availability overview of a room or resource
2 participants