mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Fix : Linked card cannot change date #2930
This commit is contained in:
parent
10e3d963ef
commit
262df6c4a0
2 changed files with 44 additions and 28 deletions
|
|
@ -500,6 +500,13 @@ Boards.attachSchema(
|
||||||
optional: true,
|
optional: true,
|
||||||
defaultValue: 'no-parent',
|
defaultValue: 'no-parent',
|
||||||
},
|
},
|
||||||
|
receivedAt: {
|
||||||
|
/**
|
||||||
|
* Date the card was received
|
||||||
|
*/
|
||||||
|
type: Date,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
startAt: {
|
startAt: {
|
||||||
/**
|
/**
|
||||||
* Starting date of the board.
|
* Starting date of the board.
|
||||||
|
|
|
||||||
|
|
@ -1168,6 +1168,13 @@ Cards.helpers({
|
||||||
} else {
|
} else {
|
||||||
return card.receivedAt;
|
return card.receivedAt;
|
||||||
}
|
}
|
||||||
|
} else if (this.isLinkedBoard()) {
|
||||||
|
const board = Boards.findOne({ _id: this.linkedId });
|
||||||
|
if (board === undefined) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return board.receivedAt;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return this.receivedAt;
|
return this.receivedAt;
|
||||||
}
|
}
|
||||||
|
|
@ -1176,6 +1183,8 @@ Cards.helpers({
|
||||||
setReceived(receivedAt) {
|
setReceived(receivedAt) {
|
||||||
if (this.isLinkedCard()) {
|
if (this.isLinkedCard()) {
|
||||||
return Cards.update({ _id: this.linkedId }, { $set: { receivedAt } });
|
return Cards.update({ _id: this.linkedId }, { $set: { receivedAt } });
|
||||||
|
} else if (this.isLinkedBoard()) {
|
||||||
|
return Boards.update({ _id: this.linkedId }, { $set: { receivedAt } });
|
||||||
} else {
|
} else {
|
||||||
return Cards.update({ _id: this._id }, { $set: { receivedAt } });
|
return Cards.update({ _id: this._id }, { $set: { receivedAt } });
|
||||||
}
|
}
|
||||||
|
|
@ -2163,13 +2172,13 @@ Cards.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setReceived(receivedAt) {
|
//setReceived(receivedAt) {
|
||||||
return {
|
// return {
|
||||||
$set: {
|
// $set: {
|
||||||
receivedAt,
|
// receivedAt,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
},
|
//},
|
||||||
|
|
||||||
unsetReceived() {
|
unsetReceived() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -2179,13 +2188,13 @@ Cards.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setStart(startAt) {
|
//setStart(startAt) {
|
||||||
return {
|
// return {
|
||||||
$set: {
|
// $set: {
|
||||||
startAt,
|
// startAt,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
},
|
//},
|
||||||
|
|
||||||
unsetStart() {
|
unsetStart() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -2195,13 +2204,13 @@ Cards.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setDue(dueAt) {
|
//setDue(dueAt) {
|
||||||
return {
|
// return {
|
||||||
$set: {
|
// $set: {
|
||||||
dueAt,
|
// dueAt,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
},
|
//},
|
||||||
|
|
||||||
unsetDue() {
|
unsetDue() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -2211,13 +2220,13 @@ Cards.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setEnd(endAt) {
|
//setEnd(endAt) {
|
||||||
return {
|
// return {
|
||||||
$set: {
|
// $set: {
|
||||||
endAt,
|
// endAt,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
},
|
//},
|
||||||
|
|
||||||
unsetEnd() {
|
unsetEnd() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue