Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declutters Slack case threads #3994

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 3 additions & 4 deletions src/dispatch/plugins/dispatch_slack/case/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ def create_signal_messages(case_id: int, channel_id: str, db_session: Session) -
).json()

signal_metadata_blocks = [
Section(
text=f"*{first_instance_signal.name}* - {first_instance_signal.variant}",
),
Actions(
elements=[
Button(
Expand All @@ -214,7 +211,9 @@ def create_signal_messages(case_id: int, channel_id: str, db_session: Session) -
),
]
),
Section(text=f"Total instances in this case: *{num_of_instances}*\n"),
Section(text="*Signal Instances*"),
mvilanova marked this conversation as resolved.
Show resolved Hide resolved
Divider(),
Section(text=f"{num_of_instances} signal instances observed in this case."),
mvilanova marked this conversation as resolved.
Show resolved Hide resolved
Section(text="\n*Entities*"),
Divider(),
]
Expand Down
6 changes: 0 additions & 6 deletions src/dispatch/plugins/dispatch_slack/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ def create_threaded(self, case: Case, conversation_id: str, db_session: Session)
client = create_slack_client(self.configuration)
blocks = create_case_message(case=case, channel_id=conversation_id)
response = send_message(client=client, conversation_id=conversation_id, blocks=blocks)
send_message(
client=client,
conversation_id=conversation_id,
text="All real-time case collaboration should be captured in this thread.",
ts=response["timestamp"],
)
if case.signal_instances:
message = create_signal_messages(
case_id=case.id, channel_id=conversation_id, db_session=db_session
Expand Down
4 changes: 3 additions & 1 deletion src/dispatch/plugins/dispatch_slack/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ def add_users_to_conversation_thread(
add_users_to_conversation(client=client, conversation_id=conversation_id, user_ids=user_ids)
blocks = Message(
blocks=[
Section(text="Looping in individuals to help resolve this case...", fields=users)
Section(
text="Adding the following individuals to help resolve this case:", fields=users
)
]
).build()["blocks"]
send_message(client=client, conversation_id=conversation_id, blocks=blocks, ts=thread_id)
Expand Down
Loading