mirror of
https://github.com/wekan/wekan.git
synced 2025-12-22 18:30:13 +01:00
Import board: added UI
This commit is contained in:
parent
15ebfa63c6
commit
468694a84c
9 changed files with 119 additions and 55 deletions
|
|
@ -49,45 +49,6 @@ Template.listActionPopup.events({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
events() {
|
||||
return [{
|
||||
'submit': (evt) => {
|
||||
evt.preventDefault();
|
||||
const jsonData = $(evt.currentTarget).find('textarea').val();
|
||||
const firstCardDom = $(`#js-list-${this.currentData()._id} .js-minicard:first`).get(0);
|
||||
const sortIndex = Utils.calculateIndex(null, firstCardDom).base;
|
||||
let trelloCard;
|
||||
try {
|
||||
trelloCard = JSON.parse(jsonData);
|
||||
} catch (e) {
|
||||
this.setError('error-json-malformed');
|
||||
return;
|
||||
}
|
||||
Meteor.call('importTrelloCard', trelloCard, this.currentData()._id, sortIndex,
|
||||
(error, response) => {
|
||||
if (error) {
|
||||
this.setError(error.error);
|
||||
} else {
|
||||
Filter.addException(response);
|
||||
Popup.close();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
onCreated() {
|
||||
this.error = new ReactiveVar('');
|
||||
},
|
||||
|
||||
setError(error) {
|
||||
this.error.set(error);
|
||||
},
|
||||
}).register('listImportCardPopup');
|
||||
|
||||
Template.listMoveCardsPopup.events({
|
||||
'click .js-select-list'() {
|
||||
const fromList = Template.parentData(2).data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue