diff options
| author | eleanor-park <eleanor_park@brown.edu> | 2024-08-27 16:44:12 -0400 |
|---|---|---|
| committer | eleanor-park <eleanor_park@brown.edu> | 2024-08-27 16:44:12 -0400 |
| commit | 39d2bba7bf4b0cc3759931691640083a48cce662 (patch) | |
| tree | 8bf110760aa926237b6294aec545f48cfc92747d /src/client/views/DashboardView.tsx | |
| parent | 6f73686ec4dc3e01ae3eacc0150aa59eafea0325 (diff) | |
| parent | b8a04a0fedf8ef3612395764a0ecd01f6824ebd1 (diff) | |
Merge branch 'master' into eleanor-gptdraw
Diffstat (limited to 'src/client/views/DashboardView.tsx')
| -rw-r--r-- | src/client/views/DashboardView.tsx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx index b7383a37e..33e905a54 100644 --- a/src/client/views/DashboardView.tsx +++ b/src/client/views/DashboardView.tsx @@ -1,5 +1,3 @@ -/* eslint-disable jsx-a11y/no-static-element-interactions */ -/* eslint-disable jsx-a11y/click-events-have-key-events */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button, ColorPicker, EditableText, Size, Type } from 'browndash-components'; import { action, computed, makeObservable, observable } from 'mobx'; @@ -46,7 +44,7 @@ export type DocConfig = { // DashboardView is the view with the dashboard previews, rendered when the app first loads @observer -export class DashboardView extends ObservableReactComponent<{}> { +export class DashboardView extends ObservableReactComponent<object> { public static _urlState: HistoryUtil.DocUrl; public static makeDocumentConfig(document: Doc, panelName?: string, width?: number, keyValue?: boolean) { return { @@ -82,7 +80,7 @@ export class DashboardView extends ObservableReactComponent<{}> { }); return doc; } - constructor(props: any) { + constructor(props: object) { super(props); makeObservable(this); } @@ -428,15 +426,15 @@ export class DashboardView extends ObservableReactComponent<{}> { const dashboardDoc = DashboardView.StandardCollectionDockingDocument([{ doc: freeformDoc, initialWidth: 600 }], { title: title }, id, 'row'); Doc.AddDocToList(Doc.MyHeaderBar, 'data', freeformDoc, undefined, undefined, true); + Doc.AddDocToList(Doc.MyDashboards, 'data', dashboardDoc); dashboardDoc.pane_count = 1; freeformDoc.embedContainer = dashboardDoc; dashboardDoc.myOverlayDocs = new List<Doc>(); - dashboardDoc.myPublishedDocs = new List<Doc>(); - - Doc.AddDocToList(Doc.MyDashboards, 'data', dashboardDoc); - - DashboardView.SetupDashboardTrails(dashboardDoc); - DashboardView.SetupDashboardCalendars(dashboardDoc); + dashboardDoc[DocData].myPublishedDocs = new List<Doc>(); + dashboardDoc[DocData].myTagCollections = new List<Doc>(); + dashboardDoc[DocData].myUniqueFaces = new List<Doc>(); + dashboardDoc[DocData].myTrails = DashboardView.SetupDashboardTrails(dashboardDoc); + dashboardDoc[DocData].myCalendars = DashboardView.SetupDashboardCalendars(dashboardDoc); // open this new dashboard Doc.ActiveDashboard = dashboardDoc; Doc.ActivePage = 'dashboard'; @@ -469,7 +467,7 @@ export class DashboardView extends ObservableReactComponent<{}> { }; const myCalendars = DocUtils.AssignScripts(Docs.Create.CalendarCollectionDocument([], reqdOpts)); // { treeView_ChildDoubleClick: 'openPresentation(documentView.rootDoc)' } - dashboardDoc.myCalendars = new PrefetchProxy(myCalendars); + return new PrefetchProxy(myCalendars); } public static SetupDashboardTrails(dashboardDoc: Doc) { @@ -515,12 +513,12 @@ export class DashboardView extends ObservableReactComponent<{}> { layout_explainer: 'All of the trails that you have created will appear here.', }; const myTrails = DocUtils.AssignScripts(Docs.Create.TreeDocument([], reqdOpts), { treeView_ChildDoubleClick: 'openPresentation(documentView.Document)' }); - dashboardDoc.myTrails = new PrefetchProxy(myTrails); const contextMenuScripts = [reqdBtnScript.onClick]; if (Cast(myTrails.contextMenuScripts, listSpec(ScriptField), null)?.length !== contextMenuScripts.length) { myTrails.contextMenuScripts = new List<ScriptField>(contextMenuScripts.map(script => ScriptField.MakeFunction(script)!)); } + return new PrefetchProxy(myTrails); } } |
