As a user, I want the departure airport to be removed from the destination airport dropdown so that I can’t select the same departure and destination
The select options for departure airport and destination airport is data from the preload API call that is formatted and stored in an array. The array is stored in local storage and the preload state variable as ‘preload.airports’
AC:
[x] When the departure airport is selected, the departure airport from the options array is filtered out for the destination airport dropdown
As a user I want the previous valid search to be shown if I make a search that is not valid or a search where there are no flights so that I can still view my last valid search
The previous query is saved in local storage correctly and is only changed when there is another valid query made, but it is never used
AC:
[x] Data stored in local storage for previous query is utilized
[x] Previous valid query is shown in the Previous Search link above the main form on the search page
Changes Made
Added function to filter selected departure airport from the destination airport select list
Use previous query data stored in local storage for displaying last valid query
Added function that sets state hooks and local storage for search query properties to previous valid query data when clicking on previous search
Type of Changes
Type
🐛 Bug Fix
✓
✨ New Feature
🔨 Refactoring
💯 Add tests
🔗 Update dependencies
📜 Docs
Testing Steps / QA Criteria
Set up and run the Flask API
In ch2-flight-search-api/creds add a service account KEY FILE
Run the following command:
export GOOGLE_APPLICATION_CREDENTIALS="[PATH TO KEY FILE]"
In ch2-flight-search-api install or activate your python virtualenv and install all packages in requirements.txt
Run the following command to start the application:
python3.7 run.py
The REST API should now be available on http://localhost:5000
Set up and run the front end
In ch2-flight-search-fontend run npm install to install project dependencies.
Run npm run start to start the application
The application should be available on http://localhost:3000
User Stories
As a user, I want the departure airport to be removed from the destination airport dropdown so that I can’t select the same departure and destination The select options for departure airport and destination airport is data from the preload API call that is formatted and stored in an array. The array is stored in local storage and the preload state variable as ‘preload.airports’
AC:
As a user I want the previous valid search to be shown if I make a search that is not valid or a search where there are no flights so that I can still view my last valid search The previous query is saved in local storage correctly and is only changed when there is another valid query made, but it is never used
AC:
Changes Made
Type of Changes
Testing Steps / QA Criteria
Set up and run the Flask API
ch2-flight-search-api/creds
add a service account KEY FILEch2-flight-search-api
install or activate your python virtualenv and install all packages in requirements.txtThe REST API should now be available on
http://localhost:5000
Set up and run the front end
ch2-flight-search-fontend
runnpm install
to install project dependencies.npm run start
to start the applicationThe application should be available on
http://localhost:3000