As a user, I want to be warned when my date selections are not within the current min and max dates so that I know if my selected dates are valid
The current min and max dates are already returned as part of the preload API call and are stored in local storage and the preload state variable as ‘preload.minDate’ and ‘preload.maxDate’
Changes Made
Installed dependencies for Material UI pickers
Replaced date TextFields with KeyboardDatePickers
Set min and max dates and related error messages for date pickers
Added an Alert component that is shown when the End Date is before the Start Date
Added Material UI theme to change the color palette.
Changed favicon to an airplane emoji and provided attribution in README
Changed Document Title from 'React App' to 'Crappy Flights'
Removed unneeded files and references
AC:
[x] Show an error message if a user selects a date before the min date and tell the user what the min date is
[x] Show an error message if a user selects a date after the max date and tells the user what the max date is
[x] Show an error message if the end date is before the start date
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 Story
As a user, I want to be warned when my date selections are not within the current min and max dates so that I know if my selected dates are valid The current min and max dates are already returned as part of the preload API call and are stored in local storage and the preload state variable as ‘preload.minDate’ and ‘preload.maxDate’
Changes Made
TextField
s withKeyboardDatePicker
sAlert
component that is shown when the End Date is before the Start DateAC:
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