Skip to content

Commit

Permalink
feat: Last seen per environment archive (#4540)
Browse files Browse the repository at this point in the history
Closes #
[1-1280](https://linear.app/unleash/issue/1-1280/update-the-archive-toggle-page-with-the-new-design)

![Screenshot 2023-08-21 at 14 53
10](https://github.com/Unleash/unleash/assets/104830839/f7c9fcc2-ef60-4415-bf9a-605fdebd92ed)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
  • Loading branch information
andreas-unleash committed Aug 21, 2023
1 parent 4857f7f commit 6250064
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx
Expand Up @@ -19,7 +19,6 @@ import { Search } from 'component/common/Search/Search';
import { FeatureTypeCell } from 'component/common/Table/cells/FeatureTypeCell/FeatureTypeCell';
import { FeatureSeenCell } from 'component/common/Table/cells/FeatureSeenCell/FeatureSeenCell';
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 { featuresPlaceholder } from 'component/feature/FeatureToggleList/FeatureToggleListTable';
import theme from 'themes/theme';
Expand All @@ -36,6 +35,8 @@ import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColum
import { RowSelectCell } from '../../project/Project/ProjectFeatureToggles/RowSelectCell/RowSelectCell';
import { BatchSelectionActionsBar } from '../../common/BatchSelectionActionsBar/BatchSelectionActionsBar';
import { ArchiveBatchActions } from './ArchiveBatchActions';
import { FeatureEnvironmentSeenCell } from 'component/common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';

export interface IFeaturesArchiveTableProps {
archivedFeatures: FeatureSchema[];
Expand Down Expand Up @@ -74,6 +75,11 @@ export const ArchiveTable = ({
searchParams.get('search') || ''
);

const { uiConfig } = useUiConfig();
const showEnvironmentLastSeen = Boolean(
uiConfig.flags.lastSeenByEnvironment
);

const onRevive = useCallback(
async (feature: string) => {
try {
Expand Down Expand Up @@ -113,11 +119,16 @@ export const ArchiveTable = ({
: []),
{
Header: 'Seen',
width: 85,
canSort: true,
Cell: FeatureSeenCell,
accessor: 'lastSeenAt',
Cell: ({ value, row: { original: feature } }: any) => {
return showEnvironmentLastSeen ? (
<FeatureEnvironmentSeenCell feature={feature} />
) : (
<FeatureSeenCell value={value} />
);
},
align: 'center',
maxWidth: 80,
},
{
Header: 'Type',
Expand Down Expand Up @@ -197,7 +208,7 @@ export const ArchiveTable = ({
},
],
//eslint-disable-next-line
[projectId]
[projectId, showEnvironmentLastSeen]
);

const {
Expand Down

0 comments on commit 6250064

Please sign in to comment.