Fixed slot fillers in fill dialog not showing children when expanded

This commit is contained in:
ThaumRystra
2024-11-09 14:21:15 +02:00
parent 40025dc7d3
commit 5c80975bc1
3 changed files with 10 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ import numberToSignedString from '/imports/api/utility/numberToSignedString';
import PropertyIcon from '/imports/client/ui/properties/shared/PropertyIcon.vue'; import PropertyIcon from '/imports/client/ui/properties/shared/PropertyIcon.vue';
import MarkdownText from '/imports/client/ui/components/MarkdownText.vue'; import MarkdownText from '/imports/client/ui/components/MarkdownText.vue';
import TreeNodeList from '/imports/client/ui/components/tree/TreeNodeList.vue'; import TreeNodeList from '/imports/client/ui/components/tree/TreeNodeList.vue';
import { getFilter, docsToForest as nodeArrayToTree } from '/imports/api/parenting/parentingFunctions'; import { getFilter, docsToForest } from '/imports/api/parenting/parentingFunctions';
import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties';
import { some } from 'lodash'; import { some } from 'lodash';
@@ -166,7 +166,7 @@ export default {
return prop.left > range.left && prop.right < range.right; return prop.left > range.left && prop.right < range.right;
}); });
}); });
return nodeArrayToTree(descendants); return docsToForest(descendants);
}, },
}, },
} }

View File

@@ -17,6 +17,7 @@
/> />
<tree-node-list <tree-node-list
group="library-node-expansion" group="library-node-expansion"
:root="{collection: 'libraryNodes', id: id}"
:children="propertyChildren" :children="propertyChildren"
@selected="clickChild" @selected="clickChild"
/> />
@@ -26,7 +27,7 @@
</template> </template>
<script lang="js"> <script lang="js">
import { filterToForest } from '/imports/api/parenting/parentingFunctions'; import { docsToForest, getFilter } from '/imports/api/parenting/parentingFunctions';
import LibraryNodes from '/imports/api/library/LibraryNodes'; import LibraryNodes from '/imports/api/library/LibraryNodes';
import propertyViewerIndex from '/imports/client/ui/properties/viewers/shared/propertyViewerIndex'; import propertyViewerIndex from '/imports/client/ui/properties/viewers/shared/propertyViewerIndex';
import TreeNodeList from '/imports/client/ui/components/tree/TreeNodeList.vue'; import TreeNodeList from '/imports/client/ui/components/tree/TreeNodeList.vue';
@@ -71,7 +72,11 @@ export default {
return LibraryNodes.findOne(this.id); return LibraryNodes.findOne(this.id);
}, },
propertyChildren() { propertyChildren() {
return filterToForest(LibraryNodes, this.id, {}); const descendants = LibraryNodes.find({
...getFilter.descendants(this.model),
removed: { $ne: true },
}).fetch();
return docsToForest(descendants);
}, },
} }
} }

View File

@@ -301,8 +301,7 @@ Meteor.publish('descendantLibraryNodes', function (nodeId) {
if (!libraryId || !node) return []; if (!libraryId || !node) return [];
this.autorun(function () { this.autorun(function () {
let userId = this.userId; let userId = this.userId;
let library = Libraries.findOne(libraryId); try { assertDocViewPermission(node, userId) }
try { assertViewPermission(library, userId) }
catch (e) { catch (e) {
return this.error(e); return this.error(e);
} }