Refactor DocumentTemplateInfo and Model Definitions for Consistency and Clarity
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
- 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:
parent
e610290465
commit
8dd55a4257
@ -105,7 +105,7 @@ const DocumentTemplateInfo = () => {
|
||||
<Space size='small'>
|
||||
<ObjectActions
|
||||
type='documentTemplate'
|
||||
pageName='info'
|
||||
pageName='info'
|
||||
id={documentTemplateId}
|
||||
disabled={objectFormState.loading}
|
||||
objectData={objectFormState.objectData}
|
||||
@ -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>
|
||||
@ -260,10 +260,10 @@ const DocumentTemplateInfo = () => {
|
||||
<ObjectTable
|
||||
type='auditLog'
|
||||
masterFilter={{
|
||||
parent:
|
||||
getModelByName('documentTemplate').prefix +
|
||||
':' +
|
||||
documentTemplateId
|
||||
parent:
|
||||
getModelByName('documentTemplate').prefix +
|
||||
':' +
|
||||
documentTemplateId
|
||||
}}
|
||||
visibleColumns={{ _id: false, parent: false }}
|
||||
/>
|
||||
|
||||
@ -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
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -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
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user