sort field types

This commit is contained in:
Pete Matsyburka
2024-02-20 11:57:06 +02:00
parent 862fa55986
commit 250889623d
2 changed files with 24 additions and 2 deletions
+12 -1
View File
@@ -68,7 +68,7 @@
class="grid grid-cols-3 gap-1 pb-2"
>
<template
v-for="(icon, type) in fieldIcons"
v-for="(icon, type) in fieldIconsSorted"
:key="type"
>
<button
@@ -213,6 +213,17 @@ export default {
computed: {
fieldNames: FieldType.computed.fieldNames,
fieldIcons: FieldType.computed.fieldIcons,
fieldIconsSorted () {
if (this.fieldTypes.length) {
return this.fieldTypes.reduce((acc, type) => {
acc[type] = this.fieldIcons[type]
return acc
}, {})
} else {
return this.fieldIcons
}
},
submitterFields () {
return this.fields.filter((f) => f.submitter_uuid === this.selectedSubmitter.uuid)
},