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 %}
{% if backLink %} @@ -64,26 +62,6 @@ } }) }} - - -{{ govukFileUpload({ - id: "accessibility-report", - name: "accessibilityReport", - label: { - text: "Upload the report (optional)", - isPageHeading: true, - classes: "govuk-label--m" - }, - hint: { - text: "The file needs to be a PDF and smaller than 10MB." - }, - errorMessage: formErrors.accessibilityReport, - value: formData.accessibilityReport, - attributes: { - accept: ".pdf" - } - }) }} - {{ govukCharacterCount({ id: "issues-discovered", name: "issuesDiscovered", @@ -97,22 +75,6 @@ value: formData.issuesDiscovered }) }} - {% if uploadedFileName %} - - {{ govukSummaryList({ - classes: 'govuk-summary-list--long-key', - rows: [ - { - key: { - text: "File" - }, - value: { - text: uploadedFileName - } - } - ] - }) }} - {% endif %}
diff --git a/views/community/pages/add-external-audit.njk b/views/community/pages/add-external-audit.njk index 67d533eef..4571883f4 100644 --- a/views/community/pages/add-external-audit.njk +++ b/views/community/pages/add-external-audit.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 %}
{% if backLink %} @@ -73,41 +71,6 @@ } }) }} - -{{ govukFileUpload({ - id: "accessibility-report", - name: "accessibilityReport", - label: { - text: "Upload the accessibility report (optional)", - classes: "govuk-label--m" - }, - hint: { - text: "The file needs to be a PDF and smaller than 10MB." - }, - errorMessage: formErrors.accessibilityReport, - value: formData.accessibilityReport, - attributes: { - accept: ".pdf" - } - }) }} - - {% if uploadedFileName %} - - {{ govukSummaryList({ - classes: 'govuk-summary-list--long-key', - rows: [ - { - key: { - text: "File" - }, - value: { - text: uploadedFileName - } - } - ] - }) }} - {% endif %} - {{ govukCharacterCount({ id: "issues-discovered", name: "issuesDiscovered", diff --git a/views/community/pages/add-internal-audit.njk b/views/community/pages/add-internal-audit.njk index 31dd97ff9..efcb470f5 100644 --- a/views/community/pages/add-internal-audit.njk +++ b/views/community/pages/add-internal-audit.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 %}
{% if backLink %} @@ -75,41 +73,6 @@ } }) }} -{{ govukFileUpload({ - id: "accessibility-report", - name: "accessibilityReport", - label: { - text: "Upload the accessibility review (optional)", - isPageHeading: true, - classes: "govuk-label--m" - }, - hint: { - text: "The file needs to be a PDF and smaller than 10MB." - }, - errorMessage: formErrors.accessibilityReport, - value: formData.accessibilityReport, - attributes: { - accept: ".pdf" - } - }) }} - - {% if uploadedFileName %} - - {{ govukSummaryList({ - classes: 'govuk-summary-list--long-key', - rows: [ - { - key: { - text: "File" - }, - value: { - text: uploadedFileName - } - } - ] - }) }} - {% endif %} - {{ govukCharacterCount({ id: "issues-discovered", name: "issuesDiscovered",