Skip to content
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

Adding mark item as purchased #38

Merged
merged 8 commits into from
Mar 2, 2024
Merged

Conversation

jtkabenni
Copy link
Collaborator

@jtkabenni jtkabenni commented Feb 27, 2024

For an example of how to fill this template out, see this Pull Request.

Description

Adding 'mark item as purchased' functionality.

  • Created checkbox input for list items to mark item as purchased.
  • Created firebase function to update item's dateLastPurchased and totalPurchases fields when item is purchased.
  • If item was purchased in last 24 hours, item displays as already checked off.
  • Passed down listpath from list to item component so firebase function can access it.

Related Issue

closes #9

Acceptance Criteria

  • The ListItem component renders a checkbox with a semantic label.
  • Checking off the item in the UI also updates the dateLastPurchased and totalPurchases properties on the corresponding Firestore document
  • The item is shown as checked for 24 hours after the purchase is made (i.e. we assume the user does not need to buy the item again for at least 1 day). After 24 hours, the item unchecks itself so the user can buy it again.
  • The updateItem function in firebase.js has been filled out, and sends updates to the firestore database when an item is checked

Type of Changes

Feature update.

Updates

Before

Screenshot 2024-02-26 at 10 49 06 PM

After

Screenshot 2024-02-26 at 10 49 19 PM

Testing Steps / QA Criteria

  1. Select a list and go to the list view to view items.
  2. Check off items to mark them as purchased.
  3. Refresh - items purchased in the past 24 hours should still be checked off.

Copy link

github-actions bot commented Feb 27, 2024

Visit the preview URL for this PR (updated for commit 96c2e8d):

https://tcl-67-smart-shopping-list--pr38-jt-rb-mark-item-purc-cipem0uf.web.app

(expires Fri, 08 Mar 2024 20:29:09 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1dc6f6876568bd8a1c97781eec7984835c207f7c

Copy link
Collaborator

@aberger3647 aberger3647 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job y'all!

Copy link
Collaborator

@TishShaw TishShaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jtkabenni jtkabenni merged commit a4e4943 into main Mar 2, 2024
2 checks passed
@flbarfield flbarfield deleted the jt-rb-mark-item-purchased-9 branch March 3, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants