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

To Do list: list structure #1

Merged
merged 11 commits into from Feb 17, 2022
Merged

To Do list: list structure #1

merged 11 commits into from Feb 17, 2022

Conversation

Saadat123456
Copy link
Owner

Project requirements

  • Set up a new project with webpack that is based on the webpack exercise you have already completed.
  • Create an index.html file and write your HTML markup here. Create an empty To Do List placeholder (<div> or <ul> element). The index.html file must be set as a template using the HTML Webpack Plugin.
  • Create an index.js file and set an array of some simple to do tasks (array of objects). Each task object should contain three keys:
    1. description [string].
    2. completed [bool].
    3. index: [number].
  • Write a function to iterate over the tasks array and populate an HTML list item element for each task.
  • On page load render the dynamically created list of tasks in the dedicated placeholder. The list should appear in order of the index values for each task.
  • Create a style.css and set rules for the To Do List. CSS must be loaded by Webpack Style/CSS Loader. Your list should be a clone of the part of the minimalist project captured in the video below.

Copy link

@omar-labana omar-labana left a 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⚠️ or bugs🪲.

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.

@Saadat123456 Saadat123456 merged commit a9d333d into main Feb 17, 2022
@Saadat123456 Saadat123456 deleted the Webpack branch February 17, 2022 01:56
Copy link

@Gambit142 Gambit142 left a 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

Comment on lines +4 to +20
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',
},
];

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.

Comment on lines +22 to +31
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>`;
});
});

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.

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.

None yet

3 participants