Skip to content

Teambuilder Workspaces

Andrew Suzuki edited this page Jun 5, 2016 · 6 revisions
Clone this wiki locally

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

:workspaces is a collection of workspaces for the user. each one has id, name and grant-op-id

:builder-workspace represents the the current workspace, bare-bones (id and name are notable). If it is the default workspace, then set to nil

:builder-workspace-faculties is a list of faculty ids in the current workspace.

[save action]:

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

when a user opens a builder:

  • GET to /api/workspace with field grant_op_id
  • :workspaces is updated using the results, WITHOUT the embedded faculties
  • :builder-workspace-faculties 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-workspace

when the user creates a workspace from default:

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

when the user deletes a workspace:

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

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-workspace-faculties
  • 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-workspace-faculties
  • then save action

when a user change the workspace name field:

  • POST to /api/workspace/name/ :builder-workspace/:id with field name=NEW_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 (?grant-op-id) => all current-user workspaces for grant op with all embedded faculties, along with current-workspace-id
  • POST (type=blank/default) => success?, id, name

/api/workspace/:workspace-id

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

/api/workspace/name/:workspace-id

  • POST (name=NAME) => success?