Skip to content

Commit 94b7f17

Browse files
committed
put back dependent code
1 parent e3afb96 commit 94b7f17

File tree

1 file changed

+18
-0
lines changed
  • src/sentry/integrations/slack/message_builder/base

1 file changed

+18
-0
lines changed

src/sentry/integrations/slack/message_builder/base/block.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from sentry.integrations.slack.message_builder import SlackBlock
99
from sentry.integrations.slack.message_builder.base.base import SlackMessageBuilder
10+
from sentry.notifications.utils.actions import MessageAction
1011

1112

1213
class BlockSlackMessageBuilder(SlackMessageBuilder, ABC):
@@ -82,6 +83,23 @@ def get_external_select_action(action, initial_option):
8283

8384
return action
8485

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+
85103
@staticmethod
86104
def get_action_block(actions: Sequence[tuple[str, str | None, str]]) -> SlackBlock:
87105
class SlackBlockType(TypedDict):

0 commit comments

Comments
 (0)