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

@@ -86,6 +86,7 @@
import { canBeParent } from '/imports/api/parenting/parentingFunctions';
import { getPropertyIcon } from '/imports/constants/PROPERTIES';
import TreeNodeView from '/imports/client/ui/properties/treeNodeViews/TreeNodeView.vue';
import { isAncestor } from '/imports/api/parenting/parentingFunctions';
import { some } from 'lodash';
export default {
@@ -121,9 +122,9 @@ export default {
},
data() {
return {
expanded: this.startExpanded || this.node._ancestorOfMatchedDocument ||
some(this.selectedNode?.ancestors, ref => ref.id === this.node._id) ||
false,
expanded: this.startExpanded ||
this.node._ancestorOfMatchedDocument ||
isAncestor(this.node, this.selectedNode),
}
},
computed: {
@@ -152,8 +153,8 @@ export default {
this.expanded = !!value ||
some(this.selectedNode?.ancestors, ref => ref.id === this.node._id);
},
'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() {