From e78e2e22cb30dec097ce8880a60a0ce50c3fbd3b Mon Sep 17 00:00:00 2001 From: John Gardner Date: Fri, 19 Apr 2024 15:16:21 -0400 Subject: [PATCH] feat: for APPLAUNCHER-43 sorting global apps --- pkg/app-launcher/pages/index.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/app-launcher/pages/index.vue b/pkg/app-launcher/pages/index.vue index 1ca420a..6011c0a 100644 --- a/pkg/app-launcher/pages/index.vue +++ b/pkg/app-launcher/pages/index.vue @@ -243,6 +243,17 @@ export default { } return []; }, + sortedFavoritedApps() { + return this.favoritedApps.sort((a, b) => { + const nameA = a.metadata.name.toLowerCase(); + const nameB = b.metadata.name.toLowerCase(); + if (this.tableHeaders[0].sortOrder === 'asc') { + return nameA.localeCompare(nameB); + } else { + return nameB.localeCompare(nameA); + } + }); + }, filteredApps() { return (services, ingresses) => { const sortedApps = [...(services || []), ...(ingresses || [])].sort((a, b) => { @@ -293,7 +304,8 @@ export default {

{{ t('appLauncher.globalApps') }}

-