feat(admin-ui): Filter reservations (#4115)
* initial filter * clenaup * reser filters correctly * filter reservations * ensure reset works * update types * add adjustment icon * pr prep * update filtering with proper description handling * location filter updates and search removal * removed greyed out dates + add created_by filtering * update filtering with proper ordering * filter out selected users * fix array issues * update spacing for searchable queries * fix deselection bug for inventory item search * update date filter; * rename const a to initialFilters * fix re-render issue * ui updates * update inventory filter to remove selected items * fix width * fix truncation for button text if desired * add span classes * add "go to reservations" popover * add tooltip if location text is truncated * fix long items * typing * minor fix for select value * fix reservation quantity field updates * add pb * Update packages/admin-ui/ui/src/components/templates/reservations-table/index.tsx Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * feedback * add changeset --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useEffect, useMemo } from "react"
|
||||
import { useAdminStockLocations } from "medusa-react"
|
||||
|
||||
import { NextSelect } from "../select/next-select"
|
||||
import { StockLocationDTO } from "@medusajs/types"
|
||||
import { useAdminStockLocations } from "medusa-react"
|
||||
|
||||
const LocationDropdown = ({
|
||||
selectedLocation,
|
||||
@@ -19,7 +21,10 @@ const LocationDropdown = ({
|
||||
|
||||
const selectedLocObj = useMemo(() => {
|
||||
if (!isLoading && locations) {
|
||||
return locations.find((l) => l.id === selectedLocation) ?? locations[0]
|
||||
return (
|
||||
locations.find((l: StockLocationDTO) => l.id === selectedLocation) ??
|
||||
locations[0]
|
||||
)
|
||||
}
|
||||
}, [selectedLocation, locations, isLoading])
|
||||
|
||||
@@ -33,7 +38,7 @@ const LocationDropdown = ({
|
||||
onChange={(loc) => {
|
||||
onChange(loc!.value)
|
||||
}}
|
||||
options={locations.map((l) => ({
|
||||
options={locations.map((l: StockLocationDTO) => ({
|
||||
label: l.name,
|
||||
value: l.id,
|
||||
}))}
|
||||
|
||||
Reference in New Issue
Block a user