From 92ec2016a405f67eca73858ff94a0919b267039c Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 21 Sep 2022 11:41:57 -0400 Subject: fixed snapshots of dashbaords to have trails setup --- src/client/views/DashboardView.tsx | 76 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 39 deletions(-) (limited to 'src/client/views/DashboardView.tsx') diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx index ce442801f..68d975a17 100644 --- a/src/client/views/DashboardView.tsx +++ b/src/client/views/DashboardView.tsx @@ -92,35 +92,32 @@ export class DashboardView extends React.Component { const dashboardCount = DocListCast(Doc.MyDashboards.data).length + 1; const placeholder = `Dashboard ${dashboardCount}`; return ( -
-
Create New Dashboard
+
+
Create New Dashboard
Title this.setNewDashboardName((e.target as any).value)} />
Background - { - this.newDashboardColor = color; - }} /> + { + this.newDashboardColor = color; + }} + />
-
); @@ -163,20 +160,19 @@ export class DashboardView extends React.Component { <>
-
+
this.selectDashboardGroup(DashboardGroup.MyDashboards)}> My Dashboards @@ -214,18 +210,15 @@ export class DashboardView extends React.Component { e.stopPropagation(); this.onContextMenu(dashboard, e); }}> - } - /> + } />
); })} -
{ +
{ this.setNewDashboardName(''); }}> + @@ -324,6 +317,15 @@ export class DashboardView extends React.Component { Doc.AddDocToList(dashboards, 'data', dashboardDoc); + DashboardView.SetupDashboardTrails(dashboardDoc); + + // open this new dashboard + Doc.ActiveDashboard = dashboardDoc; + Doc.ActivePage = 'dashboard'; + Doc.ActivePresentation = undefined; + }; + + public static SetupDashboardTrails(dashboardDoc: Doc) { // this section is creating the button document itself === myTrails = new Button const reqdBtnOpts: DocumentOptions = { _forceActive: true, @@ -368,15 +370,11 @@ export class DashboardView extends React.Component { }; dashboardDoc.myTrails = new PrefetchProxy(DocUtils.AssignScripts(Docs.Create.TreeDocument([], reqdOpts), { treeViewChildDoubleClick: 'openPresentation(documentView.rootDoc)' })); - // open this new dashboard - Doc.ActiveDashboard = dashboardDoc; - Doc.ActivePage = 'dashboard'; - Doc.ActivePresentation = undefined; const contextMenuScripts = [reqdBtnScript.onClick]; if (Cast(Doc.MyTrails.contextMenuScripts, listSpec(ScriptField), null)?.length !== contextMenuScripts.length) { Doc.MyTrails.contextMenuScripts = new List(contextMenuScripts.map(script => ScriptField.MakeFunction(script)!)); } - }; + } } export function AddToList(MySharedDocs: Doc, arg1: string, dash: any) { -- cgit v1.2.3-70-g09d2