aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication/models/current_user_utils.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-09-11 17:24:48 -0400
committerbob <bcz@cs.brown.edu>2019-09-11 17:24:48 -0400
commit68e554cafb6107bfde9526773b3e0e667d582c88 (patch)
tree7231d41d21e735f193da329fb5f4cd5b6066f012 /src/server/authentication/models/current_user_utils.ts
parent4722644d09a561e394bd72c92af5561a2020776e (diff)
added default note type collection
Diffstat (limited to 'src/server/authentication/models/current_user_utils.ts')
-rw-r--r--src/server/authentication/models/current_user_utils.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts
index 9d35d36d3..af5774ebe 100644
--- a/src/server/authentication/models/current_user_utils.ts
+++ b/src/server/authentication/models/current_user_utils.ts
@@ -7,7 +7,7 @@ import { Attribute, AttributeGroup, Catalog, Schema } from "../../../client/nort
import { ArrayUtil } from "../../../client/northstar/utils/ArrayUtil";
import { CollectionViewType } from "../../../client/views/collections/CollectionBaseView";
import { CollectionView } from "../../../client/views/collections/CollectionView";
-import { Doc } from "../../../new_fields/Doc";
+import { Doc, DocListCast } from "../../../new_fields/Doc";
import { List } from "../../../new_fields/List";
import { listSpec } from "../../../new_fields/Schema";
import { Cast, StrCast, PromiseValue } from "../../../new_fields/Types";
@@ -50,6 +50,16 @@ export class CurrentUserUtils {
doc.workspaces = workspaces;
}
PromiseValue(Cast(doc.workspaces, Doc)).then(workspaces => workspaces && (workspaces.preventTreeViewOpen = true));
+ if (doc.noteTypes === undefined) {
+ let notes = [Docs.Create.TextDocument({ title: "Note", backgroundColor: "yellow", isTemplate: true }),
+ Docs.Create.TextDocument({ title: "Idea", backgroundColor: "pink", isTemplate: true }),
+ Docs.Create.TextDocument({ title: "Topic", backgroundColor: "lightBlue", isTemplate: true }),
+ Docs.Create.TextDocument({ title: "Person", backgroundColor: "lightGreen", isTemplate: true })];
+ const noteTypes = Docs.Create.TreeDocument(notes, { title: "Note Types", height: 75 });
+ noteTypes.excludeFromLibrary = true;
+ doc.noteTypes = noteTypes;
+ }
+ PromiseValue(Cast(doc.noteTypes, Doc)).then(noteTypes => noteTypes && PromiseValue(noteTypes.data).then(vals => DocListCast(vals)));
if (doc.recentlyClosed === undefined) {
const recentlyClosed = Docs.Create.TreeDocument([], { title: "Recently Closed", height: 75 });
recentlyClosed.excludeFromLibrary = true;