From ae3bd8cc17f0c49a3f3b62b2396767751c1ddcc0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 7 Sep 2022 13:37:45 +0100 Subject: [PATCH] Sort plugins alphabetically in new component panel --- .../new/_components/NewComponentPanel.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte index c18df34556..8cef10fb26 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte @@ -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 + }), }) }