mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 10:50:13 +01:00
My Cards development
first prototype
This commit is contained in:
parent
3ed9f07015
commit
077e78d37c
6 changed files with 329 additions and 0 deletions
|
|
@ -42,6 +42,66 @@ Meteor.publish('boards', function() {
|
|||
);
|
||||
});
|
||||
|
||||
Meteor.publish('mySwimlanes', function() {
|
||||
const userId = this.userId;
|
||||
const swimlanes = [];
|
||||
|
||||
Cards.find({
|
||||
archived: false,
|
||||
$or: [{ members: userId }, { assignees: userId }],
|
||||
}).forEach(card => {
|
||||
swimlanes.push(card.swimlaneId);
|
||||
});
|
||||
|
||||
return Swimlanes.find(
|
||||
{
|
||||
archived: false,
|
||||
_id: { $in: swimlanes },
|
||||
},
|
||||
{
|
||||
fields: {
|
||||
_id: 1,
|
||||
title: 1,
|
||||
type: 1,
|
||||
sort: 1,
|
||||
},
|
||||
// sort: {
|
||||
// sort: ['boardId', 'listId', 'sort'],
|
||||
// },
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Meteor.publish('myLists', function() {
|
||||
const userId = this.userId;
|
||||
const lists = [];
|
||||
|
||||
Cards.find({
|
||||
archived: false,
|
||||
$or: [{ members: userId }, { assignees: userId }],
|
||||
}).forEach(card => {
|
||||
lists.push(card.listId);
|
||||
});
|
||||
|
||||
return Lists.find(
|
||||
{
|
||||
archived: false,
|
||||
_id: { $in: lists },
|
||||
},
|
||||
{
|
||||
fields: {
|
||||
_id: 1,
|
||||
title: 1,
|
||||
type: 1,
|
||||
sort: 1,
|
||||
},
|
||||
// sort: {
|
||||
// sort: ['boardId', 'listId', 'sort'],
|
||||
// },
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Meteor.publish('archivedBoards', function() {
|
||||
const userId = this.userId;
|
||||
if (!Match.test(userId, String)) return [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue