Slot fillers that count as more than one slot now update the space left correctly.
Slot fillers removed from a library can no longer be added to a slot. If a slot has limited space left, this will be reflected on the error finding slots message
This commit is contained in:
@@ -9,10 +9,14 @@ export default function recomputeSlotFullness(ancestorId){
|
||||
'parent.id': slot._id,
|
||||
removed: {$ne: true},
|
||||
}, {
|
||||
fields: {slotQuantityFilled: 1}
|
||||
fields: {
|
||||
slotQuantityFilled: 1,
|
||||
type: 1
|
||||
}
|
||||
}).fetch();
|
||||
let totalFilled = 0;
|
||||
children.forEach(child => {
|
||||
console.log(child);
|
||||
if (child.type === 'slotFiller'){
|
||||
totalFilled += child.slotQuantityFilled;
|
||||
} else {
|
||||
|
||||
@@ -33,6 +33,7 @@ Meteor.publish('slotFillers', function(slotId){
|
||||
// Build a filter for nodes in those libraries that match the slot
|
||||
let filter = {
|
||||
'ancestors.id': {$in: libraryIds},
|
||||
removed: {$ne: true},
|
||||
};
|
||||
if (slot.slotTags && slot.slotTags.length){
|
||||
filter.tags = {$all: slot.slotTags};
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
<code>{{ tag }}</code>,
|
||||
</span>
|
||||
</template>
|
||||
<span v-if="model.spaceLeft">
|
||||
that fills less than {{ model.spaceLeft }} slots
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
@@ -166,7 +169,9 @@ export default {
|
||||
return Creatures.findOne(this.creatureId);
|
||||
},
|
||||
libraryNodes(){
|
||||
let filter = {};
|
||||
let filter = {
|
||||
removed: {$ne: true},
|
||||
};
|
||||
if (this.model.slotTags && this.model.slotTags.length){
|
||||
filter.tags = {$all: this.model.slotTags};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user