Refactor ShipmentInfo and PurchaseOrder Models for Improved Clarity and Functionality
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Updated ShipmentInfo component to enhance code readability by adjusting label widths and formatting masterFilter properties. - Refactored PurchaseOrder model to spread objectData properties, improving data handling and consistency across order-related functionalities.
This commit is contained in:
parent
9b309aa61c
commit
a41f168adc
@ -87,7 +87,7 @@ const ShipmentInfo = () => {
|
||||
finishEdit: () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -196,7 +196,7 @@ const ShipmentInfo = () => {
|
||||
visibleProperties={{
|
||||
items: false
|
||||
}}
|
||||
labelWidth='175px'
|
||||
labelWidth='285px'
|
||||
/>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
@ -210,7 +210,10 @@ const ShipmentInfo = () => {
|
||||
>
|
||||
<ObjectTable
|
||||
type='orderItem'
|
||||
masterFilter={{ shipment: getModelByName('shipment').prefix + ':' + shipmentId }}
|
||||
masterFilter={{
|
||||
shipment:
|
||||
getModelByName('shipment').prefix + ':' + shipmentId
|
||||
}}
|
||||
visibleColumns={{
|
||||
shipment: false,
|
||||
order: false,
|
||||
@ -234,7 +237,7 @@ const ShipmentInfo = () => {
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<NotesPanel _id={shipmentId} type='shipment' />
|
||||
<NotesPanel _id={shipmentId} type='shipment' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</InfoCollapse>
|
||||
@ -251,10 +254,7 @@ const ShipmentInfo = () => {
|
||||
<ObjectTable
|
||||
type='auditLog'
|
||||
masterFilter={{
|
||||
parent:
|
||||
getModelByName('shipment').prefix +
|
||||
':' +
|
||||
shipmentId
|
||||
parent: getModelByName('shipment').prefix + ':' + shipmentId
|
||||
}}
|
||||
visibleColumns={{ _id: false, parent: false }}
|
||||
/>
|
||||
|
||||
@ -133,7 +133,7 @@ export const PurchaseOrder = {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
objectData: (objectData) => ({
|
||||
order: { _id: objectData._id },
|
||||
order: { ...objectData },
|
||||
orderType: 'purchaseOrder',
|
||||
syncAmount: 'itemCost'
|
||||
})
|
||||
@ -148,7 +148,7 @@ export const PurchaseOrder = {
|
||||
},
|
||||
objectData: (objectData) => ({
|
||||
orderType: 'purchaseOrder',
|
||||
order: { _id: objectData._id }
|
||||
order: { ...objectData }
|
||||
})
|
||||
},
|
||||
{
|
||||
@ -167,7 +167,7 @@ export const PurchaseOrder = {
|
||||
},
|
||||
objectData: (objectData) => ({
|
||||
orderType: 'purchaseOrder',
|
||||
order: objectData
|
||||
order: { ...objectData }
|
||||
})
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user