aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-05 23:15:35 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-05 23:15:35 -0400
commit9d0576378416b2e4ce7c5eb3c958ec6a650e9f90 (patch)
treea329931d497b468b5f2fb6ade7035168b8eeebca /src/client/views/collections/collectionSchema/SchemaRowBox.tsx
parentfed19c3b7e14bc00216b5f91363451a0e9bed93d (diff)
c
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaRowBox.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index 8e4161413..8ac2c0314 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -74,9 +74,13 @@ export class SchemaRowBox extends ViewBoxBaseComponent<SchemaRowBoxProps>() {
});
if (this.Document['type'] === 'collection') {
ContextMenu.Instance.addItem({
- description: 'Add children to schema',
- event: () => this.schemaView.addDocsFromChildCollection(this.Document as unknown as CollectionSchemaView),
- icon: 'plus',
+ description: this.Document._childrenSharedWithSchema ? 'Remove children from schema' : 'Add children to schema',
+ event: () => {
+ this.Document._childrenSharedWithSchema = !this.Document._childrenSharedWithSchema;
+ this.Document._childrenSharedWithSchema ?
+ this.schemaView.addDocsFromChildCollection(this.Document) : this.schemaView.removeChildCollectionDocs(this.Document);
+ },
+ icon: this.Document._childrenSharedWithSchema ? 'minus' : 'plus',
});
}
ContextMenu.Instance.displayMenu(x, y, undefined, false);