-
Notifications
You must be signed in to change notification settings - Fork 6
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
jonnygovish
wants to merge
13
commits into
tunapanda:master
Choose a base branch
from
jonnygovish:john-mutavi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
John mutavi #6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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