Skip to content

Teambuilder Workspaces

Andrew Suzuki edited this page Jun 3, 2016 · 6 revisions

interface

A user will see a workspace[s] panel with the following elements:

  • table of faculty in current workspace, with data and remove buttons for each
  • button to create a new blank workspace
  • button to create a new workspace from the default
  • horizontal tabs for switching to different workspaces
    • "default" tab (read only: when altered, a new workspace is created)
    • 1,2,3… for the user's workspaces
  • button to save current workspace
  • save status text (gray, like google docs)
  • button to delete current workspace

persistence

:builder-faculties-workspace represents the current workspace as a list of faculty ids.

:builder-faculties-workspace-id represents the back-end unique id (not the name) of the current workspace. If it is the default workspace, then set to nil

:builder-faculties-workspace-name represents the name of the current workspace. If it is the default workspace, then set to nil

[save action]:

  • PUT :builder-faculties-workspace to /api/workspace/ :builder-faculties-workspace-id

when a user opens a builder:

  • :builder-faculties-workspace is updated with the list of faculty-ids from their most-recently-updated workspace, or they are shown the (read-only) default workspace if they don't have any yet

when the user creates a new blank workspace:

  • POST to /api/workspace with field type=blank
  • set new :builder-faculties-workspace-id and :builder-faculties-workspace-name

when the user creates a workspace from default:

  • POST to /api/workspace with field type=default
  • set new :builder-faculties-workspace-id and :builder-faculties-workspace-name

when the user deletes a workspace:

  • if :builder-faculties-workspace-id is nil, then CANCEL.
  • DELETE to /api/workspace/ :builder-faculties-workspace-id
  • set new :builder-faculties-workspace-id and :builder-faculties-workspace-name

when a user adds a faculty to the workspace:

  • if the current workspace is the default workspace, then create a new workspace from the default and switch to it
  • then add the faculty-id to :builder-faculties-workspace
  • then save action

when a user removes a faculty from the workspace:

  • if the current workspace is the default workspace, then create a new workspace from the default and switch to it
  • then remove the faculty-id from :builder-faculties-workspace
  • then save action

when a user change the workspace name field:

  • POST to /api/workspace/name/ :builder-faculties-workspace-id with field name=:builder-faculties-workspace-name

data

A (grant-op, user) can have many workspaces.

Workspace is represented by rows of (id ["workspace-id"], name, grant-op-id, user-id, created-at, updated-at)

Workspace faculty are represented by rows of (id, workspace-id, faculty-id)

api

/api/workspace

  • GET => all current-user workspaces with all embedded faculties, along with current-id
  • POST (type=blank/default) => success?, id, name

/api/workspace/:id

  • PUT (faculty=array of faculty ids) => success?
  • DELETE => success?

/api/workspace/name/:id

  • POST (name=NAME) => success?
Clone this wiki locally