Skip to content

Commit

Permalink
feat(settings): Show supported apps on app settings if subscribed
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jul 26, 2023
1 parent b76b0bb commit 46e1917
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 9 deletions.
5 changes: 4 additions & 1 deletion apps/settings/src/components/AppList.vue
Expand Up @@ -154,6 +154,9 @@ export default {
if (this.category === 'updates') {
return apps.filter(app => app.update)
}
if (this.category === 'supported') {
return apps.filter(app => app.level === 300)
}
if (this.category === 'featured') {
return apps.filter(app => app.level === 200)
}
Expand Down Expand Up @@ -190,7 +193,7 @@ export default {
return !this.useListView && !this.useBundleView
},
useListView() {
return (this.category === 'installed' || this.category === 'enabled' || this.category === 'disabled' || this.category === 'updates' || this.category === 'featured')
return (this.category === 'installed' || this.category === 'enabled' || this.category === 'disabled' || this.category === 'updates' || this.category === 'featured' || this.category === 'supported')
},
useBundleView() {
return (this.category === 'app-bundles')
Expand Down
1 change: 1 addition & 0 deletions apps/settings/src/constants/AppsConstants.js
Expand Up @@ -29,4 +29,5 @@ export const APPS_SECTION_ENUM = Object.freeze({
updates: t('settings', 'Updates'),
'app-bundles': t('settings', 'App bundles'),
featured: t('settings', 'Featured apps'),
supported: t('settings', 'Supported apps'), // From subscription
})
13 changes: 13 additions & 0 deletions apps/settings/src/views/Apps.vue
Expand Up @@ -50,6 +50,14 @@
<NcCounterBubble>{{ updateCount }}</NcCounterBubble>
</template>
</NcAppNavigationItem>
<NcAppNavigationItem v-if="isSubscribed"
id="app-category-supported"
:to="{ name: 'apps-category', params: { category: 'supported' } }"
:name="$options.APPS_SECTION_ENUM.supported">
<template #icon>
<IconStarShooting :size="20" />
</template>
</NcAppNavigationItem>
<NcAppNavigationItem id="app-category-your-bundles"
:to="{ name: 'apps-category', params: { category: 'app-bundles' } }"
icon="icon-category-app-bundles"
Expand Down Expand Up @@ -147,6 +155,7 @@ import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js'
import NcAppSidebarTab from '@nextcloud/vue/dist/Components/NcAppSidebarTab.js'
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'
import IconStarShooting from 'vue-material-design-icons/StarShooting.vue'
import AppList from '../components/AppList.vue'
import AppDetails from '../components/AppDetails.vue'
Expand All @@ -165,6 +174,7 @@ export default {
NcAppContent,
AppDetails,
AppList,
IconStarShooting,
NcAppNavigation,
NcAppNavigationItem,
NcAppNavigationSpacer,
Expand Down Expand Up @@ -255,6 +265,9 @@ export default {
changelog() {
return (release) => release.translations.en.changelog
},
isSubscribed() {
return this.apps.some(app => app.level === 300)
},
},
watch: {
Expand Down
2 changes: 1 addition & 1 deletion core/css/guest.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/css/guest.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/settings-apps-view-7418.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-apps-view-7418.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

0 comments on commit 46e1917

Please sign in to comment.