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-06-10 12:56:51 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-10 12:56:51 -0400
commit4b604b5118a1aac89d977c832c81495ec2c9aa19 (patch)
tree73128d91c92b706365137eb7f18b00e686442e04 /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
parentecea2cb94fa0ea3f9959b3a8f5f43ae7e98aa552 (diff)
lock row editing
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 7302a7c22..48287c3ec 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -208,7 +208,7 @@ export class CollectionSchemaView extends CollectionSubView() {
removeDoc = (doc: Doc) => {
this.removeDocument(doc);
- this._docs = this._docs.filter(d => d !== doc);
+ this._docs = this._docs.filter(d => d !== doc)
}
rowIndex = (doc: Doc) => this.displayedDocs.docs.indexOf(doc);
@@ -739,13 +739,8 @@ export class CollectionSchemaView extends CollectionSubView() {
};
setCellValues = (key: string, value: string) => {
- const selectedDocs: Doc[] = [];
- this.childDocs.forEach(doc => {
- const isSelected = this._selectedCells && !(this._selectedCells?.filter(d => d === doc).length === 0);
- isSelected && selectedDocs.push(doc);
- });
- if (selectedDocs.length === 1) this.childDocs.forEach(doc => Doc.SetField(doc, key, value)); // if only one cell selected, fill all
- else selectedDocs.forEach(doc => Doc.SetField(doc, key, value)); // else only fill selected cells
+ if (this._selectedCells.length === 1) this.childDocs.forEach(doc => !doc._lockedSchemaEditing && Doc.SetField(doc, key, value)); // if only one cell selected, fill all
+ else this._selectedCells.forEach(doc => !doc._lockedSchemaEditing && Doc.SetField(doc, key, value)); // else only fill selected cells
return true;
};