mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 02:52:01 +08:00
1. **Multiselect Support for Choice Fields**
- Added a `multiselect` option to the choices field component
- Updated Field model to accept arrays as values for choices fields
2. **Post Content Feature Filtering**
- Added ability to filter posts based on content features:
- Posts with images
- Posts with links
- Posts with code blocks
- Posts with uploads
3. **Improved Group Filtering**
- Renamed `restricted_user_group` to `restricted_groups` to allow
filtering by multiple groups
- Added `excluded_groups` to replace `ignore_group_members` which was
complex for end users
- Renamed `restricted_groups` to `restricted_inbox_groups` for more
specific PM filtering and clarity.
4. **Public Topics Filter**
- Added a "Public Topics" filter option that excludes all secure
categories
68 lines
2.3 KiB
Ruby
Vendored
68 lines
2.3 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
DiscourseAutomation::Triggerable.add(DiscourseAutomation::Triggers::POST_CREATED_EDITED) do
|
|
field :action_type,
|
|
component: :choices,
|
|
extra: {
|
|
content: [
|
|
{
|
|
id: "created",
|
|
name: "discourse_automation.triggerables.post_created_edited.created",
|
|
},
|
|
{ id: "edited", name: "discourse_automation.triggerables.post_created_edited.edited" },
|
|
],
|
|
}
|
|
field :restricted_archetype,
|
|
component: :choices,
|
|
extra: {
|
|
content: [
|
|
{ id: "regular", name: "discourse_automation.triggerables.post_created_edited.topics" },
|
|
{
|
|
id: "public",
|
|
name: "discourse_automation.triggerables.post_created_edited.public_topics",
|
|
},
|
|
{
|
|
id: "private_message",
|
|
name: "discourse_automation.triggerables.post_created_edited.personal_messages",
|
|
},
|
|
],
|
|
}
|
|
field :restricted_categories, component: :categories
|
|
field :exclude_subcategories, component: :boolean
|
|
field :restricted_tags, component: :tags
|
|
field :restricted_groups, component: :groups
|
|
field :excluded_groups, component: :groups
|
|
field :restricted_inbox_groups, component: :groups
|
|
field :ignore_automated, component: :boolean
|
|
field :valid_trust_levels, component: :"trust-levels"
|
|
field :original_post_only, component: :boolean
|
|
field :post_features,
|
|
component: :choices,
|
|
extra: {
|
|
multiselect: true,
|
|
content: [
|
|
{
|
|
id: "with_images",
|
|
name: "discourse_automation.triggerables.post_created_edited.with_images",
|
|
},
|
|
{
|
|
id: "with_links",
|
|
name: "discourse_automation.triggerables.post_created_edited.with_links",
|
|
},
|
|
{
|
|
id: "with_code",
|
|
name: "discourse_automation.triggerables.post_created_edited.with_code",
|
|
},
|
|
{
|
|
id: "with_uploads",
|
|
name: "discourse_automation.triggerables.post_created_edited.with_uploads",
|
|
},
|
|
],
|
|
}
|
|
field :first_post_only, component: :boolean
|
|
field :first_topic_only, component: :boolean
|
|
field :skip_via_email, component: :boolean
|
|
|
|
placeholder :topic_url
|
|
placeholder :topic_title
|
|
end
|