discourse/plugins/automation/lib/discourse_automation/triggers/stalled_wiki.rb
Osama Sayegh 3d4faf3272
FEATURE: Merge discourse-automation (#26432)
Automation (previously known as discourse-automation) is now a core plugin.
2024-04-03 18:20:43 +03:00

38 lines
1.4 KiB
Ruby

# frozen_string_literal: true
module DiscourseAutomation
module Triggers
module StalledWiki
DURATION_CHOICES = [
{ id: "PT1H", name: "discourse_automation.triggerables.stalled_wiki.durations.PT1H" },
{ id: "P1D", name: "discourse_automation.triggerables.stalled_wiki.durations.P1D" },
{ id: "P1W", name: "discourse_automation.triggerables.stalled_wiki.durations.P1W" },
{ id: "P2W", name: "discourse_automation.triggerables.stalled_wiki.durations.P2W" },
{ id: "P1M", name: "discourse_automation.triggerables.stalled_wiki.durations.P1M" },
{ id: "P3M", name: "discourse_automation.triggerables.stalled_wiki.durations.P3M" },
{ id: "P6M", name: "discourse_automation.triggerables.stalled_wiki.durations.P6M" },
{ id: "P1Y", name: "discourse_automation.triggerables.stalled_wiki.durations.P1Y" },
]
end
end
end
DiscourseAutomation::Triggerable.add(DiscourseAutomation::Triggers::STALLED_WIKI) do
field :restricted_category, component: :category
field :stalled_after,
component: :choices,
extra: {
content: DiscourseAutomation::Triggers::StalledWiki::DURATION_CHOICES,
},
required: true
field :retriggered_after,
component: :choices,
extra: {
content: DiscourseAutomation::Triggers::StalledWiki::DURATION_CHOICES,
}
placeholder :wiki_url
enable_manual_trigger
end