1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

Fix PR comments

This commit is contained in:
andreas-unleash 2022-06-07 13:23:15 +03:00
parent 4ddf69436e
commit 63f147b492
4 changed files with 16 additions and 10 deletions

View File

@ -43,22 +43,22 @@ export interface IFeaturesArchiveTableProps {
archivedFeatures: FeatureSchema[];
refetch: any;
loading: boolean;
inProject: boolean;
storedParams: any;
setStoredParams: any;
searchParams: any;
setSearchParams: any;
title: string;
}
export const ArchiveTable = ({
archivedFeatures = [],
loading,
inProject,
refetch,
storedParams,
setStoredParams,
searchParams,
setSearchParams,
title,
}: IFeaturesArchiveTableProps) => {
const rowHeight = theme.shape.tableRowHeight;
const { classes } = useStyles();
@ -201,9 +201,7 @@ export const ArchiveTable = ({
isLoading={loading}
header={
<PageHeader
title={`${
inProject ? 'Project Features Archive' : 'Archived'
} (${
title={`${title} (${
rows.length < data.length
? `${rows.length} of ${data.length}`
: data.length
@ -321,6 +319,7 @@ function getColumns(onRevive: (feature: string) => Promise<void>) {
disableGlobalFilter: true,
Cell: ({ row: { original } }: any) => (
<ReviveArchivedFeatureCell
project={original.project}
onRevive={() => onRevive(original.name)}
/>
),

View File

@ -1,20 +1,27 @@
import { VFC } from 'react';
import { ActionCell } from '../../../common/Table/cells/ActionCell/ActionCell';
import { Undo } from '@mui/icons-material';
import { IconButton } from '@mui/material';
import PermissionIconButton from '../../../common/PermissionIconButton/PermissionIconButton';
import { ADMIN } from '../../../providers/AccessProvider/permissions';
interface IReviveArchivedFeatureCell {
onRevive: any;
project: string;
}
export const ReviveArchivedFeatureCell: VFC<IReviveArchivedFeatureCell> = ({
onRevive,
project,
}) => {
return (
<ActionCell>
<IconButton onClick={onRevive}>
<PermissionIconButton
onClick={onRevive}
projectId={project}
permission={ADMIN}
>
<Undo />
</IconButton>
</PermissionIconButton>
</ActionCell>
);
};

View File

@ -23,6 +23,7 @@ export const FeaturesArchiveTable = () => {
return (
<ArchiveTable
title={'Archived'}
archivedFeatures={archivedFeatures}
loading={loading}
searchParams={searchParams}
@ -30,7 +31,6 @@ export const FeaturesArchiveTable = () => {
storedParams={storedParams}
setStoredParams={setStoredParams}
refetch={refetchArchived}
inProject={false}
/>
);
};

View File

@ -27,6 +27,7 @@ export const ProjectFeaturesArchiveTable = ({
return (
<ArchiveTable
title={'Project Features Archive'}
archivedFeatures={archivedFeatures}
loading={loading}
searchParams={searchParams}
@ -34,7 +35,6 @@ export const ProjectFeaturesArchiveTable = ({
storedParams={storedParams}
setStoredParams={setStoredParams}
refetch={refetchArchived}
inProject={true}
/>
);
};