-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jo qg sort shopping list #30
base: main
Are you sure you want to change the base?
Conversation
Visit the preview URL for this PR (updated for commit f749273): https://tcl-79-smart-shopping-list--pr30-jo-qg-sort-shopping-vj0pf99x.web.app (expires Thu, 26 Sep 2024 09:58:27 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: d91d9ddbda780208241c52942f544acf8e81407a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job with this tough issue impressive work! 👏. I left suggestions as comments i believe addressing them would enhance performance and improve clarity.
I also noticed that the indicators disappear when filtering with the search bar and they don’t reappear after clearing the filter since data
goes back to before the indicators are added.
} else if (daysSinceLastPurchase > 30 && daysSinceLastPurchase < 60) { | ||
return 'Overdue'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe when dateNextPurchased
has passed is how an item becomes Overdue.
setAllData([...comparePurchaseUrgency(arrayWithIndicator)]); | ||
setDisplayData([...comparePurchaseUrgency(arrayWithIndicator)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its best to use a variable to be stored in the states instead of calling comparePurchaseUrgency
twice.
Description
Code implements a sort function to sort our shopping list items by urgency and alphabetical order. Overdue items are pushed to the top of the list and inactive items are pushed to the bottom.
Related Issue
Closes #13
Acceptance Criteria
api/firestore.js
exports a newcomparePurchaseUrgency
function with the following behaviorsType of Changes
Feature
Updates
Before
After
Testing Steps / QA Criteria
git pull
andgit checkout jo-qg-sort-shopping-list
npm start
list
page