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

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Apr 26, 2024

Fix #3185

Requires nextcloud/cdav-library#890

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' [email protected] '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' [email protected] '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.

@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 3.62319% with 133 lines in your changes missing coverage. Please review.

Project coverage is 23.68%. Comparing base (fd1e0cb) to head (8b09651).
Report is 38 commits behind head on main.

Files Patch % Lines
...mponents/Editor/FreeBusy/RoomAvailabilityModal.vue 0.00% 86 Missing ⚠️
...omponents/Editor/FreeBusy/RoomAvailabilityList.vue 0.00% 28 Missing ⚠️
src/store/principals.js 0.00% 10 Missing and 1 partial ⚠️
...components/Editor/Resources/ResourceListSearch.vue 0.00% 5 Missing ⚠️
src/views/Calendar.vue 0.00% 2 Missing ⚠️
src/services/caldavService.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5961      +/-   ##
============================================
- Coverage     23.97%   23.68%   -0.29%     
  Complexity      457      457              
============================================
  Files           247      249       +2     
  Lines         11606    11773     +167     
  Branches       2177     2214      +37     
============================================
+ Hits           2782     2788       +6     
- Misses         8509     8667     +158     
- Partials        315      318       +3     
Flag Coverage Δ
javascript 15.26% <3.62%> (-0.21%) ⬇️
php 59.53% <ø> (ø)

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.

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

@GretaD
Copy link
Contributor

GretaD commented Jun 10, 2024

Screenshot from 2024-06-10 17-12-04

Screenshot from 2024-06-10 17-04-57

@GretaD GretaD force-pushed the feat/room-and-resource-overview branch from daf56de to 309590c Compare June 19, 2024 08:17
@GretaD GretaD marked this pull request as ready for review June 24, 2024 09:29
@GretaD GretaD added 3 - to review and removed 2. developing Work in progress labels Jun 24, 2024
@kesselb
Copy link
Contributor

kesselb commented Jun 24, 2024

Are you going to update cdav-library with this pr and or a follow-up?

@kesselb
Copy link
Contributor

kesselb commented Jun 24, 2024

I'm seeing the error below when clicking on "Check room availability".

TypeError: room.toAttendeeProperty is not a function

Likely I did something wrong with build and link.

@st3iny
Copy link
Member Author

st3iny commented Jun 24, 2024

@kesselb The PR is already released and bumped here. Linking is not required anymore and it should work out of the box. I adjusted the description accordingly.

st3iny

This comment was marked as outdated.

@GretaD GretaD marked this pull request as draft June 24, 2024 13:37
@GretaD GretaD added 2. developing Work in progress and removed 3 - to review labels Jun 24, 2024
@GretaD
Copy link
Contributor

GretaD commented Jun 24, 2024

Screenshot from 2024-06-24 16-01-11

@GretaD GretaD marked this pull request as ready for review June 24, 2024 14:02
@GretaD GretaD added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 24, 2024
@GretaD GretaD force-pushed the feat/room-and-resource-overview branch 2 times, most recently from 0289d26 to fb233af Compare June 26, 2024 08:45
src/components/Editor/FreeBusy/RoomAvailabilityList.vue Outdated Show resolved Hide resolved
src/components/Editor/FreeBusy/RoomAvailabilityModal.vue Outdated Show resolved Hide resolved
src/models/principal.js Outdated Show resolved Hide resolved
src/services/caldavService.js Outdated Show resolved Hide resolved
@GretaD GretaD force-pushed the feat/room-and-resource-overview branch from fb233af to 9ef693f Compare June 27, 2024 09:04
@kesselb
Copy link
Contributor

kesselb commented Jun 28, 2024

Modal size "large" is still relatively small. We could use "full" here to improve the usability especially on larger screens.

large:

Screenshot from 2024-06-28 12-13-38

full:

Screenshot from 2024-06-28 12-19-03

I'm aware full looks a bit odd ;)

@kesselb
Copy link
Contributor

kesselb commented Jun 28, 2024

A good enhancement would be to select multiple rooms and show the availability within the same table.

@kesselb
Copy link
Contributor

kesselb commented Jun 28, 2024

As a user, I would like to have a button to "pick" the current room for the event. Currently, you need to close the modal again and type the room name into the field.

@kesselb

This comment was marked as resolved.

@kesselb kesselb added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 28, 2024
@GretaD
Copy link
Contributor

GretaD commented Jun 28, 2024

As a user, I would like to have a button to "pick" the current room for the event. Currently, you need to close the modal again and type the room name into the field.

yes,, thats a good improvement, but for now, the goal of this pr is the overview modal.

@ChristophWurst
Copy link
Member

What is missing here?

@GretaD GretaD force-pushed the feat/room-and-resource-overview branch from 783175c to 6d08536 Compare July 9, 2024 08:55
@GretaD
Copy link
Contributor

GretaD commented Jul 9, 2024

What is missing here?

is was the modal closing issue. Richard fixed it yesterday.

@GretaD GretaD requested a review from kesselb July 9, 2024 08:59
@ChristophWurst
Copy link
Member

ChristophWurst commented Jul 15, 2024

image

what is necessary to make the button show? I do have rooms on my system. wrong checkout

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Works as advertised

Some feedback

  • The action behind the button Room availability might be unclear. Consider renaming to Show all rooms or something similar. And then add a heading afterwards for Search room or similar. Then the UI will be structured more clearly.
  • Two headings Availability of rooms and Find a room
  • Find a room for a static list. Find implies that there is a way to search.
  • The room list should probably be a table-like structure. The name can grow and the buttons to check availability are aligned on the right.
  • Vue warning when I open the modal image
  • JS error when I click into the free/busy calendar image

@ChristophWurst
Copy link
Member

See nextcloud/spreed#12732 for the onMounted/setup warning. It seems to happen with other components too.

Copy link
Contributor

@SebastianKrupinski SebastianKrupinski left a comment

Choose a reason for hiding this comment

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

Works Good.

@GretaD GretaD force-pushed the feat/room-and-resource-overview branch from 6b60ab9 to 8b09651 Compare July 23, 2024 15:56
@GretaD GretaD enabled auto-merge July 23, 2024 15:56
@GretaD GretaD merged commit 3ea574c into main Jul 23, 2024
26 of 28 checks passed
@GretaD GretaD deleted the feat/room-and-resource-overview branch July 23, 2024 16:01
@miaulalala miaulalala added this to the v5.0.0 milestone Jul 23, 2024
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
6 participants