1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-27 01:19:00 +02:00

feat: export button in flags overview (#9715)

This commit is contained in:
Mateusz Kwasniewski 2025-04-08 10:23:02 +02:00 committed by GitHub
parent b120c97717
commit e76d04a7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1,26 @@
import { IconButton, Tooltip } from '@mui/material';
import IosShare from '@mui/icons-material/IosShare';
import type { FC } from 'react';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
export const ExportFlags: FC<{ onClick: () => void }> = ({ onClick }) => {
const { trackEvent } = usePlausibleTracker();
return (
<Tooltip title='Export flags' arrow>
<IconButton
onClick={() => {
onClick();
trackEvent('search-feature-buttons', {
props: {
action: 'export',
},
});
}}
size='small'
>
<IosShare />
</IconButton>
</Tooltip>
);
};

View File

@ -31,6 +31,7 @@ import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { useGlobalFeatureSearch } from './useGlobalFeatureSearch';
import { LifecycleFilters } from './FeatureToggleFilters/LifecycleFilters';
import { useUiFlag } from 'hooks/useUiFlag';
import { ExportFlags } from './ExportFlags';
export const featuresPlaceholder = Array(15).fill({
name: 'Name of the feature',
@ -289,9 +290,17 @@ export const FeatureToggleListTable: VFC = () => {
>
View archive
</Link>
<FeatureToggleListActions
onExportClick={() => setShowExportDialog(true)}
{flagsReleaseManagementUIEnabled ? (
<ExportFlags
onClick={() => setShowExportDialog(true)}
/>
) : (
<FeatureToggleListActions
onExportClick={() =>
setShowExportDialog(true)
}
/>
)}
</>
}
>