summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js37
1 files changed, 34 insertions, 3 deletions
diff --git a/models/cards.js b/models/cards.js
index c77cd682..00ec14c2 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -66,6 +66,14 @@ Cards.attachSchema(new SimpleSchema({
type: String,
optional: true,
},
+ requestedBy: {
+ type: String,
+ optional: true,
+ },
+ assignedBy: {
+ type: String,
+ optional: true,
+ },
labelIds: {
type: [String],
optional: true,
@@ -220,13 +228,28 @@ Cards.helpers({
}).fetch();
// match right definition to each field
+ if (!this.customFields) return [];
return this.customFields.map((customField) => {
+ const definition = definitions.find((definition) => {
+ return definition._id === customField._id;
+ });
+ //search for "True Value" which is for DropDowns other then the Value (which is the id)
+ let trueValue = customField.value;
+ if (definition.settings.dropdownItems && definition.settings.dropdownItems.length > 0)
+ {
+ for (let i = 0; i < definition.settings.dropdownItems.length; i++)
+ {
+ if (definition.settings.dropdownItems[i]._id === customField.value)
+ {
+ trueValue = definition.settings.dropdownItems[i].name;
+ }
+ }
+ }
return {
_id: customField._id,
value: customField.value,
- definition: definitions.find((definition) => {
- return definition._id === customField._id;
- }),
+ trueValue,
+ definition,
};
});
@@ -267,6 +290,14 @@ Cards.mutations({
return {$set: {description}};
},
+ setRequestedBy(requestedBy) {
+ return {$set: {requestedBy}};
+ },
+
+ setAssignedBy(assignedBy) {
+ return {$set: {assignedBy}};
+ },
+
move(swimlaneId, listId, sortIndex) {
const list = Lists.findOne(listId);
const mutatedFields = {