diff --git a/schema/add-assistive-tech.schema.js b/schema/add-assistive-tech.schema.js index 2834c630a..7a52dd3ab 100644 --- a/schema/add-assistive-tech.schema.js +++ b/schema/add-assistive-tech.schema.js @@ -73,20 +73,13 @@ const schema = Joi.object({ }), issuesDiscovered: Joi.string() - .optional() - .allow(null, '') + .required() .custom((value, helpers) => maxWords(value, helpers, 250)) .messages({ + 'any.required': 'Enter details about issues discovered by the assistive technology testing', + 'string.empty': 'Enter details about issues discovered by the assistive technology testing', 'custom.max.words': 'Enter 250 words or less' }), - - accessibilityReport: Joi.string() - .allow('') - .pattern(/\.pdf$/i) - .messages({ - 'string.pattern.base': 'The file must be a PDF' - }) - .optional() }) module.exports = schema diff --git a/schema/add-external-audit.schema.js b/schema/add-external-audit.schema.js index 1d9a6cf81..70ed57dde 100644 --- a/schema/add-external-audit.schema.js +++ b/schema/add-external-audit.schema.js @@ -82,19 +82,12 @@ const schema = Joi.object({ 'any.invalid': '{{#message}}' }), - accessibilityReport: Joi.string() - .allow('') - .pattern(/\.pdf$/i) - .messages({ - 'string.pattern.base': 'The file must be a PDF' - }) - .optional(), - issuesDiscovered: Joi.string() - .optional() - .allow(null, '') + .required() .custom((value, helpers) => maxWords(value, helpers, 250)) .messages({ + 'any.required': 'Enter details about issues discovered by the external audit', + 'string.empty': 'Enter details about issues discovered by the external audit', 'custom.max.words': 'Enter 250 words or less' }) }) diff --git a/schema/add-internal-audit.schema.js b/schema/add-internal-audit.schema.js index d4b592e0a..5206ef359 100644 --- a/schema/add-internal-audit.schema.js +++ b/schema/add-internal-audit.schema.js @@ -80,19 +80,12 @@ const schema = Joi.object({ 'any.invalid': '{{#message}}' }), - accessibilityReport: Joi.string() - .allow('') - .pattern(/\.pdf$/i) - .messages({ - 'string.pattern.base': 'The file must be a PDF' - }) - .optional(), - issuesDiscovered: Joi.string() - .optional() - .allow(null, '') + .required() .custom((value, helpers) => maxWords(value, helpers, 250)) .messages({ + 'any.required': 'Enter details about issues discovered by the internal review', + 'string.empty': 'Enter details about issues discovered by the internal review', 'custom.max.words': 'Enter 250 words or less' }) }) diff --git a/views/community/pages/add-assistive-tech.njk b/views/community/pages/add-assistive-tech.njk index 5c5879c13..9b0bf56f3 100644 --- a/views/community/pages/add-assistive-tech.njk +++ b/views/community/pages/add-assistive-tech.njk @@ -9,8 +9,6 @@ {% from "govuk/components/tag/macro.njk" import govukTag %} {% extends "base.njk" %} -{% set uploadedFileName = formData.accessibilityReport.originalname if formData.accessibilityReport.originalname else file.originalname %} - {% block content %}