Allow swimlane creation from template

Mix lists with same name to avoid duplicates
This commit is contained in:
Andrés Manelli 2019-02-23 23:07:54 +01:00
parent f888cfd565
commit 60be4df76e
10 changed files with 100 additions and 35 deletions

View file

@ -40,6 +40,11 @@ template(name="swimlaneAddPopup")
autocomplete="off" autofocus)
.edit-controls.clearfix
button.primary.confirm(type="submit") {{_ 'add'}}
unless currentBoard.isTemplatesBoard
unless currentBoard.isTemplateBoard
span.quiet
| {{_ 'or'}}
a.js-swimlane-template {{_ 'template'}}
template(name="setSwimlaneColorPopup")
form.edit-label

View file

@ -65,6 +65,7 @@ BlazeComponent.extendComponent({
// with a minimum of interactions
Popup.close();
},
'click .js-swimlane-template': Popup.open('searchElement'),
}];
},
}).register('swimlaneAddPopup');

View file

@ -154,8 +154,8 @@ BlazeComponent.extendComponent({
BlazeComponent.extendComponent({
onCreated() {
currentBoard = Boards.findOne(Session.get('currentBoard'));
this.isListTemplatesSwimlane = currentBoard.isTemplatesBoard() && this.currentData().isListTemplatesSwimlane();
this.currentBoard = Boards.findOne(Session.get('currentBoard'));
this.isListTemplatesSwimlane = this.currentBoard.isTemplatesBoard() && this.currentData().isListTemplatesSwimlane();
this.currentSwimlane = this.currentData();
},
@ -176,14 +176,14 @@ BlazeComponent.extendComponent({
boardId: Session.get('currentBoard'),
sort: $('.list').length,
type: (this.isListTemplatesSwimlane)?'template-list':'list',
swimlaneId: (this.isListTemplatesSwimlane)?this.currentSwimlane._id:'',
swimlaneId: (this.currentBoard.isTemplatesBoard())?this.currentSwimlane._id:'',
});
titleInput.value = '';
titleInput.focus();
}
},
'click .js-list-template': Popup.open('searchCard'),
'click .js-list-template': Popup.open('searchElement'),
}];
},
}).register('addListForm');