Remove warehouse selection for preorder cases on fulfill page (#2515)

This commit is contained in:
Michał Droń 2022-11-25 14:59:11 +01:00 committed by GitHub
parent 7933ecf482
commit 4f78d00534
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 19 deletions

View file

@ -164,6 +164,9 @@ export const OrderFulfillLine: React.FC<OrderFulfillLineProps> = props => {
: "-"} : "-"}
</TableCell> </TableCell>
<TableCell className={classes.colWarehouse}> <TableCell className={classes.colWarehouse}>
{isPreorder ? (
"-"
) : (
<IconButton <IconButton
onClick={onWarehouseChange} onClick={onWarehouseChange}
className={classNames( className={classNames(
@ -180,6 +183,7 @@ export const OrderFulfillLine: React.FC<OrderFulfillLineProps> = props => {
<ChevronIcon /> <ChevronIcon />
</div> </div>
</IconButton> </IconButton>
)}
</TableCell> </TableCell>
</TableRowLink> </TableRowLink>
); );

View file

@ -163,9 +163,9 @@ const OrderFulfillPage: React.FC<OrderFulfillPageProps> = props => {
!shopSettings?.fulfillmentAllowUnpaid && !shopSettings?.fulfillmentAllowUnpaid &&
!order?.isPaid; !order?.isPaid;
const areWarehousesSet = formsetData.every(line => const areWarehousesSet = formsetData
line.value.every(v => v.warehouse), .filter(item => !!item?.value) // preorder case
); .every(line => line.value.every(v => v.warehouse));
const shouldEnableSave = () => { const shouldEnableSave = () => {
if (!order || loading) { if (!order || loading) {