From ca9cf672bdfd8ebf11cb20264474bcb9d9729944 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 21 Aug 2020 18:46:58 -0400 Subject: switched from "scenes" to "dashboards" --- .../views/collections/CollectionDockingView.tsx | 35 ++++++++++++---------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'src/client/views/collections/CollectionDockingView.tsx') diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 6338e69a4..2f84065ec 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -31,9 +31,10 @@ import { CollectionFreeFormView } from './collectionFreeForm/CollectionFreeFormV import { listSpec } from '../../../fields/Schema'; import { clamp } from 'lodash'; import { PresBox } from '../nodes/PresBox'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { InteractionUtils } from '../../util/InteractionUtils'; import { InkTool } from '../../../fields/InkField'; +import { List } from '../../../fields/List'; +import { lstat } from 'fs'; const _global = (window /* browser */ || global /* node */) as any; @observer @@ -79,9 +80,7 @@ export class CollectionDockingView extends React.Component { - CollectionDockingView.makeDocumentConfig(doc); - }) + content: dragDocs.map((doc, i) => CollectionDockingView.makeDocumentConfig(doc)) }; } const div = document.createElement("div"); @@ -96,7 +95,7 @@ export class CollectionDockingView extends React.Component this.setupGoldenLayout(), 1); - DocListCast((Doc.UserDoc().myScenes as Doc).data).map(d => d.sceneBrush = false); - this.props.Document.sceneBrush = true; + DocListCast((Doc.UserDoc().myDashboards as Doc).data).map(d => d.dashboardBrush = false); + this.props.Document.dashboardBrush = true; } this._ignoreStateChange = ""; }, { fireImmediately: true }); @@ -421,7 +419,7 @@ export class CollectionDockingView extends React.Component void = () => { try { - this.props.Document.sceneBrush = false; + this.props.Document.dashboardBrush = false; this._goldenLayout.unbind('itemDropped', this.itemDropped); this._goldenLayout.unbind('tabCreated', this.tabCreated); this._goldenLayout.unbind('stackCreated', this.stackCreated); @@ -481,8 +479,16 @@ export class CollectionDockingView extends React.Component DocServer.GetRefField(id)))).filter(f => f).map(f => f as Doc); - docs.map(doc => Doc.AddDocToList(Doc.GetProto(this.props.Document), this.props.fieldKey, doc)); - // Doc.GetProto(this.props.Document)[this.props.fieldKey] = new List(docs); + const sublists = DocListCast(this.props.Document[this.props.fieldKey]); + const tabs = Cast(sublists[0], Doc, null); + const other = Cast(sublists[1], Doc, null); + const tabdocs = DocListCast(tabs.data); + const otherdocs = DocListCast(other.data); + Doc.GetProto(tabs).data = new List(docs); + const otherSet = new Set(); + otherdocs.filter(doc => !docs.includes(doc)).forEach(doc => otherSet.add(doc)); + tabdocs.filter(doc => !docs.includes(doc)).forEach(doc => otherSet.add(doc)); + Doc.GetProto(other).data = new List(Array.from(otherSet.values())); } } @@ -586,7 +592,6 @@ export class CollectionDockingView extends React.Component { //stack.header.controlsContainer.find('.lm_popout').hide(); @@ -652,7 +656,6 @@ export class CollectionDockingView extends React.Component 0) { - return
Nested scenes can't be rendered
; + return
Nested dashboards can't be rendered
; } return