Skip to content

Commit

Permalink
Appends outstanding incident tasks in tactical reports (#3798)
Browse files Browse the repository at this point in the history
* Appends outstanding incident tasks to the end of user input in tactical reports.

* Update src/dispatch/plugins/dispatch_slack/incident/interactive.py

Co-authored-by: Marc Vilanova <[email protected]>

* Update src/dispatch/static/dispatch/src/incident/store.js

Co-authored-by: Marc Vilanova <[email protected]>

---------

Co-authored-by: Marc Vilanova <[email protected]>
  • Loading branch information
metroid-samus and mvilanova committed Sep 22, 2023
1 parent 0eaf0e2 commit 0461a58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ def handle_report_tactical_command(

incident = incident_service.get(db_session=db_session, incident_id=context["subject"].id)
if incident.tasks:
actions = "\n".join(
actions += "\n\nOutstanding Incident Tasks:\n".join(
[
"-" + task.description
for task in incident.tasks
Expand Down
14 changes: 8 additions & 6 deletions src/dispatch/static/dispatch/src/incident/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,14 @@ const actions = {
commit("SET_DIALOG_REPORT", true)
commit("SET_SELECTED", incident)

state.report.tactical.actions = incident.tasks.reduce((result, task) => {
if (task.status == "Resolved") {
return result
}
return (result ? result + "\n" : "") + "- " + task.description
}, "")
state.report.tactical.actions +=
"\n\nOutstanding Incident Tasks:\n" +
incident.tasks.reduce((result, task) => {
if (task.status == "Resolved") {
return result
}
return (result ? result + "\n" : "") + "- " + task.description
}, "")
},
closeReportDialog({ commit }) {
commit("SET_DIALOG_REPORT", false)
Expand Down

0 comments on commit 0461a58

Please sign in to comment.