Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/pager_tree/integrations/channel/mattermost/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ module PagerTree::Integrations
class Channel::Mattermost::V3 < Channel::Slack::V3
# we can just piggy back the Channel::Slack::V3 since Mattermost is a clone of Slack
# both integrations have the same exact functionality

def _alert_created_at_timestamp_formatted
_alert.created_at.utc.iso8601.to_s
end
end
end
6 changes: 5 additions & 1 deletion app/models/pager_tree/integrations/channel/slack/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def adapter_process_outgoing
outgoing_webhook_delivery
end

def _alert_created_at_timestamp_formatted
"<!date^#{_alert.created_at.utc.to_i}^{date_num} {time_secs}|#{_alert.created_at.utc.to_i}>"
end

private

Comment on lines +71 to 76
def _alert
Expand Down Expand Up @@ -99,7 +103,7 @@ def _blocks
},
{
title: "Created",
value: "<!date^#{_alert.created_at.utc.to_i}^{date_num} {time_secs}|#{_alert.created_at.utc.to_i}>",
value: _alert_created_at_timestamp_formatted,
short: "true"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Channel::Mattermost::V3Test < ActiveSupport::TestCase
},
{
title: "Created",
value: "<!date^#{@alert.created_at.utc.to_i}^{date_num} {time_secs}|#{@alert.created_at.utc.to_i}>",
value: @alert.created_at.utc.iso8601.to_s,
short: "true"
},
{
Expand Down
Loading