mirror of
https://github.com/wekan/wekan.git
synced 2026-01-22 01:06:09 +01:00
Add methods to models for archived entities
This commit is contained in:
parent
01bd94d2b3
commit
bbcb236a46
5 changed files with 115 additions and 44 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue