-
Notifications
You must be signed in to change notification settings - Fork 9
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
Create "Busy" blocks in a user's schedule #279
Conversation
|
||
available_slots.append(a) | ||
|
||
# FIXME: Lack of coffee == duplicate code. Re-work this code so we don't need a tail append. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anyone can think of a better solution pls suggest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which edge case does this tail append solve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have just named it end append, sounds more fun 😄
If you've got a schedule 9 to 17, and you've got a event from 16-17 then it wouldn't have appended the last busy slot, because I added a continue if collision is found, and it's the end of the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see
frontend/src/views/BookingView.vue
Outdated
@@ -79,7 +79,7 @@ const call = inject('call'); | |||
const appointmentStore = useAppointmentStore(); | |||
const bookingViewStore = useBookingViewStore(); | |||
const bookingModalStore = useBookingModalStore(); | |||
const { status: appointmentStatus } = storeToRefs(appointmentStore); | |||
const { status: appointmentStatus } = appointmentStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why but this was breaking the bookingView for me. Probably because that function isn't a ref to begin with, but I don't know how it worked before..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird, indeed it shouldn't have worked before, since status
is just a function. On the other hand, storeToRefs
might be able to convert that, but the docs are a bit vague on that in composition mode... 🤷🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot, but can you check your response to see if the booking_status for that event is 3? And can you try clearing your cache (it shouldn't be affected because I think vite hashes js/css but just in case!) |
0e75e8b
to
73d348b
Compare
Ok maybe it really was a caching issue, after logging in again I cannot reproduce that anymore 😇 Case closed. If I see that again, I'll create an issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm so sorry, but now I found some issues again 🙈
- I got the first issue with blockers styled as selectable events again. But as soon as I wanted to inspect that, the blockers showed up again! Sneaky little bug. I get back to that as soon as I have some debugging information on this.
- There seems to be some issues with calculating the start blockers now. I have a blocker shown on the booking page where none is supposed to be:
The events array with the two blocker objects opened:
Any ideas? I'll play around with the blocker calculation. I feel we should do some intense testing on that method again and comment every little step since that seems kind of complicated.
Thanks for finding that! Whats your scheduled booking hours? And do you have any other calendars connected to Appointment? It uses all calendars to determine blockers (but only the schedule calendar to book on.) |
I think I've found the bug while working on a separate issue. Will poke into it more. |
The mystery blocker at 8am could be a stray booked slot. I'll add some functionality to restrict this logic to run only between the schedule's available booking time. |
237bd6e
to
f66d3f3
Compare
* Adjust event_set_difference to event_roll_up_difference - This now rolls up any collisions as a "booked" slot. * Create a replica enum of slot's booking status on the frontend * Style "booked" bookable slots to not be bookable, clickable, or friendly looking. * Locale update! * Remove storeToRefs for a function that seems to be breaking. * Hide agenda view on mobile month, because we can't style it right now. * Add a hover effect to change cursor, and highlight the day in mobile month view. * Fix case where event_roll_up_difference would not roll up trailing events. * Add test case for events_roll_up_difference.
f66d3f3
to
483a0a8
Compare
Sorry for the late reply. This is my schedule config: And I only have one calendar, the google calendar, connected. |
751c93a
to
9e6affe
Compare
...okay there's some issues with some of our test libraries that prevents me from creating a digestable unit test. Will work on that, but I've pushed up a fix for the issue. @devmount can you test the latest push? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No event glitches anymore, great work @MelissaAutumn!
This is how it looks on my end now:
I'm still not sure if I really like those "busy" blocks, I found it kind of cleaner to only show selectable events 🤷🏻 And is it correct, that busy blocks show at the beginning of the day, but not at the end?
Not showing at the end is also a bug...back to the busy mines I go! But yeah, they do look a little tough, but I'm sure we can soften the styling a bit. Maybe make them smaller than the bookable slots. 🤔 I'll play around with it early next week. |
It's fine, really! I do see the value of having the whole working hours area filled with either selectable slots or blockers. Thank for your work on this! 💪🏻 👏🏻 |
Oh no worries! It should at least look a little less heavy. 😄 |
* Make two lists * Merge them together * Sort * Might be a little less performant, but it's simpler.
cc @devmount for one last check. I re-wrote the roll up function, might be a little slower but it's simpler-ish now. Please test to see if it still works as expected. (Looks fine to me, and the tests.) Here's the updated styles to be a little less "in your face". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Mel! Edge event properly show up now on my end too 👏🏻 Also I like the less prominent blocker entries 👍🏻
* Adjustments to create "Busy" blocks in a user's schedule: * Adjust event_set_difference to event_roll_up_difference - This now rolls up any collisions as a "booked" slot. * Create a replica enum of slot's booking status on the frontend * Style "booked" bookable slots to not be bookable, clickable, or friendly looking. * Locale update! * Remove storeToRefs for a function that seems to be breaking. * Hide agenda view on mobile month, because we can't style it right now. * Add a hover effect to change cursor, and highlight the day in mobile month view. * Fix case where event_roll_up_difference would not roll up trailing events. * Add test case for events_roll_up_difference. * Fix pytest error with filenames. * Add enum jsdoc properties to our defines. * 🌐 complete German translation * Add schedule store and pass the slot_duration info into qalendar. * Add slot_duration to AppointmentOut schema, and hook it up for public view. * Fix the egg. * Fix booking redis cache clearing on booking code and fix test. * Fix busy blocks sometimes being created before the schedule starts. * Test blockers * Fix missing .start * Merge duplicate definition * Disable `tailwindcss/no-custom-classname` * Adjust styling of booked slots * Refactor events_roll_up_difference: * Make two lists * Merge them together * Sort * Might be a little less performant, but it's simpler. * Remove references to booking view. --------- Co-authored-by: Andreas Müller <[email protected]>
Fixes #277
Some screenshots:
This does have the potential to show up in the month view like:
Which I would hide, but we don't currently style that slot. I've also hidden the mobile-sized agenda view because we can't style that slot yet. I've added some logic to make it behave to how we use to do month views.