discourse/plugins/automation/lib/discourse_automation/triggers/stalled_topic.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
500 B
Ruby
Raw Normal View History

# frozen_string_literal: true
key = "discourse_automation.triggerables.stalled_topic.durations"
ids = %w[PT1H P1D P1W P2W P1M P3M P6M P1Y]
duration_choices = ids.map { |id| { id: id, name: "#{key}.#{id}" } }
DiscourseAutomation::Triggerable.add(DiscourseAutomation::Triggers::STALLED_TOPIC) do
field :categories, component: :categories
field :tags, component: :tags
field :stalled_after, component: :choices, extra: { content: duration_choices }, required: true
placeholder :topic_url
end