summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/cards.js')
-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..00ec14c2 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) => {
+ 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,
};
});