From 439d7c174526ec2d38e9ff0ab9f51a545fa6a152 Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech Date: Tue, 14 Jun 2022 09:19:41 +0200 Subject: [PATCH] hide project column on project archive --- .../archive/ArchiveTable/ArchiveTable.tsx | 33 ++++++++++++------- .../archive/ProjectFeaturesArchiveTable.tsx | 1 + 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx index e1a7a747ac..6e28a78080 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx @@ -45,6 +45,7 @@ export interface IFeaturesArchiveTableProps { | SortingRule | ((prev: SortingRule) => SortingRule) ) => SortingRule; + projectId?: string; } export const ArchiveTable = ({ @@ -54,6 +55,7 @@ export const ArchiveTable = ({ storedParams, setStoredParams, title, + projectId, }: IFeaturesArchiveTableProps) => { const rowHeight = theme.shape.tableRowHeight; const { classes } = useStyles(); @@ -129,17 +131,24 @@ export const ArchiveTable = ({ Cell: FeatureArchivedCell, sortType: 'date', }, - { - Header: 'Project ID', - accessor: 'project', - sortType: 'alphanumeric', - filterName: 'project', - searchable: true, - maxWidth: 150, - Cell: ({ value }: any) => ( - - ), - }, + ...(!projectId + ? [ + { + Header: 'Project ID', + accessor: 'project', + sortType: 'alphanumeric', + filterName: 'project', + searchable: true, + maxWidth: 150, + Cell: ({ value }: any) => ( + + ), + }, + ] + : []), { Header: 'Status', accessor: 'stale', @@ -169,7 +178,7 @@ export const ArchiveTable = ({ }, ], //eslint-disable-next-line - [] + [projectId] ); const { diff --git a/frontend/src/component/archive/ProjectFeaturesArchiveTable.tsx b/frontend/src/component/archive/ProjectFeaturesArchiveTable.tsx index a28553c53a..82cfd045e0 100644 --- a/frontend/src/component/archive/ProjectFeaturesArchiveTable.tsx +++ b/frontend/src/component/archive/ProjectFeaturesArchiveTable.tsx @@ -31,6 +31,7 @@ export const ProjectFeaturesArchiveTable = ({ storedParams={value} setStoredParams={setValue} refetch={refetchArchived} + projectId={projectId} /> ); };