aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2023-04-03 17:28:51 -0400
committermehekj <mehek.jethani@gmail.com>2023-04-03 17:28:51 -0400
commit7934c38ed641f4a10cd008fe415a50aef1240e10 (patch)
tree66b0c1f8884abed9cbc81e4d62b578c6365f1700 /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
parent95c076b64a816c6bd503089f90234f8ce078eae8 (diff)
fixed dragging doc out of schema and removing schema column sort
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index d47c9762c..967e10434 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -180,7 +180,6 @@ export class CollectionSchemaView extends CollectionSubView() {
addRow = (doc: Doc | Doc[]) => {
const result: boolean = this.addDocument(doc);
- this.setSort(this.sortField, this.sortDesc);
return result;
};
@@ -362,7 +361,6 @@ export class CollectionSchemaView extends CollectionSubView() {
const pushedAndDraggedDocs = [...pushedDocs, ...draggedDocs];
const removed = this.childDocs.slice().filter(doc => !pushedAndDraggedDocs.includes(doc));
this.dataDoc[this.fieldKey ?? 'data'] = new List<Doc>([...removed, ...draggedDocs, ...pushedDocs]);
- this.setSort(undefined);
SelectionManager.DeselectAll();
draggedDocs.forEach(doc => {
const draggedView = DocumentManager.Instance.getFirstDocumentView(doc);
@@ -378,7 +376,6 @@ export class CollectionSchemaView extends CollectionSubView() {
@action
onExternalDrop = async (e: React.DragEvent): Promise<void> => {
super.onExternalDrop(e, {}, undoBatch(action(docus => docus.map((doc: Doc) => this.addDocument(doc)))));
- this.setSort(undefined);
};
onDividerDown = (e: React.PointerEvent) => setupMoveUpEvents(this, e, this.onDividerMove, emptyFunction, emptyFunction);
@@ -799,7 +796,7 @@ export class CollectionSchemaView extends CollectionSubView() {
const desc = BoolCast(this.layoutDoc.sortDesc);
const docs = !field
? this.childDocs
- : this.childDocs.sort((docA, docB) => {
+ : [...this.childDocs].sort((docA, docB) => {
const aStr = Field.toString(docA[field] as Field);
const bStr = Field.toString(docB[field] as Field);
var out = 0;
@@ -943,6 +940,7 @@ class CollectionSchemaViewDocs extends React.Component<CollectionSchemaViewDocsP
hideLinkAnchors={true}
fitWidth={returnTrue}
scriptContext={this}
+ canEmbedOnDrag={true}
/>
</div>
);