mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Development and fixes to My Cards and Due Cards
This commit is contained in:
parent
0e1c510948
commit
55b121e0d3
7 changed files with 50 additions and 108 deletions
|
|
@ -80,51 +80,18 @@ Utils = {
|
|||
dueCardsView() {
|
||||
let view = window.localStorage.getItem('dueCardsView');
|
||||
|
||||
if (!view || !['user', 'all'].includes(view)) {
|
||||
window.localStorage.setItem('dueCardsView', 'user');
|
||||
if (!view || !['me', 'all'].includes(view)) {
|
||||
window.localStorage.setItem('dueCardsView', 'me');
|
||||
location.reload();
|
||||
view = 'user';
|
||||
view = 'me';
|
||||
}
|
||||
|
||||
return view;
|
||||
},
|
||||
|
||||
dueBoardsSelector() {
|
||||
const user = Meteor.user();
|
||||
|
||||
const selector = {
|
||||
archived: false,
|
||||
};
|
||||
|
||||
// if user is not an admin allow her to see cards only from boards where
|
||||
// she is a member
|
||||
if (!user.isAdmin()) {
|
||||
selector.$or = [
|
||||
{ permission: 'public' },
|
||||
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
|
||||
];
|
||||
}
|
||||
|
||||
return selector;
|
||||
},
|
||||
|
||||
dueCardsSelector() {
|
||||
const user = Meteor.user();
|
||||
|
||||
const selector = {
|
||||
archived: false,
|
||||
};
|
||||
|
||||
// if user is not an admin allow her to see cards only from boards where
|
||||
// she is a member
|
||||
if (!user.isAdmin()) {
|
||||
selector.$or = [
|
||||
{ permission: 'public' },
|
||||
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
|
||||
];
|
||||
}
|
||||
|
||||
return selector;
|
||||
setDueCardsView(view) {
|
||||
window.localStorage.setItem('dueCardsView', view);
|
||||
location.reload();
|
||||
},
|
||||
|
||||
// XXX We should remove these two methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue