From 5531ac971e5aed9be2c2a2523316f8694ef21c8c Mon Sep 17 00:00:00 2001 From: ruizajtruss Date: Thu, 15 Feb 2024 12:19:03 +0000 Subject: [PATCH] The sideNav should not be visible to a state user if the submission is a draft that has never been submitted --- .../src/pages/SubmissionSideNav/SubmissionSideNav.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx b/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx index b6e719f871..777e54c4ca 100644 --- a/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx +++ b/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx @@ -62,9 +62,6 @@ export const SubmissionSideNav = () => { featureFlags.CMS_QUESTIONS.flag, featureFlags.CMS_QUESTIONS.defaultValue ) - const showSidebar = - showQuestionResponse && - QUESTION_RESPONSE_SHOW_SIDEBAR_ROUTES.includes(routeName) const isSelectedLink = (route: string | string[]): string => { //We pass an array of the form routes in order to display the sideNav on all of the pages @@ -111,6 +108,13 @@ export const SubmissionSideNav = () => { const submissionStatus = pkg.status + //The sideNav should not be visible to a state user if the submission is a draft that has never been submitted + const showSidebar = + showQuestionResponse && + submissionStatus !== 'DRAFT' && + pkg.initiallySubmittedAt !== null && + QUESTION_RESPONSE_SHOW_SIDEBAR_ROUTES.includes(routeName) + const isCMSUser = loggedInUser?.role === 'CMS_USER' const isStateUser = loggedInUser?.role === 'STATE_USER' const isAdminUser = loggedInUser?.role === 'ADMIN_USER'