Commit Graph

5 Commits

Author SHA1 Message Date
Bianca Nenciu 72aa6e1a9b
FIX: Allow events belonging to deleted users to be destroyed (#688)
`DiscourseCalendar::CreateHolidayEvents` periodically deletes holiday
events to recreate updated ones. If one of the events belonged to a user
that has been destroyed and if `enable_user_status` was enabled, the
`after_destroy` hook would raise an exception.
2025-02-10 19:16:27 +02:00
Jan Cernik 0e3369e370
FEATURE: Option to configure the holiday emoji (#385)
This allows setting a custom emoji for the holiday status and changes the default from 🏝️ to 📅
2023-01-24 16:21:00 -03:00
David Taylor 3e9ab14bcd
DEV: Introduce syntax_tree for ruby formatting (#363) 2022-12-29 13:30:41 +01:00
Andrei Prigorshnev 159cb657b7
FEATURE: set holiday status immediately when adding or updating calendar post (#338)
Before this, it took up to 10 minutes for status to update after posting on the calendar topic or editing an existing calendar topic post. Now status will be updating immediately.
2022-11-17 18:42:43 +04:00
Andrei Prigorshnev ccb4993e57
FEATURE: when user is on holiday set user status in core (#333)
Before, the calendar plugin was setting this custom holiday flair in many places in Discourse. Starting from this PR, the calendar plugin will be setting user status in core instead.

Note that from now we start to show holiday's end date. If a user has several holiday events simultaneously (this can happen easily, for example, if a user is on vacation and today is a public holiday in their country), the date will be taken from the longest event.

Note also that there is an edge case that's not handled in this PR - if a user has several holidays one after another (let's say they are sick this week and has a vacation on the next week), it would be nice to show as the end date of the holiday the ending date of the second holiday. For now, the plugin uses the end date of the current holiday in such cases, but I'll improve it in one of the next PRs.

Also, in this PR, I directly use methods of the user model from Core. We definitely need API calls instead. This fix is also coming soon.
2022-10-24 16:57:53 +04:00