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
Add remove feature #3
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.
Hi Mwape,
You did extremely great on this project! 👏 👏
There are however a few issues that you still need to work on to go to the next project but you are almost there! 🚦 🚦
Good Points 👍
- Descriptive Pull Request
- No linter errors
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.
Kindly check the comments marked [OPTIONAL] under the review.
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 2 more limited reviews per this project. If you think that the code review was not fair, you can request a second opinion using this form.
README.md
Outdated
It will open your browser with the project homepage | ||
|
||
|
||
|
||
## Authors |
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.
- OPTIONAL
Kindly change the header title Authors to Author, as this project is done solely. This will make your ReadMe appear more professional.
src/index.js
Outdated
@@ -1,60 +1,55 @@ | |||
/* eslint-disable default-case */ |
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.
- You have disabled linter check on your code. Please enable all linter checks on your code to ensure that your code is robust code and clean.
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.
- As requested by the previous reviewer, Please enable all linter checks on your code to ensure that your code is robust code and clean.
src/modules/crud.js
Outdated
const list = document.getElementById('todos-list'); | ||
const addInput = document.getElementById('todo-input'); | ||
|
||
export const createTodo = () => { |
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.
- There are no indexes associated with task entries. Kindly ensure that new tasks have the property completed set to false by default and the property index set to the value of the new array length (i.e. if a 5th task is added to the list, the index of that task should equal to 5). This should be reflected in your local storage
src/modules/crud.js
Outdated
const div = document.createElement('div'); | ||
div.classList.add('TextItems'); | ||
|
||
const remove = document.createElement('span'); |
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.
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 @Mwapsam,
Good job so far!
Highlight!
- Good job implementing some of the required changes from the previous reviewer ✔️
Hello ✋, you have done well reaching this point of the milestone 🤝 . But there are some issues that you still need to work on to go to the next project but you are almost there!
Status: Required Changes ♻️⛔️
Check the comments under the review.
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.
src/index.js
Outdated
@@ -1,60 +1,55 @@ | |||
/* eslint-disable default-case */ |
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.
- As requested by the previous reviewer, Please enable all linter checks on your code to ensure that your code is robust code and clean.
src/modules/crud.js
Outdated
export const removeTodo = (removeElement, index) => { | ||
const getLocalStorageData = localStorage.getItem('New Todo'); | ||
const listArray = JSON.parse(getLocalStorageData); | ||
listArray.splice(index, 1); | ||
localStorage.setItem('New Todo', JSON.stringify(listArray)); | ||
removeElement.parentElement.parentElement.remove(); | ||
}; |
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.
-
I created three tasks and they all have the correct index [1,2,3]. However, when I deleted one task, the indexes of the remaining tasks did not update, that is the indexes were [2, 3] instead of [1,2]. Please let's make sure that deleting a task updates all remaining items' indexes, so they represent the current list order and are unique.
-
When I delete a task, the task gets deleted from the page but surprisingly, another task gets deleted from the local storage instead of the task I deleted. Let's fix this.
-
Also when I added a new task, there appears to be two tasks with the same index. Please let's fix that. Please take a look below:
After I deleted eat task, I can still see eat task in the local storage:
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, @Mwapsam 👋
Great work making the changes from the previous reviewers.
Your project is complete! There is nothing else to say other than... it's time to merge it
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.
/* eslint-disable import/prefer-default-export */ | ||
import _ from 'lodash'; | ||
|
||
export function component() { |
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.
- [OPTIONAL] Thank you for remove all other
eslint-disables
you only have one here now. The way you could fix this is by makingcomponent
a default export.
something like this
/* eslint-disable import/prefer-default-export */ | |
import _ from 'lodash'; | |
export function component() { | |
import _ from 'lodash'; | |
export default function component() { |
- [OPTIONAL] also it seems that you are not using this file. Since it came with the default webpack setup you can just remove this file and also remove
lodash
as a dependency on your package.json
CRUD - Task
Removed all hardcoded items from the tasks array
Created a TasksManager class for the new functionality:
Creating a new task
Updating task descriptions
Deleting a task
Continuous index number value
All changes are saved in local storage.