From f623d0cbf78ef9cb14c9bbaf25c481262d9def84 Mon Sep 17 00:00:00 2001 From: geireann Date: Tue, 18 Jul 2023 09:28:13 -0400 Subject: test cleanup --- src/client/util/CurrentUserUtils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/client/util') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 76dd3c356..284ceb545 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -784,8 +784,6 @@ export class CurrentUserUtils { // When the user views one of these documents, it will be added to the sharing documents 'viewed' list field // The sharing document also stores the user's color value which helps distinguish shared documents from personal documents static setupSharedDocs(doc: Doc, sharingDocumentId: string) { - const addToDashboards = ScriptField.MakeScript(`addToDashboards(self)`); - const dashboardFilter = ScriptField.MakeFunction(`doc._type_collection === '${CollectionViewType.Docking}'`, { doc: Doc.name }); const dblClkScript = "{scriptContext.openLevel(documentView); addDocToList(scriptContext.props.treeView.props.Document, 'viewed', documentView.rootDoc);}"; const sharedScripts = { treeViewChildDoubleClick: dblClkScript, } @@ -806,6 +804,7 @@ export class CurrentUserUtils { DocUtils.AssignDocField(doc, "mySharedDocs", opts => Docs.Create.TreeDocument([], opts, sharingDocumentId + "layout", sharingDocumentId), sharedDocOpts, undefined, sharedScripts); if (!DocCast(doc.mySharedDocs).data_dashboards) DocCast(doc.mySharedDocs).data_dashboards = new List(); + console.log(doc.mySharedDocs); } /// Import option on the left side button panel -- cgit v1.2.3-70-g09d2 From 1e2277597fc890f929b3155868a400ba991bcfe0 Mon Sep 17 00:00:00 2001 From: geireann Date: Tue, 18 Jul 2023 09:36:23 -0400 Subject: fixed shared dashboards field location --- src/client/util/CurrentUserUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client/util') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 284ceb545..ef1726fab 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -803,7 +803,7 @@ export class CurrentUserUtils { }; DocUtils.AssignDocField(doc, "mySharedDocs", opts => Docs.Create.TreeDocument([], opts, sharingDocumentId + "layout", sharingDocumentId), sharedDocOpts, undefined, sharedScripts); - if (!DocCast(doc.mySharedDocs).data_dashboards) DocCast(doc.mySharedDocs).data_dashboards = new List(); + if (!Doc.GetProto(DocCast(doc.mySharedDocs)).data_dashboards) Doc.GetProto(DocCast(doc.mySharedDocs)).data_dashboards = new List(); console.log(doc.mySharedDocs); } -- cgit v1.2.3-70-g09d2 From 16a1b7de3ec26187b3a426eb037a5e4f4b9fcc55 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 18 Jul 2023 10:33:55 -0400 Subject: consolidated server stats with server heartbeat --- src/client/util/ServerStats.tsx | 22 +++++++++++++++++----- src/client/views/GestureOverlay.tsx | 1 - src/client/views/topbar/TopBar.tsx | 10 ++++------ 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'src/client/util') diff --git a/src/client/util/ServerStats.tsx b/src/client/util/ServerStats.tsx index f84ad8598..b6aa4d95a 100644 --- a/src/client/util/ServerStats.tsx +++ b/src/client/util/ServerStats.tsx @@ -3,6 +3,7 @@ import { observer } from 'mobx-react'; import * as React from 'react'; import { MainViewModal } from '../views/MainViewModal'; import './SharingManager.scss'; +import { PingManager } from './PingManager'; @observer export class ServerStats extends React.Component<{}> { @@ -39,11 +40,22 @@ export class ServerStats extends React.Component<{}> { */ @computed get sharingInterface() { return ( -
- Active users:{this._stats?.socketMap.length} - {this._stats?.socketMap.map((user: any) => ( -

{user.username}

- ))} +
+
+ {PingManager.Instance.IsBeating ? 'The server connection is active' : + 'The server connection has been interrupted.NOTE: Any changes made will appear to persist but will be lost after a browser refreshes.'} + +
+ Active users:{this._stats?.socketMap.length} + {this._stats?.socketMap.map((user: any) => ( +

{user.username}

+ ))} +
); } diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index 9d4ac6c96..35d6d73e4 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -30,7 +30,6 @@ import { SetActiveInkColor, SetActiveInkWidth, } from './InkingStroke'; -import { InkTranscription } from './InkTranscription'; import TouchScrollableMenu, { TouchScrollableMenuItem } from './TouchScrollableMenu'; import { Touchable } from './Touchable'; import { checkInksToGroup } from './global/globalScripts'; diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx index 5c5547180..130e47a41 100644 --- a/src/client/views/topbar/TopBar.tsx +++ b/src/client/views/topbar/TopBar.tsx @@ -1,7 +1,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { Button, IconButton, FontSize, Size, Type, isDark } from 'browndash-components'; +import { Button, IconButton, Size, Type, isDark } from 'browndash-components'; import { action, computed, observable, reaction } from 'mobx'; -import { Tooltip } from '@mui/material'; import { observer } from 'mobx-react'; import * as React from 'react'; import { FaBug, FaCamera, FaStamp } from 'react-icons/fa'; @@ -16,11 +15,11 @@ import { ServerStats } from '../../util/ServerStats'; import { SettingsManager } from '../../util/SettingsManager'; import { SharingManager } from '../../util/SharingManager'; import { UndoManager } from '../../util/UndoManager'; -import { CollectionDockingView } from '../collections/CollectionDockingView'; import { ContextMenu } from '../ContextMenu'; import { DashboardView } from '../DashboardView'; -import { Colors } from '../global/globalEnums'; import { MainView } from '../MainView'; +import { CollectionDockingView } from '../collections/CollectionDockingView'; +import { Colors } from '../global/globalEnums'; import './TopBar.scss'; /** @@ -152,13 +151,12 @@ export class TopBar extends React.Component { SharingManager.Instance.open(undefined, Doc.ActiveDashboard); }} /> - } /> } /> window.open('https://brown-dash.github.io/Dash-Documentation/', '_blank')} icon={} /> } />