Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions schema/add-assistive-tech.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 3 additions & 10 deletions schema/add-external-audit.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
})
})
Expand Down
13 changes: 3 additions & 10 deletions schema/add-internal-audit.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
})
})
Expand Down
38 changes: 0 additions & 38 deletions views/community/pages/add-assistive-tech.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<div class="app-layout__content">
{% if backLink %}
Expand Down Expand Up @@ -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",
Expand All @@ -97,22 +75,6 @@
value: formData.issuesDiscovered
}) }}

{% if uploadedFileName %}
<input type="hidden" name="accessibilityReport" value="{{uploadedFileName}}">
{{ govukSummaryList({
classes: 'govuk-summary-list--long-key',
rows: [
{
key: {
text: "File"
},
value: {
text: uploadedFileName
}
}
]
}) }}
{% endif %}
<input type="hidden" name="_csrf" value="{{ csrfToken }}" />

<div class="govuk-button-group moj-button-action">
Expand Down
37 changes: 0 additions & 37 deletions views/community/pages/add-external-audit.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<div class="app-layout__content">
{% if backLink %}
Expand Down Expand Up @@ -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 %}
<input type="hidden" name="accessibilityReport" value="{{uploadedFileName}}">
{{ govukSummaryList({
classes: 'govuk-summary-list--long-key',
rows: [
{
key: {
text: "File"
},
value: {
text: uploadedFileName
}
}
]
}) }}
{% endif %}

{{ govukCharacterCount({
id: "issues-discovered",
name: "issuesDiscovered",
Expand Down
37 changes: 0 additions & 37 deletions views/community/pages/add-internal-audit.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<div class="app-layout__content">
{% if backLink %}
Expand Down Expand Up @@ -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 %}
<input type="hidden" name="accessibilityReport" value="{{uploadedFileName}}">
{{ govukSummaryList({
classes: 'govuk-summary-list--long-key',
rows: [
{
key: {
text: "File"
},
value: {
text: uploadedFileName
}
}
]
}) }}
{% endif %}

{{ govukCharacterCount({
id: "issues-discovered",
name: "issuesDiscovered",
Expand Down