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
To Do list: list structure #1
Conversation
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.
Approved ✔️
Hi @Saadat123456,
Congratulations on completing this project! 👏🏼 🎉
You have correctly implemented all of the requirements📃 correctly and without any errors
Cheers and good luck in your next milestones! 🍀
Feel free to leave any questions or comments in the PR thread(don't forget to tag me 😄) if something is not 100% clear.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
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.
Hi @Saadat123456 👋,
Good job so far!
Highlights
- Professional
README.md
file ✔️ - All linters checks pass ✔️
However, there are some issues that you still need to work on to go to the next project but you are almost there!
Required Changes ♻️
Kindly check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
N/A
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
Slack: Francis Ugorji
const todoList = [ | ||
{ | ||
index: 0, | ||
completed: false, | ||
description: 'Write Code', | ||
}, | ||
{ | ||
index: 1, | ||
completed: true, | ||
description: 'Drink coffee and hear lecture', | ||
}, | ||
{ | ||
index: 2, | ||
completed: false, | ||
description: 'Play Games', | ||
}, | ||
]; |
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.
-
For this milestone, you are required to remove all hardcoded items in the array and render items dynamically by creating a function that collects the value from a form
input type="text"
and pushes it to an array. Each item should have completed status set to false and should also have an index.- Hint: Your first index should start from 1, not Zero.
-
Each item in the array should be editable. You can click on this Link to learn how to edit an item in a div. Kindly create a function that does this.
window.addEventListener('load', () => { | ||
const listElem = document.querySelector('#list'); | ||
todoList.forEach((task) => { | ||
listElem.innerHTML += `<li> | ||
<input type="checkbox" name='completed' value='${task.completed ? 'completed' : 'not-completed'}' ${task.completed ? 'checked' : ''}> | ||
<span>${task.description}</span> | ||
<img src=${threeDots} alt="Three Dots Button"> | ||
</li>`; | ||
}); | ||
}); |
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.
- It would be nice to also implement a function that allows users of your app to delete an item from the to-do list. After deleting an item, the index of the remaining item should be reset.
Hint:
const filteredArray = array.filter((task) => array.indexOf(task) !== index);
filteredArray.forEach((obj, index) => {
obj.index = index + 1;
});
- It would be nice to also fulfill the project requirement of persisting data in the local storage. You can read this article that shows developers how to persist data in
localStorage
Hint: You want to persist data to the localStorage
whenever you perform a CRUD action and you want to get data from the localStorage
when the page reloads.
Project requirements
<div>
or<ul>
element). The index.html file must be set as a template using the HTML Webpack Plugin.string
].bool
].number
].index
values for each task.