Add Word Document Download Option and Update Email Template Model
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
- Introduced a new option to download document templates in Word (docx) format in the NewDocumentJob component. - Updated the EmailTemplate model to include 'docx' as a selectable format for email templates, enhancing document handling capabilities.
This commit is contained in:
parent
5f4f91dca5
commit
ab638e398e
@ -218,6 +218,23 @@ const NewDocumentJob = ({ onOk, defaultValues = {} }) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Word',
|
||||||
|
key: 'docx',
|
||||||
|
onClick: () => {
|
||||||
|
setDownloading(true)
|
||||||
|
downloadTemplate(
|
||||||
|
objectData.documentTemplate._id,
|
||||||
|
objectData.documentTemplate.content,
|
||||||
|
toTemplateObjectData(objectData.objects),
|
||||||
|
fileName,
|
||||||
|
'docx',
|
||||||
|
() => {
|
||||||
|
setDownloading(false)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -387,7 +387,8 @@ export const EmailTemplate = {
|
|||||||
{ value: 'pdf', label: 'PDF' },
|
{ value: 'pdf', label: 'PDF' },
|
||||||
{ value: 'jpeg', label: 'JPEG' },
|
{ value: 'jpeg', label: 'JPEG' },
|
||||||
{ value: 'png', label: 'PNG' },
|
{ value: 'png', label: 'PNG' },
|
||||||
{ value: 'svg', label: 'SVG' }
|
{ value: 'svg', label: 'SVG' },
|
||||||
|
{ value: 'docx', label: 'Word' }
|
||||||
],
|
],
|
||||||
value: (row) => {
|
value: (row) => {
|
||||||
if (row?.type === 'documentTemplate') {
|
if (row?.type === 'documentTemplate') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user