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

Add remove feature #3

Merged
merged 12 commits into from Jan 14, 2022
Merged

Add remove feature #3

merged 12 commits into from Jan 14, 2022

Conversation

Mwapsam
Copy link
Owner

@Mwapsam Mwapsam commented Jan 14, 2022

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.

Copy link

@rloterh rloterh left a 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
Copy link

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 */
Copy link

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.

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.

const list = document.getElementById('todos-list');
const addInput = document.getElementById('todo-input');

export const createTodo = () => {
Copy link

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

const div = document.createElement('div');
div.classList.add('TextItems');

const remove = document.createElement('span');
Copy link

Choose a reason for hiding this comment

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

  • When elements are removed they are still reflected in the local storage. Kindly ensure that removed items are deleted from the local storage.

Deleting error:
image

Copy link

@julie-ify julie-ify left a 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 */

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.

Comment on lines 129 to 135
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();
};

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:

Before I deleted eat task:
Loom_ZtviJfkqfY

After I deleted eat task, I can still see eat task in the local storage:

Loom_e2x1kSENoG

When I added a new task:
Loom_g4cGv7BDWA

Copy link

@MrBrN197 MrBrN197 left a 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 :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.

Comment on lines +1 to +4
/* eslint-disable import/prefer-default-export */
import _ from 'lodash';

export function component() {

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 making component a default export.

something like this

Suggested change
/* 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

@Mwapsam Mwapsam merged commit 49654d2 into main Jan 14, 2022
@github-pages github-pages bot temporarily deployed to github-pages January 15, 2022 14:52 Inactive
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

4 participants