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',
|
label: 'New Invoice',
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
content: (objectData, { onOk } = {}) => {
|
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',
|
name: 'post',
|
||||||
type: 'modal',
|
type: 'modal',
|
||||||
modalWidth: 520,
|
modalWidth: 520,
|
||||||
|
modalCentered: true,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
|
|||||||
@ -118,6 +118,7 @@ export const PartStock = {
|
|||||||
name: 'post',
|
name: 'post',
|
||||||
type: 'modal',
|
type: 'modal',
|
||||||
modalWidth: 520,
|
modalWidth: 520,
|
||||||
|
modalCentered: true,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
|
|||||||
@ -46,7 +46,11 @@ export const Payment = {
|
|||||||
label: 'New Payment',
|
label: 'New Payment',
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
content: (objectData, { onOk } = {}) => {
|
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',
|
name: 'post',
|
||||||
type: 'modal',
|
type: 'modal',
|
||||||
|
modalCentered: true,
|
||||||
modalWidth: 520,
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
|
|||||||
@ -120,6 +120,7 @@ export const ProductStock = {
|
|||||||
name: 'post',
|
name: 'post',
|
||||||
type: 'modal',
|
type: 'modal',
|
||||||
modalWidth: 520,
|
modalWidth: 520,
|
||||||
|
modalCentered: true,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
|
|||||||
@ -1,19 +1,24 @@
|
|||||||
import { createElement, lazy } from 'react'
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
const PurchaseOrderInfo = lazy(
|
const PurchaseOrderInfo = lazy(
|
||||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/PurchaseOrderInfo')
|
() =>
|
||||||
|
import('../../components/Dashboard/Inventory/PurchaseOrders/PurchaseOrderInfo')
|
||||||
)
|
)
|
||||||
const NewPurchaseOrder = lazy(
|
const NewPurchaseOrder = lazy(
|
||||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/NewPurchaseOrder')
|
() =>
|
||||||
|
import('../../components/Dashboard/Inventory/PurchaseOrders/NewPurchaseOrder')
|
||||||
)
|
)
|
||||||
const PostPurchaseOrder = lazy(
|
const PostPurchaseOrder = lazy(
|
||||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/PostPurchaseOrder')
|
() =>
|
||||||
|
import('../../components/Dashboard/Inventory/PurchaseOrders/PostPurchaseOrder')
|
||||||
)
|
)
|
||||||
const AcknowledgePurchaseOrder = lazy(
|
const AcknowledgePurchaseOrder = lazy(
|
||||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/AcknowledgePurchaseOrder')
|
() =>
|
||||||
|
import('../../components/Dashboard/Inventory/PurchaseOrders/AcknowledgePurchaseOrder')
|
||||||
)
|
)
|
||||||
const CancelPurchaseOrder = lazy(
|
const CancelPurchaseOrder = lazy(
|
||||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/CancelPurchaseOrder')
|
() =>
|
||||||
|
import('../../components/Dashboard/Inventory/PurchaseOrders/CancelPurchaseOrder')
|
||||||
)
|
)
|
||||||
const DeleteObject = lazy(
|
const DeleteObject = lazy(
|
||||||
() => import('../../components/Dashboard/common/DeleteObject')
|
() => import('../../components/Dashboard/common/DeleteObject')
|
||||||
@ -43,7 +48,11 @@ export const PurchaseOrder = {
|
|||||||
label: 'New Purchase Order',
|
label: 'New Purchase Order',
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
content: (objectData, { onOk } = {}) => {
|
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)
|
return !allowedStates.includes(objectData?.state?.type)
|
||||||
},
|
},
|
||||||
objectData: (objectData) => ({ orderType: 'purchaseOrder', order: objectData })
|
objectData: (objectData) => ({
|
||||||
|
orderType: 'purchaseOrder',
|
||||||
|
order: objectData
|
||||||
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'divider'
|
type: 'divider'
|
||||||
@ -164,6 +176,7 @@ export const PurchaseOrder = {
|
|||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
type: 'modal',
|
type: 'modal',
|
||||||
|
modalCentered: true,
|
||||||
modalWidth: 520,
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user