Skip to content

Commit

Permalink
Merge branch 'develop' into chore/update-icons
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen authored May 28, 2024
2 parents 71790cc + 32576a1 commit 8359c14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function Location(props: LocationProps) {
</div>

{/* ACTION*/}
<div className="flex h-[12px] grow-0 items-center gap-4 divide-x overflow-hidden">
<div className="flex grow-0 items-center gap-4 overflow-hidden">
<ActionMenu
groups={[
{
Expand All @@ -180,8 +180,9 @@ function Location(props: LocationProps) {
},
]}
/>
<div className="bg-ui-border-strong h-[12px] w-[1px]" />
<Button
className="text-ui-fg-interactive rounded-none pl-5 hover:bg-transparent active:bg-transparent"
className="text-ui-fg-interactive -ml-1 rounded-none"
onClick={() => navigate(`/settings/locations/${location.id}`)}
variant="transparent"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,9 @@ export const CreateReservationForm = () => {
resolver: zodResolver(CreateReservationSchema),
})

const { inventory_items } = useInventoryItems(
{
q: inventorySearch,
},
{
enabled: !!inventorySearch,
}
)
const { inventory_items } = useInventoryItems({
q: inventorySearch,
})

const inventoryItemId = form.watch("inventory_item_id")
const selectedInventoryItem = inventory_items?.find(
Expand Down Expand Up @@ -174,12 +169,12 @@ export const CreateReservationForm = () => {
<Form.Label>{t("fields.location")}</Form.Label>
<Form.Control>
<Combobox
disabled={!!selectedInventoryItem}
value={value}
onChange={(v) => {
onChange(v)
}}
{...field}
disabled={!inventoryItemId}
options={(stock_locations ?? []).map(
(stockLocation) => ({
label: stockLocation.name,
Expand Down Expand Up @@ -214,7 +209,7 @@ export const CreateReservationForm = () => {
title={t("inventory.available")}
value={
selectedLocationLevel
? selectedLocationLevel.available_quantity - quantity
? selectedLocationLevel.available_quantity - (quantity || 0)
: "-"
}
/>
Expand All @@ -233,7 +228,7 @@ export const CreateReservationForm = () => {
placeholder={t(
"inventory.reservation.quantityPlaceholder"
)}
min={0}
min={1}
max={
selectedLocationLevel
? selectedLocationLevel.available_quantity
Expand All @@ -250,6 +245,7 @@ export const CreateReservationForm = () => {
}
}}
{...field}
disabled={!inventoryItemId || !locationId}
/>
</Form.Control>
<Form.ErrorMessage />
Expand All @@ -268,6 +264,7 @@ export const CreateReservationForm = () => {
<Form.Control>
<Textarea
{...field}
disabled={!inventoryItemId || !locationId}
placeholder={t(
"inventory.reservation.descriptionPlaceholder"
)}
Expand Down

0 comments on commit 8359c14

Please sign in to comment.