diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-05 13:42:04 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-05 13:42:04 -0400 |
| commit | fed19c3b7e14bc00216b5f91363451a0e9bed93d (patch) | |
| tree | 9c3c8504890bdfebe0f7e9f0253b0f0ed9b7849b /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | |
| parent | 641cd55d41460cf24f07959c8f94e2723c18ddeb (diff) | |
row menu rework, icons mostly good
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 6b97cb97c..30daa793a 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -7,11 +7,11 @@ import * as React from 'react'; import { returnEmptyDoclist, returnEmptyString, returnFalse, returnIgnore, returnNever, returnTrue, setupMoveUpEvents, smoothScroll } from '../../../../ClientUtils'; import { emptyFunction } from '../../../../Utils'; import { Doc, DocListCast, Field, FieldType, IdToDoc, NumListCast, Opt, StrListCast } from '../../../../fields/Doc'; -import { DocData } from '../../../../fields/DocSymbols'; +import { AclPrivate, DocData } from '../../../../fields/DocSymbols'; import { Id } from '../../../../fields/FieldSymbols'; import { List } from '../../../../fields/List'; import { ColumnType } from '../../../../fields/SchemaHeaderField'; -import { BoolCast, NumCast, StrCast } from '../../../../fields/Types'; +import { BoolCast, Cast, NumCast, StrCast } from '../../../../fields/Types'; import { DocUtils } from '../../../documents/DocUtils'; import { Docs, DocumentOptions, FInfo } from '../../../documents/Documents'; import { DragManager } from '../../../util/DragManager'; @@ -34,6 +34,9 @@ import { SchemaRowBox } from './SchemaRowBox'; import { ActionButton } from '@adobe/react-spectrum'; import { CollectionMasonryViewFieldRow } from '../CollectionMasonryViewFieldRow'; import { Func } from 'mocha'; +import { CollectionView } from '../CollectionView'; +import { listSpec } from '../../../../fields/Schema'; +import { GetEffectiveAcl } from '../../../../fields/util'; const { SCHEMA_NEW_NODE_HEIGHT } = require('../../global/globalCssVariables.module.scss'); // prettier-ignore @@ -635,6 +638,19 @@ export class CollectionSchemaView extends CollectionSubView() { return undefined; }; + addDocsFromChildCollection = (collection: CollectionSchemaView) => { + const childDocs = collection.childDocs.slice(); + console.log(childDocs) + childDocs.forEach((doc: Doc) => {!this.childDocs.includes(doc) && this._lentDocs.push(doc)}); + } + + removeChildCollectionDocs = (collection: CollectionSchemaView) => { + const children = collection.childDocs.slice(); + this._lentDocs.forEach(element => { + + }); + } + @computed get fieldDefaultInput() { switch (this._newFieldType) { case ColumnType.Number: @@ -746,9 +762,7 @@ export class CollectionSchemaView extends CollectionSubView() { this._columnMenuIndex = index; this._menuValue = ''; this._menuKeys = this.documentKeys; - this._makeNewField = false; this._newFieldWarning = ''; - this._makeNewField = false; this._makeNewColumn = newCol; }; @@ -920,7 +934,7 @@ export class CollectionSchemaView extends CollectionSubView() { const x = this._columnMenuIndex! === -1 ? 0 : this.displayColumnWidths.reduce((total, curr, index) => total + (index < this._columnMenuIndex! ? curr : 0), CollectionSchemaView._rowMenuWidth); return ( <div className="schema-column-menu" style={{ left: x, minWidth: CollectionSchemaView._minColWidth }}> - {this._makeNewField ? this.newFieldMenu : this.keysDropdown} + {this.keysDropdown} </div> ); } @@ -928,7 +942,7 @@ export class CollectionSchemaView extends CollectionSubView() { get renderKeysMenu() { return ( <div className="schema-column-menu" style={{ left: 0, minWidth: CollectionSchemaView._minColWidth }}> - {this._makeNewField ? this.newFieldMenu : this.keysDropdown} + {this.keysDropdown} </div> ); } @@ -954,7 +968,7 @@ export class CollectionSchemaView extends CollectionSubView() { } return ( <div key={key} className="schema-filter-option"> - <input // + <input type="checkbox" onPointerDown={e => e.stopPropagation()} onClick={e => e.stopPropagation()} @@ -1025,11 +1039,7 @@ export class CollectionSchemaView extends CollectionSubView() { screenToLocal = () => this.ScreenToLocalBoxXf().translate(-this.tableWidth, 0); previewWidthFunc = () => this.previewWidth; onPassiveWheel = (e: WheelEvent) => e.stopPropagation(); - displayedDocsFunc = () => { - let docs: Doc[] = this._lentDocs.slice(); - docs = docs.concat(this.sortedDocs.docs); - return docs; - } + displayedDocsFunc = () => this._lentDocs.slice().concat(this.sortedDocs.docs); _oldWheel: any; render() { return ( |
