From e13e0b10f84e5ec428305a5956a40ce9bdc29dd3 Mon Sep 17 00:00:00 2001 From: baarkerlounger <5101747+baarkerlounger@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:59:03 +0000 Subject: [PATCH] Accessible autocomplete for select questions (#181) * Include accessible autoselect package * Test type ahead functionality * Add CSS * Disabled null value * Fix answer options so they match validations * Disabled * Only english LAs for current LA * Rubocop --- app/models/case_log.rb | 4 +- app/models/constants/case_log.rb | 943 ++++++++---- app/views/form/_select_question.html.erb | 8 +- .../accessible_autocomplete_controller.js | 12 + .../styles/_accessible-autocomplete.scss | 20 + app/webpacker/styles/application.scss | 1 + config/forms/2021_2022.json | 1331 +++++++++-------- package.json | 1 + .../form/accessible_autocomplete_spec.rb | 27 + spec/features/form/check_answers_page_spec.rb | 4 +- spec/fixtures/forms/2021_2022.json | 17 + spec/models/form_handler_spec.rb | 2 +- yarn.lock | 12 + 13 files changed, 1432 insertions(+), 950 deletions(-) create mode 100644 app/webpacker/controllers/accessible_autocomplete_controller.js create mode 100644 app/webpacker/styles/_accessible-autocomplete.scss create mode 100644 spec/features/form/accessible_autocomplete_spec.rb diff --git a/app/models/case_log.rb b/app/models/case_log.rb index b65b7ef44..274a6da52 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -114,8 +114,8 @@ class CaseLog < ApplicationRecord enum lawaitlist: LATIME, _suffix: true enum reasonpref: POLAR_WITH_UNKNOWN, _suffix: true enum reason: REASON, _suffix: true - enum la: LA, _suffix: true - enum prevloc: LA, _suffix: true + enum la: ENGLISH_LA, _suffix: true + enum prevloc: UK_LA, _suffix: true enum majorrepairs: POLAR, _suffix: true enum hb: HOUSING_BENEFIT, _suffix: true enum hbrentshortfall: POLAR_WITH_UNKNOWN, _suffix: true diff --git a/app/models/constants/case_log.rb b/app/models/constants/case_log.rb index d71b0cccc..9c7a7d164 100644 --- a/app/models/constants/case_log.rb +++ b/app/models/constants/case_log.rb @@ -275,386 +275,705 @@ module Constants::CaseLog "Prefer not to say" => 100, }.freeze - LA = { - "Hartlepool" => "E06000001", - "Na h-Eileanan Siar" => "S12000013", - "Middlesbrough" => "E06000002", - "Redcar and Cleveland" => "E06000003", - "Stockton-on-Tees" => "E06000004", - "Darlington" => "E06000005", - "Halton" => "E06000006", - "Warrington" => "E06000007", + ENGLISH_LA = { + "Adur" => "E07000223", + "Allerdale" => "E07000026", + "Amber Valley" => "E07000032", + "Arun" => "E07000224", + "Ashfield" => "E07000170", + "Ashford" => "E07000105", + "Babergh" => "E07000200", + "Barking and Dagenham" => "E09000002", + "Barnet" => "E09000003", + "Barnsley" => "E08000016", + "Barrow-in-Furness" => "E07000027", + "Basildon" => "E07000066", + "Basingstoke and Deane" => "E07000084", + "Bassetlaw" => "E07000171", + "Bath and North East Somerset" => "E06000022", + "Bedford" => "E06000055", + "Bexley" => "E09000004", + "Birmingham" => "E08000025", + "Blaby" => "E07000129", "Blackburn with Darwen" => "E06000008", "Blackpool" => "E06000009", - "Kingston upon Hull, City of" => "E06000010", - "East Riding of Yorkshire" => "E06000011", - "North East Lincolnshire" => "E06000012", - "North Lincolnshire" => "E06000013", - "York" => "E06000014", - "Derby" => "E06000015", - "Leicester" => "E06000016", - "Rutland" => "E06000017", - "Nottingham" => "E06000018", - "Herefordshire, County of" => "E06000019", - "Telford and Wrekin" => "E06000020", - "Stoke-on-Trent" => "E06000021", - "Bath and North East Somerset" => "E06000022", - "Bristol, City of" => "E06000023", - "North Somerset" => "E06000024", - "South Gloucestershire" => "E06000025", - "Plymouth" => "E06000026", - "Torbay" => "E06000027", - "Swindon" => "E06000030", - "Peterborough" => "E06000031", - "Luton" => "E06000032", - "Southend-on-Sea" => "E06000033", - "Thurrock" => "E06000034", - "Medway" => "E06000035", + "Bolsover" => "E07000033", + "Bolton" => "E08000001", + "Boston" => "E07000136", + "Bournemouth, Christchurch and Poole" => "E06000058", "Bracknell Forest" => "E06000036", - "West Berkshire" => "E06000037", - "Reading" => "E06000038", - "Slough" => "E06000039", - "Windsor and Maidenhead" => "E06000040", - "Wokingham" => "E06000041", - "Milton Keynes" => "E06000042", + "Bradford" => "E08000032", + "Braintree" => "E07000067", + "Breckland" => "E07000143", + "Brent" => "E09000005", + "Brentwood" => "E07000068", "Brighton and Hove" => "E06000043", - "Portsmouth" => "E06000044", - "Southampton" => "E06000045", - "Isle of Wight" => "E06000046", - "County Durham" => "E06000047", + "Bristol, City of" => "E06000023", + "Broadland" => "E07000144", + "Bromley" => "E09000006", + "Bromsgrove" => "E07000234", + "Broxbourne" => "E07000095", + "Broxtowe" => "E07000172", + "Buckinghamshire" => "E06000060", + "Burnley" => "E07000117", + "Bury" => "E08000002", + "Calderdale" => "E08000033", + "Cambridge" => "E07000008", + "Camden" => "E09000007", + "Cannock Chase" => "E07000192", + "Canterbury" => "E07000106", + "Carlisle" => "E07000028", + "Castle Point" => "E07000069", + "Central Bedfordshire" => "E06000056", + "Charnwood" => "E07000130", + "Chelmsford" => "E07000070", + "Cheltenham" => "E07000078", + "Cherwell" => "E07000177", "Cheshire East" => "E06000049", "Cheshire West and Chester" => "E06000050", - "Shropshire" => "E06000051", - "Cornwall" => "E06000052", - "Isles of Scilly" => "E06000053", - "Wiltshire" => "E06000054", - "Bedford" => "E06000055", - "Central Bedfordshire" => "E06000056", - "Northumberland" => "E06000057", - "Bournemouth, Christchurch and Poole" => "E06000058", - "North Warwickshire" => "E07000218", - "Nuneaton and Bedworth" => "E07000219", - "Rugby" => "E07000220", - "Stratford-on-Avon" => "E07000221", - "Warwick" => "E07000222", - "Adur" => "E07000223", - "Arun" => "E07000224", + "Chesterfield" => "E07000034", "Chichester" => "E07000225", + "Chorley" => "E07000118", + "City of London" => "E09000001", + "Colchester" => "E07000071", + "Copeland" => "E07000029", + "Corby" => "E07000150", + "Cornwall" => "E06000052", + "Cotswold" => "E07000079", + "County Durham" => "E06000047", + "Coventry" => "E08000026", + "Craven" => "E07000163", "Crawley" => "E07000226", - "Horsham" => "E07000227", - "Mid Sussex" => "E07000228", - "Worthing" => "E07000229", - "Bromsgrove" => "E07000234", - "Malvern Hills" => "E07000235", - "Redditch" => "E07000236", - "Worcester" => "E07000237", - "Wychavon" => "E07000238", - "Wyre Forest" => "E07000239", - "St Albans" => "E07000240", - "Welwyn Hatfield" => "E07000241", - "East Hertfordshire" => "E07000242", - "Stevenage" => "E07000243", - "East Suffolk" => "E07000244", - "West Suffolk" => "E07000245", - "Somerset West and Taunton" => "E07000246", - "Bolton" => "E08000001", - "Bury" => "E08000002", - "Manchester" => "E08000003", - "Oldham" => "E08000004", - "Rochdale" => "E08000005", - "Salford" => "E08000006", - "Stockport" => "E08000007", - "Tameside" => "E08000008", - "Trafford" => "E08000009", - "Wigan" => "E08000010", - "Knowsley" => "E08000011", - "Liverpool" => "E08000012", - "St. Helens" => "E08000013", - "Sefton" => "E08000014", - "Wirral" => "E08000015", - "Barnsley" => "E08000016", + "Croydon" => "E09000008", + "Dacorum" => "E07000096", + "Darlington" => "E06000005", + "Dartford" => "E07000107", + "Daventry" => "E07000151", + "Derby" => "E06000015", + "Derbyshire Dales" => "E07000035", "Doncaster" => "E08000017", - "Rotherham" => "E08000018", - "Sheffield" => "E08000019", - "Newcastle upon Tyne" => "E08000021", - "North Tyneside" => "E08000022", - "South Tyneside" => "E08000023", - "Sunderland" => "E08000024", - "Birmingham" => "E08000025", - "Coventry" => "E08000026", - "Dudley" => "E08000027", - "Sandwell" => "E08000028", - "Solihull" => "E08000029", - "Walsall" => "E08000030", "Dorset" => "E06000059", - "Wolverhampton" => "E08000031", - "Falkirk" => "S12000014", - "Highland" => "S12000017", - "Inverclyde" => "S12000018", - "Midlothian" => "S12000019", - "Moray" => "S12000020", - "North Ayrshire" => "S12000021", - "Orkney Islands" => "S12000023", - "Scottish Borders" => "S12000026", - "Shetland Islands" => "S12000027", - "South Ayrshire" => "S12000028", - "South Lanarkshire" => "S12000029", - "Stirling" => "S12000030", - "Aberdeen City" => "S12000033", - "Aberdeenshire" => "S12000034", - "Argyll and Bute" => "S12000035", - "City of Edinburgh" => "S12000036", - "Renfrewshire" => "S12000038", - "West Dunbartonshire" => "S12000039", - "West Lothian" => "S12000040", - "Angus" => "S12000041", - "Dundee City" => "S12000042", - "East Dunbartonshire" => "S12000045", - "Buckinghamshire" => "E06000060", - "Fife" => "S12000047", - "Cambridge" => "E07000008", - "Perth and Kinross" => "S12000048", + "Dover" => "E07000108", + "Dudley" => "E08000027", + "Ealing" => "E09000009", "East Cambridgeshire" => "E07000009", - "Glasgow City" => "S12000049", - "Fenland" => "E07000010", - "North Lanarkshire" => "S12000050", - "Huntingdonshire" => "E07000011", - "Isle of Anglesey" => "W06000001", - "South Cambridgeshire" => "E07000012", - "Gwynedd" => "W06000002", - "Allerdale" => "E07000026", - "Conwy" => "W06000003", - "Barrow-in-Furness" => "E07000027", - "Denbighshire" => "W06000004", - "Carlisle" => "E07000028", - "Flintshire" => "W06000005", - "Copeland" => "E07000029", - "Wrexham" => "W06000006", - "Eden" => "E07000030", - "Ceredigion" => "W06000008", - "South Lakeland" => "E07000031", - "Pembrokeshire" => "W06000009", - "Amber Valley" => "E07000032", - "Carmarthenshire" => "W06000010", - "Bolsover" => "E07000033", - "Swansea" => "W06000011", - "Chesterfield" => "E07000034", - "Neath Port Talbot" => "W06000012", - "Derbyshire Dales" => "E07000035", - "Bridgend" => "W06000013", - "Erewash" => "E07000036", - "Vale of Glamorgan" => "W06000014", - "High Peak" => "E07000037", - "Cardiff" => "W06000015", - "North East Derbyshire" => "E07000038", - "Rhondda Cynon Taf" => "W06000016", - "South Derbyshire" => "E07000039", - "Caerphilly" => "W06000018", "East Devon" => "E07000040", - "Blaenau Gwent" => "W06000019", - "Exeter" => "E07000041", - "Torfaen" => "W06000020", - "Mid Devon" => "E07000042", - "Monmouthshire" => "W06000021", - "North Devon" => "E07000043", - "Newport" => "W06000022", - "South Hams" => "E07000044", - "Powys" => "W06000023", - "Teignbridge" => "E07000045", - "Merthyr Tydfil" => "W06000024", - "Torridge" => "E07000046", - "West Devon" => "E07000047", + "East Hampshire" => "E07000085", + "East Hertfordshire" => "E07000242", + "East Lindsey" => "E07000137", + "East Northamptonshire" => "E07000152", + "East Riding of Yorkshire" => "E06000011", + "East Staffordshire" => "E07000193", + "East Suffolk" => "E07000244", "Eastbourne" => "E07000061", - "Hastings" => "E07000062", - "Lewes" => "E07000063", - "Rother" => "E07000064", - "Wealden" => "E07000065", - "Basildon" => "E07000066", - "Braintree" => "E07000067", - "Brentwood" => "E07000068", - "Castle Point" => "E07000069", - "Chelmsford" => "E07000070", - "Colchester" => "E07000071", + "Eastleigh" => "E07000086", + "Eden" => "E07000030", + "Elmbridge" => "E07000207", + "Enfield" => "E09000010", "Epping Forest" => "E07000072", - "Harlow" => "E07000073", - "Maldon" => "E07000074", - "Rochford" => "E07000075", - "Tendring" => "E07000076", - "Uttlesford" => "E07000077", - "Cheltenham" => "E07000078", - "Cotswold" => "E07000079", + "Epsom and Ewell" => "E07000208", + "Erewash" => "E07000036", + "Exeter" => "E07000041", + "Fareham" => "E07000087", + "Fenland" => "E07000010", + "Folkestone and Hythe" => "E07000112", "Forest of Dean" => "E07000080", + "Fylde" => "E07000119", + "Gateshead" => "E08000037", + "Gedling" => "E07000173", "Gloucester" => "E07000081", - "Stroud" => "E07000082", - "Tewkesbury" => "E07000083", - "Basingstoke and Deane" => "E07000084", - "East Hampshire" => "E07000085", + "Gosport" => "E07000088", + "Gravesham" => "E07000109", + "Great Yarmouth" => "E07000145", + "Greenwich" => "E09000011", + "Guildford" => "E07000209", + "Gwynedd" => "W06000002", + "Hackney" => "E09000012", + "Halton" => "E06000006", + "Hambleton" => "E07000164", + "Hammersmith and Fulham" => "E09000013", + "Harborough" => "E07000131", + "Haringey" => "E09000014", + "Harlow" => "E07000073", + "Harrogate" => "E07000165", + "Harrow" => "E09000015", + "Hart" => "E07000089", + "Hartlepool" => "E06000001", + "Hastings" => "E07000062", + "Havant" => "E07000090", + "Havering" => "E09000016", + "Herefordshire, County of" => "E06000019", + "Hertsmere" => "E07000098", + "High Peak" => "E07000037", + "Highland" => "S12000017", + "Hillingdon" => "E09000017", + "Hinckley and Bosworth" => "E07000132", + "Horsham" => "E07000227", + "Hounslow" => "E09000018", + "Huntingdonshire" => "E07000011", + "Hyndburn" => "E07000120", + "Ipswich" => "E07000202", + "Isle of Wight" => "E06000046", + "Isles of Scilly" => "E06000053", + "Islington" => "E09000019", + "Kensington and Chelsea" => "E09000020", + "Kettering" => "E07000153", "King's Lynn and West Norfolk" => "E07000146", - "Eastleigh" => "E07000086", + "Kingston upon Hull, City of" => "E06000010", + "Kingston upon Thames" => "E09000021", + "Kirklees" => "E08000034", + "Knowsley" => "E08000011", + "Lambeth" => "E09000022", + "Lancaster" => "E07000121", + "Leeds" => "E08000035", + "Leicester" => "E06000016", + "Lewes" => "E07000063", + "Lewisham" => "E09000023", + "Lichfield" => "E07000194", + "Lincoln" => "E07000138", + "Liverpool" => "E08000012", + "Luton" => "E06000032", + "Maidstone" => "E07000110", + "Maldon" => "E07000074", + "Malvern Hills" => "E07000235", + "Manchester" => "E08000003", + "Mansfield" => "E07000174", + "Medway" => "E06000035", + "Melton" => "E07000133", + "Mendip" => "E07000187", + "Merton" => "E09000024", + "Mid Devon" => "E07000042", + "Mid Suffolk" => "E07000203", + "Mid Sussex" => "E07000228", + "Middlesbrough" => "E06000002", + "Milton Keynes" => "E06000042", + "Mole Valley" => "E07000210", + "New Forest" => "E07000091", + "Newark and Sherwood" => "E07000175", + "Newcastle upon Tyne" => "E08000021", + "Newcastle-under-Lyme" => "E07000195", + "Newham" => "E09000025", + "North Devon" => "E07000043", + "North East Derbyshire" => "E07000038", + "North East Lincolnshire" => "E06000012", + "North Hertfordshire" => "E07000099", + "North Kesteven" => "E07000139", + "North Lincolnshire" => "E06000013", "North Norfolk" => "E07000147", - "Norwich" => "E07000148", - "South Norfolk" => "E07000149", - "Corby" => "E07000150", - "Daventry" => "E07000151", - "East Northamptonshire" => "E07000152", - "Kettering" => "E07000153", + "North Somerset" => "E06000024", + "North Tyneside" => "E08000022", + "North Warwickshire" => "E07000218", + "North West Leicestershire" => "E07000134", "Northampton" => "E07000154", - "South Northamptonshire" => "E07000155", - "Wellingborough" => "E07000156", - "Craven" => "E07000163", - "Hambleton" => "E07000164", - "Harrogate" => "E07000165", + "Northumberland" => "E06000057", + "Norwich" => "E07000148", + "Nottingham" => "E06000018", + "Nuneaton and Bedworth" => "E07000219", + "Oadby and Wigston" => "E07000135", + "Oldham" => "E08000004", + "Oxford" => "E07000178", + "Pendle" => "E07000122", + "Peterborough" => "E06000031", + "Plymouth" => "E06000026", + "Portsmouth" => "E06000044", + "Preston" => "E07000123", + "Reading" => "E06000038", + "Redbridge" => "E09000026", + "Redcar and Cleveland" => "E06000003", + "Redditch" => "E07000236", + "Reigate and Banstead" => "E07000211", + "Ribble Valley" => "E07000124", + "Richmond upon Thames" => "E09000027", "Richmondshire" => "E07000166", + "Rochdale" => "E08000005", + "Rochford" => "E07000075", + "Rossendale" => "E07000125", + "Rother" => "E07000064", + "Rotherham" => "E08000018", + "Rugby" => "E07000220", + "Runnymede" => "E07000212", + "Rushcliffe" => "E07000176", + "Rushmoor" => "E07000092", + "Rutland" => "E06000017", "Ryedale" => "E07000167", + "Salford" => "E08000006", + "Sandwell" => "E08000028", "Scarborough" => "E07000168", + "Sedgemoor" => "E07000188", + "Sefton" => "E08000014", "Selby" => "E07000169", - "Ashfield" => "E07000170", - "Bassetlaw" => "E07000171", - "Broxtowe" => "E07000172", - "Gedling" => "E07000173", - "Mansfield" => "E07000174", - "Newark and Sherwood" => "E07000175", - "Rushcliffe" => "E07000176", - "Cherwell" => "E07000177", - "Oxford" => "E07000178", + "Sevenoaks" => "E07000111", + "Sheffield" => "E08000019", + "Shropshire" => "E06000051", + "Slough" => "E06000039", + "Solihull" => "E08000029", + "Somerset West and Taunton" => "E07000246", + "South Cambridgeshire" => "E07000012", + "South Derbyshire" => "E07000039", + "South Gloucestershire" => "E06000025", + "South Hams" => "E07000044", + "South Holland" => "E07000140", + "South Kesteven" => "E07000141", + "South Lakeland" => "E07000031", + "South Norfolk" => "E07000149", + "South Northamptonshire" => "E07000155", "South Oxfordshire" => "E07000179", - "Vale of White Horse" => "E07000180", - "West Oxfordshire" => "E07000181", - "Mendip" => "E07000187", - "Sedgemoor" => "E07000188", + "South Ribble" => "E07000126", "South Somerset" => "E07000189", - "Cannock Chase" => "E07000192", - "East Staffordshire" => "E07000193", - "Lichfield" => "E07000194", - "Newcastle-under-Lyme" => "E07000195", "South Staffordshire" => "E07000196", + "South Tyneside" => "E08000023", + "Southampton" => "E06000045", + "Southend-on-Sea" => "E06000033", + "Southwark" => "E09000028", + "Spelthorne" => "E07000213", + "St Albans" => "E07000240", + "St. Helens" => "E08000013", "Stafford" => "E07000197", "Staffordshire Moorlands" => "E07000198", - "Tamworth" => "E07000199", - "Babergh" => "E07000200", - "Ipswich" => "E07000202", - "Mid Suffolk" => "E07000203", - "Elmbridge" => "E07000207", - "Epsom and Ewell" => "E07000208", - "Guildford" => "E07000209", - "Mole Valley" => "E07000210", - "Reigate and Banstead" => "E07000211", - "Runnymede" => "E07000212", - "Spelthorne" => "E07000213", + "Stevenage" => "E07000243", + "Stockport" => "E08000007", + "Stockton-on-Tees" => "E06000004", + "Stoke-on-Trent" => "E06000021", + "Stratford-on-Avon" => "E07000221", + "Stroud" => "E07000082", + "Sunderland" => "E08000024", "Surrey Heath" => "E07000214", + "Sutton" => "E09000029", + "Swale" => "E07000113", + "Swindon" => "E06000030", + "Tameside" => "E08000008", + "Tamworth" => "E07000199", "Tandridge" => "E07000215", - "Waverley" => "E07000216", - "Woking" => "E07000217", - "Fareham" => "E07000087", - "Gosport" => "E07000088", - "Hart" => "E07000089", - "Havant" => "E07000090", - "New Forest" => "E07000091", - "Rushmoor" => "E07000092", + "Teignbridge" => "E07000045", + "Telford and Wrekin" => "E06000020", + "Tendring" => "E07000076", "Test Valley" => "E07000093", - "Winchester" => "E07000094", - "Broxbourne" => "E07000095", - "Dacorum" => "E07000096", - "Hertsmere" => "E07000098", - "North Hertfordshire" => "E07000099", - "Three Rivers" => "E07000102", - "Watford" => "E07000103", - "Ashford" => "E07000105", - "Canterbury" => "E07000106", - "Dartford" => "E07000107", - "Dover" => "E07000108", - "Gravesham" => "E07000109", - "Maidstone" => "E07000110", - "Sevenoaks" => "E07000111", - "Folkestone and Hythe" => "E07000112", - "Swale" => "E07000113", + "Tewkesbury" => "E07000083", "Thanet" => "E07000114", + "Three Rivers" => "E07000102", + "Thurrock" => "E06000034", "Tonbridge and Malling" => "E07000115", + "Torbay" => "E06000027", + "Torridge" => "E07000046", + "Tower Hamlets" => "E09000030", + "Trafford" => "E08000009", "Tunbridge Wells" => "E07000116", - "Burnley" => "E07000117", - "Chorley" => "E07000118", - "Fylde" => "E07000119", - "Hyndburn" => "E07000120", - "Lancaster" => "E07000121", - "Pendle" => "E07000122", - "Preston" => "E07000123", - "Ribble Valley" => "E07000124", - "Rossendale" => "E07000125", - "South Ribble" => "E07000126", + "Uttlesford" => "E07000077", + "Vale of White Horse" => "E07000180", + "Wakefield" => "E08000036", + "Walsall" => "E08000030", + "Waltham Forest" => "E09000031", + "Wandsworth" => "E09000032", + "Warrington" => "E06000007", + "Warwick" => "E07000222", + "Watford" => "E07000103", + "Waverley" => "E07000216", + "Wealden" => "E07000065", + "Wellingborough" => "E07000156", + "Welwyn Hatfield" => "E07000241", + "West Berkshire" => "E06000037", + "West Devon" => "E07000047", "West Lancashire" => "E07000127", - "Wyre" => "E07000128", - "Blaby" => "E07000129", - "Charnwood" => "E07000130", - "Harborough" => "E07000131", - "Hinckley and Bosworth" => "E07000132", - "Melton" => "E07000133", - "North West Leicestershire" => "E07000134", - "Oadby and Wigston" => "E07000135", - "Boston" => "E07000136", - "East Lindsey" => "E07000137", - "Lincoln" => "E07000138", - "North Kesteven" => "E07000139", - "South Holland" => "E07000140", - "South Kesteven" => "E07000141", "West Lindsey" => "E07000142", - "Breckland" => "E07000143", - "Broadland" => "E07000144", - "Great Yarmouth" => "E07000145", - "Bradford" => "E08000032", - "Calderdale" => "E08000033", - "Kirklees" => "E08000034", - "Leeds" => "E08000035", - "Wakefield" => "E08000036", - "Gateshead" => "E08000037", - "City of London" => "E09000001", + "West Oxfordshire" => "E07000181", + "West Suffolk" => "E07000245", + "Westminster" => "E09000033", + "Wigan" => "E08000010", + "Wiltshire" => "E06000054", + "Winchester" => "E07000094", + "Windsor and Maidenhead" => "E06000040", + "Wirral" => "E08000015", + "Woking" => "E07000217", + "Wokingham" => "E06000041", + "Wolverhampton" => "E08000031", + "Worcester" => "E07000237", + "Worthing" => "E07000229", + "Wychavon" => "E07000238", + "Wyre" => "E07000128", + "Wyre Forest" => "E07000239", + "York" => "E06000014", + }.freeze + + UK_LA = { + "Aberdeen City" => "S12000033", + "Aberdeenshire" => "S12000034", + "Adur" => "E07000223", + "Allerdale" => "E07000026", + "Amber Valley" => "E07000032", + "Angus" => "S12000041", + "Antrim and Newtownabbey" => "N09000001", + "Ards and North Down" => "N09000011", + "Argyll and Bute" => "S12000035", + "Armagh City, Banbridge and Craigavon" => "N09000002", + "Arun" => "E07000224", + "Ashfield" => "E07000170", + "Ashford" => "E07000105", + "Babergh" => "E07000200", "Barking and Dagenham" => "E09000002", "Barnet" => "E09000003", + "Barnsley" => "E08000016", + "Barrow-in-Furness" => "E07000027", + "Basildon" => "E07000066", + "Basingstoke and Deane" => "E07000084", + "Bassetlaw" => "E07000171", + "Bath and North East Somerset" => "E06000022", + "Bedford" => "E06000055", + "Belfast" => "N09000003", "Bexley" => "E09000004", + "Birmingham" => "E08000025", + "Blaby" => "E07000129", + "Blackburn with Darwen" => "E06000008", + "Blackpool" => "E06000009", + "Blaenau Gwent" => "W06000019", + "Bolsover" => "E07000033", + "Bolton" => "E08000001", + "Boston" => "E07000136", + "Bournemouth, Christchurch and Poole" => "E06000058", + "Bracknell Forest" => "E06000036", + "Bradford" => "E08000032", + "Braintree" => "E07000067", + "Breckland" => "E07000143", "Brent" => "E09000005", + "Brentwood" => "E07000068", + "Bridgend" => "W06000013", + "Brighton and Hove" => "E06000043", + "Bristol, City of" => "E06000023", + "Broadland" => "E07000144", "Bromley" => "E09000006", + "Bromsgrove" => "E07000234", + "Broxbourne" => "E07000095", + "Broxtowe" => "E07000172", + "Buckinghamshire" => "E06000060", + "Burnley" => "E07000117", + "Bury" => "E08000002", + "Caerphilly" => "W06000018", + "Calderdale" => "E08000033", + "Cambridge" => "E07000008", "Camden" => "E09000007", + "Cannock Chase" => "E07000192", + "Canterbury" => "E07000106", + "Cardiff" => "W06000015", + "Carlisle" => "E07000028", + "Carmarthenshire" => "W06000010", + "Castle Point" => "E07000069", + "Causeway Coast and Glens" => "N09000004", + "Central Bedfordshire" => "E06000056", + "Ceredigion" => "W06000008", + "Charnwood" => "E07000130", + "Chelmsford" => "E07000070", + "Cheltenham" => "E07000078", + "Cherwell" => "E07000177", + "Cheshire East" => "E06000049", + "Cheshire West and Chester" => "E06000050", + "Chesterfield" => "E07000034", + "Chichester" => "E07000225", + "Chorley" => "E07000118", + "City of Edinburgh" => "S12000036", + "City of London" => "E09000001", + "Clackmannanshire" => "S12000005", + "Colchester" => "E07000071", + "Conwy" => "W06000003", + "Copeland" => "E07000029", + "Corby" => "E07000150", + "Cornwall" => "E06000052", + "Cotswold" => "E07000079", + "County Durham" => "E06000047", + "Coventry" => "E08000026", + "Craven" => "E07000163", + "Crawley" => "E07000226", "Croydon" => "E09000008", + "Dacorum" => "E07000096", + "Darlington" => "E06000005", + "Dartford" => "E07000107", + "Daventry" => "E07000151", + "Denbighshire" => "W06000004", + "Derby" => "E06000015", + "Derbyshire Dales" => "E07000035", + "Derry City and Strabane" => "N09000005", + "Doncaster" => "E08000017", + "Dorset" => "E06000059", + "Dover" => "E07000108", + "Dudley" => "E08000027", + "Dumfries and Galloway" => "S12000006", + "Dundee City" => "S12000042", "Ealing" => "E09000009", + "East Ayrshire" => "S12000008", + "East Cambridgeshire" => "E07000009", + "East Devon" => "E07000040", + "East Dunbartonshire" => "S12000045", + "East Hampshire" => "E07000085", + "East Hertfordshire" => "E07000242", + "East Lindsey" => "E07000137", + "East Lothian" => "S12000010", + "East Northamptonshire" => "E07000152", + "East Renfrewshire" => "S12000011", + "East Riding of Yorkshire" => "E06000011", + "East Staffordshire" => "E07000193", + "East Suffolk" => "E07000244", + "Eastbourne" => "E07000061", + "Eastleigh" => "E07000086", + "Eden" => "E07000030", + "Elmbridge" => "E07000207", "Enfield" => "E09000010", + "Epping Forest" => "E07000072", + "Epsom and Ewell" => "E07000208", + "Erewash" => "E07000036", + "Exeter" => "E07000041", + "Falkirk" => "S12000014", + "Fareham" => "E07000087", + "Fenland" => "E07000010", + "Fermanagh and Omagh" => "N09000006", + "Fife" => "S12000047", + "Flintshire" => "W06000005", + "Folkestone and Hythe" => "E07000112", + "Forest of Dean" => "E07000080", + "Fylde" => "E07000119", + "Gateshead" => "E08000037", + "Gedling" => "E07000173", + "Glasgow City" => "S12000049", + "Gloucester" => "E07000081", + "Gosport" => "E07000088", + "Gravesham" => "E07000109", + "Great Yarmouth" => "E07000145", "Greenwich" => "E09000011", + "Guildford" => "E07000209", + "Gwynedd" => "W06000002", "Hackney" => "E09000012", + "Halton" => "E06000006", + "Hambleton" => "E07000164", "Hammersmith and Fulham" => "E09000013", + "Harborough" => "E07000131", "Haringey" => "E09000014", + "Harlow" => "E07000073", + "Harrogate" => "E07000165", "Harrow" => "E09000015", + "Hart" => "E07000089", + "Hartlepool" => "E06000001", + "Hastings" => "E07000062", + "Havant" => "E07000090", "Havering" => "E09000016", + "Herefordshire, County of" => "E06000019", + "Hertsmere" => "E07000098", + "High Peak" => "E07000037", + "Highland" => "S12000017", "Hillingdon" => "E09000017", + "Hinckley and Bosworth" => "E07000132", + "Horsham" => "E07000227", "Hounslow" => "E09000018", + "Huntingdonshire" => "E07000011", + "Hyndburn" => "E07000120", + "Inverclyde" => "S12000018", + "Ipswich" => "E07000202", + "Isle of Anglesey" => "W06000001", + "Isle of Wight" => "E06000046", + "Isles of Scilly" => "E06000053", "Islington" => "E09000019", "Kensington and Chelsea" => "E09000020", + "Kettering" => "E07000153", + "King's Lynn and West Norfolk" => "E07000146", + "Kingston upon Hull, City of" => "E06000010", "Kingston upon Thames" => "E09000021", + "Kirklees" => "E08000034", + "Knowsley" => "E08000011", "Lambeth" => "E09000022", + "Lancaster" => "E07000121", + "Leeds" => "E08000035", + "Leicester" => "E06000016", + "Lewes" => "E07000063", "Lewisham" => "E09000023", + "Lichfield" => "E07000194", + "Lincoln" => "E07000138", + "Lisburn and Castlereagh" => "N09000007", + "Liverpool" => "E08000012", + "Luton" => "E06000032", + "Maidstone" => "E07000110", + "Maldon" => "E07000074", + "Malvern Hills" => "E07000235", + "Manchester" => "E08000003", + "Mansfield" => "E07000174", + "Medway" => "E06000035", + "Melton" => "E07000133", + "Mendip" => "E07000187", + "Merthyr Tydfil" => "W06000024", "Merton" => "E09000024", + "Mid Devon" => "E07000042", + "Mid Suffolk" => "E07000203", + "Mid Sussex" => "E07000228", + "Mid Ulster" => "N09000009", + "Mid and East Antrim" => "N09000008", + "Middlesbrough" => "E06000002", + "Midlothian" => "S12000019", + "Milton Keynes" => "E06000042", + "Mole Valley" => "E07000210", + "Monmouthshire" => "W06000021", + "Moray" => "S12000020", + "Na h-Eileanan Siar" => "S12000013", + "Neath Port Talbot" => "W06000012", + "New Forest" => "E07000091", + "Newark and Sherwood" => "E07000175", + "Newcastle upon Tyne" => "E08000021", + "Newcastle-under-Lyme" => "E07000195", "Newham" => "E09000025", + "Newport" => "W06000022", + "Newry, Mourne and Down" => "N09000010", + "North Ayrshire" => "S12000021", + "North Devon" => "E07000043", + "North East Derbyshire" => "E07000038", + "North East Lincolnshire" => "E06000012", + "North Hertfordshire" => "E07000099", + "North Kesteven" => "E07000139", + "North Lanarkshire" => "S12000050", + "North Lincolnshire" => "E06000013", + "North Norfolk" => "E07000147", + "North Somerset" => "E06000024", + "North Tyneside" => "E08000022", + "North Warwickshire" => "E07000218", + "North West Leicestershire" => "E07000134", + "Northampton" => "E07000154", + "Northumberland" => "E06000057", + "Norwich" => "E07000148", + "Nottingham" => "E06000018", + "Nuneaton and Bedworth" => "E07000219", + "Oadby and Wigston" => "E07000135", + "Oldham" => "E08000004", + "Orkney Islands" => "S12000023", + "Oxford" => "E07000178", + "Pembrokeshire" => "W06000009", + "Pendle" => "E07000122", + "Perth and Kinross" => "S12000048", + "Peterborough" => "E06000031", + "Plymouth" => "E06000026", + "Portsmouth" => "E06000044", + "Powys" => "W06000023", + "Preston" => "E07000123", + "Reading" => "E06000038", "Redbridge" => "E09000026", + "Redcar and Cleveland" => "E06000003", + "Redditch" => "E07000236", + "Reigate and Banstead" => "E07000211", + "Renfrewshire" => "S12000038", + "Rhondda Cynon Taf" => "W06000016", + "Ribble Valley" => "E07000124", "Richmond upon Thames" => "E09000027", + "Richmondshire" => "E07000166", + "Rochdale" => "E08000005", + "Rochford" => "E07000075", + "Rossendale" => "E07000125", + "Rother" => "E07000064", + "Rotherham" => "E08000018", + "Rugby" => "E07000220", + "Runnymede" => "E07000212", + "Rushcliffe" => "E07000176", + "Rushmoor" => "E07000092", + "Rutland" => "E06000017", + "Ryedale" => "E07000167", + "Salford" => "E08000006", + "Sandwell" => "E08000028", + "Scarborough" => "E07000168", + "Scottish Borders" => "S12000026", + "Sedgemoor" => "E07000188", + "Sefton" => "E08000014", + "Selby" => "E07000169", + "Sevenoaks" => "E07000111", + "Sheffield" => "E08000019", + "Shetland Islands" => "S12000027", + "Shropshire" => "E06000051", + "Slough" => "E06000039", + "Solihull" => "E08000029", + "Somerset West and Taunton" => "E07000246", + "South Ayrshire" => "S12000028", + "South Cambridgeshire" => "E07000012", + "South Derbyshire" => "E07000039", + "South Gloucestershire" => "E06000025", + "South Hams" => "E07000044", + "South Holland" => "E07000140", + "South Kesteven" => "E07000141", + "South Lakeland" => "E07000031", + "South Lanarkshire" => "S12000029", + "South Norfolk" => "E07000149", + "South Northamptonshire" => "E07000155", + "South Oxfordshire" => "E07000179", + "South Ribble" => "E07000126", + "South Somerset" => "E07000189", + "South Staffordshire" => "E07000196", + "South Tyneside" => "E08000023", + "Southampton" => "E06000045", + "Southend-on-Sea" => "E06000033", "Southwark" => "E09000028", + "Spelthorne" => "E07000213", + "St Albans" => "E07000240", + "St. Helens" => "E08000013", + "Stafford" => "E07000197", + "Staffordshire Moorlands" => "E07000198", + "Stevenage" => "E07000243", + "Stirling" => "S12000030", + "Stockport" => "E08000007", + "Stockton-on-Tees" => "E06000004", + "Stoke-on-Trent" => "E06000021", + "Stratford-on-Avon" => "E07000221", + "Stroud" => "E07000082", + "Sunderland" => "E08000024", + "Surrey Heath" => "E07000214", "Sutton" => "E09000029", + "Swale" => "E07000113", + "Swansea" => "W06000011", + "Swindon" => "E06000030", + "Tameside" => "E08000008", + "Tamworth" => "E07000199", + "Tandridge" => "E07000215", + "Teignbridge" => "E07000045", + "Telford and Wrekin" => "E06000020", + "Tendring" => "E07000076", + "Test Valley" => "E07000093", + "Tewkesbury" => "E07000083", + "Thanet" => "E07000114", + "Three Rivers" => "E07000102", + "Thurrock" => "E06000034", + "Tonbridge and Malling" => "E07000115", + "Torbay" => "E06000027", + "Torfaen" => "W06000020", + "Torridge" => "E07000046", "Tower Hamlets" => "E09000030", + "Trafford" => "E08000009", + "Tunbridge Wells" => "E07000116", + "Uttlesford" => "E07000077", + "Vale of Glamorgan" => "W06000014", + "Vale of White Horse" => "E07000180", + "Wakefield" => "E08000036", + "Walsall" => "E08000030", "Waltham Forest" => "E09000031", "Wandsworth" => "E09000032", + "Warrington" => "E06000007", + "Warwick" => "E07000222", + "Watford" => "E07000103", + "Waverley" => "E07000216", + "Wealden" => "E07000065", + "Wellingborough" => "E07000156", + "Welwyn Hatfield" => "E07000241", + "West Berkshire" => "E06000037", + "West Devon" => "E07000047", + "West Dunbartonshire" => "S12000039", + "West Lancashire" => "E07000127", + "West Lindsey" => "E07000142", + "West Lothian" => "S12000040", + "West Oxfordshire" => "E07000181", + "West Suffolk" => "E07000245", "Westminster" => "E09000033", - "Antrim and Newtownabbey" => "N09000001", - "Armagh City, Banbridge and Craigavon" => "N09000002", - "Belfast" => "N09000003", - "Causeway Coast and Glens" => "N09000004", - "Derry City and Strabane" => "N09000005", - "Fermanagh and Omagh" => "N09000006", - "Lisburn and Castlereagh" => "N09000007", - "Mid and East Antrim" => "N09000008", - "Mid Ulster" => "N09000009", - "Newry, Mourne and Down" => "N09000010", - "Ards and North Down" => "N09000011", - "Clackmannanshire" => "S12000005", - "Dumfries and Galloway" => "S12000006", - "East Ayrshire" => "S12000008", - "East Lothian" => "S12000010", - "East Renfrewshire" => "S12000011", + "Wigan" => "E08000010", + "Wiltshire" => "E06000054", + "Winchester" => "E07000094", + "Windsor and Maidenhead" => "E06000040", + "Wirral" => "E08000015", + "Woking" => "E07000217", + "Wokingham" => "E06000041", + "Wolverhampton" => "E08000031", + "Worcester" => "E07000237", + "Worthing" => "E07000229", + "Wrexham" => "W06000006", + "Wychavon" => "E07000238", + "Wyre" => "E07000128", + "Wyre Forest" => "E07000239", + "York" => "E06000014", }.freeze ARMED_FORCES = { diff --git a/app/views/form/_select_question.html.erb b/app/views/form/_select_question.html.erb index d2eb7e079..c5b3e862b 100644 --- a/app/views/form/_select_question.html.erb +++ b/app/views/form/_select_question.html.erb @@ -1,9 +1,11 @@ -<%= answers = question.answer_options.map { |key, value| OpenStruct.new(id:key, name: value) } +<%= answers = question.answer_options.map { |key, value| OpenStruct.new(id: key, name: value) } f.govuk_collection_select question.id.to_sym, answers, - :name, + :id, :name, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, label: { text: question.header, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, - hint: { text: question.hint_text&.html_safe } + hint: { text: question.hint_text&.html_safe }, + options: { disabled: [""] }, + "data-controller": "accessible-autocomplete" %> diff --git a/app/webpacker/controllers/accessible_autocomplete_controller.js b/app/webpacker/controllers/accessible_autocomplete_controller.js new file mode 100644 index 000000000..db34213ee --- /dev/null +++ b/app/webpacker/controllers/accessible_autocomplete_controller.js @@ -0,0 +1,12 @@ +import { Controller } from "@hotwired/stimulus" +import accessibleAutocomplete from "accessible-autocomplete" +import 'accessible-autocomplete/dist/accessible-autocomplete.min.css' + +export default class extends Controller { + connect() { + accessibleAutocomplete.enhanceSelectElement({ + defaultValue: '', + selectElement: this.element + }) + } +} diff --git a/app/webpacker/styles/_accessible-autocomplete.scss b/app/webpacker/styles/_accessible-autocomplete.scss new file mode 100644 index 000000000..3ffd9adaf --- /dev/null +++ b/app/webpacker/styles/_accessible-autocomplete.scss @@ -0,0 +1,20 @@ +.autocomplete__wrapper, +.autocomplete__input, +.autocomplete__hint { + font-family: $govuk-font-family; +} + +.govuk-form-group--error { + .autocomplete__input { + border-color: $govuk-error-colour; + } + + .autocomplete__input--focused { + border-color: $govuk-input-border-colour; + } +} + +.autocomplete__dropdown-arrow-down { + pointer-events: none; + z-index: 0; +} diff --git a/app/webpacker/styles/application.scss b/app/webpacker/styles/application.scss index 78b925154..551101152 100644 --- a/app/webpacker/styles/application.scss +++ b/app/webpacker/styles/application.scss @@ -14,6 +14,7 @@ $govuk-image-url-function: frontend-image-url; @import 'related-navigation'; @import 'task-list'; @import 'tab-navigation'; +@import 'accessible-autocomplete'; $govuk-global-styles: true; diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 5a97ebcba..751684a5a 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1156,321 +1156,325 @@ "check_answer_label": "Local Authority", "header": "Select a local authority", "hint_text": "", - "type": "radio", - "answer_options": { - "0": "Adur", - "1": "Allerdale", - "2": "Amber Valley", - "3": "Arun", - "4": "Ashfield", - "5": "Ashford", - "6": "Babergh", - "7": "Barking & Dagenham", - "8": "Barnet", - "9": "Barnsley", - "10": "Barrow-in-Furness", - "11": "Basildon", - "12": "Basingstoke & Deane", - "13": "Bassetlaw", - "14": "Bath & NE Somerset", - "15": "Bedford Borough Council", - "16": "Bexley", - "17": "Birmingham", - "18": "Blaby", - "19": "Blackburn", - "20": "Blackpool", - "21": "Bolsover", - "22": "Bolton", - "23": "Boston", - "24": "Bournemouth & Christchurch & Poole", - "25": "Bracknell Forest", - "26": "Bradford", - "27": "Braintree", - "28": "Breckland", - "29": "Brent", - "30": "Brentwood", - "31": "Brighton & Hove", - "32": "Bristol", - "33": "Broadland", - "34": "Bromley", - "35": "Bromsgrove", - "36": "Broxbourne", - "37": "Broxtowe", - "38": "Buckinghamshire", - "39": "Burnley", - "40": "Bury", - "41": "Calderdale", - "42": "Cambridge", - "43": "Camden", - "44": "Cannock Chase", - "45": "Canterbury", - "46": "Carlisle", - "47": "Castle Point", - "48": "Central Bedfordshire", - "49": "Charnwood", - "50": "Chelmsford", - "51": "Cheltenham", - "52": "Cherwell", - "53": "Cheshire West & Chester", - "54": "Chesterfield", - "55": "Chichester", - "56": "Chorley", - "57": "City of London", - "58": "Colchester", - "59": "Copeland", - "60": "Cornwall", - "61": "Cotswold", - "62": "Coventry", - "63": "Craven", - "64": "Crawley", - "65": "Croydon", - "66": "Dacorum", - "67": "Darlington", - "68": "Dartford", - "69": "Derby", - "70": "Derbyshire Dales", - "71": "Doncaster", - "72": "Dorset", - "73": "Dover", - "74": "Dudley", - "75": "Durham", - "76": "Ealing", - "77": "East Cambridgeshire", - "78": "East Cheshire", - "79": "East Devon", - "80": "East Hampshire", - "81": "East Herts", - "82": "East Lindsey", - "83": "East Riding", - "84": "East Staffordshire", - "85": "East Suffolk", - "86": "Eastbourne", - "87": "Eastleigh", - "88": "Eden", - "89": "Elmbridge", - "90": "Enfield", - "91": "Epping Forest", - "92": "Epsom & Ewell", - "93": "Erewash", - "94": "Exeter", - "95": "Fareham", - "96": "Fenland", - "97": "Folkestone & Hythe", - "98": "Forest of Dean", - "99": "Fylde", - "100": "Gateshead", - "101": "Gedling", - "102": "Gloucester", - "103": "Gosport", - "104": "Gravesham", - "105": "Great Yarmouth", - "106": "Greenwich", - "107": "Guildford", - "108": "Hackney", - "109": "Halton", - "110": "Hambleton", - "111": "Hammersmith & Fulham", - "112": "Harborough", - "113": "Haringey", - "114": "Harlow", - "115": "Harrogate", - "116": "Harrow", - "117": "Hart", - "118": "Hartlepool", - "119": "Hastings", - "120": "Havant", - "121": "Havering", - "122": "Herefordshire", - "123": "Hertsmere", - "124": "High Peak", - "125": "Hillingdon", - "126": "Hinckley & Bosworth", - "127": "Horsham", - "128": "Hounslow", - "129": "Huntingdonshire", - "130": "Hyndburn", - "131": "Ipswich", - "132": "Isle of Wight", - "133": "Isles of Scilly", - "134": "Islington", - "135": "Kensington & Chelsea", - "136": "King's Lynn and West Norfolk", - "137": "Kingston-upon-Hull", - "138": "Kingston-upon-Thames", - "139": "Kirklees", - "140": "Knowsley", - "141": "Lambeth", - "142": "Lancaster", - "143": "Leeds", - "144": "Leicester", - "145": "Lewes", - "146": "Lewisham", - "147": "Lichfield", - "148": "Lincoln", - "149": "Liverpool", - "150": "Luton", - "151": "Maidstone", - "152": "Maldon", - "153": "Malvern Hills", - "154": "Manchester", - "155": "Mansfield", - "156": "Medway", - "157": "Melton", - "158": "Mendip", - "159": "Merton", - "160": "Mid Devon", - "161": "Mid Suffolk", - "162": "Mid Sussex", - "163": "Middlesbrough", - "164": "Milton Keynes", - "165": "Mole Valley", - "166": "N. Ireland", - "167": "New Forest", - "168": "Newark", - "169": "Newcastle-under-Lyme", - "170": "Newcastle-upon-Tyne", - "171": "Newham", - "172": "North Devon", - "173": "North East Derbyshire", - "174": "North East Lincolnshire", - "175": "North Hertfordshire", - "176": "North Kesteven", - "177": "North Lincolnshire", - "178": "North Norfolk", - "179": "North Northamptonshire", - "180": "North Somerset", - "181": "North Tyneside", - "182": "North Warwickshire", - "183": "North West Leics", - "184": "Northumberland", - "185": "Norwich", - "186": "Nottingham", - "187": "Nuneaton & Bedworth", - "188": "Oadby & Wigston", - "189": "Oldham", - "190": "Outside UK", - "191": "Oxford", - "192": "Pendle", - "193": "Peterborough", - "194": "Plymouth", - "195": "Portsmouth", - "196": "Preston", - "197": "Reading", - "198": "Redbridge", - "199": "Redcar & Cleveland", - "200": "Redditch", - "201": "Reigate & Banstead", - "202": "Ribble Valley", - "203": "Richmond-upon-Thames", - "204": "Richmondshire", - "205": "Rochdale", - "206": "Rochford", - "207": "Rossendale", - "208": "Rother", - "209": "Rotherham", - "210": "Rugby", - "211": "Runnymede", - "212": "Rushcliffe", - "213": "Rushmoor", - "214": "Rutland", - "215": "Ryedale", - "216": "Salford", - "217": "Sandwell", - "218": "Scarborough", - "219": "Scotland", - "220": "Sedgemoor", - "221": "Sefton", - "222": "Selby", - "223": "Sevenoaks", - "224": "Sheffield", - "225": "Shropshire", - "226": "Slough", - "227": "Solihull", - "228": "Somerset West & Taunton", - "229": "South Cambridgeshire", - "230": "South Derbyshire", - "231": "South Gloucestershire", - "232": "South Hams", - "233": "South Holland", - "234": "South Kesteven", - "235": "South Lakeland", - "236": "South Norfolk", - "237": "South Oxfordshire", - "238": "South Ribble", - "239": "South Somerset", - "240": "South Staffordshire", - "241": "South Tyneside", - "242": "Southampton", - "243": "Southend-on-Sea", - "244": "Southwark", - "245": "Spelthorne", - "246": "St Albans", - "247": "St Helens", - "248": "Stafford", - "249": "Staffordshire Moorlands", - "250": "Stevenage", - "251": "Stockport", - "252": "Stockton-on-Tees", - "253": "Stoke-on-Trent", - "254": "Stratford-on-Avon", - "255": "Stroud", - "256": "Sunderland", - "257": "Surrey Heath", - "258": "Sutton", - "259": "Swale", - "260": "Swindon", - "261": "Tameside", - "262": "Tamworth", - "263": "Tandridge", - "264": "Teignbridge", - "265": "Telford & Wrekin", - "266": "Tendring", - "267": "Test Valley", - "268": "Tewkesbury", - "269": "Thanet", - "270": "Three Rivers", - "271": "Thurrock", - "272": "Tonbridge & Malling", - "273": "Torbay", - "274": "Torridge", - "275": "Tower Hamlets", - "276": "Trafford", - "277": "Tunbridge Wells", - "278": "Uttlesford", - "279": "Vale of White Horse", - "280": "Wakefield", - "281": "Wales", - "282": "Walsall", - "283": "Waltham Forest", - "284": "Wandsworth", - "285": "Warrington", - "286": "Warwick", - "287": "Watford", - "288": "Waverley", - "289": "Wealden", - "290": "Welwyn Hatfield", - "291": "West Berkshire", - "292": "West Devon", - "293": "West Lancashire", - "294": "West Lindsey", - "295": "West Northamptonshire", - "296": "West Oxfordshire", - "297": "West Suffolk", - "298": "Westminster", - "299": "Wigan", - "300": "Wiltshire", - "301": "Winchester", - "302": "Windsor & Maidenhead", - "303": "Wirral", - "304": "Woking", - "305": "Wokingham", - "306": "Wolverhampton", - "307": "Worcester", - "308": "Worthing", - "309": "Wychavon", - "310": "Wyre", - "311": "Wyre Forest", - "312": "York" + "type": "select", + "answer_options": { + "": "Select an option", + "E07000223": "Adur", + "E07000026": "Allerdale", + "E07000032": "Amber Valley", + "E07000224": "Arun", + "E07000170": "Ashfield", + "E07000105": "Ashford", + "E07000200": "Babergh", + "E09000002": "Barking and Dagenham", + "E09000003": "Barnet", + "E08000016": "Barnsley", + "E07000027": "Barrow-in-Furness", + "E07000066": "Basildon", + "E07000084": "Basingstoke and Deane", + "E07000171": "Bassetlaw", + "E06000022": "Bath and North East Somerset", + "E06000055": "Bedford", + "E09000004": "Bexley", + "E08000025": "Birmingham", + "E07000129": "Blaby", + "E06000008": "Blackburn with Darwen", + "E06000009": "Blackpool", + "E07000033": "Bolsover", + "E08000001": "Bolton", + "E07000136": "Boston", + "E06000058": "Bournemouth, Christchurch and Poole", + "E06000036": "Bracknell Forest", + "E08000032": "Bradford", + "E07000067": "Braintree", + "E07000143": "Breckland", + "E09000005": "Brent", + "E07000068": "Brentwood", + "E06000043": "Brighton and Hove", + "E06000023": "Bristol, City of", + "E07000144": "Broadland", + "E09000006": "Bromley", + "E07000234": "Bromsgrove", + "E07000095": "Broxbourne", + "E07000172": "Broxtowe", + "E06000060": "Buckinghamshire", + "E07000117": "Burnley", + "E08000002": "Bury", + "E08000033": "Calderdale", + "E07000008": "Cambridge", + "E09000007": "Camden", + "E07000192": "Cannock Chase", + "E07000106": "Canterbury", + "E07000028": "Carlisle", + "E07000069": "Castle Point", + "E06000056": "Central Bedfordshire", + "E07000130": "Charnwood", + "E07000070": "Chelmsford", + "E07000078": "Cheltenham", + "E07000177": "Cherwell", + "E06000049": "Cheshire East", + "E06000050": "Cheshire West and Chester", + "E07000034": "Chesterfield", + "E07000225": "Chichester", + "E07000118": "Chorley", + "E09000001": "City of London", + "E07000071": "Colchester", + "E07000029": "Copeland", + "E07000150": "Corby", + "E06000052": "Cornwall", + "E07000079": "Cotswold", + "E06000047": "County Durham", + "E08000026": "Coventry", + "E07000163": "Craven", + "E07000226": "Crawley", + "E09000008": "Croydon", + "E07000096": "Dacorum", + "E06000005": "Darlington", + "E07000107": "Dartford", + "E07000151": "Daventry", + "E06000015": "Derby", + "E07000035": "Derbyshire Dales", + "E08000017": "Doncaster", + "E06000059": "Dorset", + "E07000108": "Dover", + "E08000027": "Dudley", + "E09000009": "Ealing", + "E07000009": "East Cambridgeshire", + "E07000040": "East Devon", + "E07000085": "East Hampshire", + "E07000242": "East Hertfordshire", + "E07000137": "East Lindsey", + "E07000152": "East Northamptonshire", + "E06000011": "East Riding of Yorkshire", + "E07000193": "East Staffordshire", + "E07000244": "East Suffolk", + "E07000061": "Eastbourne", + "E07000086": "Eastleigh", + "E07000030": "Eden", + "E07000207": "Elmbridge", + "E09000010": "Enfield", + "E07000072": "Epping Forest", + "E07000208": "Epsom and Ewell", + "E07000036": "Erewash", + "E07000041": "Exeter", + "E07000087": "Fareham", + "E07000010": "Fenland", + "E07000112": "Folkestone and Hythe", + "E07000080": "Forest of Dean", + "E07000119": "Fylde", + "E08000037": "Gateshead", + "E07000173": "Gedling", + "E07000081": "Gloucester", + "E07000088": "Gosport", + "E07000109": "Gravesham", + "E07000145": "Great Yarmouth", + "E09000011": "Greenwich", + "E07000209": "Guildford", + "W06000002": "Gwynedd", + "E09000012": "Hackney", + "E06000006": "Halton", + "E07000164": "Hambleton", + "E09000013": "Hammersmith and Fulham", + "E07000131": "Harborough", + "E09000014": "Haringey", + "E07000073": "Harlow", + "E07000165": "Harrogate", + "E09000015": "Harrow", + "E07000089": "Hart", + "E06000001": "Hartlepool", + "E07000062": "Hastings", + "E07000090": "Havant", + "E09000016": "Havering", + "E06000019": "Herefordshire, County of", + "E07000098": "Hertsmere", + "E07000037": "High Peak", + "S12000017": "Highland", + "E09000017": "Hillingdon", + "E07000132": "Hinckley and Bosworth", + "E07000227": "Horsham", + "E09000018": "Hounslow", + "E07000011": "Huntingdonshire", + "E07000120": "Hyndburn", + "E07000202": "Ipswich", + "E06000046": "Isle of Wight", + "E06000053": "Isles of Scilly", + "E09000019": "Islington", + "E09000020": "Kensington and Chelsea", + "E07000153": "Kettering", + "E07000146": "King's Lynn and West Norfolk", + "E06000010": "Kingston upon Hull, City of", + "E09000021": "Kingston upon Thames", + "E08000034": "Kirklees", + "E08000011": "Knowsley", + "E09000022": "Lambeth", + "E07000121": "Lancaster", + "E08000035": "Leeds", + "E06000016": "Leicester", + "E07000063": "Lewes", + "E09000023": "Lewisham", + "E07000194": "Lichfield", + "E07000138": "Lincoln", + "E08000012": "Liverpool", + "E06000032": "Luton", + "E07000110": "Maidstone", + "E07000074": "Maldon", + "E07000235": "Malvern Hills", + "E08000003": "Manchester", + "E07000174": "Mansfield", + "E06000035": "Medway", + "E07000133": "Melton", + "E07000187": "Mendip", + "E09000024": "Merton", + "E07000042": "Mid Devon", + "E07000203": "Mid Suffolk", + "E07000228": "Mid Sussex", + "E06000002": "Middlesbrough", + "E06000042": "Milton Keynes", + "E07000210": "Mole Valley", + "E07000091": "New Forest", + "E07000175": "Newark and Sherwood", + "E08000021": "Newcastle upon Tyne", + "E07000195": "Newcastle-under-Lyme", + "E09000025": "Newham", + "E07000043": "North Devon", + "E07000038": "North East Derbyshire", + "E06000012": "North East Lincolnshire", + "E07000099": "North Hertfordshire", + "E07000139": "North Kesteven", + "E06000013": "North Lincolnshire", + "E07000147": "North Norfolk", + "E06000024": "North Somerset", + "E08000022": "North Tyneside", + "E07000218": "North Warwickshire", + "E07000134": "North West Leicestershire", + "E07000154": "Northampton", + "E06000057": "Northumberland", + "E07000148": "Norwich", + "E06000018": "Nottingham", + "E07000219": "Nuneaton and Bedworth", + "E07000135": "Oadby and Wigston", + "E08000004": "Oldham", + "E07000178": "Oxford", + "E07000122": "Pendle", + "E06000031": "Peterborough", + "E06000026": "Plymouth", + "E06000044": "Portsmouth", + "E07000123": "Preston", + "E06000038": "Reading", + "E09000026": "Redbridge", + "E06000003": "Redcar and Cleveland", + "E07000236": "Redditch", + "E07000211": "Reigate and Banstead", + "E07000124": "Ribble Valley", + "E09000027": "Richmond upon Thames", + "E07000166": "Richmondshire", + "E08000005": "Rochdale", + "E07000075": "Rochford", + "E07000125": "Rossendale", + "E07000064": "Rother", + "E08000018": "Rotherham", + "E07000220": "Rugby", + "E07000212": "Runnymede", + "E07000176": "Rushcliffe", + "E07000092": "Rushmoor", + "E06000017": "Rutland", + "E07000167": "Ryedale", + "E08000006": "Salford", + "E08000028": "Sandwell", + "E07000168": "Scarborough", + "E07000188": "Sedgemoor", + "E08000014": "Sefton", + "E07000169": "Selby", + "E07000111": "Sevenoaks", + "E08000019": "Sheffield", + "E06000051": "Shropshire", + "E06000039": "Slough", + "E08000029": "Solihull", + "E07000246": "Somerset West and Taunton", + "E07000012": "South Cambridgeshire", + "E07000039": "South Derbyshire", + "E06000025": "South Gloucestershire", + "E07000044": "South Hams", + "E07000140": "South Holland", + "E07000141": "South Kesteven", + "E07000031": "South Lakeland", + "E07000149": "South Norfolk", + "E07000155": "South Northamptonshire", + "E07000179": "South Oxfordshire", + "E07000126": "South Ribble", + "E07000189": "South Somerset", + "E07000196": "South Staffordshire", + "E08000023": "South Tyneside", + "E06000045": "Southampton", + "E06000033": "Southend-on-Sea", + "E09000028": "Southwark", + "E07000213": "Spelthorne", + "E07000240": "St Albans", + "E08000013": "St. Helens", + "E07000197": "Stafford", + "E07000198": "Staffordshire Moorlands", + "E07000243": "Stevenage", + "E08000007": "Stockport", + "E06000004": "Stockton-on-Tees", + "E06000021": "Stoke-on-Trent", + "E07000221": "Stratford-on-Avon", + "E07000082": "Stroud", + "E08000024": "Sunderland", + "E07000214": "Surrey Heath", + "E09000029": "Sutton", + "E07000113": "Swale", + "E06000030": "Swindon", + "E08000008": "Tameside", + "E07000199": "Tamworth", + "E07000215": "Tandridge", + "E07000045": "Teignbridge", + "E06000020": "Telford and Wrekin", + "E07000076": "Tendring", + "E07000093": "Test Valley", + "E07000083": "Tewkesbury", + "E07000114": "Thanet", + "E07000102": "Three Rivers", + "E06000034": "Thurrock", + "E07000115": "Tonbridge and Malling", + "E06000027": "Torbay", + "E07000046": "Torridge", + "E09000030": "Tower Hamlets", + "E08000009": "Trafford", + "E07000116": "Tunbridge Wells", + "E07000077": "Uttlesford", + "E07000180": "Vale of White Horse", + "E08000036": "Wakefield", + "E08000030": "Walsall", + "E09000031": "Waltham Forest", + "E09000032": "Wandsworth", + "E06000007": "Warrington", + "E07000222": "Warwick", + "E07000103": "Watford", + "E07000216": "Waverley", + "E07000065": "Wealden", + "E07000156": "Wellingborough", + "E07000241": "Welwyn Hatfield", + "E06000037": "West Berkshire", + "E07000047": "West Devon", + "E07000127": "West Lancashire", + "E07000142": "West Lindsey", + "E07000181": "West Oxfordshire", + "E07000245": "West Suffolk", + "E09000033": "Westminster", + "E08000010": "Wigan", + "E06000054": "Wiltshire", + "E07000094": "Winchester", + "E06000040": "Windsor and Maidenhead", + "E08000015": "Wirral", + "E07000217": "Woking", + "E06000041": "Wokingham", + "E08000031": "Wolverhampton", + "E07000237": "Worcester", + "E07000229": "Worthing", + "E07000238": "Wychavon", + "E07000128": "Wyre", + "E07000239": "Wyre Forest", + "E06000014": "York" } } }, @@ -2009,321 +2013,388 @@ "check_answer_label": "The LA in which household lived immediately before this letting\t", "header": "Which local authority area did the household live in immediately before this letting?", "hint_text": "Includes temporary accommodation", - "type": "radio", - "answer_options": { - "0": "Adur", - "1": "Allerdale", - "2": "Amber Valley", - "3": "Arun", - "4": "Ashfield", - "5": "Ashford", - "6": "Babergh", - "7": "Barking & Dagenham", - "8": "Barnet", - "9": "Barnsley", - "10": "Barrow-in-Furness", - "11": "Basildon", - "12": "Basingstoke & Deane", - "13": "Bassetlaw", - "14": "Bath & NE Somerset", - "15": "Bedford Borough Council", - "16": "Bexley", - "17": "Birmingham", - "18": "Blaby", - "19": "Blackburn", - "20": "Blackpool", - "21": "Bolsover", - "22": "Bolton", - "23": "Boston", - "24": "Bournemouth & Christchurch & Poole", - "25": "Bracknell Forest", - "26": "Bradford", - "27": "Braintree", - "28": "Breckland", - "29": "Brent", - "30": "Brentwood", - "31": "Brighton & Hove", - "32": "Bristol", - "33": "Broadland", - "34": "Bromley", - "35": "Bromsgrove", - "36": "Broxbourne", - "37": "Broxtowe", - "38": "Buckinghamshire", - "39": "Burnley", - "40": "Bury", - "41": "Calderdale", - "42": "Cambridge", - "43": "Camden", - "44": "Cannock Chase", - "45": "Canterbury", - "46": "Carlisle", - "47": "Castle Point", - "48": "Central Bedfordshire", - "49": "Charnwood", - "50": "Chelmsford", - "51": "Cheltenham", - "52": "Cherwell", - "53": "Cheshire West & Chester", - "54": "Chesterfield", - "55": "Chichester", - "56": "Chorley", - "57": "City of London", - "58": "Colchester", - "59": "Copeland", - "60": "Cornwall", - "61": "Cotswold", - "62": "Coventry", - "63": "Craven", - "64": "Crawley", - "65": "Croydon", - "66": "Dacorum", - "67": "Darlington", - "68": "Dartford", - "69": "Derby", - "70": "Derbyshire Dales", - "71": "Doncaster", - "72": "Dorset", - "73": "Dover", - "74": "Dudley", - "75": "Durham", - "76": "Ealing", - "77": "East Cambridgeshire", - "78": "East Cheshire", - "79": "East Devon", - "80": "East Hampshire", - "81": "East Herts", - "82": "East Lindsey", - "83": "East Riding", - "84": "East Staffordshire", - "85": "East Suffolk", - "86": "Eastbourne", - "87": "Eastleigh", - "88": "Eden", - "89": "Elmbridge", - "90": "Enfield", - "91": "Epping Forest", - "92": "Epsom & Ewell", - "93": "Erewash", - "94": "Exeter", - "95": "Fareham", - "96": "Fenland", - "97": "Folkestone & Hythe", - "98": "Forest of Dean", - "99": "Fylde", - "100": "Gateshead", - "101": "Gedling", - "102": "Gloucester", - "103": "Gosport", - "104": "Gravesham", - "105": "Great Yarmouth", - "106": "Greenwich", - "107": "Guildford", - "108": "Hackney", - "109": "Halton", - "110": "Hambleton", - "111": "Hammersmith & Fulham", - "112": "Harborough", - "113": "Haringey", - "114": "Harlow", - "115": "Harrogate", - "116": "Harrow", - "117": "Hart", - "118": "Hartlepool", - "119": "Hastings", - "120": "Havant", - "121": "Havering", - "122": "Herefordshire", - "123": "Hertsmere", - "124": "High Peak", - "125": "Hillingdon", - "126": "Hinckley & Bosworth", - "127": "Horsham", - "128": "Hounslow", - "129": "Huntingdonshire", - "130": "Hyndburn", - "131": "Ipswich", - "132": "Isle of Wight", - "133": "Isles of Scilly", - "134": "Islington", - "135": "Kensington & Chelsea", - "136": "Kings Lynn & West Norfolk", - "137": "Kingston-upon-Hull", - "138": "Kingston-upon-Thames", - "139": "Kirklees", - "140": "Knowsley", - "141": "Lambeth", - "142": "Lancaster", - "143": "Leeds", - "144": "Leicester", - "145": "Lewes", - "146": "Lewisham", - "147": "Lichfield", - "148": "Lincoln", - "149": "Liverpool", - "150": "Luton", - "151": "Maidstone", - "152": "Maldon", - "153": "Malvern Hills", - "154": "Manchester", - "155": "Mansfield", - "156": "Medway", - "157": "Melton", - "158": "Mendip", - "159": "Merton", - "160": "Mid Devon", - "161": "Mid Suffolk", - "162": "Mid Sussex", - "163": "Middlesbrough", - "164": "Milton Keynes", - "165": "Mole Valley", - "166": "N. Ireland", - "167": "New Forest", - "168": "Newark", - "169": "Newcastle-under-Lyme", - "170": "Newcastle-upon-Tyne", - "171": "Newham", - "172": "North Devon", - "173": "North East Derbyshire", - "174": "North East Lincolnshire", - "175": "North Hertfordshire", - "176": "North Kesteven", - "177": "North Lincolnshire", - "178": "North Norfolk", - "179": "North Northamptonshire", - "180": "North Somerset", - "181": "North Tyneside", - "182": "North Warwickshire", - "183": "North West Leics", - "184": "Northumberland", - "185": "Norwich", - "186": "Nottingham", - "187": "Nuneaton & Bedworth", - "188": "Oadby & Wigston", - "189": "Oldham", - "190": "Outside UK", - "191": "Oxford", - "192": "Pendle", - "193": "Peterborough", - "194": "Plymouth", - "195": "Portsmouth", - "196": "Preston", - "197": "Reading", - "198": "Redbridge", - "199": "Redcar & Cleveland", - "200": "Redditch", - "201": "Reigate & Banstead", - "202": "Ribble Valley", - "203": "Richmond-upon-Thames", - "204": "Richmondshire", - "205": "Rochdale", - "206": "Rochford", - "207": "Rossendale", - "208": "Rother", - "209": "Rotherham", - "210": "Rugby", - "211": "Runnymede", - "212": "Rushcliffe", - "213": "Rushmoor", - "214": "Rutland", - "215": "Ryedale", - "216": "Salford", - "217": "Sandwell", - "218": "Scarborough", - "219": "Scotland", - "220": "Sedgemoor", - "221": "Sefton", - "222": "Selby", - "223": "Sevenoaks", - "224": "Sheffield", - "225": "Shropshire", - "226": "Slough", - "227": "Solihull", - "228": "Somerset West & Taunton", - "229": "South Cambridgeshire", - "230": "South Derbyshire", - "231": "South Gloucestershire", - "232": "South Hams", - "233": "South Holland", - "234": "South Kesteven", - "235": "South Lakeland", - "236": "South Norfolk", - "237": "South Oxfordshire", - "238": "South Ribble", - "239": "South Somerset", - "240": "South Staffordshire", - "241": "South Tyneside", - "242": "Southampton", - "243": "Southend-on-Sea", - "244": "Southwark", - "245": "Spelthorne", - "246": "St Albans", - "247": "St Helens", - "248": "Stafford", - "249": "Staffordshire Moorlands", - "250": "Stevenage", - "251": "Stockport", - "252": "Stockton-on-Tees", - "253": "Stoke-on-Trent", - "254": "Stratford-on-Avon", - "255": "Stroud", - "256": "Sunderland", - "257": "Surrey Heath", - "258": "Sutton", - "259": "Swale", - "260": "Swindon", - "261": "Tameside", - "262": "Tamworth", - "263": "Tandridge", - "264": "Teignbridge", - "265": "Telford & Wrekin", - "266": "Tendring", - "267": "Test Valley", - "268": "Tewkesbury", - "269": "Thanet", - "270": "Three Rivers", - "271": "Thurrock", - "272": "Tonbridge & Malling", - "273": "Torbay", - "274": "Torridge", - "275": "Tower Hamlets", - "276": "Trafford", - "277": "Tunbridge Wells", - "278": "Uttlesford", - "279": "Vale of White Horse", - "280": "Wakefield", - "281": "Wales", - "282": "Walsall", - "283": "Waltham Forest", - "284": "Wandsworth", - "285": "Warrington", - "286": "Warwick", - "287": "Watford", - "288": "Waverley", - "289": "Wealden", - "290": "Welwyn Hatfield", - "291": "West Berkshire", - "292": "West Devon", - "293": "West Lancashire", - "294": "West Lindsey", - "295": "West Northamptonshire", - "296": "West Oxfordshire", - "297": "West Suffolk", - "298": "Westminster", - "299": "Wigan", - "300": "Wiltshire", - "301": "Winchester", - "302": "Windsor & Maidenhead", - "303": "Wirral", - "304": "Woking", - "305": "Wokingham", - "306": "Wolverhampton", - "307": "Worcester", - "308": "Worthing", - "309": "Wychavon", - "310": "Wyre", - "311": "Wyre Forest", - "312": "York" + "type": "select", + "answer_options": { + "": "Select an option", + "S12000033": "Aberdeen City", + "S12000034": "Aberdeenshire", + "E07000223": "Adur", + "E07000026": "Allerdale", + "E07000032": "Amber Valley", + "S12000041": "Angus", + "N09000001": "Antrim and Newtownabbey", + "N09000011": "Ards and North Down", + "S12000035": "Argyll and Bute", + "N09000002": "Armagh City, Banbridge and Craigavon", + "E07000224": "Arun", + "E07000170": "Ashfield", + "E07000105": "Ashford", + "E07000200": "Babergh", + "E09000002": "Barking and Dagenham", + "E09000003": "Barnet", + "E08000016": "Barnsley", + "E07000027": "Barrow-in-Furness", + "E07000066": "Basildon", + "E07000084": "Basingstoke and Deane", + "E07000171": "Bassetlaw", + "E06000022": "Bath and North East Somerset", + "E06000055": "Bedford", + "N09000003": "Belfast", + "E09000004": "Bexley", + "E08000025": "Birmingham", + "E07000129": "Blaby", + "E06000008": "Blackburn with Darwen", + "E06000009": "Blackpool", + "W06000019": "Blaenau Gwent", + "E07000033": "Bolsover", + "E08000001": "Bolton", + "E07000136": "Boston", + "E06000058": "Bournemouth, Christchurch and Poole", + "E06000036": "Bracknell Forest", + "E08000032": "Bradford", + "E07000067": "Braintree", + "E07000143": "Breckland", + "E09000005": "Brent", + "E07000068": "Brentwood", + "W06000013": "Bridgend", + "E06000043": "Brighton and Hove", + "E06000023": "Bristol, City of", + "E07000144": "Broadland", + "E09000006": "Bromley", + "E07000234": "Bromsgrove", + "E07000095": "Broxbourne", + "E07000172": "Broxtowe", + "E06000060": "Buckinghamshire", + "E07000117": "Burnley", + "E08000002": "Bury", + "W06000018": "Caerphilly", + "E08000033": "Calderdale", + "E07000008": "Cambridge", + "E09000007": "Camden", + "E07000192": "Cannock Chase", + "E07000106": "Canterbury", + "W06000015": "Cardiff", + "E07000028": "Carlisle", + "W06000010": "Carmarthenshire", + "E07000069": "Castle Point", + "N09000004": "Causeway Coast and Glens", + "E06000056": "Central Bedfordshire", + "W06000008": "Ceredigion", + "E07000130": "Charnwood", + "E07000070": "Chelmsford", + "E07000078": "Cheltenham", + "E07000177": "Cherwell", + "E06000049": "Cheshire East", + "E06000050": "Cheshire West and Chester", + "E07000034": "Chesterfield", + "E07000225": "Chichester", + "E07000118": "Chorley", + "S12000036": "City of Edinburgh", + "E09000001": "City of London", + "S12000005": "Clackmannanshire", + "E07000071": "Colchester", + "W06000003": "Conwy", + "E07000029": "Copeland", + "E07000150": "Corby", + "E06000052": "Cornwall", + "E07000079": "Cotswold", + "E06000047": "County Durham", + "E08000026": "Coventry", + "E07000163": "Craven", + "E07000226": "Crawley", + "E09000008": "Croydon", + "E07000096": "Dacorum", + "E06000005": "Darlington", + "E07000107": "Dartford", + "E07000151": "Daventry", + "W06000004": "Denbighshire", + "E06000015": "Derby", + "E07000035": "Derbyshire Dales", + "N09000005": "Derry City and Strabane", + "E08000017": "Doncaster", + "E06000059": "Dorset", + "E07000108": "Dover", + "E08000027": "Dudley", + "S12000006": "Dumfries and Galloway", + "S12000042": "Dundee City", + "E09000009": "Ealing", + "S12000008": "East Ayrshire", + "E07000009": "East Cambridgeshire", + "E07000040": "East Devon", + "S12000045": "East Dunbartonshire", + "E07000085": "East Hampshire", + "E07000242": "East Hertfordshire", + "E07000137": "East Lindsey", + "S12000010": "East Lothian", + "E07000152": "East Northamptonshire", + "S12000011": "East Renfrewshire", + "E06000011": "East Riding of Yorkshire", + "E07000193": "East Staffordshire", + "E07000244": "East Suffolk", + "E07000061": "Eastbourne", + "E07000086": "Eastleigh", + "E07000030": "Eden", + "E07000207": "Elmbridge", + "E09000010": "Enfield", + "E07000072": "Epping Forest", + "E07000208": "Epsom and Ewell", + "E07000036": "Erewash", + "E07000041": "Exeter", + "S12000014": "Falkirk", + "E07000087": "Fareham", + "E07000010": "Fenland", + "N09000006": "Fermanagh and Omagh", + "S12000047": "Fife", + "W06000005": "Flintshire", + "E07000112": "Folkestone and Hythe", + "E07000080": "Forest of Dean", + "E07000119": "Fylde", + "E08000037": "Gateshead", + "E07000173": "Gedling", + "S12000049": "Glasgow City", + "E07000081": "Gloucester", + "E07000088": "Gosport", + "E07000109": "Gravesham", + "E07000145": "Great Yarmouth", + "E09000011": "Greenwich", + "E07000209": "Guildford", + "W06000002": "Gwynedd", + "E09000012": "Hackney", + "E06000006": "Halton", + "E07000164": "Hambleton", + "E09000013": "Hammersmith and Fulham", + "E07000131": "Harborough", + "E09000014": "Haringey", + "E07000073": "Harlow", + "E07000165": "Harrogate", + "E09000015": "Harrow", + "E07000089": "Hart", + "E06000001": "Hartlepool", + "E07000062": "Hastings", + "E07000090": "Havant", + "E09000016": "Havering", + "E06000019": "Herefordshire, County of", + "E07000098": "Hertsmere", + "E07000037": "High Peak", + "S12000017": "Highland", + "E09000017": "Hillingdon", + "E07000132": "Hinckley and Bosworth", + "E07000227": "Horsham", + "E09000018": "Hounslow", + "E07000011": "Huntingdonshire", + "E07000120": "Hyndburn", + "S12000018": "Inverclyde", + "E07000202": "Ipswich", + "W06000001": "Isle of Anglesey", + "E06000046": "Isle of Wight", + "E06000053": "Isles of Scilly", + "E09000019": "Islington", + "E09000020": "Kensington and Chelsea", + "E07000153": "Kettering", + "E07000146": "King's Lynn and West Norfolk", + "E06000010": "Kingston upon Hull, City of", + "E09000021": "Kingston upon Thames", + "E08000034": "Kirklees", + "E08000011": "Knowsley", + "E09000022": "Lambeth", + "E07000121": "Lancaster", + "E08000035": "Leeds", + "E06000016": "Leicester", + "E07000063": "Lewes", + "E09000023": "Lewisham", + "E07000194": "Lichfield", + "E07000138": "Lincoln", + "N09000007": "Lisburn and Castlereagh", + "E08000012": "Liverpool", + "E06000032": "Luton", + "E07000110": "Maidstone", + "E07000074": "Maldon", + "E07000235": "Malvern Hills", + "E08000003": "Manchester", + "E07000174": "Mansfield", + "E06000035": "Medway", + "E07000133": "Melton", + "E07000187": "Mendip", + "W06000024": "Merthyr Tydfil", + "E09000024": "Merton", + "E07000042": "Mid Devon", + "E07000203": "Mid Suffolk", + "E07000228": "Mid Sussex", + "N09000009": "Mid Ulster", + "N09000008": "Mid and East Antrim", + "E06000002": "Middlesbrough", + "S12000019": "Midlothian", + "E06000042": "Milton Keynes", + "E07000210": "Mole Valley", + "W06000021": "Monmouthshire", + "S12000020": "Moray", + "S12000013": "Na h-Eileanan Siar", + "W06000012": "Neath Port Talbot", + "E07000091": "New Forest", + "E07000175": "Newark and Sherwood", + "E08000021": "Newcastle upon Tyne", + "E07000195": "Newcastle-under-Lyme", + "E09000025": "Newham", + "W06000022": "Newport", + "N09000010": "Newry, Mourne and Down", + "S12000021": "North Ayrshire", + "E07000043": "North Devon", + "E07000038": "North East Derbyshire", + "E06000012": "North East Lincolnshire", + "E07000099": "North Hertfordshire", + "E07000139": "North Kesteven", + "S12000050": "North Lanarkshire", + "E06000013": "North Lincolnshire", + "E07000147": "North Norfolk", + "E06000024": "North Somerset", + "E08000022": "North Tyneside", + "E07000218": "North Warwickshire", + "E07000134": "North West Leicestershire", + "E07000154": "Northampton", + "E06000057": "Northumberland", + "E07000148": "Norwich", + "E06000018": "Nottingham", + "E07000219": "Nuneaton and Bedworth", + "E07000135": "Oadby and Wigston", + "E08000004": "Oldham", + "S12000023": "Orkney Islands", + "E07000178": "Oxford", + "W06000009": "Pembrokeshire", + "E07000122": "Pendle", + "S12000048": "Perth and Kinross", + "E06000031": "Peterborough", + "E06000026": "Plymouth", + "E06000044": "Portsmouth", + "W06000023": "Powys", + "E07000123": "Preston", + "E06000038": "Reading", + "E09000026": "Redbridge", + "E06000003": "Redcar and Cleveland", + "E07000236": "Redditch", + "E07000211": "Reigate and Banstead", + "S12000038": "Renfrewshire", + "W06000016": "Rhondda Cynon Taf", + "E07000124": "Ribble Valley", + "E09000027": "Richmond upon Thames", + "E07000166": "Richmondshire", + "E08000005": "Rochdale", + "E07000075": "Rochford", + "E07000125": "Rossendale", + "E07000064": "Rother", + "E08000018": "Rotherham", + "E07000220": "Rugby", + "E07000212": "Runnymede", + "E07000176": "Rushcliffe", + "E07000092": "Rushmoor", + "E06000017": "Rutland", + "E07000167": "Ryedale", + "E08000006": "Salford", + "E08000028": "Sandwell", + "E07000168": "Scarborough", + "S12000026": "Scottish Borders", + "E07000188": "Sedgemoor", + "E08000014": "Sefton", + "E07000169": "Selby", + "E07000111": "Sevenoaks", + "E08000019": "Sheffield", + "S12000027": "Shetland Islands", + "E06000051": "Shropshire", + "E06000039": "Slough", + "E08000029": "Solihull", + "E07000246": "Somerset West and Taunton", + "S12000028": "South Ayrshire", + "E07000012": "South Cambridgeshire", + "E07000039": "South Derbyshire", + "E06000025": "South Gloucestershire", + "E07000044": "South Hams", + "E07000140": "South Holland", + "E07000141": "South Kesteven", + "E07000031": "South Lakeland", + "S12000029": "South Lanarkshire", + "E07000149": "South Norfolk", + "E07000155": "South Northamptonshire", + "E07000179": "South Oxfordshire", + "E07000126": "South Ribble", + "E07000189": "South Somerset", + "E07000196": "South Staffordshire", + "E08000023": "South Tyneside", + "E06000045": "Southampton", + "E06000033": "Southend-on-Sea", + "E09000028": "Southwark", + "E07000213": "Spelthorne", + "E07000240": "St Albans", + "E08000013": "St. Helens", + "E07000197": "Stafford", + "E07000198": "Staffordshire Moorlands", + "E07000243": "Stevenage", + "S12000030": "Stirling", + "E08000007": "Stockport", + "E06000004": "Stockton-on-Tees", + "E06000021": "Stoke-on-Trent", + "E07000221": "Stratford-on-Avon", + "E07000082": "Stroud", + "E08000024": "Sunderland", + "E07000214": "Surrey Heath", + "E09000029": "Sutton", + "E07000113": "Swale", + "W06000011": "Swansea", + "E06000030": "Swindon", + "E08000008": "Tameside", + "E07000199": "Tamworth", + "E07000215": "Tandridge", + "E07000045": "Teignbridge", + "E06000020": "Telford and Wrekin", + "E07000076": "Tendring", + "E07000093": "Test Valley", + "E07000083": "Tewkesbury", + "E07000114": "Thanet", + "E07000102": "Three Rivers", + "E06000034": "Thurrock", + "E07000115": "Tonbridge and Malling", + "E06000027": "Torbay", + "W06000020": "Torfaen", + "E07000046": "Torridge", + "E09000030": "Tower Hamlets", + "E08000009": "Trafford", + "E07000116": "Tunbridge Wells", + "E07000077": "Uttlesford", + "W06000014": "Vale of Glamorgan", + "E07000180": "Vale of White Horse", + "E08000036": "Wakefield", + "E08000030": "Walsall", + "E09000031": "Waltham Forest", + "E09000032": "Wandsworth", + "E06000007": "Warrington", + "E07000222": "Warwick", + "E07000103": "Watford", + "E07000216": "Waverley", + "E07000065": "Wealden", + "E07000156": "Wellingborough", + "E07000241": "Welwyn Hatfield", + "E06000037": "West Berkshire", + "E07000047": "West Devon", + "S12000039": "West Dunbartonshire", + "E07000127": "West Lancashire", + "E07000142": "West Lindsey", + "S12000040": "West Lothian", + "E07000181": "West Oxfordshire", + "E07000245": "West Suffolk", + "E09000033": "Westminster", + "E08000010": "Wigan", + "E06000054": "Wiltshire", + "E07000094": "Winchester", + "E06000040": "Windsor and Maidenhead", + "E08000015": "Wirral", + "E07000217": "Woking", + "E06000041": "Wokingham", + "E08000031": "Wolverhampton", + "E07000237": "Worcester", + "E07000229": "Worthing", + "W06000006": "Wrexham", + "E07000238": "Wychavon", + "E07000128": "Wyre", + "E07000239": "Wyre Forest", + "E06000014": "York" } } } diff --git a/package.json b/package.json index e20af9cbb..f27fbab7b 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "5.4.0", + "accessible-autocomplete": "^2.0.3", "chart.js": "^3.6.0", "chartkick": "^4.1.0", "govuk-frontend": "^3.14.0", diff --git a/spec/features/form/accessible_autocomplete_spec.rb b/spec/features/form/accessible_autocomplete_spec.rb new file mode 100644 index 000000000..dc56c2994 --- /dev/null +++ b/spec/features/form/accessible_autocomplete_spec.rb @@ -0,0 +1,27 @@ +require "rails_helper" +require_relative "helpers" +require_relative "../../request_helper" + +RSpec.describe "Accessible Automcomplete" do + include Helpers + let(:user) { FactoryBot.create(:user) } + let(:case_log) do + FactoryBot.create( + :case_log, + :in_progress, + owning_organisation: user.organisation, + managing_organisation: user.organisation, + ) + end + + before do + RequestHelper.stub_http_requests + sign_in user + end + + it "allows type ahead filtering", js: true do + visit("/logs/#{case_log.id}/accessible-select") + find("#case-log-la-field").click.native.send_keys("T", "h", "a", "n", :down, :enter) + expect(find("#case-log-la-field").value).to eq("Thanet") + end +end diff --git a/spec/features/form/check_answers_page_spec.rb b/spec/features/form/check_answers_page_spec.rb index 57e09c295..aa8f77f93 100644 --- a/spec/features/form/check_answers_page_spec.rb +++ b/spec/features/form/check_answers_page_spec.rb @@ -76,13 +76,13 @@ RSpec.describe "Form Check Answers Page" do it "should have a change link for answered questions" do visit("/logs/#{empty_case_log.id}/household-needs/check-answers") - assert_selector "a", text: /Answer\z/, count: 4 + assert_selector "a", text: /Answer\z/, count: 5 assert_selector "a", text: "Change", count: 0 visit("/logs/#{empty_case_log.id}/accessibility-requirements") check("case-log-accessibility-requirements-housingneeds-c-field") click_button("Save and continue") visit("/logs/#{empty_case_log.id}/household-needs/check-answers") - assert_selector "a", text: /Answer\z/, count: 3 + assert_selector "a", text: /Answer\z/, count: 4 assert_selector "a", text: "Change", count: 1 expect(page).to have_link("Change", href: "/logs/#{empty_case_log.id}/accessibility-requirements") end diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index d2c234bc0..c19c2d955 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -185,6 +185,23 @@ } } }, + "accessible_select": { + "questions": { + "la": { + "header": "Select options", + "hint_text": "Type ahead to filter the options", + "type": "select", + "check_answer_label": "Accessible Select", + "answer_options": { + "0": "Adur", + "1": "Lewisham", + "2": "Oxford", + "3": "Thanet", + "4": "York" + } + } + } + }, "condition_effects": { "questions": { "condition_effects": { diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 188ca33d1..e44785519 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -16,7 +16,7 @@ RSpec.describe FormHandler do form_handler = FormHandler.instance form = form_handler.get_form(test_form_name) expect(form).to be_a(Form) - expect(form.pages.count).to eq(27) + expect(form.pages.count).to eq(28) end end diff --git a/yarn.lock b/yarn.lock index c160e3dc9..4c8dfe1e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1203,6 +1203,13 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +accessible-autocomplete@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/accessible-autocomplete/-/accessible-autocomplete-2.0.3.tgz#3ed8d529b227b77e99ab509eec5d2c8d1b8bea8b" + integrity sha512-bUswBs/mDH17dUFRAJMTtcGafJ++w1YLPPFjdfJj3lnuBsLpByAw2gmr8qxXX8oc7tzoKS3Ay5FKOPM+WMBxIw== + dependencies: + preact "^8.3.1" + acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -5506,6 +5513,11 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2 picocolors "^0.2.1" source-map "^0.6.1" +preact@^8.3.1: + version "8.5.3" + resolved "https://registry.yarnpkg.com/preact/-/preact-8.5.3.tgz#78c2a5562fcecb1fed1d0055fa4ac1e27bde17c1" + integrity sha512-O3kKP+1YdgqHOFsZF2a9JVdtqD+RPzCQc3rP+Ualf7V6rmRDchZ9MJbiGTT7LuyqFKZqlHSOyO/oMFmI2lVTsw== + prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"