diff --git a/frontend/src/components/workspaces/Templates/TemplatesTableLogic/TemplatesTableLogic.tsx b/frontend/src/components/workspaces/Templates/TemplatesTableLogic/TemplatesTableLogic.tsx index 0f7cea264..5124f4ee9 100644 --- a/frontend/src/components/workspaces/Templates/TemplatesTableLogic/TemplatesTableLogic.tsx +++ b/frontend/src/components/workspaces/Templates/TemplatesTableLogic/TemplatesTableLogic.tsx @@ -93,15 +93,17 @@ const TemplatesTableLogic: FC = ({ ...props }) => { onError: apolloErrorCatcher, onCompleted: data => setDataTemplate( - data.templateList?.templates?.map(t => - makeGuiTemplate({ - original: t ?? {}, - alias: { - id: t?.metadata?.name ?? '', - name: t?.spec?.prettyName ?? '', - }, - }) - ) ?? [] + data.templateList?.templates + ?.map(t => + makeGuiTemplate({ + original: t ?? {}, + alias: { + id: t?.metadata?.name ?? '', + name: t?.spec?.prettyName ?? '', + }, + }) + ) + .sort((a, b) => a.name.localeCompare(b.name)) ?? [] ), fetchPolicy: fetchPolicy_networkOnly, }); diff --git a/frontend/src/utilsLogic.tsx b/frontend/src/utilsLogic.tsx index 1cf943ec4..992e28e35 100644 --- a/frontend/src/utilsLogic.tsx +++ b/frontend/src/utilsLogic.tsx @@ -106,7 +106,7 @@ export const updateQueryWorkspaceTemplatesQuery = ( name: template?.spec?.prettyName ?? '', }, }), - ].sort((a, b) => a.id.localeCompare(b.id)) + ].sort((a, b) => a.name.localeCompare(b.name)) ); } }