Enhance Invoice, Payment, ProductStock, and PartStock Models with Modal Centering and Code Formatting
Some checks are pending
farmcontrol/farmcontrol-ui/pipeline/head Build started...
Some checks are pending
farmcontrol/farmcontrol-ui/pipeline/head Build started...
- Added 'modalCentered' property to the 'post' modal in Invoice, Payment, ProductStock, and PartStock models to improve modal presentation. - Reformatted content return statements in Invoice, Payment, and PurchaseOrder models for better readability and consistency.
This commit is contained in:
parent
972fdb62ad
commit
b8adc777a4
@ -40,7 +40,11 @@ export const Invoice = {
|
||||
label: 'New Invoice',
|
||||
icon: PlusIcon,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(NewInvoice, { defaultValues: objectData, onOk, reset: true })
|
||||
return createElement(NewInvoice, {
|
||||
defaultValues: objectData,
|
||||
onOk,
|
||||
reset: true
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -131,6 +135,7 @@ export const Invoice = {
|
||||
name: 'post',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Post',
|
||||
icon: CheckIcon,
|
||||
visible: (objectData) => {
|
||||
|
||||
@ -118,6 +118,7 @@ export const PartStock = {
|
||||
name: 'post',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Post',
|
||||
icon: CheckIcon,
|
||||
disabled: (objectData) => {
|
||||
|
||||
@ -46,7 +46,11 @@ export const Payment = {
|
||||
label: 'New Payment',
|
||||
icon: PlusIcon,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(NewPayment, { defaultValues: objectData, onOk, reset: true })
|
||||
return createElement(NewPayment, {
|
||||
defaultValues: objectData,
|
||||
onOk,
|
||||
reset: true
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -121,6 +125,7 @@ export const Payment = {
|
||||
{
|
||||
name: 'post',
|
||||
type: 'modal',
|
||||
modalCentered: true,
|
||||
modalWidth: 520,
|
||||
label: 'Post',
|
||||
icon: CheckIcon,
|
||||
|
||||
@ -120,6 +120,7 @@ export const ProductStock = {
|
||||
name: 'post',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Post',
|
||||
icon: CheckIcon,
|
||||
disabled: (objectData) => {
|
||||
|
||||
@ -1,19 +1,24 @@
|
||||
import { createElement, lazy } from 'react'
|
||||
|
||||
const PurchaseOrderInfo = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/PurchaseOrderInfo')
|
||||
() =>
|
||||
import('../../components/Dashboard/Inventory/PurchaseOrders/PurchaseOrderInfo')
|
||||
)
|
||||
const NewPurchaseOrder = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/NewPurchaseOrder')
|
||||
() =>
|
||||
import('../../components/Dashboard/Inventory/PurchaseOrders/NewPurchaseOrder')
|
||||
)
|
||||
const PostPurchaseOrder = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/PostPurchaseOrder')
|
||||
() =>
|
||||
import('../../components/Dashboard/Inventory/PurchaseOrders/PostPurchaseOrder')
|
||||
)
|
||||
const AcknowledgePurchaseOrder = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/AcknowledgePurchaseOrder')
|
||||
() =>
|
||||
import('../../components/Dashboard/Inventory/PurchaseOrders/AcknowledgePurchaseOrder')
|
||||
)
|
||||
const CancelPurchaseOrder = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/CancelPurchaseOrder')
|
||||
() =>
|
||||
import('../../components/Dashboard/Inventory/PurchaseOrders/CancelPurchaseOrder')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
@ -43,7 +48,11 @@ export const PurchaseOrder = {
|
||||
label: 'New Purchase Order',
|
||||
icon: PlusIcon,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(NewPurchaseOrder, { defaultValues: objectData, onOk, reset: true })
|
||||
return createElement(NewPurchaseOrder, {
|
||||
defaultValues: objectData,
|
||||
onOk,
|
||||
reset: true
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -156,7 +165,10 @@ export const PurchaseOrder = {
|
||||
]
|
||||
return !allowedStates.includes(objectData?.state?.type)
|
||||
},
|
||||
objectData: (objectData) => ({ orderType: 'purchaseOrder', order: objectData })
|
||||
objectData: (objectData) => ({
|
||||
orderType: 'purchaseOrder',
|
||||
order: objectData
|
||||
})
|
||||
},
|
||||
{
|
||||
type: 'divider'
|
||||
@ -164,6 +176,7 @@ export const PurchaseOrder = {
|
||||
{
|
||||
name: 'post',
|
||||
type: 'modal',
|
||||
modalCentered: true,
|
||||
modalWidth: 520,
|
||||
label: 'Post',
|
||||
icon: CheckIcon,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user