discourse/plugins/discourse-calendar
Sérgio Saquetim 95a95a492b
DEV: Deprecate Site.mobileView/desktopView during initialization (#34122)
This commit introduces deprecation warnings for accessing Site.mobileView or
Site.desktopView during application initialization to prevent
layout-related errors and improve code reliability.

The changes include:

* Added deprecation warnings for Site.mobileView and Site.desktopView
access during the initialization phase.
* Updated multiple plugins and components to avoid these deprecated
calls during startup.
* Refactored initialization logic across discourse-ai, discourse-chat,
discourse-calendar, discourse-reactions, discourse-assign,
discourse-subscriptions, and discourse-user-notes plugins
* Improved error prevention by discouraging early access to
view-dependent properties before the application is fully initialized
* Enhanced code maintainability by establishing clearer boundaries
between initialization and runtime phases

This deprecation helps prevent subtle bugs that can occur when
components try to determine the view type before the application context
is properly established, leading to more robust plugin initialization
patterns.
2025-08-25 16:49:52 -03:00
..
app PERF: limit the number of upcoming dates generated (#34134) 2025-08-07 15:40:06 +02:00
assets DEV: Deprecate Site.mobileView/desktopView during initialization (#34122) 2025-08-25 16:49:52 -03:00
config Update translations (#34510) 2025-08-25 11:43:23 +02:00
db/migrate FIX: event scheduler could create dupe record (#34127) 2025-08-07 16:14:32 +10:00
jobs
lib
public/javascripts
spec FIX: Remove redundant allowedGroups parameter (#34244) 2025-08-12 11:56:26 +08:00
test/javascripts FIX: Remove redundant allowedGroups parameter (#34244) 2025-08-12 11:56:26 +08:00
vendor/holidays
.prettierignore
plugin.rb FIX: Serialize time objects properly in calendar plugin 2025-07-16 16:14:51 +02:00
README.md

Discourse Calendar

Adds the ability to create a dynamic calendar in the first post of a topic.

Topic discussing the plugin itself can be found here: https://meta.discourse.org/t/discourse-calendar/97376

Customization

Events

  • discourse_post_event_event_will_start this DiscourseEvent will be triggered one hour before an event starts
  • discourse_post_event_event_started this DiscourseEvent will be triggered when an event starts
  • discourse_post_event_event_ended this DiscourseEvent will be triggered when an event ends

Custom Fields

Custom fields can be set in plugin settings. Once added a new form will appear on event UI. These custom fields are available when a plugin event is triggered.

Holidays

See an incorrect or missing holiday? Familiarize yourself with the holiday definition Syntax. Then make your updates in the vendor/holiday/definitions directory.

Generate updated holidays as follows.

cd vendor/holidays

# Generate holiday definitions
rake generate:definitions

Install the plugin and switch to the discourse root(not the plugin directory).

# Collect all holiday regions into assets/javascripts/lib/regions.js
bin/rails javascript:update_constants

Interactions with Other Plugins

You can use an element of this plugin with the Right Sidebar Blocks component. You'll want to ensure the desired route is enabled via the events calendar categories setting. In Right Sidebar Block's settings, the block name will be upcoming-events-list, and the params use this syntax, for example MMMM D, YYYY.