File tree 1 file changed +18
-0
lines changed
src/sentry/integrations/slack/message_builder/base 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from sentry .integrations .slack .message_builder import SlackBlock
9
9
from sentry .integrations .slack .message_builder .base .base import SlackMessageBuilder
10
+ from sentry .notifications .utils .actions import MessageAction
10
11
11
12
12
13
class BlockSlackMessageBuilder (SlackMessageBuilder , ABC ):
@@ -82,6 +83,23 @@ def get_external_select_action(action, initial_option):
82
83
83
84
return action
84
85
86
+ @staticmethod
87
+ def get_link_button (action : MessageAction ) -> SlackBlock :
88
+ return {
89
+ "type" : "section" ,
90
+ "text" : {
91
+ "type" : "mrkdwn" ,
92
+ "text" : action .label ,
93
+ },
94
+ "accessory" : {
95
+ "type" : "button" ,
96
+ "text" : {"type" : "plain_text" , "text" : action .name , "emoji" : True },
97
+ "style" : action .style ,
98
+ "value" : action .value ,
99
+ "url" : action .url ,
100
+ },
101
+ }
102
+
85
103
@staticmethod
86
104
def get_action_block (actions : Sequence [tuple [str , str | None , str ]]) -> SlackBlock :
87
105
class SlackBlockType (TypedDict ):
You can’t perform that action at this time.
0 commit comments