Folders now only hide their immediate children
This commit is contained in:
@@ -70,6 +70,8 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: folderIds,
|
||||
},
|
||||
type: 'action',
|
||||
|
||||
@@ -68,6 +68,8 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: folderIds,
|
||||
},
|
||||
type: 'feature',
|
||||
|
||||
@@ -155,6 +155,8 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
type: 'container',
|
||||
@@ -179,7 +181,10 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
$nin: [...this.containerIds, ...this.folderIds],
|
||||
$nin: this.containerIds,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
type: 'container',
|
||||
removed: { $ne: true },
|
||||
@@ -192,7 +197,10 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
$nin: [...this.containerIds, ...this.folderIds],
|
||||
$nin: this.containerIds,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
type: 'item',
|
||||
equipped: { $ne: true },
|
||||
|
||||
@@ -72,6 +72,8 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: folderIds,
|
||||
},
|
||||
type: 'note',
|
||||
|
||||
@@ -102,6 +102,8 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
inactive: { $ne: true },
|
||||
@@ -121,6 +123,8 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
type: 'spellList',
|
||||
@@ -142,7 +146,10 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
$nin: [...this.spellListIds, ...this.folderIds],
|
||||
$nin: this.spellListIds,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
type: 'spell',
|
||||
removed: { $ne: true },
|
||||
@@ -159,7 +166,10 @@ export default {
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': {
|
||||
$eq: this.creatureId,
|
||||
$nin: [...this.spellListIds, ...this.folderIds],
|
||||
$nin: this.spellListIds,
|
||||
},
|
||||
'parent.id': {
|
||||
$nin: this.folderIds,
|
||||
},
|
||||
type: 'spellList',
|
||||
removed: { $ne: true },
|
||||
|
||||
@@ -425,15 +425,11 @@ function walkDown(forest, callback){
|
||||
|
||||
const propertyHandlers = {
|
||||
folder(prop) {
|
||||
let skipChildren;
|
||||
let propPath = null;
|
||||
if (prop.groupStats && prop.hideStatsGroup) {
|
||||
skipChildren = true;
|
||||
}
|
||||
if (prop.groupStats && prop.tab === 'stats') {
|
||||
propPath = ['folder', prop.location]
|
||||
}
|
||||
return { skipChildren, propPath }
|
||||
return { propPath }
|
||||
},
|
||||
attribute(prop) {
|
||||
if (
|
||||
@@ -524,8 +520,20 @@ export default {
|
||||
properties() {
|
||||
const creature = this.creature;
|
||||
if (!creature) return;
|
||||
const folderIds = CreatureProperties.find({
|
||||
'ancestors.id': this.creatureId,
|
||||
type: 'folder',
|
||||
groupStats: true,
|
||||
hideStatsGroup: true,
|
||||
removed: { $ne: true },
|
||||
inactive: { $ne: true },
|
||||
}, { fields: { _id: 1 } }).map(folder => folder._id);
|
||||
|
||||
const filter = {
|
||||
'ancestors.id': this.creatureId,
|
||||
'parent.id': {
|
||||
$nin: folderIds,
|
||||
},
|
||||
$or: [
|
||||
{ inactive: { $ne: true } },
|
||||
{ type: 'toggle' },
|
||||
|
||||
Reference in New Issue
Block a user