From a4959a79b002a25617a84e6edff1148fff666c68 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Fri, 19 Jun 2020 11:37:39 +0530 Subject: initial commit: added group document type + started setting up GroupManager --- src/client/util/CurrentUserUtils.ts | 1 + src/client/util/GroupManager.tsx | 43 +++++++++++++++++++++++++++++++++++++ src/client/util/SharingManager.tsx | 4 ++-- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 src/client/util/GroupManager.tsx (limited to 'src/client/util') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 37eaa5f5e..423b1fb90 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -766,6 +766,7 @@ export class CurrentUserUtils { await this.setupSidebarButtons(doc); // the pop-out left sidebar of tools/panels doc.globalLinkDatabase = Docs.Prototypes.MainLinkDocument(); doc.globalScriptDatabase = Docs.Prototypes.MainScriptDocument(); + // doc.globalGroupDatabse = Docs.Prototypes.MainGroupDocument(); // setup reactions to change the highlights on the undo/redo buttons -- would be better to encode this in the undo/redo buttons, but the undo/redo stacks are not wired up that way yet doc["dockedBtn-undo"] && reaction(() => UndoManager.undoStack.slice(), () => Doc.GetProto(doc["dockedBtn-undo"] as Doc).opacity = UndoManager.CanUndo() ? 1 : 0.4, { fireImmediately: true }); diff --git a/src/client/util/GroupManager.tsx b/src/client/util/GroupManager.tsx new file mode 100644 index 000000000..d9a20e1a7 --- /dev/null +++ b/src/client/util/GroupManager.tsx @@ -0,0 +1,43 @@ +import React from "react"; +import { observable, action } from "mobx"; +import { SelectionManager } from "./SelectionManager"; +import MainViewModal from "../views/MainViewModal"; + + +export default class GroupManager extends React.Component<{}>{ + + static Instance: GroupManager; + @observable private isOpen: boolean = false; // whether the menu is open or not + @observable private dialogueBoxOpacity = 1; + @observable private overlayOpacity = 0.4; + + constructor(props: Readonly<{}>) { + super(props); + GroupManager.Instance = this; + } + + + open = action(() => { + SelectionManager.DeselectAll(); + this.isOpen = true; + }); + + close = action(() => { + this.isOpen = false; + }); + + private get groupInterface() { + return
TESTING
; + } + + render() { + return ; + } + +} \ No newline at end of file diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index dc67145fc..2e660e819 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -28,14 +28,14 @@ export interface User { export enum SharingPermissions { None = "Not Shared", View = "Can View", - Comment = "Can Comment", + Add = "Can Add and Comment", Edit = "Can Edit" } const ColorMapping = new Map([ [SharingPermissions.None, "red"], [SharingPermissions.View, "maroon"], - [SharingPermissions.Comment, "blue"], + [SharingPermissions.Add, "blue"], [SharingPermissions.Edit, "green"] ]); -- cgit v1.2.3-70-g09d2