Began migration of queries to nested sets

This commit is contained in:
Thaum Rystra
2023-10-03 16:28:20 +02:00
parent 28a19f2037
commit f63d2ad254
41 changed files with 242 additions and 392 deletions

View File

@@ -131,6 +131,7 @@ import { snackbar } from '/imports/client/ui/components/snackbars/SnackbarQueue'
import softRemoveProperty from '/imports/api/creature/creatureProperties/methods/softRemoveProperty';
import restoreProperty from '/imports/api/creature/creatureProperties/methods/restoreProperty';
import getPropertyTitle from '/imports/client/ui/properties/shared/getPropertyTitle';
import { isAncestor } from '/imports/api/parenting/parentingFunctions';
export default {
name: 'BuildTreeNode',
@@ -233,11 +234,10 @@ export default {
},
watch: {
'node._ancestorOfMatchedDocument'(value){
this.expanded = !!value ||
some(this.selectedNode?.ancestors, ref => ref.id === this.node._id);
this.expanded = !!value || isAncestor(this.node, this.selectedNode);
},
'selectedNode.ancestors'(value){
this.expanded = !!some(value, ref => ref.id === this.node._id) || this.expanded;
'selectedNode.parentId'(){
this.expanded = isAncestor(this.node, this.selectedNode) || this.expanded;
},
},
beforeCreate() {