discourse/plugins/discourse-calendar/spec/services
Renato Atilio eaca2d8a59
FEATURE: Add "Events" category type for Calendar plugin (#39727)
Adds an Events category type alongside Support and Ideas in the
simplified category creation flow. Auto-enables Calendar + Discourse
Post Event, registers the category in events_calendar_categories, and
writes a matching calendar_categories entry. Gated behind
enable_events_category_type_setup.

The Events tab exposes: default calendar view, display weekends, allowed
groups, event date format, topic sorting, and the upcoming events
sidebar link.

Framework support for per-category type settings:

- CategoriesController#create and #update now accept
category_type_settings, slicing the payload by each type's own
configuration_schema_keys(:category_settings). On create the slice
merges into Categories::Configure's category_configuration_values; on
update the controller iterates the category's attached types and calls
configure_category per type, so per-type fields persist on edit and a
type only ever sees its own keys.

- Categories::Types::Base#read_category_settings is a new extension
point types override to return current per-category values; the
CategorySerializer aggregates these as category_type_settings so the
edit form preloads stored values rather than schema defaults.

- Categories::Types::Base forwards :choices through the resolved schema
and lets a type override site setting :type and :choices when it wants a
bool to render as a labelled enum. configure_custom_fields and
configure_site_settings tolerate string or symbol keys.

- SchemaFormField gains enum (FormKit select) and group_list
(GroupChooser) branches. EditCategoryTypeSchemaFields renders a new form
section bound to a category_type_settings form object that iterates
schema.category_settings, gated by a hasCategorySettings getter. tabs.js
seeds the bucket from model.category_type_settings plus schema defaults;
Category#_categoryTypeSaveProperties sends it on save.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2026-05-15 18:24:16 -03:00
..
discourse_calendar/categories/types FEATURE: Add "Events" category type for Calendar plugin (#39727) 2026-05-15 18:24:16 -03:00
discourse_post_event FIX: allow event creators to manage invitees (#38966) 2026-03-31 11:36:59 +02:00
discouse-calendar DEV: Remove unnecessary rails_helper requires (#33812) 2025-07-24 13:50:04 +02:00