Remove links from templates board for the moment

Insert the correct template type in templates board
Allow independant lists in templates board
Add some helpers
This commit is contained in:
Andrés Manelli 2019-02-23 01:40:11 +01:00
parent 64bf455b29
commit cdf070189e
7 changed files with 61 additions and 10 deletions

View file

@ -27,6 +27,13 @@ Lists.attachSchema(new SimpleSchema({
*/
type: String,
},
swimlaneId: {
/**
* the swimalen associated to this list. Used for templates
*/
type: String,
defaultValue: '',
},
createdAt: {
/**
* creation date

View file

@ -108,6 +108,13 @@ Swimlanes.helpers({
}), { sort: ['sort'] });
},
lists() {
return Lists.find(Filter.mongoSelector({
swimlaneId: this._id,
archived: false,
}), { sort: ['sort'] });
},
allCards() {
return Cards.find({ swimlaneId: this._id });
},
@ -129,6 +136,21 @@ Swimlanes.helpers({
isTemplateContainer() {
return this.type === 'template-container';
},
isListTemplatesSwimlane() {
const user = Users.findOne(Meteor.userId());
return user.profile.listTemplatesSwimlaneId === this._id;
},
isCardTemplatesSwimlane() {
const user = Users.findOne(Meteor.userId());
return user.profile.cardTemplatesSwimlaneId === this._id;
},
isBoardTemplatesSwimlane() {
const user = Users.findOne(Meteor.userId());
return user.profile.boardsTemplatesSwimlaneId === this._id;
},
});
Swimlanes.mutations({