Added library node "searchable" switch
This commit is contained in:
@@ -4,6 +4,7 @@ export default function getSlotFillFilter({ slot, libraryIds }) {
|
||||
if (!libraryIds) throw 'LibraryIds is required for getSlotFillFilter';
|
||||
|
||||
let filter = {
|
||||
fillSlots: true,
|
||||
removed: { $ne: true },
|
||||
$and: []
|
||||
};
|
||||
|
||||
@@ -38,6 +38,28 @@
|
||||
v-if="context.isLibraryForm"
|
||||
dense
|
||||
>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<smart-switch
|
||||
label="Can fill slots"
|
||||
:value="model.fillSlots"
|
||||
:error-messages="errors.fillSlots"
|
||||
@change="(value, ack) => $emit('change', {path: ['fillSlots'], value, ack})"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<smart-switch
|
||||
label="Searchable from character sheet"
|
||||
:value="model.searchable"
|
||||
:error-messages="errors.searchable"
|
||||
@change="(value, ack) => $emit('change', {path: ['searchable'], value, ack})"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
|
||||
@@ -24,6 +24,7 @@ const LIBRARY_NODE_TREE_FIELDS = {
|
||||
slotFillerType: 1,
|
||||
slotFillerConditionNote: 1,
|
||||
slotFillerCondition: 1,
|
||||
fillSlots: 1,
|
||||
searchable: 1,
|
||||
slotFillImage: 1,
|
||||
// Effect
|
||||
|
||||
@@ -65,13 +65,12 @@ Meteor.publish('searchLibraryNodes', function (creatureId) {
|
||||
let filter = {
|
||||
'ancestors.id': { $in: libraryIds },
|
||||
removed: { $ne: true },
|
||||
tags: { $ne: [] }, // Only tagged library nodes are considered
|
||||
searchable: true //library nodes must opt-in
|
||||
};
|
||||
if (type) {
|
||||
filter.$or = [{
|
||||
type,
|
||||
}, {
|
||||
type: 'slotFiller',
|
||||
slotFillerType: type,
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user