-
Notifications
You must be signed in to change notification settings - Fork 1
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
[MF] Refactoring for readability and maintenance #73
Conversation
… list based on urgency of purchase
… imports, extracts add item form inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of heavy lifting in this one! Left a comment in sortedData.js.
Visit the preview URL for this PR (updated for commit 2bfa8ea): https://tcl-69-smart-shopping-list--pr73-mf-refactor-v2-f8os23pr.web.app (expires Tue, 09 Apr 2024 00:20:00 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 93172cc46147b7d365c2b1b8239b61e2efb07a80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New sort looks great, thanks Marty!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! Some optional comments about renaming some stuff.
Description
This code extracts most of the logic from List.jsx that handles sorting of the list items by urgency and alphabetically. It creates new files to handle this abstraction. There is a new utils file that will hold some of the sorting and filtering functions. These functions are then imported into the List.jsx and a new SortedDataMap component. Once these functions have run the SortedDataMap will render the sorted list items onto the current /list page.
In addition the inputs in the
add item
dialog have been removed from List.jsx and pasted into the new AddItem component with the handleInput change functionality to update the form state values.The goal was to trim the size of the file and better organize for maintainability.
Related Issue
closes #72
subissue #14
Acceptance Criteria
sortedData
utils file to effectively filtered data and sort into urgency arraysType of Changes
Use one or more labels to help your team understand the nature of the change(s) you’re proposing. E.g.,
bug fix
orenhancement
are common ones.Updates
Does not update the UI
Testing Steps / QA Criteria
Upon login the app should function in the same way prior to refactor. Try adding an item and verifying that item is sorted correctly.