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

Better summary and impact updates #189

Merged
merged 4 commits into from
Nov 15, 2019
Merged
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
Prev Previous commit
Next Next commit
Changed wording to improve the UX in the summary/impact flow
evnsio committed Nov 15, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3b89b95f57e98e71594f395c1197da8d70d30226
15 changes: 9 additions & 6 deletions response/slack/incident_commands/impact.py
Original file line number Diff line number Diff line change
@@ -12,11 +12,14 @@
UPDATE_CURRENT_IMPACT_ACTION = "update-current-impact-action"
SET_NEW_IMPACT_ACTION = "set-new-impact-action"
PROPOSED_MESSAGE_BLOCK_ID = "proposed"
NO_IMPACT_TEXT = "The impact of this incicent hasn't been set yet."
CURRENT_TITLE = "*Current impact:*\n"
PROPOSED_TITLE = "*Proposed impact:*\n"
UPDATE_IMPACT_DIALOG = "update-impact-dialog"
IMPACT_UPDATED_TITLE = "*Impact updated to:*\n"

NO_IMPACT_TEXT = "The impact of this incicent hasn't been set yet."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NO_IMPACT_TEXT = "The impact of this incicent hasn't been set yet."
NO_IMPACT_TEXT = "The impact of this incident hasn't been set yet."

CURRENT_TITLE = "*This is the current impact:*\n"
PROPOSED_TITLE = "*Or would you like to update the impact to this?*\n"
IMPACT_UPDATED_TITLE = "*The impact has been updated to:*\n"
CHANGE_BUTTON_TEXT = "Change"
ACCEPT_PROPOSED_TEXT = "Yes"


@__default_incident_command(["impact"], helptext="Explain the impact of this")
@@ -34,7 +37,7 @@ def update_impact(incident: Incident, user_id: str, message: str):
block_id="update",
text=block_kit.Text(f"{CURRENT_TITLE}{incident.impact or NO_IMPACT_TEXT}"),
accessory=block_kit.Button(
"Update", UPDATE_CURRENT_IMPACT_ACTION, value=incident.pk
CHANGE_BUTTON_TEXT, UPDATE_CURRENT_IMPACT_ACTION, value=incident.pk
),
)
)
@@ -47,7 +50,7 @@ def update_impact(incident: Incident, user_id: str, message: str):
block_id=PROPOSED_MESSAGE_BLOCK_ID,
text=block_kit.Text(f"{PROPOSED_TITLE}{message}"),
accessory=block_kit.Button(
"Set to this", SET_NEW_IMPACT_ACTION, value=incident.pk
ACCEPT_PROPOSED_TEXT, SET_NEW_IMPACT_ACTION, value=incident.pk
),
)
)
17 changes: 11 additions & 6 deletions response/slack/incident_commands/summary.py
Original file line number Diff line number Diff line change
@@ -12,11 +12,14 @@
UPDATE_CURRENT_SUMMARY_ACTION = "update-current-summary-action"
SET_NEW_SUMMARY_ACTION = "set-new-summary-action"
PROPOSED_MESSAGE_BLOCK_ID = "proposed"
NO_SUMMARY_TEXT = "This incident doesn't have a summary yet."
CURRENT_TITLE = "*Current summary:*\n"
PROPOSED_TITLE = "*Proposed summary:*\n"
UPDATE_SUMMARY_DIALOG = "update-summary-dialog"
SUMMARY_UPDATED_TITLE = "*Summary updated to:*\n"

NO_SUMMARY_TEXT = "This incident doesn't have a summary yet."
CURRENT_TITLE = "*This is the current summary:*\n"
PROPOSED_TITLE = "*Or would you like to update the summary to this?*\n"
SUMMARY_UPDATED_TITLE = "*The summary has been updated to:*\n"
CHANGE_BUTTON_TEXT = "Change"
ACCEPT_PROPOSED_TEXT = "Yes"


@__default_incident_command(
@@ -31,27 +34,29 @@ def update_summary(incident: Incident, user_id: str, message: str):

# Either no new summary has been provided, or one already exists
msg = block_kit.Message()

msg.add_block(
block_kit.Section(
block_id="update",
text=block_kit.Text(
f"{CURRENT_TITLE}{incident.summary or NO_SUMMARY_TEXT}"
),
accessory=block_kit.Button(
"Update", UPDATE_CURRENT_SUMMARY_ACTION, value=incident.pk
CHANGE_BUTTON_TEXT, UPDATE_CURRENT_SUMMARY_ACTION, value=incident.pk
),
)
)

# if the user has supplied a message, provide the option for them to set it without
# retyping in the dialog
if message:
msg.add_block(block_kit.Divider())
msg.add_block(
block_kit.Section(
block_id=PROPOSED_MESSAGE_BLOCK_ID,
text=block_kit.Text(f"{PROPOSED_TITLE}{message}"),
accessory=block_kit.Button(
"Set to this", SET_NEW_SUMMARY_ACTION, value=incident.pk
ACCEPT_PROPOSED_TEXT, SET_NEW_SUMMARY_ACTION, value=incident.pk
),
)
)