mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
card model and card ui preparation for custom fields
This commit is contained in:
parent
afd87e3caa
commit
d87191f17e
5 changed files with 47 additions and 3 deletions
|
|
@ -38,6 +38,21 @@ Cards.attachSchema(new SimpleSchema({
|
|||
}
|
||||
},
|
||||
},
|
||||
customFields: {
|
||||
type: [Object],
|
||||
optional: true,
|
||||
},
|
||||
'customFields.$': {
|
||||
type: new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
},
|
||||
value: {
|
||||
type: Match.OneOf(String,Number,Boolean,Date),
|
||||
optional: true,
|
||||
},
|
||||
})
|
||||
},
|
||||
dateLastActivity: {
|
||||
type: Date,
|
||||
autoValue() {
|
||||
|
|
@ -238,6 +253,24 @@ Cards.mutations({
|
|||
}
|
||||
},
|
||||
|
||||
assignCustomField(customFieldId) {
|
||||
console.log("assignCustomField", customFieldId);
|
||||
return {$push: {customFields: {_id: customFieldId, value: null}}};
|
||||
},
|
||||
|
||||
unassignCustomField(customFieldId) {
|
||||
console.log("unassignCustomField", customFieldId);
|
||||
return {$pull: {customFields: {_id: customFieldId}}};
|
||||
},
|
||||
|
||||
toggleCustomField(customFieldId) {
|
||||
if (this.customFields && this.customFields[customFieldId]) {
|
||||
return this.unassignCustomField(customFieldId);
|
||||
} else {
|
||||
return this.assignCustomField(customFieldId);
|
||||
}
|
||||
},
|
||||
|
||||
setCover(coverId) {
|
||||
return {$set: {coverId}};
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue