From b5172eb3e57d7faab86a97284b17ba5a02146a70 Mon Sep 17 00:00:00 2001 From: Robert Parkinson Date: Fri, 18 Jan 2019 08:54:43 +0000 Subject: [PATCH] Limit address lines to 20 characters (#114) --- macros/address.njk | 5 ++++- macros/form.njk | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/macros/address.njk b/macros/address.njk index fbe4139..e437ca5 100644 --- a/macros/address.njk +++ b/macros/address.njk @@ -101,6 +101,7 @@ {{ t(line1Error) }} {% endif %} {{ t(line2Error) }} {% endif %} {{ t(line3Error) }} {% endif %} {{ textInput('Town or city', name + '[city]' if name else 'city', form, inputClass='address-town-or-city', - compound=true, autocomplete = 'address-level2') }} + compound=true, autocomplete = 'address-level2', maxLength=20) }} {{ textInput('Postcode', name + '[postcode]' if name else 'postcode', form, inputClass='postcode form-control-1-4', autocomplete = 'postal-code') }} {% endmacro %} diff --git a/macros/form.njk b/macros/form.njk index 3dbc56b..7ac5ff0 100644 --- a/macros/form.njk +++ b/macros/form.njk @@ -17,8 +17,8 @@ {% endmacro %} -{% macro textInput(label, name, form, hint, inputClass='', compound=false, autocomplete='on') %} - {{ input(label, name, form, hint, 'text', inputClass, compound, autocomplete) }} +{% macro textInput(label, name, form, hint, inputClass='', compound=false, autocomplete='on', maxLength) %} + {{ input(label, name, form, hint, 'text', inputClass, compound, autocomplete, maxLength=maxLength) }} {% endmacro %} {% macro numericInput(label, name, form, hint, inputClass='', compound=false, autocomplete='on') %} diff --git a/package.json b/package.json index 7bd070b..a5caf26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/cmc-common-frontend", - "version": "1.53.1", + "version": "1.54.0", "author": "HMCTS", "license": "MIT", "repository": {