aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DashboardView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-02 09:26:37 -0400
committerbobzel <zzzman@gmail.com>2024-09-02 09:26:37 -0400
commitcda69e48361fce8d71a4dc66edd9dd976a27f52d (patch)
tree82b9a1a5967ae88a9534f89f7eaed3aeb289652f /src/client/views/DashboardView.tsx
parentc01828308714874589d1f60c33ca59df4c656c0c (diff)
parenta958577d4c27b276aa37484e3f895e196138b17c (diff)
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/DashboardView.tsx')
-rw-r--r--src/client/views/DashboardView.tsx22
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);
}
}