-
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
Sm ar items in order issue 13 #30
Conversation
…d out by category of soonness
Visit the preview URL for this PR (updated for commit 547cad0): https://tcl-76-smart-shopping-list--pr30-sm-ar-items-in-order-y2d5p2a0.web.app (expires Fri, 27 Sep 2024 14:35:06 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 512b1a88be8ae05fd3e727b99332819df760271d |
const dateNextPurchasedAsDateA = a.dateNextPurchased?.toDate(); | ||
const dateNextPurchasedAsDateB = b.dateNextPurchased?.toDate(); | ||
|
||
const daysUntilNextPurchaseA = getDaysBetweenDates( |
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 like how getDaysBetwenDates
gets used again here!
return <ListItem key={item.id} item={item} />; | ||
})} | ||
{filteredObject && | ||
Object.entries(filteredObject).map(([timeBucket, list]) => ( |
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 like the implementation of using Object.entries here. I definitely learned a bit about data type conversion by looking at this.
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 was able to test everything out and did not come across any issues. Well done!
return daysUntilNextPurchaseB > daysUntilNextPurchaseA ? -1 : 1; | ||
}); | ||
|
||
sortedList.forEach((item) => { |
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 like the approach you guys took here. It's interesting to me how you created empty array's for each Urgency and then in the if else statement are just pushing values dependent on what is selected by the user.
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.
Nice work with this one!
Description
dateNextPurchased
value is).Related Issue
closes 13
Acceptance Criteria
api/firestore.js
exports a newcomparePurchaseUrgency
function with the following behaviorsA stretch goal
If you complete all of the previous acceptance criteria, consider what happens when an item’s dateNextPurchased has passed, but it isn’t yet inactive. Let’s call that item “overdue”.
Type of Changes
enhancement
feature
Updates
Before
After
Testing Steps / QA Criteria
sm-ar-items-in-order-issue-13
calculateEstimate
thinks you will buy that item every single day)dateLastPurchased
anddateNextPurchased
inputs in Firebase to reflect items being purchased over 60 days ago. (Set an item'sdateLastPurchased
to January 1,dateNextPurchased
to January 10, andtotalPurchases
to 4.)dateLastPurchased
anddateNextPurchased
inputs in Firebase to reflect items being purchased over 60 days ago. (Set an item'sdateLastPurchased
to January 1,dateNextPurchased
to December 10, andtotalPurchases
to 4.)