mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-18 13:48:58 +02:00
chore: link to events for that flag name
This commit is contained in:
parent
9eb19618bf
commit
a2aa66b22a
@ -0,0 +1,33 @@
|
|||||||
|
import { Box, styled } from '@mui/material';
|
||||||
|
import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton';
|
||||||
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
|
import EventNoteIcon from '@mui/icons-material/EventNote';
|
||||||
|
import type { UnknownFlag } from './hooks/useUnknownFlags.js';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
const StyledBox = styled(Box)(() => ({
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
}));
|
||||||
|
|
||||||
|
interface IUnknownFlagsActionsCellProps {
|
||||||
|
unknownFlag: UnknownFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const UnknownFlagsActionsCell = ({
|
||||||
|
unknownFlag,
|
||||||
|
}: IUnknownFlagsActionsCellProps) => (
|
||||||
|
<StyledBox>
|
||||||
|
<PermissionIconButton
|
||||||
|
component={Link}
|
||||||
|
data-loading
|
||||||
|
to={`/history?feature=${encodeURIComponent(`IS:${unknownFlag.name}`)}`}
|
||||||
|
permission={ADMIN}
|
||||||
|
tooltipProps={{
|
||||||
|
title: 'See events',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<EventNoteIcon />
|
||||||
|
</PermissionIconButton>
|
||||||
|
</StyledBox>
|
||||||
|
);
|
@ -9,13 +9,14 @@ import { useFlexLayout, useSortBy, useTable } from 'react-table';
|
|||||||
import { sortTypes } from 'utils/sortTypes';
|
import { sortTypes } from 'utils/sortTypes';
|
||||||
import { Search } from 'component/common/Search/Search';
|
import { Search } from 'component/common/Search/Search';
|
||||||
import { useSearch } from 'hooks/useSearch';
|
import { useSearch } from 'hooks/useSearch';
|
||||||
import { useUnknownFlags } from './hooks/useUnknownFlags.js';
|
import { type UnknownFlag, useUnknownFlags } from './hooks/useUnknownFlags.js';
|
||||||
import theme from 'themes/theme.js';
|
import theme from 'themes/theme.js';
|
||||||
import { TimeAgoCell } from 'component/common/Table/cells/TimeAgoCell/TimeAgoCell.js';
|
import { TimeAgoCell } from 'component/common/Table/cells/TimeAgoCell/TimeAgoCell.js';
|
||||||
import { formatDateYMDHMS } from 'utils/formatDate.js';
|
import { formatDateYMDHMS } from 'utils/formatDate.js';
|
||||||
import { HighlightCell } from 'component/common/Table/cells/HighlightCell/HighlightCell.js';
|
import { HighlightCell } from 'component/common/Table/cells/HighlightCell/HighlightCell.js';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag.js';
|
import { useUiFlag } from 'hooks/useUiFlag.js';
|
||||||
import NotFound from 'component/common/NotFound/NotFound.js';
|
import NotFound from 'component/common/NotFound/NotFound.js';
|
||||||
|
import { UnknownFlagsActionsCell } from './UnknownFlagsActionsCell.js';
|
||||||
|
|
||||||
const StyledAlert = styled(Alert)(({ theme }) => ({
|
const StyledAlert = styled(Alert)(({ theme }) => ({
|
||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
@ -59,6 +60,18 @@ export const UnknownFlagsTable = () => {
|
|||||||
<TimeAgoCell value={value} dateFormat={formatDateYMDHMS} />
|
<TimeAgoCell value={value} dateFormat={formatDateYMDHMS} />
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Header: 'Actions',
|
||||||
|
id: 'Actions',
|
||||||
|
align: 'center',
|
||||||
|
Cell: ({
|
||||||
|
row: { original: unknownFlag },
|
||||||
|
}: { row: { original: UnknownFlag } }) => (
|
||||||
|
<UnknownFlagsActionsCell unknownFlag={unknownFlag} />
|
||||||
|
),
|
||||||
|
width: 100,
|
||||||
|
disableSortBy: true,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user