|
@@ -324,45 +324,54 @@ BlazeComponent.extendComponent({
|
|
},
|
|
},
|
|
}).register('listsGroup');
|
|
}).register('listsGroup');
|
|
|
|
|
|
-BlazeComponent.extendComponent({
|
|
|
|
|
|
+class MoveSwimlaneComponent extends BlazeComponent {
|
|
|
|
+ serverMethod = 'moveSwimlane';
|
|
|
|
+
|
|
onCreated() {
|
|
onCreated() {
|
|
this.currentSwimlane = this.currentData();
|
|
this.currentSwimlane = this.currentData();
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
|
|
board() {
|
|
board() {
|
|
return Boards.findOne(Session.get('currentBoard'));
|
|
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() {
|
|
events() {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
'click .js-done'() {
|
|
'click .js-done'() {
|
|
- const swimlane = Swimlanes.findOne(this.currentSwimlane._id);
|
|
|
|
|
|
+ // const swimlane = Swimlanes.findOne(this.currentSwimlane._id);
|
|
const bSelect = $('.js-select-boards')[0];
|
|
const bSelect = $('.js-select-boards')[0];
|
|
let boardId;
|
|
let boardId;
|
|
if (bSelect) {
|
|
if (bSelect) {
|
|
boardId = bSelect.options[bSelect.selectedIndex].value;
|
|
boardId = bSelect.options[bSelect.selectedIndex].value;
|
|
- Meteor.call('moveSwimlane', this.currentSwimlane._id, boardId);
|
|
|
|
|
|
+ Meteor.call(this.serverMethod, this.currentSwimlane._id, boardId);
|
|
}
|
|
}
|
|
Popup.close();
|
|
Popup.close();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
];
|
|
];
|
|
- },
|
|
|
|
-}).register('moveSwimlanePopup');
|
|
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+MoveSwimlaneComponent.register('moveSwimlanePopup');
|
|
|
|
+
|
|
|
|
+(class extends MoveSwimlaneComponent {
|
|
|
|
+ serverMethod = 'copySwimlane';
|
|
|
|
+ toBoardsSelector() {
|
|
|
|
+ const selector = super.toBoardsSelector();
|
|
|
|
+ delete selector._id;
|
|
|
|
+ return selector;
|
|
|
|
+ }
|
|
|
|
+}.register('copySwimlanePopup'));
|