diff options
Diffstat (limited to 'src/server/authentication')
| -rw-r--r-- | src/server/authentication/controllers/WorkspacesMenu.tsx | 48 | ||||
| -rw-r--r-- | src/server/authentication/models/user_model.ts | 5 |
2 files changed, 48 insertions, 5 deletions
diff --git a/src/server/authentication/controllers/WorkspacesMenu.tsx b/src/server/authentication/controllers/WorkspacesMenu.tsx new file mode 100644 index 000000000..77e3a9778 --- /dev/null +++ b/src/server/authentication/controllers/WorkspacesMenu.tsx @@ -0,0 +1,48 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import { observable, action, configure, reaction, computed } from 'mobx'; +import { observer } from "mobx-react"; +import * as request from 'request' + +@observer +export class WorkspacesMenu extends React.Component { + static Instance: WorkspacesMenu; + @observable private workspacesExposed: boolean = false; + @observable private workspaceIds: Array<string> = []; + + constructor(props: Readonly<{}>) { + super(props); + WorkspacesMenu.Instance = this; + } + + toggle() { + action(() => { + if (!this.workspacesExposed) { + request.get(window.location.origin + "/getAllWorkspaceIds", (error, response, body) => { + this.workspaceIds = body; + console.log(this.workspaceIds); + }) + } + this.workspacesExposed = !this.workspacesExposed; + }); + } + + render() { + return ( + <div + style={{ + width: "150px", + height: "150px", + position: "absolute", + top: 75, + right: 0, + background: "grey", + zIndex: 15, + visibility: this.workspacesExposed ? "visible" : "hidden" + }} + > + {this.workspaceIds.map(s => <li key={s} >${s}</li>)} + </div> + ); + } +}
\ No newline at end of file diff --git a/src/server/authentication/models/user_model.ts b/src/server/authentication/models/user_model.ts index dfd104ef8..29076ba19 100644 --- a/src/server/authentication/models/user_model.ts +++ b/src/server/authentication/models/user_model.ts @@ -23,7 +23,6 @@ export type DashUserModel = mongoose.Document & { allWorkspaceIds: Array<String>, activeWorkspaceId: String, - didSelectSessionWorkspace: Boolean, profile: { name: string, @@ -54,10 +53,6 @@ const userSchema = new mongoose.Schema({ default: [] }, activeWorkspaceId: String, - didSelectSessionWorkspace: { - type: Boolean, - default: false - }, facebook: String, twitter: String, |
