Sort plugins alphabetically in new component panel

This commit is contained in:
Andrew Kingston 2022-09-07 13:37:45 +01:00
parent 7b4c842eb3
commit ae3bd8cc17
1 changed files with 8 additions and 4 deletions

View File

@ -58,10 +58,14 @@
enrichedStructure.push({
name: "Plugins",
isCategory: true,
children: customComponents.map(x => ({
...definitions[x],
name: definitions[x].friendlyName || definitions[x].name,
})),
children: customComponents
.map(x => ({
...definitions[x],
name: definitions[x].friendlyName || definitions[x].name,
}))
.sort((a, b) => {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1
}),
})
}