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

John mutavi #6

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

John mutavi #6

wants to merge 13 commits into from

Conversation

jonnygovish
Copy link

I was not able to fully make the toggle complete component work, I kept encountering an error that I was ultimately not able to solve. I didn't find another workaround though despite not having to use the toggle component

Created a new package-lock.json file as a result of running npm install
…then creates a pinned task object.

Thought Process:
As per the instructions, since the action needs to send tasks to the index controller. I decided to define the action  here so that I can pass it down to the single task component. That way it will be able to send the task that is pinned to the index controller.
Started with passing down the pinTask action that I created in the index.js controller.

I passed it as an argument called pinnedTask to the TaskList component. This way I can be able to pass it to the SingleTask component via the TaskList component.

The next thing I did was to create an onclick event listener for unpin button.
This event listner has an action that mutates the pinnedTask object back to null when the user unpins the task
pass down the pinnedTask action from the index.hbs template.

Once again I pass it as an argument called setPinnedTask to the SingleTask component
Create an onclick eventlistner  with  the action we passed down from the TaskList component.

I also pass the task that is pinned as an argument to the action.

This is because I want the action to send this task up to the index controller.
I created a computed property so that I will be able to automatically count the number of completed tasks
Created the toggle complete component .
passed in an argument called @text that checks whether the task is complete then toggles between the words 'Undo' and 'Done'.

The idea here is to pass the action  taskComplete to the ToggleComplete component.
Once the click event is triggered the action will be passed up to the index.js controller.
Once in the index.js controller I can be able to set the isComplete boolean to true.
Created the action function taskCompleted which when triggered set the isCompleted to true
passed down the action for changing the status of complete task from the index.js controller to the Toggle Complete component.
Create the action for toggling the status of the complete task
Pass the toggle complete component into the single task component
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.

1 participant