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

Add checks to new item input #30

Merged
merged 3 commits into from
Mar 10, 2024
Merged

Conversation

etiry
Copy link
Collaborator

@etiry etiry commented Mar 6, 2024

Description

Adds checks to user input of new items to alert the user if they submitted an empty item name or submitted an item that is already on their list after normalizing case and punctuation

Related Issue

closes #10

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

Type of Changes

enhancement

Updates

Before

N/A

After

Screenshot 2024-03-07 at 8 54 38 AM

Screenshot 2024-03-07 at 8 54 12 AM
3c18)

Screenshot 2024-03-07 at 8 55 17 AM

Testing Steps / QA Criteria

  • Sign in and select the dinner list
  • Navigate to the Manage List view
  • Try to submit the form without entering an item name
  • Confirm that an alert displays saying "Please enter an item name"
  • Try to add an item that is already on the list by entering it identically (e.g., Gruyere not gruyere)
  • Confirm that an alert displays saying "This item already exists in the list"
  • Try to add an item that is already on the list by changing the casing and/or adding punctuation or spaces (e.g., gruyere or Gruyere!)
  • Confirm that an alert displays saying "This item already exists in the list"
  • Try to add an item that is not on the list
  • Confirm it gets added successfully
  • Confirm it gets added as you typed it in rather than a normalized version (e.g., Oreos not oreos)

Copy link

github-actions bot commented Mar 6, 2024

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

https://tcl-68-smart-shopping-list--pr30-et-ap-check-item-emp-xryu1k3k.web.app

(expires Sun, 17 Mar 2024 00:50:33 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 8cb5d089a99ba9972009993f4dd31796b0cbda84

@etiry etiry changed the title Et ap check item empty dupe Add checks to new item input Mar 7, 2024
@andiedoescode andiedoescode marked this pull request as ready for review March 8, 2024 00:50
sdmisra
sdmisra previously approved these changes Mar 8, 2024
Copy link
Collaborator

@sdmisra sdmisra left a comment

Choose a reason for hiding this comment

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

This looks good to me, nice work this week!

src/views/ManageList.jsx Outdated Show resolved Hide resolved
@raaynaldo
Copy link
Collaborator

Great job on utilizing regex

DevinaG007
DevinaG007 previously approved these changes Mar 9, 2024
Copy link
Collaborator

@DevinaG007 DevinaG007 left a comment

Choose a reason for hiding this comment

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

Praise: Nice comparison choice used on line 36 of ManageList. I tested "New England Clam Chowder" versus "Clam Chowder" and it worked!

success

Moved if clause

Co-authored-by: Raynaldo Sutisna <[email protected]>
Copy link
Collaborator

@raaynaldo raaynaldo left a comment

Choose a reason for hiding this comment

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

Thanks!

@andiedoescode andiedoescode merged commit 7bf44b2 into main Mar 10, 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