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: () => {
|
finishEdit: () => {
|
||||||
objectFormRef?.current?.handleUpdate?.()
|
objectFormRef?.current?.handleUpdate?.()
|
||||||
return true
|
return true
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -196,7 +196,7 @@ const ShipmentInfo = () => {
|
|||||||
visibleProperties={{
|
visibleProperties={{
|
||||||
items: false
|
items: false
|
||||||
}}
|
}}
|
||||||
labelWidth='175px'
|
labelWidth='285px'
|
||||||
/>
|
/>
|
||||||
</InfoCollapse>
|
</InfoCollapse>
|
||||||
<InfoCollapse
|
<InfoCollapse
|
||||||
@ -210,7 +210,10 @@ const ShipmentInfo = () => {
|
|||||||
>
|
>
|
||||||
<ObjectTable
|
<ObjectTable
|
||||||
type='orderItem'
|
type='orderItem'
|
||||||
masterFilter={{ shipment: getModelByName('shipment').prefix + ':' + shipmentId }}
|
masterFilter={{
|
||||||
|
shipment:
|
||||||
|
getModelByName('shipment').prefix + ':' + shipmentId
|
||||||
|
}}
|
||||||
visibleColumns={{
|
visibleColumns={{
|
||||||
shipment: false,
|
shipment: false,
|
||||||
order: false,
|
order: false,
|
||||||
@ -234,7 +237,7 @@ const ShipmentInfo = () => {
|
|||||||
indicator={<LoadingOutlined />}
|
indicator={<LoadingOutlined />}
|
||||||
>
|
>
|
||||||
<Card>
|
<Card>
|
||||||
<NotesPanel _id={shipmentId} type='shipment' />
|
<NotesPanel _id={shipmentId} type='shipment' />
|
||||||
</Card>
|
</Card>
|
||||||
</Spin>
|
</Spin>
|
||||||
</InfoCollapse>
|
</InfoCollapse>
|
||||||
@ -251,10 +254,7 @@ const ShipmentInfo = () => {
|
|||||||
<ObjectTable
|
<ObjectTable
|
||||||
type='auditLog'
|
type='auditLog'
|
||||||
masterFilter={{
|
masterFilter={{
|
||||||
parent:
|
parent: getModelByName('shipment').prefix + ':' + shipmentId
|
||||||
getModelByName('shipment').prefix +
|
|
||||||
':' +
|
|
||||||
shipmentId
|
|
||||||
}}
|
}}
|
||||||
visibleColumns={{ _id: false, parent: false }}
|
visibleColumns={{ _id: false, parent: false }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -133,7 +133,7 @@ export const PurchaseOrder = {
|
|||||||
return objectData?.state?.type != 'draft'
|
return objectData?.state?.type != 'draft'
|
||||||
},
|
},
|
||||||
objectData: (objectData) => ({
|
objectData: (objectData) => ({
|
||||||
order: { _id: objectData._id },
|
order: { ...objectData },
|
||||||
orderType: 'purchaseOrder',
|
orderType: 'purchaseOrder',
|
||||||
syncAmount: 'itemCost'
|
syncAmount: 'itemCost'
|
||||||
})
|
})
|
||||||
@ -148,7 +148,7 @@ export const PurchaseOrder = {
|
|||||||
},
|
},
|
||||||
objectData: (objectData) => ({
|
objectData: (objectData) => ({
|
||||||
orderType: 'purchaseOrder',
|
orderType: 'purchaseOrder',
|
||||||
order: { _id: objectData._id }
|
order: { ...objectData }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -167,7 +167,7 @@ export const PurchaseOrder = {
|
|||||||
},
|
},
|
||||||
objectData: (objectData) => ({
|
objectData: (objectData) => ({
|
||||||
orderType: 'purchaseOrder',
|
orderType: 'purchaseOrder',
|
||||||
order: objectData
|
order: { ...objectData }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user