aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DashboardView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-05-22 11:25:32 -0400
committerbobzel <zzzman@gmail.com>2023-05-22 11:25:32 -0400
commitbed3309e1fda6597b2a8fea10ad82cd3a0402051 (patch)
treefe599bbdc5fca2c221e1e0f7a60995b7cd39f870 /src/client/views/DashboardView.tsx
parent887a4f7e0fc25fde87b20a5de2e7b0aee561cc78 (diff)
parent3d26d5b2654841a9b92f3d66b28d1dc8e36cca6a (diff)
merged physics with master
Diffstat (limited to 'src/client/views/DashboardView.tsx')
-rw-r--r--src/client/views/DashboardView.tsx41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index 7ebe8d0e3..fb41ca8af 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -66,18 +66,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));
};
@@ -109,17 +109,8 @@ export class DashboardView extends React.Component {
/>
</div>
<div className="button-bar">
- <Button text="Cancel" borderRadius={10} hoverStyle={'gray'} fontSize={FontSize.SECONDARY} onClick={this.abortCreateNewDashboard} />
- <Button
- text="Create"
- borderRadius={10}
- backgroundColor={Colors.LIGHT_BLUE}
- hoverStyle={'darken'}
- fontSize={FontSize.SECONDARY}
- onClick={() => {
- this.createNewDashboard(this.newDashboardName!, this.newDashboardColor);
- }}
- />
+ <Button text="Cancel" onClick={this.abortCreateNewDashboard} />
+ <Button text="Create" onClick={() => this.createNewDashboard(this.newDashboardName!, this.newDashboardColor)} />
</div>
</div>
);
@@ -163,7 +154,7 @@ export class DashboardView extends React.Component {
<div className="dashboard-view">
<div className="left-menu">
<div className="new-dashboard-button">
- <Button icon={<FaPlus />} hoverStyle="darken" backgroundColor={Colors.LIGHT_BLUE} size={Size.MEDIUM} fontSize={FontSize.HEADER} text="New" onClick={() => this.setNewDashboardName('')} borderRadius={50} />
+ <Button icon={<FaPlus />} size={Size.MEDIUM} text="New" onClick={() => this.setNewDashboardName('')} />
</div>
<div className={`text-button ${this.selectedDashboardGroup === DashboardGroup.MyDashboards && 'selected'}`} onClick={() => this.selectDashboardGroup(DashboardGroup.MyDashboards)}>
My Dashboards
@@ -196,7 +187,7 @@ export class DashboardView extends React.Component {
e.stopPropagation();
this.onContextMenu(dashboard, e);
}}>
- <IconButton isCircle={true} size={Size.SMALL} hoverStyle="gray" icon={<FontAwesomeIcon color="black" size="lg" icon="bars" />} />
+ <Button size={Size.SMALL} icon={<FontAwesomeIcon color="black" size="lg" icon="bars" />} />
</div>
</div>
</div>
@@ -233,7 +224,6 @@ export class DashboardView extends React.Component {
/// this also sets the readonly state of the dashboard based on the current mode of dash (from its url)
public static openDashboard = (doc: Doc | undefined, fromHistory = false) => {
if (!doc) return false;
- Doc.MainDocId = doc[Id];
Doc.AddDocToList(Doc.MyDashboards, 'data', doc);
// this has the side-effect of setting the main container since we're assigning the active/guest dashboard
@@ -368,15 +358,14 @@ 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);
@@ -406,7 +395,7 @@ export class DashboardView extends React.Component {
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);
@@ -416,13 +405,13 @@ 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,
@@ -433,7 +422,7 @@ export class DashboardView extends React.Component {
boxShadow: '0 0',
childDontRegisterViews: true,
targetDropAction: 'same',
- system: true,
+ isSystem: true,
explainer: 'All of the trails that you have created will appear here.',
};
const myTrails = DocUtils.AssignScripts(Docs.Create.TreeDocument([], reqdOpts), { treeViewChildDoubleClick: 'openPresentation(documentView.rootDoc)' });
@@ -463,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();