mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
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:
parent
90546c56c3
commit
2e1c46f178
1 changed files with 4 additions and 18 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import { Box, Button, Chip, Drawer, IconButton, Stack, Typography } from "@mui/material";
|
||||
import type { VendorFacets } from "@/domain/vendors/types/vendor";
|
||||
import { VendorFilterOptions } from "./vendor-filter-options";
|
||||
import { emptyVendorFilters, type VendorFilters } from "./vendor-filters";
|
||||
import { VendorFiltersDrawerFields } from "./vendor-filters-drawer-fields";
|
||||
|
||||
interface VendorFiltersDrawerProps {
|
||||
open: boolean;
|
||||
|
|
@ -30,11 +30,6 @@ export function VendorFiltersDrawer({
|
|||
}
|
||||
}, [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 =
|
||||
draft.companies.length + draft.trades.length + draft.locations.length + draft.jobBuckets.length;
|
||||
|
||||
|
|
@ -84,16 +79,7 @@ export function VendorFiltersDrawer({
|
|||
</Stack>
|
||||
|
||||
<Box className="flex-1 overflow-y-auto" sx={{ px: 2.5 }}>
|
||||
<VendorFiltersDrawerFields
|
||||
draft={draft}
|
||||
setDraft={setDraft}
|
||||
options={{
|
||||
companies: companyOptions,
|
||||
trades: tradeOptions,
|
||||
locations: locationOptions,
|
||||
jobBuckets: jobBucketOptions,
|
||||
}}
|
||||
/>
|
||||
<VendorFilterOptions facets={facets} draft={draft} setDraft={setDraft} />
|
||||
</Box>
|
||||
|
||||
<Stack
|
||||
|
|
@ -109,7 +95,7 @@ export function VendorFiltersDrawer({
|
|||
Clear all
|
||||
</Button>
|
||||
<Button variant="contained" onClick={handleApply} fullWidth>
|
||||
Apply
|
||||
Apply filters
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue