1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00

feat: Last seen per environment archive

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2023-08-21 15:14:23 +03:00
parent 10c21461bd
commit 31104183ac
No known key found for this signature in database
GPG Key ID: DB82A1577B38F66B

View File

@ -19,7 +19,6 @@ import { Search } from 'component/common/Search/Search';
import { FeatureTypeCell } from 'component/common/Table/cells/FeatureTypeCell/FeatureTypeCell'; import { FeatureTypeCell } from 'component/common/Table/cells/FeatureTypeCell/FeatureTypeCell';
import { FeatureSeenCell } from 'component/common/Table/cells/FeatureSeenCell/FeatureSeenCell'; import { FeatureSeenCell } from 'component/common/Table/cells/FeatureSeenCell/FeatureSeenCell';
import { LinkCell } from 'component/common/Table/cells/LinkCell/LinkCell'; import { LinkCell } from 'component/common/Table/cells/LinkCell/LinkCell';
import { FeatureStaleCell } from 'component/feature/FeatureToggleList/FeatureStaleCell/FeatureStaleCell';
import { ArchivedFeatureActionCell } from 'component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureActionCell'; import { ArchivedFeatureActionCell } from 'component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureActionCell';
import { featuresPlaceholder } from 'component/feature/FeatureToggleList/FeatureToggleListTable'; import { featuresPlaceholder } from 'component/feature/FeatureToggleList/FeatureToggleListTable';
import theme from 'themes/theme'; import theme from 'themes/theme';
@ -36,6 +35,8 @@ import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColum
import { RowSelectCell } from '../../project/Project/ProjectFeatureToggles/RowSelectCell/RowSelectCell'; import { RowSelectCell } from '../../project/Project/ProjectFeatureToggles/RowSelectCell/RowSelectCell';
import { BatchSelectionActionsBar } from '../../common/BatchSelectionActionsBar/BatchSelectionActionsBar'; import { BatchSelectionActionsBar } from '../../common/BatchSelectionActionsBar/BatchSelectionActionsBar';
import { ArchiveBatchActions } from './ArchiveBatchActions'; import { ArchiveBatchActions } from './ArchiveBatchActions';
import { FeatureEnvironmentSeenCell } from '../../common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell';
import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig';
export interface IFeaturesArchiveTableProps { export interface IFeaturesArchiveTableProps {
archivedFeatures: FeatureSchema[]; archivedFeatures: FeatureSchema[];
@ -74,6 +75,11 @@ export const ArchiveTable = ({
searchParams.get('search') || '' searchParams.get('search') || ''
); );
const { uiConfig } = useUiConfig();
const showEnvironmentLastSeen = Boolean(
uiConfig.flags.lastSeenByEnvironment
);
const onRevive = useCallback( const onRevive = useCallback(
async (feature: string) => { async (feature: string) => {
try { try {
@ -113,11 +119,16 @@ export const ArchiveTable = ({
: []), : []),
{ {
Header: 'Seen', Header: 'Seen',
width: 85,
canSort: true,
Cell: FeatureSeenCell,
accessor: 'lastSeenAt', accessor: 'lastSeenAt',
Cell: ({ value, row: { original: feature } }: any) => {
return showEnvironmentLastSeen ? (
<FeatureEnvironmentSeenCell feature={feature} />
) : (
<FeatureSeenCell value={value} />
);
},
align: 'center', align: 'center',
maxWidth: 80,
}, },
{ {
Header: 'Type', Header: 'Type',
@ -197,7 +208,7 @@ export const ArchiveTable = ({
}, },
], ],
//eslint-disable-next-line //eslint-disable-next-line
[projectId] [projectId, showEnvironmentLastSeen]
); );
const { const {