Began implementing class level up UI

This commit is contained in:
Stefan Zermatten
2022-07-04 13:55:41 +02:00
parent 292388dead
commit 1a71c2cfa7
6 changed files with 513 additions and 16 deletions

View File

@@ -15,9 +15,30 @@ export default function getSlotFillFilter({slot, libraryIds}){
slotFillerType: slot.slotType,
}]
});
} else if (slot.type === 'class') {
filter.$and.push({
$or: [{
type: 'classLevel',
},{
type: 'slotFiller',
slotFillerType: 'classLevel',
}]
});
filter.variableName = slot.variableName;
// Only search for levels the class needs
const levels = [];
if (slot.missingLevels && slot.missingLevels.length) {
levels.push(...slot.missingLevels);
} else if (slot.level) {
levels.push(slot.level);
}
if (levels.length) {
filter.level = {$or: levels};
}
}
let tagsOr = [];
let tagsNor = [];
let tagsNin = [];
if (slot.slotTags && slot.slotTags.length){
tagsOr.push({tags: {$all: slot.slotTags}});
}
@@ -27,15 +48,15 @@ export default function getSlotFillFilter({slot, libraryIds}){
if (extra.operation === 'OR'){
tagsOr.push({tags: {$all: extra.tags}});
} else if (extra.operation === 'NOT'){
tagsNor.push({tags: {$all: extra.tags}});
tagsNin.push(...extra.tags);
}
});
}
if (tagsOr.length){
filter.$and.push({$or: tagsOr});
}
if (tagsNor.length){
filter.$and.push({$nor: tagsNor});
if (tagsNin.length){
filter.$and.push({$nin: tagsNin});
}
if (!filter.$and.length){
delete filter.$and;