Frontend API
export class WorkspaceChooserComponent implements OnInit
Component for choosing what workspace/project to open and create new ones.
It displays all the available workspaces on a grid. Each workspace has its own card. The component takes care of retrieving the list of available workspaces.
After selecting the workspace, the app will go to /workspace/:id
Created by antoine on 13/07/17.
ngOnInit ()
On init, set the body’s background color to grey, makes sure the workspace connexion socket is closed and download the list of available workspaces.
onSelectWorkspace (id: string): void
React to a click on a workspace’s card to select it. Set the active workspace in the app’s data and redirect to /workspace/:id
- Parameters:
id
—
nextBackgroundColor (id: string): string
Returns the background color to use for the card that calls this method.
- Parameters:
id
— the id of the workspace - Returns:
string
— the name of the color to use
createProject ()
Send a request to the server to create a new workspace with the information input in the .new-workspace-modal.
private fetchWorkspaces ()
Download the list of available workspaces from the server.