mirror of
https://github.com/wekan/wekan.git
synced 2025-12-27 20:58:48 +01:00
Merge branch 'master' of https://github.com/wekan/wekan
This commit is contained in:
commit
52e45211a2
37 changed files with 7053 additions and 134 deletions
|
|
@ -375,6 +375,14 @@ Boards.attachSchema(
|
|||
defaultValue: true,
|
||||
},
|
||||
|
||||
allowsCardNumber: {
|
||||
/**
|
||||
* Does the board allows card numbers?
|
||||
*/
|
||||
type: Boolean,
|
||||
defaultValue: false,
|
||||
},
|
||||
|
||||
allowsActivities: {
|
||||
/**
|
||||
* Does the board allows comments?
|
||||
|
|
@ -1056,6 +1064,26 @@ Boards.helpers({
|
|||
return result;
|
||||
},
|
||||
|
||||
getNextCardNumber() {
|
||||
const boardCards = Cards.find(
|
||||
{
|
||||
boardId: this._id
|
||||
},
|
||||
{
|
||||
sort: { cardNumber: -1 },
|
||||
limit: 1
|
||||
}
|
||||
).fetch();
|
||||
|
||||
// If no card is assigned to the board, return 1
|
||||
if (!boardCards || boardCards.length === 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const maxCardNr = !!boardCards[0].cardNumber ? boardCards[0].cardNumber : 0;
|
||||
return maxCardNr + 1;
|
||||
},
|
||||
|
||||
cardsDueInBetween(start, end) {
|
||||
return Cards.find({
|
||||
boardId: this._id,
|
||||
|
|
@ -1285,6 +1313,10 @@ Boards.mutations({
|
|||
return { $set: { allowsDescriptionTitle } };
|
||||
},
|
||||
|
||||
setAllowsCardNumber(allowsCardNumber) {
|
||||
return { $set: { allowsCardNumber } };
|
||||
},
|
||||
|
||||
setAllowsDescriptionText(allowsDescriptionText) {
|
||||
return { $set: { allowsDescriptionText } };
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue