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

Alert on repeated item #27

Merged
merged 6 commits into from
Sep 15, 2024
Merged

Alert on repeated item #27

merged 6 commits into from
Sep 15, 2024

Conversation

didemydn
Copy link
Collaborator

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

Description

Users shouldn't be able to add an empty item to their list, or add the same item twice. If they try to do this, we need to show them an error message that explains the problem. This way, we’ll prevent some clutter in their lists.

Related Issue

closes #10

Acceptance Criteria

Acceptance criteria

  • Show an error message if the user tries to submit an empty item
  • Show an error message if the user tries to submit a new item that is identical to an existing name. For instance, if the list contains apples and the user adds apples.
  • Show an error message if the user tries to submit a new item that matches an existing name with punctuation and casing normalized. For instance, if the list contains apples and the user adds aPples or apples, or a pples.
  • The user’s original input is saved in the database

Updates

Before

List view
You can add an item if there is already one in the list. exp oat and Oat,
image

After

- an error message if the user tries to submit an empty item
image

- an error message if the user tries to submit a new item that is identical to an existing name
image

- an existing name with punctuation and casing normalized
image

Testing Steps / QA Criteria

npm start
manageList view
Add an item to a list

Copy link

github-actions bot commented Sep 12, 2024

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

https://tcl-78-smart-shopping-list--pr27-dc-tc-alert-on-repea-ib43nvjo.web.app

(expires Sun, 22 Sep 2024 16:24:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c781903507c1507075d7a974036959ddeec29c0a

Copy link
Collaborator

@eva-lng eva-lng left a comment

Choose a reason for hiding this comment

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

The feature works well, great job! I like the use of regex, makes the code look concise and clean.

@GrannyYetta
Copy link
Collaborator

Hi Didem and Tataw, the feature works well for me. It looks great and the comments are very helpful!

Fun fact: I get the "fill out all the fields" messages in Spanish.

Copy link
Collaborator

@vivitt vivitt left a comment

Choose a reason for hiding this comment

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

Thanks for your work team 🚀
The new feature works well, and your code looks great! Great job ⚡️

Just a suggestion for a possible future improvement: normalizing all the names that are stored, so that when we display items in the list they all have consistent capitalization.

@tataw-cl tataw-cl merged commit a895d04 into main Sep 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10. As a user, I want to be alerted when I’m entering an empty item or an item that's already on my list
5 participants