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'>
|
<Space size='small'>
|
||||||
<ObjectActions
|
<ObjectActions
|
||||||
type='documentTemplate'
|
type='documentTemplate'
|
||||||
pageName='info'
|
pageName='info'
|
||||||
id={documentTemplateId}
|
id={documentTemplateId}
|
||||||
disabled={objectFormState.loading}
|
disabled={objectFormState.loading}
|
||||||
objectData={objectFormState.objectData}
|
objectData={objectFormState.objectData}
|
||||||
@ -200,7 +200,7 @@ const DocumentTemplateInfo = () => {
|
|||||||
testObject: false,
|
testObject: false,
|
||||||
resources: false
|
resources: false
|
||||||
}}
|
}}
|
||||||
labelWidth='190px'
|
labelWidth='210px'
|
||||||
/>
|
/>
|
||||||
</InfoCollapse>
|
</InfoCollapse>
|
||||||
<InfoCollapse
|
<InfoCollapse
|
||||||
@ -213,10 +213,7 @@ const DocumentTemplateInfo = () => {
|
|||||||
collapseKey='resources'
|
collapseKey='resources'
|
||||||
>
|
>
|
||||||
<ObjectProperty
|
<ObjectProperty
|
||||||
{...getModelProperty(
|
{...getModelProperty('documentTemplate', 'resources')}
|
||||||
'documentTemplate',
|
|
||||||
'resources'
|
|
||||||
)}
|
|
||||||
isEditing={isEditing}
|
isEditing={isEditing}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
@ -240,7 +237,10 @@ const DocumentTemplateInfo = () => {
|
|||||||
indicator={<LoadingOutlined />}
|
indicator={<LoadingOutlined />}
|
||||||
>
|
>
|
||||||
<Card>
|
<Card>
|
||||||
<NotesPanel _id={documentTemplateId} type='documentTemplate' />
|
<NotesPanel
|
||||||
|
_id={documentTemplateId}
|
||||||
|
type='documentTemplate'
|
||||||
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
</Spin>
|
</Spin>
|
||||||
</InfoCollapse>
|
</InfoCollapse>
|
||||||
@ -260,10 +260,10 @@ const DocumentTemplateInfo = () => {
|
|||||||
<ObjectTable
|
<ObjectTable
|
||||||
type='auditLog'
|
type='auditLog'
|
||||||
masterFilter={{
|
masterFilter={{
|
||||||
parent:
|
parent:
|
||||||
getModelByName('documentTemplate').prefix +
|
getModelByName('documentTemplate').prefix +
|
||||||
':' +
|
':' +
|
||||||
documentTemplateId
|
documentTemplateId
|
||||||
}}
|
}}
|
||||||
visibleColumns={{ _id: false, parent: false }}
|
visibleColumns={{ _id: false, parent: false }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -222,6 +222,13 @@ export const DocumentTemplate = {
|
|||||||
readOnly: true,
|
readOnly: true,
|
||||||
columnWidth: 180
|
columnWidth: 180
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'updatedAt',
|
||||||
|
label: 'Updated At',
|
||||||
|
type: 'dateTime',
|
||||||
|
readOnly: true,
|
||||||
|
columnWidth: 200
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'name',
|
name: 'name',
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
@ -230,13 +237,7 @@ export const DocumentTemplate = {
|
|||||||
columnWidth: 200,
|
columnWidth: 200,
|
||||||
columnFixed: 'left'
|
columnFixed: 'left'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'updatedAt',
|
|
||||||
label: 'Updated At',
|
|
||||||
type: 'dateTime',
|
|
||||||
readOnly: true,
|
|
||||||
columnWidth: 200
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'objectType',
|
name: 'objectType',
|
||||||
label: 'Object Type',
|
label: 'Object Type',
|
||||||
@ -337,12 +338,14 @@ export const DocumentTemplate = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'file',
|
name: 'file',
|
||||||
label: 'File',
|
|
||||||
type: 'object',
|
|
||||||
objectType: 'file',
|
|
||||||
required: true,
|
required: true,
|
||||||
|
type: 'file',
|
||||||
|
label: 'File',
|
||||||
|
showPreview: false,
|
||||||
showHyperlink: true,
|
showHyperlink: true,
|
||||||
columnWidth: 230
|
masterFilter: ['.pdf', '.jpeg', '.png', '.svg', '.gif'],
|
||||||
|
thumbnail: true,
|
||||||
|
columnWidth: 200
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@ -319,12 +319,14 @@ export const EmailTemplate = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'file',
|
name: 'file',
|
||||||
label: 'File',
|
|
||||||
type: 'object',
|
|
||||||
objectType: 'file',
|
|
||||||
required: true,
|
required: true,
|
||||||
|
label: 'File',
|
||||||
|
type: 'file',
|
||||||
|
showPreview: false,
|
||||||
showHyperlink: true,
|
showHyperlink: true,
|
||||||
columnWidth: 230
|
masterFilter: ['.pdf', '.jpeg', '.png', '.svg', '.gif'],
|
||||||
|
thumbnail: true,
|
||||||
|
columnWidth: 200
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user