Skip to content

Commit

Permalink
Templates alphabetically ordered in dashboard
Browse files Browse the repository at this point in the history
Co-authored-by: Alessandro Cannarella <cannarella.dev@gmail.com>
  • Loading branch information
2 people authored and giorio94 committed Mar 17, 2022
1 parent 4bfa563 commit b285de1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,17 @@ const TemplatesTableLogic: FC<ITemplateTableLogicProps> = ({ ...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,
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
}
}
Expand Down

0 comments on commit b285de1

Please sign in to comment.