mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
My Cards: fix bug when null board, swimlane, or list
* Add new functions to model card for retrieving associated board, swimlane, or list with default values * Use new card model methods
This commit is contained in:
parent
b79ee281ec
commit
0e1c510948
6 changed files with 54 additions and 33 deletions
|
|
@ -30,21 +30,21 @@ template(name="dueCards")
|
|||
ul.due-cards-context-list
|
||||
li.due-cards-context(title="{{_ 'board'}}")
|
||||
+viewer
|
||||
= card.board.title
|
||||
= card.getBoard.title
|
||||
li.due-cards-context.due-cards-context-separator
|
||||
= ' '
|
||||
| {{_ 'context-separator'}}
|
||||
= ' '
|
||||
li.due-cards-context(title="{{_ 'swimlane'}}")
|
||||
+viewer
|
||||
= card.swimlane.title
|
||||
= card.getSwimlane.title
|
||||
li.due-cards-context
|
||||
= ' '
|
||||
| {{_ 'context-separator'}}
|
||||
= ' '
|
||||
li.due-cards-context(title="{{_ 'list'}}")
|
||||
+viewer
|
||||
= card.list.title
|
||||
= card.getList.title
|
||||
|
||||
|
||||
template(name="dueCardsViewChangePopup")
|
||||
|
|
|
|||
|
|
@ -142,22 +142,4 @@ BlazeComponent.extendComponent({
|
|||
// console.log('cards:', cards);
|
||||
return cards;
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
// 'click .js-my-card'(evt) {
|
||||
// const card = this.currentData().card;
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log('currentData():', this.currentData());
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log('card:', card);
|
||||
// if (card) {
|
||||
// Utils.goCardId(card._id);
|
||||
// }
|
||||
// evt.preventDefault();
|
||||
// },
|
||||
},
|
||||
];
|
||||
},
|
||||
}).register('dueCards');
|
||||
|
|
|
|||
|
|
@ -50,21 +50,21 @@ template(name="myCards")
|
|||
ul.my-cards-context-list
|
||||
li.my-cards-context(title="{{_ 'board'}}")
|
||||
+viewer
|
||||
= card.board.title
|
||||
= card.getBoard.title
|
||||
li.my-cards-context.my-cards-context-separator
|
||||
= ' '
|
||||
| {{_ 'context-separator'}}
|
||||
= ' '
|
||||
li.my-cards-context(title="{{_ 'swimlane'}}")
|
||||
+viewer
|
||||
= card.swimlane.title
|
||||
= card.getSwimlane.title
|
||||
li.my-cards-context
|
||||
= ' '
|
||||
| {{_ 'context-separator'}}
|
||||
= ' '
|
||||
li.my-cards-context(title="{{_ 'list'}}")
|
||||
+viewer
|
||||
= card.list.title
|
||||
= card.getList.title
|
||||
|
||||
|
||||
template(name="myCardsSortChangePopup")
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ BlazeComponent.extendComponent({
|
|||
if (list === null || card.listId !== list._id) {
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('new list');
|
||||
list = card.list();
|
||||
list = card.getList();
|
||||
if (list.archived) {
|
||||
list = null;
|
||||
return;
|
||||
|
|
@ -104,7 +104,7 @@ BlazeComponent.extendComponent({
|
|||
if (swimlane === null || card.swimlaneId !== swimlane._id) {
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('new swimlane');
|
||||
swimlane = card.swimlane();
|
||||
swimlane = card.getSwimlane();
|
||||
if (swimlane.archived) {
|
||||
swimlane = null;
|
||||
return;
|
||||
|
|
@ -115,7 +115,7 @@ BlazeComponent.extendComponent({
|
|||
if (board === null || card.boardId !== board._id) {
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('new board');
|
||||
board = card.board();
|
||||
board = card.getBoard();
|
||||
if (board.archived) {
|
||||
board = null;
|
||||
return;
|
||||
|
|
@ -201,9 +201,9 @@ BlazeComponent.extendComponent({
|
|||
const cards = [];
|
||||
cursor.forEach(card => {
|
||||
if (
|
||||
!card.board().archived &&
|
||||
!card.swimlane().archived &&
|
||||
!card.list().archived
|
||||
!card.getBoard().archived &&
|
||||
!card.getSwimlane().archived &&
|
||||
!card.getList().archived
|
||||
) {
|
||||
cards.push(card);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue