aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
diff options
context:
space:
mode:
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;
};