mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
feat: Last seen per environment archive (#4540)
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>
This commit is contained in:
parent
4857f7f4bc
commit
6250064183
@ -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 'component/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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user