aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/Main.tsx8
-rw-r--r--src/server/authentication/models/current_user_utils.ts3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 2636b08bd..4e918221c 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -146,9 +146,9 @@ export class Main extends React.Component {
@action
createNewWorkspace = async (id?: string) => {
- const list = Cast(CurrentUserUtils.UserDocument.workspaces, listSpec(Doc));
+ const list = Cast(CurrentUserUtils.UserDocument.data, listSpec(Doc));
if (list) {
- let freeformDoc = Docs.FreeformDocument([], { x: 0, y: 400, title: "mini collection" });
+ let freeformDoc = Docs.FreeformDocument([], { x: 0, y: 400, title: `WS collection ${list.length + 1}` });
var dockingLayout = { content: [{ type: 'row', content: [CollectionDockingView.makeDocumentConfig(freeformDoc)] }] };
let mainDoc = Docs.DockDocument([freeformDoc], JSON.stringify(dockingLayout), { title: `Workspace ${list.length + 1}` });
list.push(mainDoc);
@@ -219,7 +219,7 @@ export class Main extends React.Component {
let addTextNode = action(() => Docs.TextDocument({ borderRounding: -1, width: 200, height: 200, title: "a text note" }));
let addColNode = action(() => Docs.FreeformDocument([], { width: 200, height: 200, title: "a freeform collection" }));
let addSchemaNode = action(() => Docs.SchemaDocument([], { width: 200, height: 200, title: "a schema collection" }));
- let addTreeNode = action(() => Docs.TreeDocument([this.mainContainer!], { width: 250, height: 400, title: "Library:" + StrCast(this.mainContainer!.title), copyDraggedItems: true }));
+ let addTreeNode = action(() => Docs.TreeDocument([CurrentUserUtils.UserDocument], { width: 250, height: 400, title: "Library:" + CurrentUserUtils.email, copyDraggedItems: true }));
// let addTreeNode = action(() => Docs.TreeDocument(this._northstarSchemas, { width: 250, height: 400, title: "northstar schemas", copyDraggedItems: true }));
let addVideoNode = action(() => Docs.VideoDocument(videourl, { width: 200, title: "video node" }));
let addPDFNode = action(() => Docs.PdfDocument(pdfurl, { width: 200, height: 200, title: "a pdf doc" }));
@@ -281,7 +281,7 @@ export class Main extends React.Component {
get workspaceMenu() {
let areWorkspacesShown = () => this._workspacesShown;
let toggleWorkspaces = () => runInAction(() => this._workspacesShown = !this._workspacesShown);
- let workspaces = Cast(CurrentUserUtils.UserDocument.workspaces, listSpec(Doc));
+ let workspaces = Cast(CurrentUserUtils.UserDocument.data, listSpec(Doc));
return (!workspaces || !this.mainContainer) ? (null) :
<WorkspacesMenu active={this.mainContainer} open={this.openWorkspace}
new={this.createNewWorkspace} allWorkspaces={workspaces}
diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts
index 30a8980ae..9db470ca0 100644
--- a/src/server/authentication/models/current_user_utils.ts
+++ b/src/server/authentication/models/current_user_utils.ts
@@ -23,7 +23,8 @@ export class CurrentUserUtils {
private static createUserDocument(id: string): Doc {
let doc = new Doc(id, true);
- doc.workspaces = new List<Doc>();
+ doc.title = this.email;
+ doc.data = new List<Doc>();
doc.optionalRightCollection = Docs.SchemaDocument([], { title: "Pending documents" });
return doc;
}