diff options
author | mehekj <mehek.jethani@gmail.com> | 2023-02-28 15:15:48 -0500 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2023-02-28 15:15:48 -0500 |
commit | d7d94fb4a9480a699eafa250a95821f7c584911d (patch) | |
tree | be4562bbe696027af5513e09e684c092d8657e01 /src | |
parent | fcbcf0290c8da423667b94db9a92f41c962955ed (diff) |
rows are documentviews (again)
Diffstat (limited to 'src')
3 files changed, 11 insertions, 9 deletions
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; })}> - <div className="schema-header-row"> + <div className="schema-header-row" style={{ height: CollectionSchemaView._rowHeight }}> <div className="row-menu" style={{ width: CollectionSchemaView._rowMenuWidth }}></div> {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<DocumentView>; return ( - <div className="schema-row-wrapper"> + <div className="schema-row-wrapper" style={{ maxHeight: CollectionSchemaView._rowHeight }}> <DocumentView {...this.props} ref={r => (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} /> </div> ); 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<FieldViewProps>() { return ( <div className="schema-row" - style={this.props.isSelected() ? { backgroundColor: Colors.LIGHT_BLUE /*, opacity: this.props.dragging ? 0.5 : 1 */ } : {}} + style={this.props.isSelected() ? { height: CollectionSchemaView._rowHeight, backgroundColor: Colors.LIGHT_BLUE /*, opacity: this.props.dragging ? 0.5 : 1 */ } : { height: CollectionSchemaView._rowHeight }} // onPointerDown={this.onRowPointerDown} // onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerLeave} |