Skip to content

Commit

Permalink
Remove view survey action from survey listing (#1864)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadmsaadaot authored Jul 19, 2023
1 parent 30f08d0 commit 1e1b526
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions met-web/src/components/survey/listing/ActionsDropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ export const ActionsDropDown = ({ survey }: { survey: Survey }) => {
return false;
};

const canViewSurvey = (): boolean => {
if (!survey.engagement) {
return false;
}

if (submissionHasBeenOpened || roles.includes(USER_ROLES.VIEW_ALL_SURVEYS)) {
return true;
}

return assignedEngagements.includes(engagementId);
};

const canViewReport = (): boolean => {
return (
submissionHasBeenOpened &&
Expand All @@ -80,22 +68,14 @@ export const ActionsDropDown = ({ survey }: { survey: Survey }) => {
},
{
value: 2,
label: 'View Survey',
action: () => {
navigate(`/surveys/${survey.id}/submit`);
},
condition: canViewSurvey(),
},
{
value: 3,
label: 'View Report',
action: () => {
navigate(`/engagements/${engagementId}/dashboard`);
},
condition: canViewReport(),
},
{
value: 4,
value: 3,
label: 'View All Comments',
action: () => {
navigate(`/surveys/${survey.id}/comments`);
Expand Down

0 comments on commit 1e1b526

Please sign in to comment.