Skip to content

Commit

Permalink
The sideNav should not be visible to a state user if the submission i…
Browse files Browse the repository at this point in the history
…s a draft that has never been submitted
  • Loading branch information
ruizajtruss committed Feb 15, 2024
1 parent 22ab839 commit 5531ac9
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 5531ac9

Please sign in to comment.