cds-snc / c19-benefits-node

Answer some questions to find which federal programs can help you https://covid-benefits.alpha.canada.ca/. - Répondez à quelques questions pour trouver quels programmes d’aide financière fédéraux s’offrent à vous https://covid-prestations.alpha.canada.ca/.
MIT License
2 stars 4 forks source link

Feature/province list #523

Closed EricDube closed 4 years ago

EricDube commented 4 years ago

Description

Dropdown

Closes: https://trello.com/c/KcuVOorR/181-people-can-type-to-select-their-province-or-territory-from-a-list Allow users to select their province or territory from a drop down list. It allows the users to type in the province or territory and will auto-complete to the appropriate value. It does not allow values not in the list.

Screenshot from 2020-06-16 15-44-45

Test Instructions

  1. Navigate to the Your province or territory page
  2. Enter text in text field or click on arrow of dropdown
  3. Validate that the correct result displays on the results page.

Back Button

Modified implementation of the Back button. The back button now stores a history of pages viewed in the session so the user can navigate back to the last page viewed with javascript disabled.

Screenshot from 2020-06-16 16-06-49

Test Instructions for back button changes

  1. Navigate to the Your province or territory page
  2. Select a province or territory and click Next
  3. Validate that the back button appears at the top left of the current page
  4. Click back button
  5. Validate that it brings you back to the Your province or territory page
  6. Validate that the back button does NOT appear on the Your province or territory page

Help Requested

katewilhelm commented 4 years ago

I've now finished testing that all provinces get the right result. Just the French ordering needs fixing as far as I can see

CalvinRodo commented 4 years ago

Province Sorting has been fixed, just need to fix unit tests

katewilhelm commented 4 years ago

Order of provinces looks great!

CalvinRodo commented 4 years ago

I've also addressed @katedee 's comments about the drop down colours

dsamojlenko commented 4 years ago

I'd recommend decoupling the js from the dropdown macro, and using the webpack build pipeline to compile the related js.

So:

import accessibleAutocomplete from 'accessible-autocomplete'

accessibleAutocomplete.enhanceSelectElement({
  selectElement: document.querySelector('#province-select'),
  showAllValues: true,
  showNoOptionsFound: false,
})
entry: {
  styles: './assets/scss/app.scss',
  app: './assets/js/app.js',
  province: './routes/question-province/js/question-province.js',
},
{% block scripts %}
    <script type="text/javascript" src="{{ asset('/dist/js/province.js') }}"></script>
{% endblock %}
corahansen commented 4 years ago

Reviewed and approved, thank you!