Compare commits
No commits in common. "46cc8f89d8ec5c7128b48d9410b7d9113e7b9ade" and "cd89dff9fac6f52562768fcd4875742033050696" have entirely different histories.
46cc8f89d8
...
cd89dff9fa
|
|
@ -72,7 +72,7 @@ export const OrderTable = () => {
|
||||||
const tableHeight = calculateTableHeight(rows.length, 10);
|
const tableHeight = calculateTableHeight(rows.length, 10);
|
||||||
|
|
||||||
const mobileTableHeight = calculateTableHeight(rows.length, 5, {
|
const mobileTableHeight = calculateTableHeight(rows.length, 5, {
|
||||||
minHeight: 500,
|
minHeight: 300,
|
||||||
rowHeight: 40,
|
rowHeight: 40,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ interface LocalFilters {
|
||||||
sellerName: string | null;
|
sellerName: string | null;
|
||||||
deliveryType: string[] | null;
|
deliveryType: string[] | null;
|
||||||
statusTransfer: string[] | null;
|
statusTransfer: string[] | null;
|
||||||
markName: string | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DELIVERY_TYPES = ['RI', 'EN', 'EF', 'RP'];
|
const DELIVERY_TYPES = ['RI', 'EN', 'EF', 'RP'];
|
||||||
|
|
@ -82,7 +81,6 @@ const getInitialLocalFilters = (
|
||||||
sellerName: urlFilters.sellerName ?? null,
|
sellerName: urlFilters.sellerName ?? null,
|
||||||
deliveryType: urlFilters.deliveryType ?? null,
|
deliveryType: urlFilters.deliveryType ?? null,
|
||||||
statusTransfer: urlFilters.statusTransfer ?? null,
|
statusTransfer: urlFilters.statusTransfer ?? null,
|
||||||
markName: urlFilters.markName ?? null,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const SearchBar = () => {
|
export const SearchBar = () => {
|
||||||
|
|
@ -146,7 +144,6 @@ export const SearchBar = () => {
|
||||||
productName: null,
|
productName: null,
|
||||||
deliveryType: null,
|
deliveryType: null,
|
||||||
statusTransfer: null,
|
statusTransfer: null,
|
||||||
markName: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
setLocalFilters(getInitialLocalFilters(resetState));
|
setLocalFilters(getInitialLocalFilters(resetState));
|
||||||
|
|
@ -213,7 +210,6 @@ export const SearchBar = () => {
|
||||||
localFilters.productId,
|
localFilters.productId,
|
||||||
localFilters.deliveryType?.length,
|
localFilters.deliveryType?.length,
|
||||||
localFilters.statusTransfer?.length,
|
localFilters.statusTransfer?.length,
|
||||||
localFilters.markName,
|
|
||||||
].filter(Boolean).length;
|
].filter(Boolean).length;
|
||||||
|
|
||||||
const toggleDrawer = (open: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
const toggleDrawer = (open: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
||||||
|
|
@ -315,19 +311,6 @@ export const SearchBar = () => {
|
||||||
Limpar
|
Limpar
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="primary"
|
|
||||||
size="small"
|
|
||||||
onClick={handleFilter}
|
|
||||||
disabled={!isDateValid || !!dateError || isFetching}
|
|
||||||
startIcon={isFetching ? <CircularProgress size={16} color="inherit" /> : <SearchIcon />}
|
|
||||||
fullWidth
|
|
||||||
sx={{ textTransform: 'none', minWidth: { xs: '100%', sm: 100 } }}
|
|
||||||
>
|
|
||||||
Buscar
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Badge badgeContent={activeDrawerFiltersCount} color="primary" sx={{ width: { xs: '100%', sm: 'auto' } }}>
|
<Badge badgeContent={activeDrawerFiltersCount} color="primary" sx={{ width: { xs: '100%', sm: 'auto' } }}>
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|
@ -341,6 +324,19 @@ export const SearchBar = () => {
|
||||||
Filtros
|
Filtros
|
||||||
</Button>
|
</Button>
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
size="small"
|
||||||
|
onClick={handleFilter}
|
||||||
|
disabled={!isDateValid || !!dateError || isFetching}
|
||||||
|
startIcon={isFetching ? <CircularProgress size={16} color="inherit" /> : <SearchIcon />}
|
||||||
|
fullWidth
|
||||||
|
sx={{ textTransform: 'none', minWidth: { xs: '100%', sm: 100 } }}
|
||||||
|
>
|
||||||
|
Buscar
|
||||||
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
@ -434,17 +430,8 @@ export const SearchBar = () => {
|
||||||
updateLocalFilter('sellerId', newValue?.seller.id.toString() || null);
|
updateLocalFilter('sellerId', newValue?.seller.id.toString() || null);
|
||||||
updateLocalFilter('sellerName', newValue?.seller.name || null);
|
updateLocalFilter('sellerName', newValue?.seller.name || null);
|
||||||
}}
|
}}
|
||||||
isOptionEqualToValue={(option, value) => option.value === value.value}
|
|
||||||
loading={sellers.isLoading}
|
loading={sellers.isLoading}
|
||||||
renderInput={(params) => <TextField {...params} label="Vendedor" placeholder="Selecione vendedor" />}
|
renderInput={(params) => <TextField {...params} label="Vendedor" placeholder="Selecione vendedor" />}
|
||||||
renderOption={(props, option) => {
|
|
||||||
const { key, ...restProps } = props;
|
|
||||||
return (
|
|
||||||
<li key={option.id} {...restProps}>
|
|
||||||
{option.label}
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Parceiro */}
|
{/* Parceiro */}
|
||||||
|
|
@ -481,16 +468,6 @@ export const SearchBar = () => {
|
||||||
filterOptions={(x) => x}
|
filterOptions={(x) => x}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Marca */}
|
|
||||||
<Autocomplete
|
|
||||||
freeSolo
|
|
||||||
size="small"
|
|
||||||
options={[]}
|
|
||||||
value={localFilters.markName ?? ''}
|
|
||||||
onInputChange={(_, newValue) => updateLocalFilter('markName', newValue || null)}
|
|
||||||
renderInput={(params) => <TextField {...params} label="Marca" placeholder="Digite a marca..." />}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Tipo de Entrega */}
|
{/* Tipo de Entrega */}
|
||||||
<Autocomplete
|
<Autocomplete
|
||||||
multiple
|
multiple
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ export const useOrderFilters = () => {
|
||||||
searchTriggered: parseAsBoolean.withDefault(false),
|
searchTriggered: parseAsBoolean.withDefault(false),
|
||||||
deliveryType: parseAsArrayOf(parseAsString, ','),
|
deliveryType: parseAsArrayOf(parseAsString, ','),
|
||||||
statusTransfer: parseAsArrayOf(parseAsString, ','),
|
statusTransfer: parseAsArrayOf(parseAsString, ','),
|
||||||
markName: parseAsString,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shallow: true,
|
shallow: true,
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,6 @@ export const orderApiParamsSchema = findOrdersSchema
|
||||||
|
|
||||||
if (filters.partnerId) queryParams.partnerId = filters.partnerId;
|
if (filters.partnerId) queryParams.partnerId = filters.partnerId;
|
||||||
if (filters.productId) queryParams.productId = filters.productId;
|
if (filters.productId) queryParams.productId = filters.productId;
|
||||||
if (filters.markName) queryParams.markName = filters.markName;
|
|
||||||
|
|
||||||
return queryParams;
|
return queryParams;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue