fix(admin-ui): Show all locations in allocation creation modal (#3448)
* Remove SC constraint from allocation location options * Create tricky-peas-clean.md * Update company field placeholder in address form
This commit is contained in:
5
.changeset/tricky-peas-clean.md
Normal file
5
.changeset/tricky-peas-clean.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
---
|
||||
|
||||
fix(admin): Show all locations in allocation creation modal
|
||||
@@ -63,7 +63,7 @@ const AddressForm = ({
|
||||
<div className="gap-x-large grid grid-cols-2">
|
||||
<InputField
|
||||
label="Company"
|
||||
placeholder="Medusa"
|
||||
placeholder="Company"
|
||||
errors={errors}
|
||||
{...register(path("company"), {
|
||||
pattern: FormValidator.whiteSpaceRule("Company"),
|
||||
|
||||
@@ -51,14 +51,7 @@ const AllocateItemsModal: React.FC<AllocateItemsModalProps> = ({
|
||||
|
||||
const selectedLocation = useWatch({ control, name: "location" })
|
||||
|
||||
// if not sales channel is present fetch all locations
|
||||
const stockLocationsFilter: { sales_channel_id?: string } = {}
|
||||
if (order.sales_channel_id) {
|
||||
stockLocationsFilter.sales_channel_id = order.sales_channel_id
|
||||
}
|
||||
|
||||
const { stock_locations, isLoading } =
|
||||
useAdminStockLocations(stockLocationsFilter)
|
||||
const { stock_locations, isLoading } = useAdminStockLocations()
|
||||
|
||||
const locationOptions = useMemo(() => {
|
||||
if (!stock_locations) {
|
||||
|
||||
@@ -57,7 +57,6 @@ const CreateFulfillmentModal: React.FC<CreateFulfillmentModalProps> = ({
|
||||
}, {})
|
||||
: {}
|
||||
)
|
||||
console.log({ orderToFulfill })
|
||||
const [noNotis, setNoNotis] = useState(false)
|
||||
const [errors, setErrors] = useState({})
|
||||
const [locationSelectValue, setLocationSelectValue] = useState<{
|
||||
|
||||
@@ -106,14 +106,6 @@ const FulfillmentLine = ({
|
||||
(locationId &&
|
||||
(!availableQuantity || quantities[item.id] < availableQuantity))
|
||||
|
||||
console.log({
|
||||
validQuantity,
|
||||
locationId,
|
||||
availableQuantity,
|
||||
quantities,
|
||||
itemId: item.id,
|
||||
})
|
||||
|
||||
React.useEffect(() => {
|
||||
setErrors((errors) => {
|
||||
if (validQuantity) {
|
||||
|
||||
Reference in New Issue
Block a user