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:
Rares Stefan
2023-03-10 15:43:18 +01:00
committed by GitHub
parent f97b3d7cce
commit d4af873113
5 changed files with 7 additions and 18 deletions
+5
View 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"> <div className="gap-x-large grid grid-cols-2">
<InputField <InputField
label="Company" label="Company"
placeholder="Medusa" placeholder="Company"
errors={errors} errors={errors}
{...register(path("company"), { {...register(path("company"), {
pattern: FormValidator.whiteSpaceRule("Company"), pattern: FormValidator.whiteSpaceRule("Company"),
@@ -51,14 +51,7 @@ const AllocateItemsModal: React.FC<AllocateItemsModalProps> = ({
const selectedLocation = useWatch({ control, name: "location" }) const selectedLocation = useWatch({ control, name: "location" })
// if not sales channel is present fetch all locations const { stock_locations, isLoading } = useAdminStockLocations()
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 locationOptions = useMemo(() => { const locationOptions = useMemo(() => {
if (!stock_locations) { if (!stock_locations) {
@@ -57,7 +57,6 @@ const CreateFulfillmentModal: React.FC<CreateFulfillmentModalProps> = ({
}, {}) }, {})
: {} : {}
) )
console.log({ orderToFulfill })
const [noNotis, setNoNotis] = useState(false) const [noNotis, setNoNotis] = useState(false)
const [errors, setErrors] = useState({}) const [errors, setErrors] = useState({})
const [locationSelectValue, setLocationSelectValue] = useState<{ const [locationSelectValue, setLocationSelectValue] = useState<{
@@ -106,14 +106,6 @@ const FulfillmentLine = ({
(locationId && (locationId &&
(!availableQuantity || quantities[item.id] < availableQuantity)) (!availableQuantity || quantities[item.id] < availableQuantity))
console.log({
validQuantity,
locationId,
availableQuantity,
quantities,
itemId: item.id,
})
React.useEffect(() => { React.useEffect(() => {
setErrors((errors) => { setErrors((errors) => {
if (validQuantity) { if (validQuantity) {