Skip to content

Commit 584d8d6

Browse files
committed
#4089 few fixes
1 parent 8aed2d1 commit 584d8d6

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { Link, useHistory } from 'react-router-dom';
7-
import { Project, isGuest, isAdmin, isLeadership, RoleEnum } from 'shared';
7+
import { Project, isGuest, isAdmin, isLeadership } from 'shared';
88
import { projectWbsPipe, wbsPipe } from '../../../utils/pipes';
99
import ProjectDetails from './ProjectDetails';
1010
import { routes } from '../../../utils/routes';
@@ -179,38 +179,38 @@ const ProjectViewContainer: React.FC<ProjectViewContainerProps> = ({ project, en
179179

180180
const wbsNum = wbsPipe(project.wbsNum);
181181

182-
if (user.role === RoleEnum.GUEST) return (
183-
<PageLayout
184-
title={pageTitle}
185-
headerRight={headerRight}
186-
tabs={
187-
<FullPageTabs
188-
setTab={setTab}
189-
tabsLabels={[
190-
{ tabUrlValue: 'overview', tabName: 'Overview' },
191-
{ tabUrlValue: 'tasks', tabName: 'Tasks' },
192-
{ tabUrlValue: 'changes', tabName: 'Changes' },
193-
{ tabUrlValue: 'gantt', tabName: 'Gantt' }
194-
]}
195-
baseUrl={`${routes.PROJECTS}/${wbsNum}`}
196-
defaultTab='overview'
197-
id='project-detail-tabs'
198-
/>
199-
}
200-
previousPages={[{ name: 'Projects', route: routes.PROJECTS }]}
201-
>
202-
{tab === 0 ? (
203-
<ProjectDetails project={project} />
204-
) : tab === 1 ? (
205-
<TaskList project={project} isGuest={user.role === RoleEnum.GUEST} />
206-
) : tab === 2 ? (
207-
<ChangesList changes={project.changes} />
208-
) : (
209-
<ProjectGantt workPackages={project.workPackages} />
210-
)
211-
}
212-
</PageLayout>
213-
)
182+
if (isGuest(user.role))
183+
return (
184+
<PageLayout
185+
title={pageTitle}
186+
headerRight={headerRight}
187+
tabs={
188+
<FullPageTabs
189+
setTab={setTab}
190+
tabsLabels={[
191+
{ tabUrlValue: 'overview', tabName: 'Overview' },
192+
{ tabUrlValue: 'tasks', tabName: 'Tasks' },
193+
{ tabUrlValue: 'changes', tabName: 'Changes' },
194+
{ tabUrlValue: 'gantt', tabName: 'Gantt' }
195+
]}
196+
baseUrl={`${routes.PROJECTS}/${wbsNum}`}
197+
defaultTab="overview"
198+
id="project-detail-tabs"
199+
/>
200+
}
201+
previousPages={[{ name: 'Projects', route: routes.PROJECTS }]}
202+
>
203+
{tab === 0 ? (
204+
<ProjectDetails project={project} />
205+
) : tab === 1 ? (
206+
<TaskList project={project} isGuest={true} />
207+
) : tab === 2 ? (
208+
<ChangesList changes={project.changes} />
209+
) : (
210+
<ProjectGantt workPackages={project.workPackages} />
211+
)}
212+
</PageLayout>
213+
);
214214

215215
return (
216216
<PageLayout
@@ -240,7 +240,7 @@ const ProjectViewContainer: React.FC<ProjectViewContainerProps> = ({ project, en
240240
{tab === 0 ? (
241241
<ProjectDetails project={project} />
242242
) : tab === 1 ? (
243-
<TaskList project={project} isGuest={user.role === RoleEnum.GUEST} />
243+
<TaskList project={project} isGuest={false} />
244244
) : tab === 2 ? (
245245
<BOMTab project={project} />
246246
) : tab === 3 ? (

0 commit comments

Comments
 (0)