Fixed showstopping bugs with tree organize functions

This commit is contained in:
ThaumRystra
2023-12-31 18:06:31 +02:00
parent 9d07953a40
commit e886be8f04
12 changed files with 360 additions and 181 deletions

View File

@@ -1,4 +1,3 @@
import { Accounts } from 'meteor/accounts-base'
import emailTemplate from './emailTemplate';
Accounts.emailTemplates.from = 'no-reply@dicecloud.com';

View File

@@ -11,9 +11,15 @@ const LIBRARY_NODE_TREE_FIELDS = {
type: 1,
icon: 1,
color: 1,
// Old tree fields
order: 1,
parent: 1,
ancestors: 1,
// Tree fields
parentId: 1,
left: 1,
right: 1,
root: 1,
removed: 1,
removedAt: 1,
// Actions
@@ -235,7 +241,7 @@ Meteor.publish('libraryNodes', function (libraryId, extraFields) {
});
return [
LibraryNodes.find({
'ancestors.id': libraryId,
'root.id': libraryId,
}, {
sort: { order: 1 },
fields,

View File

@@ -104,9 +104,9 @@ Meteor.publish('searchLibraryNodes', function (creatureId) {
sort: {
// `score` property specified in the projection fields above.
// score: { $meta: 'textScore' },
'ancestors.0.id': 1,
'root.id': 1,
name: 1,
order: 1,
left: 1,
}
}
} else {
@@ -114,9 +114,9 @@ Meteor.publish('searchLibraryNodes', function (creatureId) {
delete filter.$and;
options = {
sort: {
'ancestors.0.id': 1,
'root.id': 1,
name: 1,
order: 1,
left: 1,
}
};
}