aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-09-29 19:55:40 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-09-29 19:55:40 -0400
commitcf45abf8ada938caddb226c825166d4acdee3086 (patch)
tree135f601da07aa62185221fd79f4d196e094121b7 /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
parentd8a43b76f101a2f38ef1e3e9cbf8ec036468481d (diff)
linting
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx56
1 files changed, 22 insertions, 34 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 11a4e88f9..51b3e1532 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -7,16 +7,15 @@ import * as React from 'react';
import { ClientUtils, 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 { AclPrivate, DocData } from '../../../../fields/DocSymbols';
+import { DocData } from '../../../../fields/DocSymbols';
import { Id } from '../../../../fields/FieldSymbols';
import { List } from '../../../../fields/List';
import { ColumnType } from '../../../../fields/SchemaHeaderField';
-import { BoolCast, Cast, NumCast, StrCast } from '../../../../fields/Types';
+import { BoolCast, NumCast, StrCast } from '../../../../fields/Types';
import { DocUtils } from '../../../documents/DocUtils';
import { Docs, DocumentOptions, FInfo } from '../../../documents/Documents';
import { DragManager } from '../../../util/DragManager';
import { dropActionType } from '../../../util/DropActionTypes';
-import { SettingsManager } from '../../../util/SettingsManager';
import { undoBatch, undoable } from '../../../util/UndoManager';
import { ContextMenu } from '../../ContextMenu';
import { EditableView } from '../../EditableView';
@@ -31,20 +30,9 @@ import { CollectionSubView } from '../CollectionSubView';
import './CollectionSchemaView.scss';
import { SchemaColumnHeader } from './SchemaColumnHeader';
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';
import { ContextMenuProps } from '../../ContextMenuItem';
-import { truncate } from 'lodash';
import { DocumentManager } from '../../../util/DocumentManager';
-import { TbHemispherePlus } from 'react-icons/tb';
-import { docs_v1 } from 'googleapis';
import { SchemaCellField } from './SchemaCellField';
-import { threadId } from 'worker_threads';
-import { FontIconBox } from '../../nodes/FontIconBox/FontIconBox';
import { SnappingManager } from '../../../util/SnappingManager';
/**
@@ -458,7 +446,7 @@ export class CollectionSchemaView extends CollectionSubView() {
* @returns column index
*/
findColDropIndex = (mouseX: number) => {
- let xOffset: number = this._props.ScreenToLocalTransform().inverse().transformPoint(0,0)[0] + CollectionSchemaView._rowMenuWidth;
+ const xOffset: number = this._props.ScreenToLocalTransform().inverse().transformPoint(0,0)[0] + CollectionSchemaView._rowMenuWidth;
let index: number | undefined;
this.displayColumnWidths.reduce((total, curr, i) => {
if (total <= mouseX && total + curr >= mouseX) {
@@ -562,7 +550,7 @@ export class CollectionSchemaView extends CollectionSubView() {
*/
highlightSortedColumn = (field?: string, descending?: boolean) => {
let index = -1;
- let highlightColors: string[] = [];
+ const highlightColors: string[] = [];
const rowCount: number = this._containedDocs.length + 1;
if (field || this.sortField){
index = this.columnKeys.indexOf(field || this.sortField);
@@ -1169,20 +1157,20 @@ export class CollectionSchemaView extends CollectionSubView() {
};
/**
- * Gets docs contained by collections within the schema
+ * Gets docs contained by collections within the schema. Currently defunct.
* @param doc
* @param displayed
* @returns
*/
- subCollectionDocs = (doc: Doc, displayed: boolean) => {
- const childDocs = DocListCast(doc[Doc.LayoutFieldKey(doc)]);
- let collections: Array<Doc> = [];
- if (displayed) collections = childDocs.filter(d => d.type === 'collection' && d._childrenSharedWithSchema);
- else collections = childDocs.filter(d => d.type === 'collection' && !d._childrenSharedWithSchema);
- let toReturn: Doc[] = [...childDocs];
- collections.forEach(d => toReturn = toReturn.concat(this.subCollectionDocs(d, displayed)));
- return toReturn;
- }
+ // subCollectionDocs = (doc: Doc, displayed: boolean) => {
+ // const childDocs = DocListCast(doc[Doc.LayoutFieldKey(doc)]);
+ // let collections: Array<Doc> = [];
+ // if (displayed) collections = childDocs.filter(d => d.type === 'collection' && d._childrenSharedWithSchema);
+ // else collections = childDocs.filter(d => d.type === 'collection' && !d._childrenSharedWithSchema);
+ // let toReturn: Doc[] = [...childDocs];
+ // collections.forEach(d => toReturn = toReturn.concat(this.subCollectionDocs(d, displayed)));
+ // return toReturn;
+ // }
/**
* Applies any filters active on the schema to filter out docs that don't match.
@@ -1234,16 +1222,16 @@ export class CollectionSchemaView extends CollectionSubView() {
* Returns all child docs of the schema and child docs of contained collections that satisfy applied filters.
*/
@computed get docs() {
- let docsFromChildren: Doc[] = [];
+ //let docsFromChildren: Doc[] = [];
- const displayedCollections = this.childDocs.filter(d => d.type === 'collection' && d._childrenSharedWithSchema);
- displayedCollections.forEach(d => {
- let docsNotAlreadyDisplayed = this.subCollectionDocs(d, true).filter(dc => !this._containedDocs.includes(dc));
- docsFromChildren = docsFromChildren.concat(docsNotAlreadyDisplayed);
- });
- let docs = this.filteredDocs;
+ // Functionality for adding child docs
+ //const displayedCollections = this.childDocs.filter(d => d.type === 'collection' && d._childrenSharedWithSchema);
+ // displayedCollections.forEach(d => {
+ // let docsNotAlreadyDisplayed = this.subCollectionDocs(d, true).filter(dc => !this._containedDocs.includes(dc));
+ // docsFromChildren = docsFromChildren.concat(docsNotAlreadyDisplayed);
+ // });
- return docs;
+ return this.filteredDocs;;
}
/**