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 #2

Merged
merged 3 commits into from Jul 6, 2022
Merged

To-do-list #2

merged 3 commits into from Jul 6, 2022

Conversation

piesieomane
Copy link
Owner

@piesieomane piesieomane commented Jul 5, 2022

  • Remove all hardcoded items from the tasks array.
  • Create a new JavaScript file for the new functionality.
  • Implement a function for adding a new task (add a new element to the array).
  • Implement a function for deleting a task (remove an element from the array).
  • Deleting a task should update all remaining items' indexes, so they represent the current list order and are unique
  • All changes to the To-Do List should be saved in local storage.

Copy link

@tresorsawasawa tresorsawasawa left a comment

Choose a reason for hiding this comment

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

STATUS: REQUIRED CHANGES ♻️♻️

Hi @piesieomane
Good job so far! I know you worked hard to implement this project, I really appreciate the effort you put in! But there are some issues that you still need to work on to go to the next project but you are almost there!

almost-there

To highlight 🍾

  • All linters are passing ✔️
  • Good commit history ✔️
  • Your design looks good 💯 ✔️
  • Good PR description ✔️
  • Follow GitHub flow ✔️

Required changes ♻️ ♻️

  • 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.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please ping me @tresorsawasawa when you comment so I can receive the notification or use slack with the same name.

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.

src/style.css Outdated
@@ -88,7 +88,7 @@ button {
}

.icon i {
color: #cfcfcf;
/* color: #cfcfcf; */
Copy link

@tresorsawasawa tresorsawasawa Jul 6, 2022

Choose a reason for hiding this comment

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

  • Kindly make sure you remove the commented code lines to make your code base cleaner.

Comment on lines +24 to +58

addBtn.addEventListener('click', (e) => {
const input = todoInputEl.value;
e.preventDefault();
todoInputEl.value = '';
if (!input) return;
const obj = {
description: input,
completed: false,
index: task.length,
};
task.push(obj);
localStorage.setItem('task', JSON.stringify(task));
renderTasks();
});

const removeTask = (index) => {
const newArr = task.filter((element) => element.index !== index);
task.length = 0;
let i = 0;
newArr.forEach((element) => {
element.index = i;
i += 1;
});
task.push(...newArr);
localStorage.setItem('task', JSON.stringify(task));
renderTasks();
};

oneContainer.addEventListener('click', (e) => {
if (e.target.classList.contains('fa-solid')) {
const index = parseInt(e.target.getAttribute('id'), 10);
removeTask(index);
}
});

Choose a reason for hiding this comment

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

  • Kindly make sure you also implement functionality for editing task descriptions is implemented as required for the project(it should also update data in Local storage once you have edited the task description).

Copy link
Owner Author

Choose a reason for hiding this comment

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

@tresorsawasawa ,thanks for the review, but this functionality I think is for the next project. This is only add and remove functionality

Copy link

@mikethreels mikethreels left a comment

Choose a reason for hiding this comment

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

Hi Piesie,

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread 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.

@piesieomane piesieomane merged commit 7e6770d into main Jul 6, 2022
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