aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TreeView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-27 22:23:12 -0400
committerbobzel <zzzman@gmail.com>2020-09-27 22:23:12 -0400
commitbc4f646c74dadf1a95b993dc0b11beb9f5f9f044 (patch)
treec6905642f412e94c5080ee0e76994e1234d5c723 /src/client/views/collections/TreeView.tsx
parent85f6e30109671a22e296c9b13b3940debd3c39a1 (diff)
trying a different solr schema that better supports regexp's by not doing stemming. fixed issues with schema and tree views where children need to be registered for tryUpdateHeight to work but not when they're in a sidebar that specifies dontRegisterView. Changed stacking/freeform/tree/masonry to NOT be dontRegisterChildView -- this should be set by the context (ie, sidebar)
Diffstat (limited to 'src/client/views/collections/TreeView.tsx')
-rw-r--r--src/client/views/collections/TreeView.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx
index 486e44f6b..744e8fed6 100644
--- a/src/client/views/collections/TreeView.tsx
+++ b/src/client/views/collections/TreeView.tsx
@@ -48,6 +48,7 @@ export interface TreeViewProps {
indentDocument?: () => void;
outdentDocument?: () => void;
ScreenToLocalTransform: () => Transform;
+ dontRegisterView?: boolean;
backgroundColor?: (doc: Opt<Doc>, renderDepth: number) => string | undefined;
outerXf: () => { translateX: number, translateY: number };
treeView: CollectionTreeView;
@@ -319,7 +320,7 @@ export class TreeView extends React.Component<TreeViewProps> {
this.props.treeView, doc, undefined, key, this.props.containingCollection, this.props.prevSibling, addDoc, remDoc, this.move,
this.props.dropAction, this.props.addDocTab, this.props.pinToPres, this.props.backgroundColor, this.props.ScreenToLocalTransform, this.props.outerXf, this.props.active,
this.props.panelWidth, this.props.ChromeHeight, this.props.renderDepth, this.props.treeViewHideHeaderFields, this.props.treeViewPreventOpen,
- [...this.props.renderedIds, doc[Id]], this.props.onCheckedClick, this.props.onChildClick, this.props.ignoreFields, false, this.props.whenActiveChanged);
+ [...this.props.renderedIds, doc[Id]], this.props.onCheckedClick, this.props.onChildClick, this.props.ignoreFields, false, this.props.whenActiveChanged, this.props.dontRegisterView);
} else {
contentElement = <EditableView key="editableView"
contents={contents !== undefined ? Field.toString(contents as Field) : "null"}
@@ -372,7 +373,7 @@ export class TreeView extends React.Component<TreeViewProps> {
this.dataDoc, expandKey, this.props.containingCollection, this.props.prevSibling, addDoc, remDoc, this.move,
StrCast(this.doc.childDropAction, this.props.dropAction) as dropActionType, this.props.addDocTab, this.props.pinToPres, this.props.backgroundColor, this.props.ScreenToLocalTransform,
this.props.outerXf, this.props.active, this.props.panelWidth, this.props.ChromeHeight, this.props.renderDepth, this.props.treeViewHideHeaderFields, this.props.treeViewPreventOpen,
- [...this.props.renderedIds, this.doc[Id]], this.props.onCheckedClick, this.props.onChildClick, this.props.ignoreFields, false, this.props.whenActiveChanged)}
+ [...this.props.renderedIds, this.doc[Id]], this.props.onCheckedClick, this.props.onChildClick, this.props.ignoreFields, false, this.props.whenActiveChanged, this.props.dontRegisterView)}
</ul >;
} else if (this.treeViewExpandedView === "fields") {
return <ul key={this.doc[Id] + this.doc.title}><div ref={this._dref} style={{ display: "inline-block" }} >
@@ -387,6 +388,7 @@ export class TreeView extends React.Component<TreeViewProps> {
Document={this.doc}
DataDoc={undefined}
LibraryPath={emptyPath}
+ dontRegisterView={this.props.dontRegisterView}
renderDepth={this.props.renderDepth + 1}
rootSelected={returnTrue}
treeViewDoc={undefined}
@@ -658,7 +660,8 @@ export class TreeView extends React.Component<TreeViewProps> {
onChildClick: undefined | (() => ScriptField),
ignoreFields: string[] | undefined,
firstLevel: boolean,
- whenActiveChanged: (isActive: boolean) => void) {
+ whenActiveChanged: (isActive: boolean) => void,
+ dontRegisterView: boolean | undeifned) {
const viewSpecScript = Cast(containingCollection.viewSpecScript, ScriptField);
if (viewSpecScript) {
childDocs = childDocs.filter(d => viewSpecScript.script.run({ doc: d }, console.log).result);
@@ -709,7 +712,7 @@ export class TreeView extends React.Component<TreeViewProps> {
}
};
const outdent = !parentCollectionDoc ? undefined : () => {
- if (remove && StrCast(parentCollectionDoc.layout).indexOf('fieldKey') !== -1) {
+ if (parentCollectionDoc._viewType === CollectionViewType.Tree && remove && StrCast(parentCollectionDoc.layout).indexOf('fieldKey') !== -1) {
const fieldKeysub = StrCast(parentCollectionDoc.layout).split('fieldKey')[1];
const fieldKey = fieldKeysub.split("\'")[1];
remove(child);
@@ -742,6 +745,7 @@ export class TreeView extends React.Component<TreeViewProps> {
panelWidth={rowWidth}
panelHeight={rowHeight}
ChromeHeight={ChromeHeight}
+ dontRegisterView={dontRegisterView}
moveDocument={move}
dropAction={dropAction}
addDocTab={addDocTab}