the-collab-lab / tcl-65-smart-shopping-list

1 stars 1 forks source link

Issue 5: Join and share lists #21

Closed lydiadunning closed 1 year ago

lydiadunning commented 1 year ago

Description

This PR adds functionality allowing the user to connect to an existing list.

User Facing Behavior

Adds a text input field to a form in the Home view, allowing a user to input a listToken. When this form is submitted, if the list exists the listToken is saved in local storage and the user is redirected to the list page. Otherwise, a message informs the user that the list was not found.

Firebase API

Adds a function to firebase.js to return the count of items in a collection. If the collection does not exist, the count will be 0.

Refactoring

Changed the AddItem view so that when a new item is added to a new list, firebase creates a new collection with the same name as the token in local storage.

Related Issue

closes #5

Acceptance Criteria

If a user doesn’t already have a token:

If a user does already have a token:

Type of Changes

Type
:bug: Bug fix
:sparkles: New feature
:hammer: Refactoring
:100: Add tests
:link: Update dependencies
:scroll: Docs

Updates

Before

image

After

https://github.com/the-collab-lab/tcl-65-smart-shopping-list/assets/71429289/e0c7ae2c-d540-4c88-97c1-db332bc71ef8

Testing Steps / QA Criteria

github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit 46e5645):

https://tcl-65-smart-shopping-list--pr21-ld-is-join-and-share-g8ybfaf7.web.app

(expires Sun, 10 Sep 2023 16:41:02 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a91b8fb0f37677e20d8afa3e8ea496251536f9b8