aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 7c2cfd15f..4df647728 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -383,6 +383,9 @@ export class CollectionSchemaView extends CollectionSubView() {
};
findColDropIndex = (mouseX: number) => {
+ const leftOffset: number = this._props.ScreenToLocalTransform().inverse().transformPoint(0, 0)[0];
+ console.log(leftOffset);
+ console.log(CollectionSchemaView._rowMenuWidth);
let index: number | undefined;
this.displayColumnWidths.reduce((total, curr, i) => {
if (total <= mouseX && total + curr >= mouseX) {
@@ -390,7 +393,7 @@ export class CollectionSchemaView extends CollectionSubView() {
else index = i + 1;
}
return total + curr;
- }, 2 * CollectionSchemaView._rowMenuWidth); // probably prone to issues; find better implementation (!!!)
+ }, leftOffset + CollectionSchemaView._rowMenuWidth); // probably prone to issues; find better implementation (!!!)
return index;
};
@@ -567,6 +570,7 @@ export class CollectionSchemaView extends CollectionSubView() {
this.clearSelection();
draggedDocs.forEach(doc => {
DocumentView.addViewRenderedCb(doc, dv => dv.select(true));
+ console.log(doc.x);
});
this._lowestSelectedIndex = Math.min(...(draggedDocs?.map(doc => this.rowIndex(doc)) ?? []));
return true;
@@ -717,6 +721,19 @@ export class CollectionSchemaView extends CollectionSubView() {
return true;
};
+ @computed
+ get activeMenuKeys() {
+ const activeKeys = this.documentKeys.filter(key => this.childDocsInclude(key));
+ return activeKeys;
+ }
+
+ childDocsInclude = (key: string) => {
+ this.childDocs.forEach(doc => {
+ // TODO: if childdoc fieldkeys contain the key, return true
+ });
+ return false;
+ };
+
@action
openColumnMenu = (index: number, newCol: boolean) => {
this._makeNewColumn = false;
@@ -914,6 +931,10 @@ export class CollectionSchemaView extends CollectionSubView() {
return (
<div className="schema-column-menu" style={{ left: 0, minWidth: CollectionSchemaView._minColWidth }}>
<input className="schema-key-search-input" type="text" onKeyDown={this.onSearchKeyDown} onChange={this.updateKeySearch} onPointerDown={e => e.stopPropagation()} />
+ {
+ // eslint-disable-next-line jsx-a11y/control-has-associated-label
+ <button type="button" className="schema-column-menu-toggle" />
+ }
{this._makeNewField ? this.newFieldMenu : this.keysDropdown}
</div>
);