|
|
|
@ -324,45 +324,54 @@ BlazeComponent.extendComponent({ |
|
|
|
|
}, |
|
|
|
|
}).register('listsGroup'); |
|
|
|
|
|
|
|
|
|
BlazeComponent.extendComponent({ |
|
|
|
|
class MoveSwimlaneComponent extends BlazeComponent { |
|
|
|
|
serverMethod = 'moveSwimlane'; |
|
|
|
|
|
|
|
|
|
onCreated() { |
|
|
|
|
this.currentSwimlane = this.currentData(); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
board() { |
|
|
|
|
return Boards.findOne(Session.get('currentBoard')); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toBoards() { |
|
|
|
|
const boards = Boards.find( |
|
|
|
|
{ |
|
|
|
|
archived: false, |
|
|
|
|
'members.userId': Meteor.userId(), |
|
|
|
|
type: 'board', |
|
|
|
|
_id: { $ne: this.board()._id }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
sort: { title: 1 }, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
toBoardsSelector() { |
|
|
|
|
return { |
|
|
|
|
archived: false, |
|
|
|
|
'members.userId': Meteor.userId(), |
|
|
|
|
type: 'board', |
|
|
|
|
_id: { $ne: this.board()._id }, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return boards; |
|
|
|
|
}, |
|
|
|
|
toBoards() { |
|
|
|
|
return Boards.find(this.toBoardsSelector(), { sort: { title: 1 } }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
events() { |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
'click .js-done'() { |
|
|
|
|
const swimlane = Swimlanes.findOne(this.currentSwimlane._id); |
|
|
|
|
// const swimlane = Swimlanes.findOne(this.currentSwimlane._id);
|
|
|
|
|
const bSelect = $('.js-select-boards')[0]; |
|
|
|
|
let boardId; |
|
|
|
|
if (bSelect) { |
|
|
|
|
boardId = bSelect.options[bSelect.selectedIndex].value; |
|
|
|
|
Meteor.call('moveSwimlane', this.currentSwimlane._id, boardId); |
|
|
|
|
Meteor.call(this.serverMethod, this.currentSwimlane._id, boardId); |
|
|
|
|
} |
|
|
|
|
Popup.close(); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
}, |
|
|
|
|
}).register('moveSwimlanePopup'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
MoveSwimlaneComponent.register('moveSwimlanePopup'); |
|
|
|
|
|
|
|
|
|
(class extends MoveSwimlaneComponent { |
|
|
|
|
serverMethod = 'copySwimlane'; |
|
|
|
|
toBoardsSelector() { |
|
|
|
|
const selector = super.toBoardsSelector(); |
|
|
|
|
delete selector._id; |
|
|
|
|
return selector; |
|
|
|
|
} |
|
|
|
|
}.register('copySwimlanePopup')); |
|
|
|
|