From d7d94fb4a9480a699eafa250a95821f7c584911d Mon Sep 17 00:00:00 2001 From: mehekj Date: Tue, 28 Feb 2023 15:15:48 -0500 Subject: rows are documentviews (again) --- .../collections/collectionSchema/CollectionSchemaView.scss | 4 ++-- .../collections/collectionSchema/CollectionSchemaView.tsx | 14 ++++++++------ .../views/collections/collectionSchema/SchemaRowBox.tsx | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.scss b/src/client/views/collections/collectionSchema/CollectionSchemaView.scss index 46c2e2d1a..5c0b6d88b 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.scss +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.scss @@ -135,7 +135,7 @@ } .schema-row-wrapper { - max-height: 70px; + // max-height: 70px; overflow: hidden; } @@ -144,7 +144,7 @@ display: flex; flex-direction: row; height: 100%; - max-height: 70px; + // max-height: 70px; overflow: auto; .schema-column-header, diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 379676f41..bd9303997 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -33,7 +33,7 @@ export enum ColumnType { Image, } -const defaultColumnKeys: string[] = ['title', 'type', 'author', 'text', 'data', 'creationDate']; +const defaultColumnKeys: string[] = ['title', 'type', 'author', 'creationDate', 'links']; @observer export class CollectionSchemaView extends CollectionSubView() { @@ -43,6 +43,7 @@ export class CollectionSchemaView extends CollectionSubView() { private _closestDropIndex: number = 0; private _previewRef: HTMLDivElement | null = null; + public static _rowHeight: number = 50; public static _minColWidth: number = 150; public static _rowMenuWidth: number = 100; public static _previewDividerWidth: number = 4; @@ -419,7 +420,7 @@ export class CollectionSchemaView extends CollectionSubView() { @action addNewTextDoc = (value: string, shiftDown?: boolean, forceEmptyNote?: boolean) => { if (!value && !forceEmptyNote) return false; - const newDoc = Docs.Create.TextDocument(value, { title: value }); + const newDoc = Docs.Create.TextDocument(value, { title: value, _autoHeight: true }); FormattedTextBox.SelectOnLoad = newDoc[Id]; FormattedTextBox.SelectOnLoadChar = forceEmptyNote ? '' : ' '; return this.props.addDocument?.(newDoc) || false; @@ -534,7 +535,7 @@ export class CollectionSchemaView extends CollectionSubView() { SelectionManager.SelectSchemaViewDoc(undefined); this._previewDoc = undefined; })}> -
+
{this.columnKeys.map((key, index) => { return ( @@ -561,7 +562,7 @@ export class CollectionSchemaView extends CollectionSubView() { const dataDoc = !doc.isTemplateDoc && !doc.isTemplateForField && !doc.PARAMS ? undefined : this.props.DataDoc; let dref: Opt; return ( -
+
(dref = r || undefined)} @@ -573,7 +574,7 @@ export class CollectionSchemaView extends CollectionSubView() { ContainingCollectionView={this.props.CollectionView} ContainingCollectionDoc={this.Document} PanelWidth={() => this.tableWidth} - PanelHeight={() => 70} + PanelHeight={() => CollectionSchemaView._rowHeight} styleProvider={DefaultStyleProvider} focus={this.focusDocument} docFilters={this.childDocFilters} @@ -581,12 +582,13 @@ export class CollectionSchemaView extends CollectionSubView() { docRangeFilters={this.childDocRangeFilters} searchFilterDocs={this.searchFilterDocs} rootSelected={this.rootSelected} - ScreenToLocalTransform={() => this.getDocTransform(doc, dref)} + ScreenToLocalTransform={Transform.Identity} bringToFront={emptyFunction} isContentActive={this.isChildContentActive} hideDecorations={true} hideTitle={true} hideDocumentButtonBar={true} + fitWidth={returnTrue} />
); diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx index 0378fa67e..e72ed3c4f 100644 --- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx +++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx @@ -102,7 +102,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent() { return (