aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2020-03-03 10:49:22 -0500
committerbob <bcz@cs.brown.edu>2020-03-03 10:49:22 -0500
commitd4fd33ea337b1136344b73b92e9d5494ff94f090 (patch)
tree02680cccb52a8be0509d53617608fd116f03ea39 /src/client/views/collections/CollectionMasonryViewFieldRow.tsx
parentdbdf81e191107240a62086ebe65d1dc5e3b503c6 (diff)
fixes to allow navigation from hashtag tag to pivot/schema/stacking views
Diffstat (limited to 'src/client/views/collections/CollectionMasonryViewFieldRow.tsx')
-rw-r--r--src/client/views/collections/CollectionMasonryViewFieldRow.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
index 3c2cbb5b0..6ebd3194d 100644
--- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
+++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
@@ -80,7 +80,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
if (de.complete.docDragData) {
(this.props.parent.Document.dropConverter instanceof ScriptField) &&
this.props.parent.Document.dropConverter.script.run({ dragData: de.complete.docDragData });
- const key = StrCast(this.props.parent.props.Document.sectionFilter);
+ const key = StrCast(this.props.parent.props.Document._pivotField);
const castedValue = this.getValue(this._heading);
de.complete.docDragData.droppedDocuments.forEach(d => d[key] = castedValue);
this.props.parent.onInternalDrop(e, de);
@@ -99,7 +99,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
@action
headingChanged = (value: string, shiftDown?: boolean) => {
this._createAliasSelected = false;
- const key = StrCast(this.props.parent.props.Document.sectionFilter);
+ const key = StrCast(this.props.parent.props.Document._pivotField);
const castedValue = this.getValue(value);
if (castedValue) {
if (this.props.parent.sectionHeaders) {
@@ -138,7 +138,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
@action
addDocument = (value: string, shiftDown?: boolean) => {
this._createAliasSelected = false;
- const key = StrCast(this.props.parent.props.Document.sectionFilter);
+ const key = StrCast(this.props.parent.props.Document._pivotField);
const newDoc = Docs.Create.TextDocument("", { _height: 18, _width: 200, title: value });
newDoc[key] = this.getValue(this.props.heading);
return this.props.parent.props.addDocument(newDoc);
@@ -146,7 +146,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
deleteRow = undoBatch(action(() => {
this._createAliasSelected = false;
- const key = StrCast(this.props.parent.props.Document.sectionFilter);
+ const key = StrCast(this.props.parent.props.Document._pivotField);
this.props.docList.forEach(d => d[key] = undefined);
if (this.props.parent.sectionHeaders && this.props.headingObject) {
const index = this.props.parent.sectionHeaders.indexOf(this.props.headingObject);
@@ -168,7 +168,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
const [dx, dy] = this.props.screenToLocalTransform().transformDirection(e.clientX - this._startDragPosition.x, e.clientY - this._startDragPosition.y);
if (Math.abs(dx) + Math.abs(dy) > this._sensitivity) {
const alias = Doc.MakeAlias(this.props.parent.props.Document);
- const key = StrCast(this.props.parent.props.Document.sectionFilter);
+ const key = StrCast(this.props.parent.props.Document._pivotField);
let value = this.getValue(this._heading);
value = typeof value === "string" ? `"${value}"` : value;
const script = `return doc.${key} === ${value}`;
@@ -296,7 +296,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
@computed get headingView() {
const heading = this._heading;
- const key = StrCast(this.props.parent.props.Document.sectionFilter);
+ const key = StrCast(this.props.parent.props.Document._pivotField);
const evContents = heading ? heading : this.props.type && this.props.type === "number" ? "0" : `NO ${key.toUpperCase()} VALUE`;
const headerEditableViewProps = {
GetValue: () => evContents,