2
0
Эх сурвалжийг харах

Merge pull request #3442 from mfilser/master

Cards, custom fields are displayed in alphabetic order
Lauri Ojansivu 4 жил өмнө
parent
commit
2714032e77
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      models/cards.js

+ 5 - 1
models/cards.js

@@ -689,7 +689,7 @@ Cards.helpers({
 
     // match right definition to each field
     if (!this.customFields) return [];
-    return this.customFields.map(customField => {
+    const ret = this.customFields.map(customField => {
       const definition = definitions.find(definition => {
         return definition._id === customField._id;
       });
@@ -715,6 +715,10 @@ Cards.helpers({
         definition,
       };
     });
+    if (ret.definition !== undefined) {
+      ret.sort((a, b) => a.definition.name.localeCompare(b.definition.name));
+    }
+    return ret;
   },
 
   colorClass() {