fix(settings): Open app details also on app discover section when requested

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/44259/head
Ferdinand Thiessen 2024-03-18 14:13:01 +07:00
parent 7b1d1b329e
commit c6e75be83d
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
5 changed files with 11 additions and 6 deletions

@ -105,7 +105,7 @@ export default defineComponent({
to: {
name: 'apps-details',
params: {
category: 'installed',
category: this.$route.params?.category ?? 'discover',
id: appId,
},
},

@ -29,6 +29,13 @@ const routes: RouteConfig[] = [
{
path: '/:index(index.php/)?settings/apps',
name: 'apps',
// redirect to our default route - the app discover section
redirect: {
name: 'apps-category',
params: {
category: 'discover',
},
},
components: {
default: AppStore,
navigation: AppStoreNavigation,

@ -97,7 +97,7 @@ export const useAppsStore = defineStore('settings-apps', {
return this.categories.find(({ id }) => id === categoryId) ?? null
},
getAppById(appId: string) {
getAppById(appId: string): IAppstoreApp|null {
return this.apps.find(({ id }) => id === appId) ?? null
},
},

@ -3,8 +3,7 @@
<NcAppNavigation :aria-label="t('settings', 'Apps')">
<template #list>
<NcAppNavigationItem id="app-category-discover"
:to="{ name: 'apps' }"
:exact="true"
:to="{ name: 'apps-category', params: { category: 'discover'} }"
:name="APPS_SECTION_ENUM.discover">
<template #icon>
<NcIconSvgWrapper :path="APPSTORE_CATEGORY_ICONS.discover" />
@ -12,7 +11,6 @@
</NcAppNavigationItem>
<NcAppNavigationItem id="app-category-installed"
:to="{ name: 'apps-category', params: { category: 'installed'} }"
:exact="true"
:name="APPS_SECTION_ENUM.installed">
<template #icon>
<NcIconSvgWrapper :path="APPSTORE_CATEGORY_ICONS.installed" />

@ -80,7 +80,7 @@ const hasRating = computed(() => app.value.appstoreData?.ratingNumOverall > 5)
const rating = computed(() => app.value.appstoreData?.ratingNumRecent > 5
? app.value.appstoreData.ratingRecent
: (app.value.appstoreData?.ratingOverall ?? 0.5))
const showSidebar = computed(() => app.value)
const showSidebar = computed(() => app.value !== null)
const { appIcon } = useAppIcon(app)