Refactor DocumentTemplateInfo and Model Definitions for Consistency and Clarity
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good

- Adjusted formatting in DocumentTemplateInfo component for improved readability and consistency.
- Updated DocumentTemplate and EmailTemplate models to include 'updatedAt' field with appropriate properties for better data tracking.
- Refined file field definitions in both models to enhance clarity and functionality, including master filters and thumbnail support.
This commit is contained in:
Tom Butcher 2026-09-13 19:34:34 +01:00
parent e610290465
commit 8dd55a4257
3 changed files with 31 additions and 26 deletions

View File

@ -200,7 +200,7 @@ const DocumentTemplateInfo = () => {
testObject: false,
resources: false
}}
labelWidth='190px'
labelWidth='210px'
/>
</InfoCollapse>
<InfoCollapse
@ -213,10 +213,7 @@ const DocumentTemplateInfo = () => {
collapseKey='resources'
>
<ObjectProperty
{...getModelProperty(
'documentTemplate',
'resources'
)}
{...getModelProperty('documentTemplate', 'resources')}
isEditing={isEditing}
objectData={objectData}
loading={loading}
@ -240,7 +237,10 @@ const DocumentTemplateInfo = () => {
indicator={<LoadingOutlined />}
>
<Card>
<NotesPanel _id={documentTemplateId} type='documentTemplate' />
<NotesPanel
_id={documentTemplateId}
type='documentTemplate'
/>
</Card>
</Spin>
</InfoCollapse>

View File

@ -222,6 +222,13 @@ export const DocumentTemplate = {
readOnly: true,
columnWidth: 180
},
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 200
},
{
name: 'name',
label: 'Name',
@ -230,13 +237,7 @@ export const DocumentTemplate = {
columnWidth: 200,
columnFixed: 'left'
},
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 200
},
{
name: 'objectType',
label: 'Object Type',
@ -337,12 +338,14 @@ export const DocumentTemplate = {
},
{
name: 'file',
label: 'File',
type: 'object',
objectType: 'file',
required: true,
type: 'file',
label: 'File',
showPreview: false,
showHyperlink: true,
columnWidth: 230
masterFilter: ['.pdf', '.jpeg', '.png', '.svg', '.gif'],
thumbnail: true,
columnWidth: 200
}
]
},

View File

@ -319,12 +319,14 @@ export const EmailTemplate = {
},
{
name: 'file',
label: 'File',
type: 'object',
objectType: 'file',
required: true,
label: 'File',
type: 'file',
showPreview: false,
showHyperlink: true,
columnWidth: 230
masterFilter: ['.pdf', '.jpeg', '.png', '.svg', '.gif'],
thumbnail: true,
columnWidth: 200
}
]
},