mirror of
https://github.com/wekan/wekan.git
synced 2026-02-03 23:21:47 +01:00
Bug fix for #3864 searching archived cards and add new operators for organizations and teams
This commit is contained in:
parent
6ef612d04e
commit
aa0dee1fba
8 changed files with 89 additions and 6 deletions
|
|
@ -1501,8 +1501,8 @@ Boards.userBoards = (
|
|||
selector.$or = [
|
||||
{ permission: 'public' },
|
||||
{ members: { $elemMatch: { userId, isActive: true } } },
|
||||
{ 'orgs.orgId': { $in: user.orgIds() } },
|
||||
{ 'teams.teamId': { $in : user.teamIds() } },
|
||||
{ orgs: { $elemMatch: { orgId: { $in: user.orgIds() }, isActive: true } } },
|
||||
{ teams: { $elemMatch: { teamId: { $in: user.teamIds() }, isActive: true } } },
|
||||
];
|
||||
|
||||
return Boards.find(selector, projection);
|
||||
|
|
|
|||
|
|
@ -345,6 +345,17 @@ Lists.mutations({
|
|||
},
|
||||
});
|
||||
|
||||
Lists.userArchivedLists = userId => {
|
||||
return Lists.find({
|
||||
boardId: { $in: Boards.userBoardIds(userId, null) },
|
||||
archived: true,
|
||||
})
|
||||
};
|
||||
|
||||
Lists.userArchivedListIds = () => {
|
||||
return Lists.userArchivedLists().map(list => { return list._id; });
|
||||
};
|
||||
|
||||
Lists.archivedLists = () => {
|
||||
return Lists.find({ archived: true });
|
||||
};
|
||||
|
|
|
|||
|
|
@ -306,6 +306,17 @@ Swimlanes.mutations({
|
|||
},
|
||||
});
|
||||
|
||||
Swimlanes.userArchivedSwimlanes = userId => {
|
||||
return Swimlanes.find({
|
||||
boardId: { $in: Boards.userBoardIds(userId, null) },
|
||||
archived: true,
|
||||
})
|
||||
};
|
||||
|
||||
Swimlanes.userArchivedSwimlaneIds = () => {
|
||||
return Swimlanes.userArchivedSwimlanes().map(swim => { return swim._id; });
|
||||
};
|
||||
|
||||
Swimlanes.archivedSwimlanes = () => {
|
||||
return Swimlanes.find({ archived: true });
|
||||
};
|
||||
|
|
|
|||
|
|
@ -521,12 +521,14 @@ Users.helpers({
|
|||
},
|
||||
teamIds() {
|
||||
if (this.teams) {
|
||||
// TODO: Should the Team collection be queried to determine if the team isActive?
|
||||
return this.teams.map(team => { return team.teamId });
|
||||
}
|
||||
return [];
|
||||
},
|
||||
orgIds() {
|
||||
if (this.orgs) {
|
||||
// TODO: Should the Org collection be queried to determine if the organization isActive?
|
||||
return this.orgs.map(org => { return org.orgId });
|
||||
}
|
||||
return [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue