Add methods to models for archived entities

This commit is contained in:
John R. Supplee 2021-01-11 18:18:26 +02:00
parent 01bd94d2b3
commit bbcb236a46
5 changed files with 115 additions and 44 deletions

View file

@ -88,6 +88,7 @@ BlazeComponent.extendComponent({
s: 'swimlanes',
list: 'lists',
l: 'lists',
is: 'is',
};
const selector = {
boards: [],
@ -95,6 +96,7 @@ BlazeComponent.extendComponent({
lists: [],
users: [],
labels: [],
is: [],
};
let text = '';
while (query) {
@ -150,6 +152,48 @@ BlazeComponent.extendComponent({
// eslint-disable-next-line no-console
console.log('text:', text);
if (selector.boards.length) {
selector.boardsSelector = {
archived: false,
title: { $in: [] },
};
selector.boards.forEach(term => {
selector.boardsSelector.title.$in.push(term);
});
}
if (selector.lists.length) {
selector.listsSelector = {
archived: false,
title: { $in: [] },
};
selector.lists.forEach(term => {
selector.listsSelector.title.$in.push(term);
});
}
if (selector.swimlanes.length) {
selector.swimlanesSelector = {
archived: false,
title: { $in: [] },
};
selector.swimlanes.forEach(term => {
selector.swimlanesSelector.title.$in.push(term);
});
}
if (selector.labels.length) {
selector.labelsSelector = {
archived: false,
title: { $in: [] },
};
selector.labels.forEach(term => {
selector.labelsSelector.title.$in.push(term);
});
}
selector.text = text;
this.autorun(() => {
const handle = subManager.subscribe('globalSearch', selector);
Tracker.nonreactive(() => {