diff --git a/engine/apps/slack/scenarios/resolution_note.py b/engine/apps/slack/scenarios/resolution_note.py index d67e5257..a5bfb279 100644 --- a/engine/apps/slack/scenarios/resolution_note.py +++ b/engine/apps/slack/scenarios/resolution_note.py @@ -324,6 +324,7 @@ class ResolutionNoteModalStep(AlertGroupActionsMixin, scenario_step.ScenarioStep REQUIRED_PERMISSIONS = [RBACPermission.Permissions.CHATOPS_WRITE] RESOLUTION_NOTE_TEXT_BLOCK_ID = "resolution_note_text" RESOLUTION_NOTE_MESSAGES_MAX_COUNT = 25 + MESSAGE_SHORTCUT_INSTRUCTION = "You can add thread messages as resolution notes using the message shortcut" class ScenarioData(typing.TypedDict): resolution_note_window_action: str @@ -576,29 +577,17 @@ class ResolutionNoteModalStep(AlertGroupActionsMixin, scenario_step.ScenarioStep if not blocks: # there aren't any resolution notes yet, display a hint instead - link_to_instruction = create_engine_url("static/images/postmortem.gif") blocks = [ - DIVIDER, - typing.cast( - Block.Section, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":bulb: You can add a message to the resolution notes via context menu:", - }, - }, - ), typing.cast( Block.Image, { "type": "image", "title": { "type": "plain_text", - "text": "Add a resolution note", + "text": self.MESSAGE_SHORTCUT_INSTRUCTION, }, - "image_url": link_to_instruction, - "alt_text": "Add to postmortem context menu", + "image_url": create_engine_url("static/images/resolution_note.gif"), + "alt_text": self.MESSAGE_SHORTCUT_INSTRUCTION, }, ), ] @@ -606,9 +595,7 @@ class ResolutionNoteModalStep(AlertGroupActionsMixin, scenario_step.ScenarioStep return blocks def get_invite_bot_tip_blocks(self, channel: str) -> Block.AnyBlocks: - link_to_instruction = create_engine_url("static/images/postmortem.gif") - blocks: Block.AnyBlocks = [ - DIVIDER, + return [ typing.cast( Block.Context, { @@ -616,15 +603,12 @@ class ResolutionNoteModalStep(AlertGroupActionsMixin, scenario_step.ScenarioStep "elements": [ { "type": "mrkdwn", - "text": f":bulb: To include messages from thread to resolution note `/invite` Grafana OnCall to " - f"<#{channel}>. Or you can add a message via " - f"<{link_to_instruction}|context menu>.", + "text": f"To enable this feature, `/invite` Grafana OnCall to <#{channel}>.", }, ], }, ), ] - return blocks class ReadEditPostmortemStep(ResolutionNoteModalStep): diff --git a/engine/apps/slack/tests/test_scenario_steps/test_resolution_note.py b/engine/apps/slack/tests/test_scenario_steps/test_resolution_note.py index 9bc0b2b6..5ed39ecf 100644 --- a/engine/apps/slack/tests/test_scenario_steps/test_resolution_note.py +++ b/engine/apps/slack/tests/test_scenario_steps/test_resolution_note.py @@ -27,26 +27,15 @@ def test_get_resolution_notes_blocks_default_if_empty( blocks = step.get_resolution_notes_blocks(alert_group, "", False) - link_to_instruction = create_engine_url("static/images/postmortem.gif") expected_blocks = [ - { - "type": "divider", - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":bulb: You can add a message to the resolution notes via context menu:", - }, - }, { "type": "image", "title": { "type": "plain_text", - "text": "Add a resolution note", + "text": SlackResolutionNoteModalStep.MESSAGE_SHORTCUT_INSTRUCTION, }, - "image_url": link_to_instruction, - "alt_text": "Add to postmortem context menu", + "image_url": create_engine_url("static/images/resolution_note.gif"), + "alt_text": SlackResolutionNoteModalStep.MESSAGE_SHORTCUT_INSTRUCTION, }, ] assert blocks == expected_blocks diff --git a/engine/static/images/postmortem.gif b/engine/static/images/postmortem.gif deleted file mode 100644 index 4265e34a..00000000 Binary files a/engine/static/images/postmortem.gif and /dev/null differ diff --git a/engine/static/images/resolution_note.gif b/engine/static/images/resolution_note.gif new file mode 100644 index 00000000..8c98d4fb Binary files /dev/null and b/engine/static/images/resolution_note.gif differ