Browse Source

Reverted Cards, custom fields are displayed in alphabetic order from Wekan v4.71
https://github.com/wekan/wekan/pulls/3417 because it caused board not loading.

Thanks to olivierlambert and xet7 !

Fixes #3367

Lauri Ojansivu 4 years ago
parent
commit
413f91d0c8
1 changed files with 2 additions and 4 deletions
  1. 2 4
      models/cards.js

+ 2 - 4
models/cards.js

@@ -689,11 +689,11 @@ Cards.helpers({
 
 
     // match right definition to each field
     // match right definition to each field
     if (!this.customFields) return [];
     if (!this.customFields) return [];
-    const ret = this.customFields.map(customField => {
+    return this.customFields.map(customField => {
       const definition = definitions.find(definition => {
       const definition = definitions.find(definition => {
         return definition._id === customField._id;
         return definition._id === customField._id;
       });
       });
-      if (definition === undefined) {
+      if (!definition) {
         return {};
         return {};
       }
       }
       //search for "True Value" which is for DropDowns other then the Value (which is the id)
       //search for "True Value" which is for DropDowns other then the Value (which is the id)
@@ -715,8 +715,6 @@ Cards.helpers({
         definition,
         definition,
       };
       };
     });
     });
-    ret.sort((a, b) => a.definition.name.localeCompare(b.definition.name));
-    return ret;
   },
   },
 
 
   colorClass() {
   colorClass() {