Merge pull request #3442 from mfilser/master

Cards, custom fields are displayed in alphabetic order
This commit is contained in:
Lauri Ojansivu 2021-01-19 07:04:40 +02:00 committed by GitHub
commit 2714032e77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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