Fixed showstopping bugs with tree organize functions
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { Accounts } from 'meteor/accounts-base'
|
||||
import emailTemplate from './emailTemplate';
|
||||
|
||||
Accounts.emailTemplates.from = 'no-reply@dicecloud.com';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user