aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-05-14 12:03:40 -0400
committerbobzel <zzzman@gmail.com>2023-05-14 12:03:40 -0400
commit42afc0250de658fc3e924864bfae5afb4edec335 (patch)
treed61bbc43d95cb6e1d6fa5c997102d505adc09af5 /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
parent0849fbd97c61688d51e5fea6cf8edc47989df5de (diff)
major overhaul of field naming conventions.
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 588affc1c..bcc2ca129 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -79,7 +79,7 @@ export class CollectionSchemaView extends CollectionSubView() {
@observable _selectedCell: [Doc, number] | undefined;
@computed get _selectedDocs() {
- return SelectionManager.Docs().filter(doc => Doc.AreProtosEqual(DocCast(doc.context), this.rootDoc));
+ return SelectionManager.Docs().filter(doc => Doc.AreProtosEqual(DocCast(doc.embedContainer), this.rootDoc));
}
@computed get documentKeys() {
@@ -87,7 +87,7 @@ export class CollectionSchemaView extends CollectionSubView() {
}
@computed get previewWidth() {
- return NumCast(this.layoutDoc.schemaPreviewWidth);
+ return NumCast(this.layoutDoc.schema_previewWidth);
}
@computed get tableWidth() {
@@ -95,12 +95,12 @@ export class CollectionSchemaView extends CollectionSubView() {
}
@computed get columnKeys() {
- return Cast(this.layoutDoc.columnKeys, listSpec('string'), defaultColumnKeys);
+ return Cast(this.layoutDoc.schema_columnKeys, listSpec('string'), defaultColumnKeys);
}
@computed get storedColumnWidths() {
const widths = NumListCast(
- this.layoutDoc.columnWidths,
+ this.layoutDoc.schema_columnWidths,
this.columnKeys.map(() => (this.tableWidth - CollectionSchemaView._rowMenuWidth) / this.columnKeys.length)
);
@@ -243,7 +243,7 @@ export class CollectionSchemaView extends CollectionSubView() {
let currKeys = [...this.columnKeys];
currKeys[index] = newKey;
- this.layoutDoc.columnKeys = new List<string>(currKeys);
+ this.layoutDoc.schema_columnKeys = new List<string>(currKeys);
};
@undoBatch
@@ -257,11 +257,11 @@ export class CollectionSchemaView extends CollectionSubView() {
const currWidths = this.storedColumnWidths.slice();
currWidths.splice(0, 0, newColWidth);
const newDesiredTableWidth = currWidths.reduce((w, cw) => w + cw, 0);
- this.layoutDoc.columnWidths = new List<number>(currWidths.map(w => (w / newDesiredTableWidth) * (this.tableWidth - CollectionSchemaView._rowMenuWidth)));
+ this.layoutDoc.schema_columnWidths = new List<number>(currWidths.map(w => (w / newDesiredTableWidth) * (this.tableWidth - CollectionSchemaView._rowMenuWidth)));
let currKeys = this.columnKeys.slice();
currKeys.splice(0, 0, key);
- this.layoutDoc.columnKeys = new List<string>(currKeys);
+ this.layoutDoc.schema_columnKeys = new List<string>(currKeys);
};
@action
@@ -274,11 +274,11 @@ export class CollectionSchemaView extends CollectionSubView() {
const currWidths = this.storedColumnWidths.slice();
currWidths.splice(index, 1);
const newDesiredTableWidth = currWidths.reduce((w, cw) => w + cw, 0);
- this.layoutDoc.columnWidths = new List<number>(currWidths.map(w => (w / newDesiredTableWidth) * (this.tableWidth - CollectionSchemaView._rowMenuWidth)));
+ this.layoutDoc.schema_columnWidths = new List<number>(currWidths.map(w => (w / newDesiredTableWidth) * (this.tableWidth - CollectionSchemaView._rowMenuWidth)));
let currKeys = this.columnKeys.slice();
currKeys.splice(index, 1);
- this.layoutDoc.columnKeys = new List<string>(currKeys);
+ this.layoutDoc.schema_columnKeys = new List<string>(currKeys);
};
@action
@@ -317,7 +317,7 @@ export class CollectionSchemaView extends CollectionSubView() {
@action
finishResize = () => {
- this.layoutDoc.columnWidths = new List<number>(this._displayColumnWidths);
+ this.layoutDoc.schema_columnWidths = new List<number>(this._displayColumnWidths);
this._displayColumnWidths = undefined;
};
@@ -326,11 +326,11 @@ export class CollectionSchemaView extends CollectionSubView() {
moveColumn = (fromIndex: number, toIndex: number) => {
let currKeys = this.columnKeys.slice();
currKeys.splice(toIndex, 0, currKeys.splice(fromIndex, 1)[0]);
- this.layoutDoc.columnKeys = new List<string>(currKeys);
+ this.layoutDoc.schema_columnKeys = new List<string>(currKeys);
let currWidths = this.storedColumnWidths.slice();
currWidths.splice(toIndex, 0, currWidths.splice(fromIndex, 1)[0]);
- this.layoutDoc.columnWidths = new List<number>(currWidths);
+ this.layoutDoc.schema_columnWidths = new List<number>(currWidths);
};
@action
@@ -480,14 +480,14 @@ export class CollectionSchemaView extends CollectionSubView() {
const maxWidth = 1000;
const movedWidth = this.props.ScreenToLocalTransform().transformDirection(nativeWidth.right - e.clientX, 0)[0];
const width = movedWidth < minWidth ? minWidth : movedWidth > maxWidth ? maxWidth : movedWidth;
- this.layoutDoc.schemaPreviewWidth = width;
+ this.layoutDoc.schema_previewWidth = width;
return false;
};
@action
addNewTextDoc = (value: string, shiftDown?: boolean, forceEmptyNote?: boolean) => {
if (!value && !forceEmptyNote) return false;
- const newDoc = Docs.Create.TextDocument(value, { title: value, _autoHeight: true });
+ const newDoc = Docs.Create.TextDocument(value, { title: value, _layout_autoHeight: true });
FormattedTextBox.SelectOnLoad = newDoc[Id];
FormattedTextBox.SelectOnLoadChar = forceEmptyNote ? '' : ' ';
return this.addRow(newDoc) || false;
@@ -500,7 +500,7 @@ export class CollectionSchemaView extends CollectionSubView() {
ContextMenu.Instance.setDefaultItem('::', (name: string): void => {
Doc.GetProto(this.props.Document)[name] = '';
- this.addRow(Docs.Create.TextDocument('', { title: name, _autoHeight: true }));
+ this.addRow(Docs.Create.TextDocument('', { title: name, _layout_autoHeight: true }));
});
ContextMenu.Instance.displayMenu(x, y, undefined, true);
};
@@ -837,7 +837,7 @@ export class CollectionSchemaView extends CollectionSubView() {
});
return { docs };
}
- rowHeightFunc = () => (BoolCast(this.layoutDoc._singleLine) ? CollectionSchemaView._rowSingleLineHeight : CollectionSchemaView._rowHeight);
+ rowHeightFunc = () => (BoolCast(this.layoutDoc._schema_singleLine) ? CollectionSchemaView._rowSingleLineHeight : CollectionSchemaView._rowHeight);
sortedDocsFunc = () => this.sortedDocs;
isContentActive = () => this.props.isSelected() || this.props.isContentActive();
screenToLocal = () => this.props.ScreenToLocalTransform().translate(-this.tableWidth, 0);
@@ -968,7 +968,7 @@ class CollectionSchemaViewDocs extends React.Component<CollectionSchemaViewDocsP
hideTitle={true}
hideDocumentButtonBar={true}
hideLinkAnchors={true}
- fitWidth={returnTrue}
+ layout_fitWidth={returnTrue}
scriptContext={this}
canEmbedOnDrag={true}
/>