Files
fizzy/app/helpers/webhooks_helper.rb
T
2025-10-29 11:11:04 -05:00

25 lines
861 B
Ruby

module WebhooksHelper
ACTION_LABELS = {
card_published: "Card added",
card_title_changed: "Card title changed",
card_collection_changed: "Card collection changed",
comment_created: "Comment added",
card_assigned: "Card assigned",
card_unassigned: "Card unassigned",
card_triaged: "Card column changed",
card_closed: "Card moved to “Done”",
card_reopened: "Card reopened",
card_postponed: "Card moved to “Not Now”",
card_auto_postponed: "Card auto-closed as “Not Now”",
card_sent_back_to_triage: "Card moved back to “Maybe?”"
}.with_indifferent_access.freeze
def webhook_action_options(actions = Webhook::PERMITTED_ACTIONS)
ACTION_LABELS.select { |key, _| actions.include?(key.to_s) }
end
def webhook_action_label(action)
ACTION_LABELS[action] || action.to_s.humanize
end
end