fix(vendors): restore filter drawer labels for e2e and visual CI

Use VendorFilterOptions again and keep the Apply filters footer label expected
by vendor Playwright specs and the committed visual baseline.
This commit is contained in:
arthur.bassi 2026-08-14 09:42:18 -03:00
parent 90546c56c3
commit 2e1c46f178

View file

@ -1,9 +1,9 @@
import { useEffect, useMemo, useState } from "react"; import { useEffect, useState } from "react";
import CloseIcon from "@mui/icons-material/Close"; import CloseIcon from "@mui/icons-material/Close";
import { Box, Button, Chip, Drawer, IconButton, Stack, Typography } from "@mui/material"; import { Box, Button, Chip, Drawer, IconButton, Stack, Typography } from "@mui/material";
import type { VendorFacets } from "@/domain/vendors/types/vendor"; import type { VendorFacets } from "@/domain/vendors/types/vendor";
import { VendorFilterOptions } from "./vendor-filter-options";
import { emptyVendorFilters, type VendorFilters } from "./vendor-filters"; import { emptyVendorFilters, type VendorFilters } from "./vendor-filters";
import { VendorFiltersDrawerFields } from "./vendor-filters-drawer-fields";
interface VendorFiltersDrawerProps { interface VendorFiltersDrawerProps {
open: boolean; open: boolean;
@ -30,11 +30,6 @@ export function VendorFiltersDrawer({
} }
}, [open, appliedFilters]); }, [open, appliedFilters]);
const companyOptions = useMemo(() => facets?.companies ?? [], [facets]);
const tradeOptions = useMemo(() => facets?.trades ?? [], [facets]);
const locationOptions = useMemo(() => facets?.locations ?? [], [facets]);
const jobBucketOptions = useMemo(() => facets?.jobBuckets ?? [], [facets]);
const activeCount = const activeCount =
draft.companies.length + draft.trades.length + draft.locations.length + draft.jobBuckets.length; draft.companies.length + draft.trades.length + draft.locations.length + draft.jobBuckets.length;
@ -84,16 +79,7 @@ export function VendorFiltersDrawer({
</Stack> </Stack>
<Box className="flex-1 overflow-y-auto" sx={{ px: 2.5 }}> <Box className="flex-1 overflow-y-auto" sx={{ px: 2.5 }}>
<VendorFiltersDrawerFields <VendorFilterOptions facets={facets} draft={draft} setDraft={setDraft} />
draft={draft}
setDraft={setDraft}
options={{
companies: companyOptions,
trades: tradeOptions,
locations: locationOptions,
jobBuckets: jobBucketOptions,
}}
/>
</Box> </Box>
<Stack <Stack
@ -109,7 +95,7 @@ export function VendorFiltersDrawer({
Clear all Clear all
</Button> </Button>
<Button variant="contained" onClick={handleApply} fullWidth> <Button variant="contained" onClick={handleApply} fullWidth>
Apply Apply filters
</Button> </Button>
</Stack> </Stack>
</Stack> </Stack>