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

Ember Frontend Developer Challenge #5

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

Conversation

brianmarete
Copy link

This is my submission for the Ember Frontend Developer Challenge. The changes include:

  • Added pinning functionality to tasks
  • A computed property for showing number of completed tasks
  • Refactoring the toggling of task completion to be more DRY by using a component

I added an action in the index controller that handles the setting of
a pinned task. This action handles logic for pinning, unpinning and
replacing a pinned task. This action is passed down to the single task
component through the task list component and is triggered when
the pin/unpin button is clicked.

I also added an attribute to the task model and I use this to display
or hide the task in the task list. There's probably a better way to do
this though as I don't think this attribute belongs to the model.
I added a computed property in the index controller
that finds all the tasks marked complete. These
tasks are in an array so the computed property
returns the length of the array.
I created a new component that handles the toggling of task completion.
I then refactored the button for toggling "Done/Undo" from the single task
component to the new component. I created an action in the single task
component to handle the toggling of the 'isComplete' property on tasks.
This action is what is passed down to the ToggleComplete component and
is triggered  by a click event on the "Done/Undo" button.
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