From 92cf271247b2278205a553a3085758c37b633567 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Thu, 23 Nov 2023 09:58:28 +0000 Subject: [PATCH] make sure form is populated with values in the session --- src/views/data-subject.html | 2 +- src/views/dataset.html | 2 +- src/views/email-address.html | 2 +- src/views/lpa.html | 2 +- src/views/name.html | 4 ++-- src/views/upload.html | 1 + 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/views/data-subject.html b/src/views/data-subject.html index 085b1724..e387c526 100644 --- a/src/views/data-subject.html +++ b/src/views/data-subject.html @@ -68,7 +68,7 @@ text: "Tree preservation order" } ], - value: data.check.dataSubject, + value: values['data-subject'], errorMessage: { text: errorMessage } if dataSubjectError else undefined diff --git a/src/views/dataset.html b/src/views/dataset.html index e25cb908..fe911223 100644 --- a/src/views/dataset.html +++ b/src/views/dataset.html @@ -48,7 +48,7 @@ } }, items: options.datasetItems, - value: data.check.dataset, + value: values.dataset, errorMessage: { text: errorMessage } if datasetError else undefined diff --git a/src/views/email-address.html b/src/views/email-address.html index 93e717b0..e6242055 100644 --- a/src/views/email-address.html +++ b/src/views/email-address.html @@ -45,7 +45,7 @@ type: "email", autocomplete: "email", spellcheck: false, - value: data.check.emailAddress, + value: values['email-address'], errorMessage: { text: 'email-address' | validationMessageLookup(errors['email-address'].type) } if datasetError else undefined diff --git a/src/views/lpa.html b/src/views/lpa.html index 571a0884..e1960f65 100644 --- a/src/views/lpa.html +++ b/src/views/lpa.html @@ -37,7 +37,7 @@ classes: 'govuk-label--l' }, type: "text", - value: data.check.lpa, + value: values.lpa, errorMessage: { text: 'lpa' | validationMessageLookup(errors['lpa'].type) } if 'lpa' in errors diff --git a/src/views/name.html b/src/views/name.html index ec8096fe..8d42a711 100644 --- a/src/views/name.html +++ b/src/views/name.html @@ -40,7 +40,7 @@

hint: { text: "Or given name" }, - value: data.check.firstName, + value: values['first-name'], errorMessage: { text: 'first-name' | validationMessageLookup(errors['first-name'].type) } if 'first-name' in errors @@ -56,7 +56,7 @@

hint: { text: "Or family name" }, - value: data.check.lastName, + value: values['last-name'], errorMessage: { text: 'last-name' | validationMessageLookup(errors['last-name'].type) } if 'last-name' in errors diff --git a/src/views/upload.html b/src/views/upload.html index 3cb5689d..fb1d2183 100644 --- a/src/views/upload.html +++ b/src/views/upload.html @@ -50,6 +50,7 @@ hint: { text: "You can upload a CSV, GeoJSON, GML or Geopackage file" }, + value: values.datafile, errorMessage: { text: errorMessage } if datasetError else undefined