-
Notifications
You must be signed in to change notification settings - Fork 3
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
Display items in categories #31
Conversation
…n List component to sort rendering order of items, created ContainerItems component to sort items into categories
Visit the preview URL for this PR (updated for commit 3c18015): https://tcl-71-smart-shopping-list--pr31-bo-ce-compareitems-jm8hed6x.web.app (expires Fri, 22 Mar 2024 09:31:39 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 1e7ade9d0f374c4ddb5d7ab6fc541062fc7a1ab4 |
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.
Nicely done!! <3
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.
Hello team! Nice job, the new feature works great and the items are nicely ordered. I like that the changes in the UI are simple yet clear.
I think we can still add more work on this issue, so we address the problem of displaying the items with a sooner nextPurchaseDate first.
I tried locally to make some changes in the comparePurchaseUrgency function in firebase.js line 251:
let dataSortedByDaysLeft = newData.sort((itemA, itemB) => {
return itemA.daysBeforePurchase - itemB.daysBeforePurchase;
});
let dataSortedAlphabetically = dataSortedByDaysLeft.sort((itemA, itemB) => {
if (itemA.daysBeforePurchase === itemB.daysBeforePurchase) {
return itemA.name.localeCompare(itemB.name);
}
});
return dataSortedAlphabetically;
Will be happy to contribute on this if needed :)
Thank you for your feedback Viviana! @borjaMarti Viviana raised this question during the office hour meeting yesterday. We have now this question, in each categories (Buy Soon, Buy soonish...etc), do we display items alphabetically or by day before purchased. As the meeting was yesterday, I had some thinking time, and this decision will have to be a team one, as both way of handling the sortering are acceptable. I approach this question with the user and their behavior in mind:
Example one, there are three items in the 'buy soon' category, and the date before purchase is 5 of those three items. The user won't know the date of purchase, however as the items are in the 'buy soon' category, they know they will probably need them soon. Example two, there are three items in the 'buy soon' category, and the date before purchase for chocolate is 3 and for the other two items 7. The user won't know the date of purchase, however as the items are in the 'buy soon' category, they know they will probably need them soon. The 'buy soon' category is more an indication we give the user that they are more likely to need to purchase this items soon so they can plan their grocery accordingly.
@BikeMouse @vivitt @borjaMarti Let's come up with a decision before the weekend :) |
Hey team! The way I understood the issue, sorting should work the way you mention, @vivitt, but while coding it @ocsiddisco mentioned that from a UX perspective it makes more sense to alphabetically order the items inside each block since we aren't communicating the exact numbers of days left to the user. To me this made sense as well, so that's the way we implemented it. Personally I'd keep the sorting behavior consistent between blocks, one way or the other. I'm open to doing it either way though ^^ |
Good morning team! |
Description
This PR is adding visuals indicators to how soon an item should be bought. It takes in consideration that an item could be 'overdue', meaning that it had not been purchased at the expected time, and 'inactif', meaning an item has not been purchased for more than 60 days.
The implementation keeps the previous filtering method implemented and adapted it to the new UI.
Regarding the acceptance criteria 'sorts inactive items last', we did not implemented it in the 'comparePurchaseUrgency' in firebase.js, but it is implemented in the UI in the 'list.jsx'.
Related Issue
closes #13
Acceptance Criteria
api/firestore.js
exports a newcomparePurchaseUrgency
function with the following behaviorsType of Changes
Updates
Before
After
Testing Steps / QA Criteria