Merge pull request #3459 from jrsupplee/new-search

Search All Boards: Added list of board, list and color names.
This commit is contained in:
Lauri Ojansivu 2021-01-22 16:21:01 +02:00 committed by GitHub
commit 1df060b8f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 198 additions and 9 deletions

View file

@ -1954,6 +1954,18 @@ Cards.globalSearch = queryParams => {
selector.listId.$in = queryLists;
}
if (queryParams.dueAt !== null) {
selector.dueAt = { $gte: new Date(queryParams.dueAt) };
}
if (queryParams.createdAt !== null) {
selector.createdAt = { $gte: new Date(queryParams.createdAt) };
}
if (queryParams.modifiedAt !== null) {
selector.modifiedAt = { $gte: new Date(queryParams.modifiedAt) };
}
const queryMembers = [];
const queryAssignees = [];
if (queryParams.users.length) {
@ -2079,7 +2091,7 @@ Cards.globalSearch = queryParams => {
}
// eslint-disable-next-line no-console
// console.log('selector:', selector);
console.log('selector:', selector);
const cards = Cards.find(selector, {
fields: {
_id: 1,
@ -2094,13 +2106,15 @@ Cards.globalSearch = queryParams => {
assignees: 1,
colors: 1,
dueAt: 1,
createdAt: 1,
modifiedAt: 1,
labelIds: 1,
},
limit: 50,
});
// eslint-disable-next-line no-console
// console.log('count:', cards.count());
console.log('count:', cards.count());
return { cards, errors };
};