From a96b5940dd9d80c6ea6fbb5faa6ef7d1a7cc6734 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 8 Jul 2024 16:23:52 +0200 Subject: [PATCH] chore: Make active apps initial state consistent with OCS API Signed-off-by: Ferdinand Thiessen --- .../components/AppStoreDiscover/AppLink.vue | 8 ++--- .../src/components/UserAppMenuSection.vue | 23 ++------------ .../src/components/admin/AppMenuSection.vue | 7 +++-- apps/updatenotification/src/init.ts | 9 ++++-- core/src/types/navigation.d.ts | 30 +++++++++++++++++++ lib/private/TemplateLayout.php | 2 +- 6 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 core/src/types/navigation.d.ts diff --git a/apps/settings/src/components/AppStoreDiscover/AppLink.vue b/apps/settings/src/components/AppStoreDiscover/AppLink.vue index 1ce19ad7319..703adb9f041 100644 --- a/apps/settings/src/components/AppStoreDiscover/AppLink.vue +++ b/apps/settings/src/components/AppStoreDiscover/AppLink.vue @@ -18,12 +18,10 @@ import { loadState } from '@nextcloud/initial-state' import { generateUrl } from '@nextcloud/router' import { defineComponent } from 'vue' import { RouterLink } from 'vue-router' +import type { INavigationEntry } from '../../../../../core/src/types/navigation' -const knownRoutes = Object.fromEntries( - Object.entries( - loadState>('core', 'apps'), - ).map(([k, v]) => [v.app ?? k, v.href]), -) +const apps = loadState('core', 'apps') +const knownRoutes = Object.fromEntries(apps.map((app) => [app.app ?? app.id, app.href])) /** * This component either shows a native link to the installed app or external size - or a router link to the appstore page of the app if not installed diff --git a/apps/theming/src/components/UserAppMenuSection.vue b/apps/theming/src/components/UserAppMenuSection.vue index b3d9d9f7694..56abd357274 100644 --- a/apps/theming/src/components/UserAppMenuSection.vue +++ b/apps/theming/src/components/UserAppMenuSection.vue @@ -33,6 +33,7 @@