mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
removed unused code
This commit is contained in:
parent
b6beae95cc
commit
e53baaf718
@ -1,50 +0,0 @@
|
||||
import { useFeaturesArchive } from 'hooks/api/getters/useFeaturesArchive/useFeaturesArchive';
|
||||
import { FeatureToggleList } from '../feature/FeatureToggleList/FeatureToggleArchiveList';
|
||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||
import { useFeaturesFilter } from 'hooks/useFeaturesFilter';
|
||||
import { useFeatureArchiveApi } from 'hooks/api/actions/useFeatureArchiveApi/useReviveFeatureApi';
|
||||
import useToast from 'hooks/useToast';
|
||||
import { useFeaturesSort } from 'hooks/useFeaturesSort';
|
||||
|
||||
export const ArchiveListContainer = () => {
|
||||
const { setToastData, setToastApiError } = useToast();
|
||||
const { uiConfig } = useUiConfig();
|
||||
const { reviveFeature } = useFeatureArchiveApi();
|
||||
|
||||
const {
|
||||
archivedFeatures = [],
|
||||
refetchArchived,
|
||||
loading,
|
||||
} = useFeaturesArchive();
|
||||
|
||||
const { filtered, filter, setFilter } = useFeaturesFilter(archivedFeatures);
|
||||
const { sorted, sort, setSort } = useFeaturesSort(filtered);
|
||||
|
||||
const onRevive = (feature: string) => {
|
||||
reviveFeature(feature)
|
||||
.then(refetchArchived)
|
||||
.then(() =>
|
||||
setToastData({
|
||||
type: 'success',
|
||||
title: "And we're back!",
|
||||
text: 'The feature toggle has been revived.',
|
||||
confetti: true,
|
||||
})
|
||||
)
|
||||
.catch(e => setToastApiError(e.toString()));
|
||||
};
|
||||
|
||||
return (
|
||||
<FeatureToggleList
|
||||
features={sorted}
|
||||
loading={loading}
|
||||
onRevive={onRevive}
|
||||
flags={uiConfig.flags}
|
||||
filter={filter}
|
||||
setFilter={setFilter}
|
||||
sort={sort}
|
||||
setSort={setSort}
|
||||
isArchive
|
||||
/>
|
||||
);
|
||||
};
|
@ -165,8 +165,6 @@ export const ArchiveTable = ({
|
||||
getSearchContext,
|
||||
} = useSearch(columns, searchValue, archivedFeatures);
|
||||
|
||||
debugger;
|
||||
|
||||
const data = useMemo(
|
||||
() => (loading ? featuresPlaceholder : searchedData),
|
||||
[searchedData, loading]
|
||||
@ -238,7 +236,7 @@ export const ArchiveTable = ({
|
||||
const renderRows = () => {
|
||||
return (
|
||||
<>
|
||||
{rows.map((row) => {
|
||||
{rows.map(row => {
|
||||
prepareRow(row);
|
||||
return (
|
||||
<TableRow hover {...row.getRowProps()}>
|
||||
@ -263,7 +261,6 @@ export const ArchiveTable = ({
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<PageContent
|
||||
isLoading={loading}
|
||||
|
@ -1,58 +0,0 @@
|
||||
import { FC } from 'react';
|
||||
import { useProjectFeaturesArchive } from 'hooks/api/getters/useProjectFeaturesArchive/useProjectFeaturesArchive';
|
||||
import { FeatureToggleList } from '../feature/FeatureToggleList/FeatureToggleArchiveList';
|
||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||
import { useFeaturesFilter } from 'hooks/useFeaturesFilter';
|
||||
import { useFeatureArchiveApi } from 'hooks/api/actions/useFeatureArchiveApi/useReviveFeatureApi';
|
||||
import useToast from 'hooks/useToast';
|
||||
import { useFeaturesSort } from 'hooks/useFeaturesSort';
|
||||
|
||||
interface IProjectFeaturesArchiveList {
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
export const ProjectFeaturesArchiveList: FC<IProjectFeaturesArchiveList> = ({
|
||||
projectId,
|
||||
}) => {
|
||||
const { setToastData, setToastApiError } = useToast();
|
||||
const { uiConfig } = useUiConfig();
|
||||
const { reviveFeature } = useFeatureArchiveApi();
|
||||
|
||||
const {
|
||||
archivedFeatures = [],
|
||||
refetchArchived,
|
||||
loading,
|
||||
} = useProjectFeaturesArchive(projectId);
|
||||
|
||||
const { filtered, filter, setFilter } = useFeaturesFilter(archivedFeatures);
|
||||
const { sorted, sort, setSort } = useFeaturesSort(filtered);
|
||||
|
||||
const onRevive = (feature: string) => {
|
||||
reviveFeature(feature)
|
||||
.then(refetchArchived)
|
||||
.then(() =>
|
||||
setToastData({
|
||||
type: 'success',
|
||||
title: "And we're back!",
|
||||
text: 'The feature toggle has been revived.',
|
||||
confetti: true,
|
||||
})
|
||||
)
|
||||
.catch(e => setToastApiError(e.toString()));
|
||||
};
|
||||
|
||||
return (
|
||||
<FeatureToggleList
|
||||
features={sorted}
|
||||
loading={loading}
|
||||
onRevive={onRevive}
|
||||
flags={uiConfig.flags}
|
||||
filter={filter}
|
||||
setFilter={setFilter}
|
||||
sort={sort}
|
||||
setSort={setSort}
|
||||
isArchive
|
||||
inProject={Boolean(projectId)}
|
||||
/>
|
||||
);
|
||||
};
|
@ -1,9 +1,9 @@
|
||||
import React, {VFC} from 'react';
|
||||
import React, { VFC } from 'react';
|
||||
import TimeAgo from 'react-timeago';
|
||||
import {Tooltip, Typography} from '@mui/material';
|
||||
import {formatDateYMD} from '../../../../../utils/formatDate';
|
||||
import {TextCell} from '../TextCell/TextCell';
|
||||
import {useLocationSettings} from "../../../../../hooks/useLocationSettings";
|
||||
import { Tooltip, Typography } from '@mui/material';
|
||||
import { formatDateYMD } from '../../../../../utils/formatDate';
|
||||
import { TextCell } from '../TextCell/TextCell';
|
||||
import { useLocationSettings } from '../../../../../hooks/useLocationSettings';
|
||||
|
||||
interface IFeatureArchivedCellProps {
|
||||
value?: string | Date | null;
|
||||
@ -20,7 +20,10 @@ export const FeatureArchivedCell: VFC<IFeatureArchivedCellProps> = ({
|
||||
<TextCell>
|
||||
{archivedAt && (
|
||||
<Tooltip
|
||||
title={`Archived on: ${formatDateYMD(archivedAt, locationSettings.locale)}`}
|
||||
title={`Archived on: ${formatDateYMD(
|
||||
archivedAt,
|
||||
locationSettings.locale
|
||||
)}`}
|
||||
arrow
|
||||
>
|
||||
<Typography noWrap variant="body2" data-loading>
|
||||
|
Loading…
Reference in New Issue
Block a user