This commit is making two major changes:
- Move all the post event widgets code to glimmer
- Implement tracked models to ensure reactivity, many paths didn't have real reactivity atm and were mostly working by luck or the fact that widgets re-render a lot
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Previously event editors could remove people from an event but had no way
of acting on behalf of users in the event and adding them.
That meant that for events to properly show up in agenda and so on a user
must actively click a button.
In some cases (company ran events) the event manager may prefer controlling
attendance.
Adds a before parameter to the events endpoint and uses it through a upcomingDays parameter to the upcoming events list component – which can be used when adding it to the right sidebar blocks theme component.
* FEATURE: site setting to include expired events on calendar views
Adds a new site setting to include expired events on calendar views (Upcoming Events and Category Calendar).
Past events are displayed with the configured color (from the category or from the "Map events to color" site setting) as text and border colors instead of the background.
The #queue_jobs= method on site settings has been deprecated and replaced by Jobs.run_later! and Jobs.run_immediately!. This PR replaces usages in this plugin so we can remove the fallback in core.
FEATURE:
- Added custom fields `sort_topics_by_event_start_date` and `disable_topic_resorting`
- Sort topics of event categories by event start date. Event categories have custom field `sort_topics_by_event_start_date` set to true.
- Disable re-sorting of categories with custom field `disable_topic_resorting`
- Event date displayed beside the Topic title can optionally be set to show the local date-time, instead of relative date-time.
-
* DEV: Add backend functionality to enable/disable holidays
This will add two backend endpoints, one to disable holidays and
another to enable holidays.
I also introduced a new `Holiday` service that is responsible for
getting the holidays and attaching a new `disabled` attribute to the
holidays. The `#index` action has been updated to use this new service,
so it will return this new `disabled` attribute.
* DEV: Only add enabled holidays to the calendar
I updated this job so that it will use the new `Holiday` service, which
will return the holidays like before but with a new `disabled` field,
which this job will use to only add enabled holidays to the calendar.
* FEATURE: Allow admins to disable/enable holidays
The main thing I added here is a new component `admin-holiday-list-item`
that is responsible for displaying a holiday, and an enable or disable
button and the corresponding functionality.
Adds two new endpoints available to admins:
* `/admin/discourse-calendar/holiday-regions` - this will return a list of holiday regions (as defined by the Holidays gem)
* `/admin/discourse-calendar/holiday-regions/:id/holidays` - this will return all of the holidays for a given region
* FEATURE: add events calendar on the category page
This commit adds a new site setting `events calendar category` for events calendar that is separate and independent from `calendar categories`. If a category is present in both `events calendar category` and `calendar categories` then priority is given to `calendar categories`.
* remove some jQuery usage
* rename `events_calendar_category` to `events_calendar_categories`
* add tests