mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
Feat: last seen toggle list (#4541)
Closes # [1-1279](https://linear.app/unleash/issue/1-1279/update-the-feature-toggle-page-with-the-new-design)  --------- Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
parent
6250064183
commit
3acff3e6d9
@ -37,6 +37,7 @@ import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironmen
|
|||||||
import { ExportDialog } from './ExportDialog';
|
import { ExportDialog } from './ExportDialog';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import { focusable } from 'themes/themeStyles';
|
import { focusable } from 'themes/themeStyles';
|
||||||
|
import { FeatureEnvironmentSeenCell } from 'component/common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell';
|
||||||
|
|
||||||
export const featuresPlaceholder: FeatureSchema[] = Array(15).fill({
|
export const featuresPlaceholder: FeatureSchema[] = Array(15).fill({
|
||||||
name: 'Name of the feature',
|
name: 'Name of the feature',
|
||||||
@ -69,6 +70,9 @@ export const FeatureToggleListTable: VFC = () => {
|
|||||||
const { features = [], loading, refetchFeatures } = useFeatures();
|
const { features = [], loading, refetchFeatures } = useFeatures();
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
const { uiConfig } = useUiConfig();
|
const { uiConfig } = useUiConfig();
|
||||||
|
const showEnvironmentLastSeen = Boolean(
|
||||||
|
uiConfig.flags.lastSeenByEnvironment
|
||||||
|
);
|
||||||
const [initialState] = useState(() => ({
|
const [initialState] = useState(() => ({
|
||||||
sortBy: [
|
sortBy: [
|
||||||
{
|
{
|
||||||
@ -125,10 +129,15 @@ export const FeatureToggleListTable: VFC = () => {
|
|||||||
{
|
{
|
||||||
Header: 'Seen',
|
Header: 'Seen',
|
||||||
accessor: 'lastSeenAt',
|
accessor: 'lastSeenAt',
|
||||||
Cell: FeatureSeenCell,
|
Cell: ({ value, row: { original: feature } }: any) => {
|
||||||
sortType: 'date',
|
return showEnvironmentLastSeen ? (
|
||||||
|
<FeatureEnvironmentSeenCell feature={feature} />
|
||||||
|
) : (
|
||||||
|
<FeatureSeenCell value={value} />
|
||||||
|
);
|
||||||
|
},
|
||||||
align: 'center',
|
align: 'center',
|
||||||
maxWidth: 85,
|
maxWidth: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Type',
|
Header: 'Type',
|
||||||
@ -190,7 +199,7 @@ export const FeatureToggleListTable: VFC = () => {
|
|||||||
searchable: true,
|
searchable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[isFavoritesPinned]
|
[isFavoritesPinned, showEnvironmentLastSeen]
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
Loading…
Reference in New Issue
Block a user