From 0461a58201260bf95f2ce0348144d848beca47b7 Mon Sep 17 00:00:00 2001 From: Avery Date: Wed, 20 Sep 2023 12:37:37 -0700 Subject: [PATCH] Appends outstanding incident tasks in tactical reports (#3798) * 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 <39573146+mvilanova@users.noreply.github.com> * Update src/dispatch/static/dispatch/src/incident/store.js Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --------- Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com> --- .../plugins/dispatch_slack/incident/interactive.py | 2 +- src/dispatch/static/dispatch/src/incident/store.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/dispatch/plugins/dispatch_slack/incident/interactive.py b/src/dispatch/plugins/dispatch_slack/incident/interactive.py index eb2553022f67..f8718e7097fa 100644 --- a/src/dispatch/plugins/dispatch_slack/incident/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/incident/interactive.py @@ -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 diff --git a/src/dispatch/static/dispatch/src/incident/store.js b/src/dispatch/static/dispatch/src/incident/store.js index ac90973ed8cd..45f5d7adc023 100644 --- a/src/dispatch/static/dispatch/src/incident/store.js +++ b/src/dispatch/static/dispatch/src/incident/store.js @@ -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)