mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-05 00:44:53 +08:00
This adds an "Ideas" category type to the category setup system, following the same patterns established by the "Support" category type in the discourse-solved plugin. When admins create an Ideas category, the Topic Voting plugin is automatically enabled and the category is preconfigured with sensible defaults: name "Ideas", bulb emoji, and voting enabled. The Ideas tab exposes vote limit settings (TL0-TL4), alert threshold, and visibility settings so admins can tune them without hunting through plugin settings. The implementation registers a new `Ideas` category type class that creates a `topic_voting_category_settings` record (the mechanism Topic Voting uses to track voting-enabled categories), resets the voting cache, and defines a configuration schema with 8 site settings. A new `enable_ideas_category_type_setup` hidden site setting gates visibility behind an upcoming change flag. On the frontend, a tab initializer and `UpsertCategoryIdeas` component mirror the Support type pattern. The legacy voting checkbox connector is hidden when the Ideas type setup is active. The "Remove Ideas type" button only appears when editing an existing category, not during creation. Ref - t/180008 --------- Co-authored-by: Martin Brennan <martin@discourse.org> |
||
|---|---|---|
| .. | ||
| controllers/discourse_topic_voting | ||
| jobs/regular/discourse_topic_voting | ||
| models/discourse_topic_voting | ||
| services/discourse_topic_voting/categories/types | ||