From 42afc0250de658fc3e924864bfae5afb4edec335 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 14 May 2023 12:03:40 -0400 Subject: major overhaul of field naming conventions. --- .../collections/CollectionMasonryViewFieldRow.tsx | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/client/views/collections/CollectionMasonryViewFieldRow.tsx') diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx index befd89e41..528781991 100644 --- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx +++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx @@ -44,7 +44,7 @@ interface CMVFieldRowProps { @observer export class CollectionMasonryViewFieldRow extends React.Component { @observable private _background = 'inherit'; - @observable private _createAliasSelected: boolean = false; + @observable private _createEmbeddingSelected: boolean = false; @observable private heading: string = ''; @observable private color: string = '#f1efeb'; @observable private collapsed: boolean = false; @@ -95,7 +95,7 @@ export class CollectionMasonryViewFieldRow extends React.Component { - this._createAliasSelected = false; + this._createEmbeddingSelected = false; if (de.complete.docDragData) { this.props.parent.Document.dropConverter instanceof ScriptField && this.props.parent.Document.dropConverter.script.run({ dragData: de.complete.docDragData }); const key = this.props.pivotField; @@ -117,12 +117,12 @@ export class CollectionMasonryViewFieldRow extends React.Component { - this._createAliasSelected = false; + this._createEmbeddingSelected = false; const key = this.props.pivotField; const castedValue = this.getValue(value); if (castedValue) { - if (this.props.parent.columnHeaders) { - if (this.props.parent.columnHeaders.map(i => i.heading).indexOf(castedValue.toString()) > -1) { + if (this.props.parent.colHeaderData) { + if (this.props.parent.colHeaderData.map(i => i.heading).indexOf(castedValue.toString()) > -1) { return false; } } @@ -135,7 +135,7 @@ export class CollectionMasonryViewFieldRow extends React.Component { - this._createAliasSelected = false; + this._createEmbeddingSelected = false; this._color = color; }; @@ -143,16 +143,16 @@ export class CollectionMasonryViewFieldRow extends React.Component { - this._createAliasSelected = false; + this._createEmbeddingSelected = false; this._background = 'inherit'; }; @action addDocument = (value: string, shiftDown?: boolean, forceEmptyNote?: boolean) => { if (!value && !forceEmptyNote) return false; - this._createAliasSelected = false; + this._createEmbeddingSelected = false; const key = this.props.pivotField; - const newDoc = Docs.Create.TextDocument('', { _autoHeight: true, _width: 200, _fitWidth: true, title: value }); + const newDoc = Docs.Create.TextDocument('', { _layout_autoHeight: true, _width: 200, _layout_fitWidth: true, title: value }); const onLayoutDoc = this.onLayoutDoc(key); FormattedTextBox.SelectOnLoad = newDoc[Id]; FormattedTextBox.SelectOnLoadChar = value; @@ -163,33 +163,33 @@ export class CollectionMasonryViewFieldRow extends React.Component { - this._createAliasSelected = false; + this._createEmbeddingSelected = false; const key = this.props.pivotField; this.props.docList.forEach(d => Doc.SetInPlace(d, key, undefined, true)); - if (this.props.parent.columnHeaders && this.props.headingObject) { - const index = this.props.parent.columnHeaders.indexOf(this.props.headingObject); - this.props.parent.columnHeaders.splice(index, 1); + if (this.props.parent.colHeaderData && this.props.headingObject) { + const index = this.props.parent.colHeaderData.indexOf(this.props.headingObject); + this.props.parent.colHeaderData.splice(index, 1); } }) ); @action collapseSection = (e: any) => { - this._createAliasSelected = false; + this._createEmbeddingSelected = false; this.toggleVisibility(); e.stopPropagation(); }; headerMove = (e: PointerEvent) => { - const alias = Doc.MakeAlias(this.props.Document); + const embedding = Doc.MakeEmbedding(this.props.Document); const key = this.props.pivotField; let value = this.getValue(this.heading); value = typeof value === 'string' ? `"${value}"` : value; const script = `return doc.${key} === ${value}`; const compiled = CompileScript(script, { params: { doc: Doc.name } }); if (compiled.compiled) { - alias.viewSpecScript = new ScriptField(compiled); - DragManager.StartDocumentDrag([this._headerRef.current!], new DragManager.DocumentDragData([alias]), e.clientX, e.clientY); + embedding.viewSpecScript = new ScriptField(compiled); + DragManager.StartDocumentDrag([this._headerRef.current!], new DragManager.DocumentDragData([embedding]), e.clientX, e.clientY); } return true; }; @@ -198,7 +198,7 @@ export class CollectionMasonryViewFieldRow extends React.Component) => { if (e.button === 0 && !e.ctrlKey) { setupMoveUpEvents(this, e, this.headerMove, emptyFunction, e => !this.props.chromeHidden && this.collapseSection(e)); - this._createAliasSelected = false; + this._createEmbeddingSelected = false; } }; @@ -242,16 +242,16 @@ export class CollectionMasonryViewFieldRow extends React.Component (this._createAliasSelected = true)); + toggleEmbedding = action(() => (this._createEmbeddingSelected = true)); toggleVisibility = () => (this._collapsed = !this.collapsed); renderMenu = () => { - const selected = this._createAliasSelected; + const selected = this._createEmbeddingSelected; return (
-
- Create Alias +
+ Create Embedding
Delete -- cgit v1.2.3-70-g09d2