Make UserProfileCalendar event blocks routable
Fixes ilios/ilios#4295
Clicking on an event in the calendar does nothing, but clicking on an event when on the Dashboard::Calendar component routes the user to an event detail, so I changed it so they work the same way.
@dartajax Needs some discussion over the issue I found that events not connected to the current logged in user (e.g. demo_dev1 looking at non-demo_dev1 events) go to a 404 Event Not Found page instead of the expected event detail page.
@dartajax Needs some discussion over the issue I found that events not connected to the current logged in user (e.g. demo_dev1 looking at non-demo_dev1 events) go to a 404 Event Not Found page instead of the expected event detail page.
I think my gut instinct on this one was that a user like demo_dev1 and basically any user who has access to the admin console would have enough permissions to be routed to the event.
This may prove tricky because it's not an event for the user. The event detail routes expect to know and load the current user unless the event it a school event. Wondering if we change the way we load events on this calendar to load all school events and the filter for the user we're interested in. Or something else complicated.
Deploy Preview for ilios-frontend ready!
| Name | Link |
|---|---|
| Latest commit | 5aa306c272dda136933eff6f1b6d706a302908ea |
| Latest deploy log | https://app.netlify.com/projects/ilios-frontend/deploys/68eeb0f62826a60008607f1f |
| Deploy Preview | https://deploy-preview-8371--ilios-frontend.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
@dartajax Upon further reflection, I'm not sure if there's any issue with this one. That being said, I need someone else to test it and let me know if something odd happens, and you're the person for the job, Dave.
not sure how I feel about this one -- I am logged in as Nicholas Gutierrez who has permissions to see anything as that user is a user with many permissions indeed
as Nicholas, I look up the student learner "demo_student28" in the Admin Console and click to view this user's calendar - the events can now be clicked upon but always I "demo_dev1" end up with something like the following after clicking ...
See image comments below ...
Why would power user demo_dev1 not have access to this event? Better just close the whole thing probably and leave the events not clickable I guess or ...?
Logged in as the same user, I can go to Event Detail for anything on the Calendar - I was thinking when I wrote this ticket that the same thing could and / or should happen in Calendar on Admin Console but if it's not feasible, I guess we'd just have to close this?
@dartajax This is definitely a more involved fix than I thought, so will need to ponder further action. That being said, I made a separate PR just for remembering the hide/show calendar toggle: https://github.com/ilios/frontend/pull/8891
I think what you'd need to do is extract the information from the event slug and load the offering and other data needed to create a school event slug, then you could route to the single event page for a school event. It's not a permission issue, it is that we only load user events that belong directly to the user, for seeing the details of an event (as you would on the school calendar) you need a slightly different format. Then permissions matter.
That doesn't really make sense even to me. When you want to dig into this @michaelchadwick let's pair for a bit.