Extract class of current "Move Checklist Option" Component

This commit is contained in:
Martin Filser 2022-01-30 11:35:33 +01:00
parent ea95357ae4
commit 95ebf3bda8

View file

@ -378,14 +378,14 @@ BlazeComponent.extendComponent({
}, },
}).register('checklistItemDetail'); }).register('checklistItemDetail');
BlazeComponent.extendComponent({ class DialogWithBoardSwimlaneListAndCard extends BlazeComponent {
onCreated() { onCreated() {
this.currentBoardId = Utils.getCurrentBoardId(); this.currentBoardId = Utils.getCurrentBoardId();
this.selectedBoardId = new ReactiveVar(this.currentBoardId); this.selectedBoardId = new ReactiveVar(this.currentBoardId);
this.selectedSwimlaneId = new ReactiveVar(''); this.selectedSwimlaneId = new ReactiveVar('');
this.selectedListId = new ReactiveVar(''); this.selectedListId = new ReactiveVar('');
this.setMoveChecklistDialogOption(this.currentBoardId); this.setMoveChecklistDialogOption(this.currentBoardId);
}, }
/** set the last confirmed dialog field values /** set the last confirmed dialog field values
* @param boardId the current board id * @param boardId the current board id
@ -418,7 +418,7 @@ BlazeComponent.extendComponent({
if (!this.selectedListId.get() || !Lists.findOne({_id: this.selectedListId.get(), boardId: this.selectedBoardId.get()})) { if (!this.selectedListId.get() || !Lists.findOne({_id: this.selectedListId.get(), boardId: this.selectedBoardId.get()})) {
this.setFirstListId(); this.setFirstListId();
} }
}, }
/** sets the first swimlane id */ /** sets the first swimlane id */
setFirstSwimlaneId() { setFirstSwimlaneId() {
try { try {
@ -426,7 +426,7 @@ BlazeComponent.extendComponent({
const swimlaneId = board.swimlanes().fetch()[0]._id; const swimlaneId = board.swimlanes().fetch()[0]._id;
this.selectedSwimlaneId.set(swimlaneId); this.selectedSwimlaneId.set(swimlaneId);
} catch (e) {} } catch (e) {}
}, }
/** sets the first list id */ /** sets the first list id */
setFirstListId() { setFirstListId() {
try { try {
@ -434,7 +434,7 @@ BlazeComponent.extendComponent({
const listId = board.lists().fetch()[0]._id; const listId = board.lists().fetch()[0]._id;
this.selectedListId.set(listId); this.selectedListId.set(listId);
} catch (e) {} } catch (e) {}
}, }
/** returns if the board id was the last confirmed one /** returns if the board id was the last confirmed one
* @param boardId check this board id * @param boardId check this board id
@ -443,7 +443,7 @@ BlazeComponent.extendComponent({
isMoveChecklistDialogOptionBoardId(boardId) { isMoveChecklistDialogOptionBoardId(boardId) {
let ret = this.moveChecklistDialogOption.boardId == boardId; let ret = this.moveChecklistDialogOption.boardId == boardId;
return ret; return ret;
}, }
/** returns if the swimlane id was the last confirmed one /** returns if the swimlane id was the last confirmed one
* @param swimlaneId check this swimlane id * @param swimlaneId check this swimlane id
@ -452,7 +452,7 @@ BlazeComponent.extendComponent({
isMoveChecklistDialogOptionSwimlaneId(swimlaneId) { isMoveChecklistDialogOptionSwimlaneId(swimlaneId) {
let ret = this.moveChecklistDialogOption.swimlaneId == swimlaneId; let ret = this.moveChecklistDialogOption.swimlaneId == swimlaneId;
return ret; return ret;
}, }
/** returns if the list id was the last confirmed one /** returns if the list id was the last confirmed one
* @param listId check this list id * @param listId check this list id
@ -461,7 +461,7 @@ BlazeComponent.extendComponent({
isMoveChecklistDialogOptionListId(listId) { isMoveChecklistDialogOptionListId(listId) {
let ret = this.moveChecklistDialogOption.listId == listId; let ret = this.moveChecklistDialogOption.listId == listId;
return ret; return ret;
}, }
/** returns if the card id was the last confirmed one /** returns if the card id was the last confirmed one
* @param cardId check this card id * @param cardId check this card id
@ -470,7 +470,7 @@ BlazeComponent.extendComponent({
isMoveChecklistDialogOptionCardId(cardId) { isMoveChecklistDialogOptionCardId(cardId) {
let ret = this.moveChecklistDialogOption.cardId == cardId; let ret = this.moveChecklistDialogOption.cardId == cardId;
return ret; return ret;
}, }
boards() { boards() {
const ret = Boards.find( const ret = Boards.find(
@ -484,25 +484,25 @@ BlazeComponent.extendComponent({
}, },
); );
return ret; return ret;
}, }
swimlanes() { swimlanes() {
const board = Boards.findOne(this.selectedBoardId.get()); const board = Boards.findOne(this.selectedBoardId.get());
const ret = board.swimlanes(); const ret = board.swimlanes();
return ret; return ret;
}, }
lists() { lists() {
const board = Boards.findOne(this.selectedBoardId.get()); const board = Boards.findOne(this.selectedBoardId.get());
const ret = board.lists(); const ret = board.lists();
return ret; return ret;
}, }
cards() { cards() {
const list = Lists.findOne(this.selectedListId.get()); const list = Lists.findOne(this.selectedListId.get());
const ret = list.cards(this.selectedSwimlaneId.get()); const ret = list.cards(this.selectedSwimlaneId.get());
return ret; return ret;
}, }
/** get the board data from the server /** get the board data from the server
* @param boardId get the board data of this board id * @param boardId get the board data of this board id
@ -523,7 +523,7 @@ BlazeComponent.extendComponent({
} }
}, },
}); });
}, }
events() { events() {
return [ return [
@ -563,5 +563,8 @@ BlazeComponent.extendComponent({
}, },
}, },
]; ];
}, }
}
(class extends DialogWithBoardSwimlaneListAndCard {
}).register('moveChecklistPopup'); }).register('moveChecklistPopup');