summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorIgnatz <computer-freak94@gmx.de>2018-06-14 11:58:37 +0200
committerIgnatz <computer-freak94@gmx.de>2018-06-14 11:58:37 +0200
commit259614b647c72773675541d3de8d0ff73006c299 (patch)
tree44a03c14e2a97a58eafca69b2e03b382eb64a4cd /models
parent8ec60879dc1666e9129c5f690da06c2931135fc5 (diff)
downloadwekan-259614b647c72773675541d3de8d0ff73006c299.tar.gz
wekan-259614b647c72773675541d3de8d0ff73006c299.tar.bz2
wekan-259614b647c72773675541d3de8d0ff73006c299.zip
trying to fix display Issue with dropdown custom fields
Diffstat (limited to 'models')
-rw-r--r--models/cards.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/models/cards.js b/models/cards.js
index 9236fcaa..484e442a 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -230,12 +230,26 @@ Cards.helpers({
// match right definition to each field
if (!this.customFields) return [];
return this.customFields.map((customField) => {
+ var 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)
+ var trueValue = customField.value;
+ if (definition.settings.dropdownItems.length > 0)
+ {
+ for (var 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,
};
});