From fe38356d361ff1fe802f2d64d5d180dde7afe837 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Wed, 20 Feb 2019 16:17:54 +0000
Subject: [PATCH] Gh-991: Add messages for when the submission is incorrect

---
 .../static_src/src/app/src/redux/actions/submissions.js    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/opentech/static_src/src/app/src/redux/actions/submissions.js b/opentech/static_src/src/app/src/redux/actions/submissions.js
index 37cbbda53..b1c4cabdc 100644
--- a/opentech/static_src/src/app/src/redux/actions/submissions.js
+++ b/opentech/static_src/src/app/src/redux/actions/submissions.js
@@ -20,6 +20,11 @@ import {
     getCurrentRoundSubmissionIDs,
 } from '@selectors/rounds';
 
+import {
+    MESSAGE_TYPES,
+    addMessage,
+} from '@actions/messages';
+
 
 // Round
 export const UPDATE_ROUND = 'UPDATE_ROUND';
@@ -125,6 +130,7 @@ export const loadCurrentRoundSubmissions = () => (dispatch, getState) => {
         const state = getState()
         const ids = getCurrentRoundSubmissionIDs(state)
         if (!ids.includes(getCurrentSubmissionID(state))) {
+            dispatch(addMessage('The selected submission is not available in this view', MESSAGE_TYPES.WARNING))
             return dispatch(setCurrentSubmission(null))
         }
     })
@@ -190,6 +196,7 @@ export const loadSubmissionsForCurrentStatus = () => (dispatch, getState) => {
         const state = getState()
         const ids = getSubmissionIDsForCurrentStatuses(state)
         if (!ids.includes(getCurrentSubmissionID(state))) {
+            dispatch(addMessage('The selected submission is not available in this view', MESSAGE_TYPES.WARNING))
             return dispatch(setCurrentSubmission(null))
         }
     })
-- 
GitLab