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

Sort shopping list by urgency #30

Merged
merged 7 commits into from
Sep 22, 2024
Merged

Conversation

joriordan332
Copy link
Collaborator

Description

Code implements a sort function to sort our shopping list items by urgency and alphabetical order. Overdue items are pushed to the top of the list and inactive items are pushed to the bottom.

Related Issue

Closes #13

Acceptance Criteria

  • Items in the list are shown with an indicator that tells the user they should buy the item “soon”, “kind of soon”, or “not soon”; or that the item is “inactive”
    • This urgency indicator does not rely on only color
  • api/firestore.js exports a new comparePurchaseUrgency function with the following behaviors
    • sorts inactive items last, then
    • sorts items in ascending order of days until purchase, and
    • sorts items with the same days until purchase alphabetically

Type of Changes

Feature

Updates

Before

After

image

image

Testing Steps / QA Criteria

  • Do a git pull and git checkout jo-qg-sort-shopping-list
  • Open the homepage by running npm start
  • Navigate to the list page
  • Each item on your list should have an indicator next to it and be ordered as followed-overdue, soon, kind of soon, not soon & inactive
  • For each urgency category the items will be alphabetised
  • Adding a new item to the list should automatically sort the items

Copy link

github-actions bot commented Sep 18, 2024

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

https://tcl-79-smart-shopping-list--pr30-jo-qg-sort-shopping-vj0pf99x.web.app

(expires Sun, 29 Sep 2024 09:05:31 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: d91d9ddbda780208241c52942f544acf8e81407a

Copy link
Collaborator

@Hudamabkhoot Hudamabkhoot 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 with this tough issue impressive work! 👏. I left suggestions as comments i believe addressing them would enhance performance and improve clarity.

I also noticed that the indicators disappear when filtering with the search bar and they don’t reappear after clearing the filter since data goes back to before the indicators are added.

src/api/firebase.js Outdated Show resolved Hide resolved
src/views/List.jsx Outdated Show resolved Hide resolved
src/views/List.jsx Outdated Show resolved Hide resolved
src/utils/helpers.js Outdated Show resolved Hide resolved
src/views/List.jsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@Hudamabkhoot Hudamabkhoot left a comment

Choose a reason for hiding this comment

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

Amazing work well done guys! 👏

Copy link
Collaborator

@marshjaja marshjaja left a comment

Choose a reason for hiding this comment

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

Amazing job guys!🤾🏾🤸🏾

@joriordan332 joriordan332 changed the title Jo qg sort shopping list Sort shopping list by urgency Sep 20, 2024
Copy link
Member

@hariscs hariscs left a comment

Choose a reason for hiding this comment

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

this is some impressive work 🙌, great job guys.
also @Hudamabkhoot the suggestions are amazing on this PR 🥳

@joriordan332 joriordan332 merged commit 7dc2713 into main Sep 22, 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
5 participants