aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DashboardView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DashboardView.tsx')
-rw-r--r--src/client/views/DashboardView.tsx37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index dee161931..50cf2226e 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -3,7 +3,8 @@ import { Button, ColorPicker, FontSize, IconButton, Size } from 'browndash-compo
import { action, computed, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
-import { DataSym, Doc, DocListCast, DocListCastAsync } from '../../fields/Doc';
+import { Doc, DocListCast, DocListCastAsync } from '../../fields/Doc';
+import { DocData } from '../../fields/DocSymbols';
import { Id } from '../../fields/FieldSymbols';
import { List } from '../../fields/List';
import { PrefetchProxy } from '../../fields/Proxy';
@@ -66,18 +67,18 @@ export class DashboardView extends React.Component {
if (this.selectedDashboardGroup === DashboardGroup.MyDashboards) {
return allDashboards.filter(dashboard => Doc.GetProto(dashboard).author === Doc.CurrentUserEmail);
} else {
- const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._viewType === CollectionViewType.Docking);
+ const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._type_collection === CollectionViewType.Docking);
return sharedDashboards;
}
};
isUnviewedSharedDashboard = (dashboard: Doc): boolean => {
- // const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._viewType === CollectionViewType.Docking);
+ // const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._type_collection === CollectionViewType.Docking);
return !DocListCast(Doc.MySharedDocs.viewed).includes(dashboard);
};
getSharedDashboards = () => {
- const sharedDashs = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._viewType === CollectionViewType.Docking);
+ const sharedDashs = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._type_collection === CollectionViewType.Docking);
return sharedDashs.filter(dashboard => !DocListCast(Doc.MySharedDocs.viewed).includes(dashboard));
};
@@ -358,18 +359,17 @@ export class DashboardView extends React.Component {
y: 400,
_width: 1500,
_height: 1000,
- _fitWidth: true,
- _backgroundGridShow: true,
+ _layout_fitWidth: true,
+ _freeform_backgroundGrid: true,
backgroundColor: background,
title: `Untitled Tab 1`,
};
const title = name ? name : `Dashboard ${dashboardCount}`;
const freeformDoc = Doc.GuestTarget || Docs.Create.FreeformDocument([], freeformOptions);
const dashboardDoc = Docs.Create.StandardCollectionDockingDocument([{ doc: freeformDoc, initialWidth: 600 }], { title: title }, id, 'row');
- freeformDoc.context = dashboardDoc;
// switching the tabs from the datadoc to the regular doc
- const dashboardTabs = DocListCast(dashboardDoc[DataSym].data);
+ const dashboardTabs = DocListCast(dashboardDoc[DocData].data);
dashboardDoc.data = new List<Doc>(dashboardTabs);
dashboardDoc['pane-count'] = 1;
@@ -390,13 +390,13 @@ export class DashboardView extends React.Component {
_width: 30,
_height: 30,
_stayInCollection: true,
- _hideContextMenu: true,
+ _layout_hideContextMenu: true,
title: 'New trail',
toolTip: 'Create new trail',
btnType: ButtonType.ClickButton,
buttonText: 'New trail',
icon: 'plus',
- system: true,
+ isSystem: true,
};
const reqdBtnScript = { onClick: `createNewPresentation()` };
const myTrailsBtn = DocUtils.AssignScripts(Docs.Create.FontIconDocument(reqdBtnOpts), reqdBtnScript);
@@ -406,25 +406,24 @@ export class DashboardView extends React.Component {
// but we don't want to create the list of trails here-- but rather in createDashboard
const reqdOpts: DocumentOptions = {
title: 'My Trails',
- _showTitle: 'title',
+ _layout_showTitle: 'title',
_height: 100,
treeViewHideTitle: true,
- _fitWidth: true,
+ _layout_fitWidth: true,
_gridGap: 5,
_forceActive: true,
- childDropAction: 'alias',
+ childDropAction: 'embed',
treeViewTruncateTitleWidth: 150,
ignoreClick: true,
- buttonMenu: true,
- buttonMenuDoc: myTrailsBtn,
+ layout_headerButton: myTrailsBtn,
contextMenuIcons: new List<string>(['plus']),
contextMenuLabels: new List<string>(['Create New Trail']),
_lockedPosition: true,
- boxShadow: '0 0',
+ layout_boxShadow: '0 0',
childDontRegisterViews: true,
targetDropAction: 'same',
- system: true,
- explainer: 'All of the trails that you have created will appear here.',
+ isSystem: true,
+ layout_explainer: 'All of the trails that you have created will appear here.',
};
const myTrails = DocUtils.AssignScripts(Docs.Create.TreeDocument([], reqdOpts), { treeViewChildDoubleClick: 'openPresentation(documentView.rootDoc)' });
dashboardDoc.myTrails = new PrefetchProxy(myTrails);
@@ -453,7 +452,7 @@ ScriptingGlobals.add(function resetDashboard(dashboard: Doc) {
DashboardView.resetDashboard(dashboard);
}, 'move all dashboard tabs to single stack');
ScriptingGlobals.add(function addToDashboards(dashboard: Doc) {
- DashboardView.openDashboard(Doc.MakeAlias(dashboard));
+ DashboardView.openDashboard(Doc.MakeEmbedding(dashboard));
}, 'adds Dashboard to set of Dashboards');
ScriptingGlobals.add(function snapshotDashboard() {
DashboardView.snapshotDashboard();