Skip to content

Latest commit

 

History

History
93 lines (77 loc) · 4.21 KB

pseudo.md

File metadata and controls

93 lines (77 loc) · 4.21 KB

Planning

User story:

As a busy person, I want a todo app so that I can manage all my tasks as I work my way through them.

Requirements

Task items

Each task is an object with the following keys:

Properties

  • id (autogenerated)
  • title
  • status
  • dueDate
  • project
  • priority
  • notes
  • tags

Methods

  • Getters and setters

App overall

  • 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.

Logical flow:

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.
    • 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"),
  • 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 at removeName's index.
  • 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.
    • 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 has edit-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), then updateScreen().
    • On drag and drop: tasks move between columns and update status, though they will also need to have a dropdown for the mobile version.
  • Adding things.
    • new-thing-btn that reveals 2 buttons above:
      • add-task-btn on click: opens dialog/form in editMode, 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 triggers appController.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 triggers appController.Projects.removeProject(removeName), updateScreen().