As a busy person, I want a todo app so that I can manage all my tasks as I work my way through them.
Each task is an object with the following keys:
- id (autogenerated)
- title
- status
- dueDate
- project
- priority
- notes
- tags
- Getters and setters
- A Kanban style board with columns for: Backlog, Loaded, In Progress, and Done.
- Mobile version: status columns will be stacked vertically on top of each other.
- Tasks default sorted by due date.
- Projects can be viewed individually as tabs, but the default is an
all-tasks
tab that's essentially a project.
appController:
- Tasks
- Tasks stored in an
_tasks
array. - Tasks created by
_taskFactory()
- Sort by date with
_dateSort()
. - Creating a task:
addTask(inputValuesArray)
- Creates an empty task with
_taskFactory()
, - Assigns it a unique id from
_idCounter
- Iterates over the submitted values,
- Adds it to
_tasks
.
- Creates an empty task with
- Removing a task:
removeTasks(...removeIds)
splices each item with the given ids from_tasks
. - Editing a task:
updateTask(updateId, inputValuesArray)
.- Finds the task with relevant id,
- Gets its index in
_tasks
, - Calls
setProperty
iteratively.
- Exporting tasks always ends with
_dateSort()
.- All:
getAllTasks()
- Filtered:
getTasksByProperty(prop, value)
- Find all tasks where
prop === value
(eg.project === "home"
),
- Find all tasks where
- All:
- Tasks stored in an
- Projects
- Project names array: finances, reading, home, etc.
- Exporting all project names:
getProjects()
- Creating a new project:
addProject(newProjectName)
pushes new name to array. - Removing a project (and all its tasks!!!):
removeProject(removeName)
- Finds all tasks from that project and removes them from
_tasks
.Tasks.getTasksByProperty("project", projectName)
,- Store ids,
Tasks.removeTasks(...removeIds)
- Splices the name from
_projectList
atremoveName
's index.
- Finds all tasks from that project and removes them from
- Create sample tasks: Pay bills, groceries, files taxes, read Chekhov, replace lightbulb
screenController:
- Displaying
updateScreen()
: use elFactory to create nested objects and htmlFactory to add them to the DOM.- Each detail will have a
data-task-key
(JS:dataset.taskKey
) for things like title, status, etc.
- Each detail will have a
- Separate Fn's for creating the display structures of tasks viewed in listMode, in displayMode, and in editMode.
- (Re)Organizing the view.
- Default all tasks.
- Sorting:
statusSort()
splits tasks up into appropriate columns. - Filtering: Clicking on a tag, project, etc. will filter tasks by that property.
- Editing in place:
- On task click: show the full details in dialog modal with 2 modes:
displayMode
, a div that shows the task's full info and hasedit-btn
, which replaces the div with...editMode
, a form with the task's info entered as values in each<input>
.- On submit: triggers
appController.Tasks.updateTask(taskId, inputValuesArray)
, thenupdateScreen()
.
- On submit: triggers
- On drag and drop: tasks move between columns and update status, though they will also need to have a dropdown for the mobile version.
- On task click: show the full details in dialog modal with 2 modes:
- Adding things.
new-thing-btn
that reveals 2 buttons above:add-task-btn
on click: opens dialog/form ineditMode
, but blank. On submit:appController.addTask(inputValuesArray)
,updateScreen()
add-project-btn
on click: opens a dialog/form/input for project name. On submit:appController.addProject(inputValue)
,updateScreen()
.
- Deleting things.
- Removing a task.
remove-task-btn
on click: shows warning dialog ("This can't be undone", etc.), then triggersappController.Tasks.removeTasks(removeId)
,updateScreen()
.
- Removing a project (and all its tasks).
remove-project-btn
on click: shows warning dialog ("This can't be undone", etc.), then triggersappController.Projects.removeProject(removeName)
,updateScreen()
.
- Removing a task.