Skip to content

Commit

Permalink
Added validation messages and api creds
Browse files Browse the repository at this point in the history
  • Loading branch information
mislam987 authored and Rhodine-orleans-lindsay committed Oct 18, 2024
1 parent 2dacf09 commit eb40cce
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 253 deletions.
13 changes: 12 additions & 1 deletion apps/lmr/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable */
'use strict';

const hof = require('hof');
const Submit = require('./behaviours/submit');
const SummaryPageBehaviour = require('hof').components.summary;
const PostcodeLookup = hof.components.postcodeLookup;

module.exports = {
name: 'lmr',
Expand All @@ -19,9 +21,18 @@ module.exports = {
},
'/tenant-details': {
fields: ['tenant-full-name', 'tenant-dob', 'tenant-nationality'],
next: '/property-address',
next: '/postcode',
backLink: 'tenancy-start'
},
'/postcode': {
behaviours: [PostcodeLookup({
addressFieldNamePrefix: 'address-one',
apiURL: process.env.POSTCODE_API_URL,
apiKey: process.env.POSTCODE_API_KEY,
required: true
})],
next: '/property-address'
},
'/property-address': {
fields: ['address-line-1', 'address-line-2', 'town-or-city', 'county', 'postcode'],
next: '/landlord-details',
Expand Down
3 changes: 2 additions & 1 deletion apps/lmr/translations/src/en/buttons.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"start-now": "Start now",
"submit-report": "Submit report"
"submit-report": "Submit report",
"find-address": "Find address"
}
13 changes: 13 additions & 0 deletions apps/lmr/translations/src/en/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,18 @@
},
"privacy-check": {
"required": "Confirm you have read the Data Protection statement"
},
"address-one-postcode": {
"required": "You must enter a postcode",
"postcodeValidation": "Enter a full, valid UK postcode"
},
"address-one-select": {
"required": "You must select an option"
},
"address-one": {
"required": "You must enter the address"
},
"address-one-postcode-manual": {
"required": "You must enter the postcode"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "",
"dependencies": {
"accessible-autocomplete": "^2.0.4",
"hof": "^20.4.0",
"hof": "^21.2.0-postcode-lookup-beta",
"homeoffice-countries": "^0.1.0",
"jquery": "^3.6.0",
"lodash": "^4.17.21",
Expand Down
Loading

0 comments on commit eb40cce

Please sign in to comment.