mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
feat: adjust filter UI (#9720)
This commit is contained in:
parent
f8e75e5250
commit
1e027dcf4f
@ -76,14 +76,14 @@ const setupApi = (features: APIFeature[], projects: APIProject[]) => {
|
||||
|
||||
const verifyTableFeature = async (feature: Partial<UIFeature>) => {
|
||||
await screen.findByText('Search');
|
||||
await screen.findByText('Add Filter');
|
||||
await screen.findByText('Filter');
|
||||
await Promise.all(
|
||||
Object.values(feature).map((value) => screen.findByText(value)),
|
||||
);
|
||||
};
|
||||
|
||||
const filterFeaturesByProject = async (projectName: string) => {
|
||||
const addFilterButton = screen.getByText('Add Filter');
|
||||
const addFilterButton = screen.getByText('Filter');
|
||||
addFilterButton.click();
|
||||
|
||||
const projectItem = await screen.findByText('Project');
|
||||
|
@ -4,7 +4,7 @@ import Button from '@mui/material/Button';
|
||||
import Menu from '@mui/material/Menu';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import { Icon, styled } from '@mui/material';
|
||||
import Add from '@mui/icons-material/Add';
|
||||
import FilterList from '@mui/icons-material/FilterList';
|
||||
import { Box } from '@mui/system';
|
||||
import type { IFilterItem } from './Filters/Filters';
|
||||
import { FILTERS_MENU } from 'utils/testIds';
|
||||
@ -117,13 +117,16 @@ export const AddFilterButton = ({
|
||||
describeChild
|
||||
open={archiveTooltipOpen}
|
||||
>
|
||||
<StyledButton onClick={handleClick} startIcon={<Add />}>
|
||||
Add Filter
|
||||
<StyledButton
|
||||
onClick={handleClick}
|
||||
startIcon={<FilterList />}
|
||||
>
|
||||
Filter
|
||||
</StyledButton>
|
||||
</StyledHtmlTooltip>
|
||||
) : (
|
||||
<StyledButton onClick={handleClick} startIcon={<Add />}>
|
||||
Add Filter
|
||||
<StyledButton onClick={handleClick} startIcon={<FilterList />}>
|
||||
Filter
|
||||
</StyledButton>
|
||||
)}
|
||||
|
||||
|
@ -120,7 +120,7 @@ test('should remove selected item from the add filter list', async () => {
|
||||
);
|
||||
|
||||
// initial selection list
|
||||
const addFilterButton = await screen.findByText('Add Filter');
|
||||
const addFilterButton = await screen.findByText('Filter');
|
||||
fireEvent.click(addFilterButton);
|
||||
expect((await screen.findByTestId(FILTERS_MENU)).textContent).toBe(
|
||||
'StateTags',
|
||||
|
@ -31,7 +31,7 @@ test('Filter insights by project and date', async () => {
|
||||
vi.setSystemTime(currentTime);
|
||||
setupApi();
|
||||
render(<Insights withCharts={false} />);
|
||||
const addFilter = await screen.findByText('Add Filter');
|
||||
const addFilter = await screen.findByText('Filter');
|
||||
fireEvent.click(addFilter);
|
||||
const projectFilter = await screen.findByText('Project');
|
||||
|
||||
|
@ -150,7 +150,7 @@ test('filters by flag author', async () => {
|
||||
route: '/projects/default',
|
||||
},
|
||||
);
|
||||
const addFilter = await screen.findByText('Add Filter');
|
||||
const addFilter = await screen.findByText('Filter');
|
||||
fireEvent.click(addFilter);
|
||||
|
||||
const createdBy = await screen.findByText('Created by');
|
||||
|
Loading…
Reference in New Issue
Block a user