-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add favorites to Outlook calendar #184
base: master
Are you sure you want to change the base?
Conversation
351f2c2
to
53b257e
Compare
outlook/indico_outlook/migrations/20241115_2151_636d44cb7a7c_add_new_action.py
Outdated
Show resolved
Hide resolved
outlook/indico_outlook/migrations/20241115_2151_636d44cb7a7c_add_new_action.py
Outdated
Show resolved
Hide resolved
Regarding the concern of somebody marking Home as favorite, this is actually already an issue for the calendar exporter feature: you can export an ical file for the entire Indico instance. It takes a little while on the CERN instance and produces an ical file with 6114 events (for me, users with more access will probably get more), all ending in the future. With the code as it's implemented now, marking a category as favorite wouldn't affect that many events because it's no longer fully recursive. Even if it were, though, this may not really be an issue depending on how |
It is. See
Actually your comment just reminded me of the perfect solution! We have something called visibility. Add a |
After 4386d9a, this PR now depends on indico/indico#6618. |
42dd87c
to
b91d020
Compare
outlook/indico_outlook/plugin.py
Outdated
and event.can_access(user): | ||
return | ||
# Stop once we reach the visibility horizon of the event | ||
if category is event.category.real_visibility_horizon: |
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 almost certain we can do some magic to use a single query to check whether the event is visible in one of the user's favorite categories... I may have another look later.
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.
You'd have to help me with that bit, I'm afraid.
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.
Yeah I'm having a look. Tricky for sure, also since it's been aces since I touched those black magic CTEs for category trees. Might not be worth it in the end...
…dd_new_action.py Co-authored-by: Adrian <[email protected]>
…dd_new_action.py Co-authored-by: Adrian <[email protected]>
Co-authored-by: Adrian <[email protected]>
Co-authored-by: Adrian <[email protected]>
outlook/indico_outlook/plugin.py
Outdated
'favorite_events': True, | ||
'favorite_categories': True, |
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.
'favorite_events': True, | |
'favorite_categories': True, | |
'favorite_events': False, | |
'favorite_categories': False, |
For events I'm unsure (defaulting to False
avoids surprises for users), but categories certainly need to be opt-in.
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 concerned about the discoverability of this feature, if it's disabled by default nobody will find it and it won't be very useful.
Add favorite events and categories to Outlook calendar.
For favorited categories, only new/updated events are added to the calendar because Indico is missing the signals
signals.users.favorite_category_added
andsignals.users.favorite_category_removed
.Depends on indico/indico#6618