소스 검색

Merge pull request #3417 from mfilser/cards_custom_fields_alphabetic_order

Cards, custom fields are displayed in alphabetic order
Lauri Ojansivu 4 년 전
부모
커밋
5f0cb23f52
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      models/cards.js

+ 3 - 1
models/cards.js

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