From cd97bc6a195ac3ddc98ff52c55664e80c9767224 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 4 Oct 2022 11:18:59 +0100 Subject: [PATCH] File upload file type exclusions and language variations --- components/elements/index.js | 19 ++++++++++++++----- locales/cy/newappeal.json | 4 +++- locales/en/newappeal.json | 4 +++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/components/elements/index.js b/components/elements/index.js index 6fc76b5e..111e05dd 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -1290,6 +1290,7 @@ const rejectStyle = { const RenderFileUpload = (field) => { const files = field.input.value; let { t } = useTranslation(); + const style = useMemo( () => ({ ...baseStyle, @@ -1478,10 +1479,7 @@ const RenderFileUpload = (field) => { return ( <> - // field.input.onChange(filesToUpload) - // } - + accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/tiff,image/jpeg,application/zip" onDrop={(filesToUpload, e) => { const renamedAcceptedFiles = filesToUpload.map( (file) => @@ -1508,7 +1506,18 @@ const RenderFileUpload = (field) => {
{" "} -
Drag and drop your files here.
+
+ {t( + "newappeal:new-appeal-fileupload-drop-label" + )} +
+ + ( + {t( + "newappeal:new-appeal-fileupload-file-list-label" + )} + ) +
diff --git a/locales/cy/newappeal.json b/locales/cy/newappeal.json index ae12bc98..f8a9dd01 100644 --- a/locales/cy/newappeal.json +++ b/locales/cy/newappeal.json @@ -55,5 +55,7 @@ "new-appeal-agricultural-holding-option-NA": "(b) (ii) Mae safle’r apêl yn ddaliad amaethyddol neu’n rhan o ddaliad amaethyddol ac mae’r apelydd (neu’r asiant) wedi rhoi’r hysbysiad gofynnol i bob person (ac eithrio’r apelydd) sydd, ar y diwrnod 21 diwrnod cyn y dyddiad o’r apêl, a oedd yn denant daliad amaethyddol ar y cyfan neu ran o’r tir y mae’r apêl yn ymwneud ag ef fel a restrir isod:", "new-appeal-procedure-option-virtual": "Rhith", "new-appeal-procedure-option-inperson": "Yn bersonol", - "new-appeal-procedure-option-hybrid": "Hybrid" + "new-appeal-procedure-option-hybrid": "Hybrid", + "new-appeal-fileupload-drop-label": "Llusgwch a gollwng eich ffeiliau yma.", + "new-appeal-fileupload-file-list-label": "Dim ond ffeiliau .pdf, .doc, .docx, .tif, .tiff, .jpeg, .jpg neu .zip a dderbynnir" } \ No newline at end of file diff --git a/locales/en/newappeal.json b/locales/en/newappeal.json index a19f74ac..0c96680a 100644 --- a/locales/en/newappeal.json +++ b/locales/en/newappeal.json @@ -55,5 +55,7 @@ "new-appeal-agricultural-holding-option-NA": "(b) (ii) The appeal site is, or is part of, an agricultural holding and the appellant (or the agent) has given the requisite notice to every person (other than the appellant) who, on the day 21 days before the date of the appeal, was a tenant of anagricultural holding on all or part of the land to which the appeal relates as listed below:", "new-appeal-procedure-option-virtual": "Virtual", "new-appeal-procedure-option-inperson": "In person", - "new-appeal-procedure-option-hybrid": "Hybrid" + "new-appeal-procedure-option-hybrid": "Hybrid", + "new-appeal-fileupload-drop-label": "Drag and drop your files here.", + "new-appeal-fileupload-file-list-label": "Only .pdf, .doc, .docx, .tif, .tiff, .jpeg, .jpg or .zip files will be accepted" } \ No newline at end of file