diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-04 20:18:58 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-12 08:13:01 +0100 |
commit | 302558cfd2b3dd37e6332c0d9c650174b64f20fb (patch) | |
tree | 27a7bcbf35f94a496fc2c42c361c79793811418e /apps/settings/src | |
parent | 97deaf85b9d18cabfc345025ef273da24006c6de (diff) | |
download | nextcloud-server-302558cfd2b3dd37e6332c0d9c650174b64f20fb.tar.gz nextcloud-server-302558cfd2b3dd37e6332c0d9c650174b64f20fb.zip |
Add a dedicated page for the recommended apps installation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/settings/src')
-rw-r--r-- | apps/settings/src/components/AppList.vue | 52 | ||||
-rw-r--r-- | apps/settings/src/recommendedApps.js | 26 | ||||
-rw-r--r-- | apps/settings/src/views/Apps.vue | 15 |
3 files changed, 18 insertions, 75 deletions
diff --git a/apps/settings/src/components/AppList.vue b/apps/settings/src/components/AppList.vue index f03d7c5a694..a406f6b8ff6 100644 --- a/apps/settings/src/components/AppList.vue +++ b/apps/settings/src/components/AppList.vue @@ -96,11 +96,9 @@ </template> <script> -import pLimit from 'p-limit' - import AppItem from './AppList/AppItem' import PrefixMixin from './PrefixMixin' -import recommended from '../recommendedApps' +import pLimit from 'p-limit' export default { name: 'AppList', @@ -131,26 +129,26 @@ export default { return OC.Util.naturalSortCompare(sortStringA, sortStringB) }) - switch (this.category) { - case 'installed': + if (this.category === 'installed') { return apps.filter(app => app.installed) - case 'recommended': - return apps.filter(app => recommended.includes(app.id)) - case 'enabled': + } + if (this.category === 'enabled') { return apps.filter(app => app.active && app.installed) - case 'disabled': + } + if (this.category === 'disabled') { return apps.filter(app => !app.active && app.installed) - case 'app-bundles': + } + if (this.category === 'app-bundles') { return apps.filter(app => app.bundles) - case 'updates': + } + if (this.category === 'updates') { return apps.filter(app => app.update) - default: - // filter app store categories - return apps.filter(app => { - return app.appstore && app.category !== undefined - && (app.category === this.category || app.category.indexOf(this.category) > -1) - }) } + // filter app store categories + return apps.filter(app => { + return app.appstore && app.category !== undefined + && (app.category === this.category || app.category.indexOf(this.category) > -1) + }) }, bundles() { return this.$store.getters.getServerData.bundles.filter(bundle => this.bundleApps(bundle.id).length > 0) @@ -177,7 +175,7 @@ export default { return !this.useListView && !this.useBundleView }, useListView() { - return ['installed', 'recommended', 'enabled', 'disabled', 'updates'].includes(this.category) + return (this.category === 'installed' || this.category === 'enabled' || this.category === 'disabled' || this.category === 'updates') }, useBundleView() { return (this.category === 'app-bundles') @@ -198,24 +196,6 @@ export default { } } }, - mounted() { - if (this.category === 'recommended' && 'download' in this.$route.query) { - const limit = pLimit(1) - const installing = this.apps - .filter(app => !app.active && app.canInstall) - .map(app => limit(() => this.$store.dispatch('enableApp', { appId: app.id, groups: [] }))) - console.debug(`installing ${installing.length} recommended apps`) - Promise.all(installing) - .then(() => { - console.info('recommended apps installed') - - if ('returnTo' in this.$route.query) { - window.location = this.$route.query.returnTo - } - }) - .catch(e => console.error('could not install recommended apps', e)) - } - }, methods: { toggleBundle(id) { if (this.allBundlesEnabled(id)) { diff --git a/apps/settings/src/recommendedApps.js b/apps/settings/src/recommendedApps.js deleted file mode 100644 index d2868b8728b..00000000000 --- a/apps/settings/src/recommendedApps.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -export default [ - 'contacts', - 'calendar', - 'mail' -] diff --git a/apps/settings/src/views/Apps.vue b/apps/settings/src/views/Apps.vue index a2c4cae825d..2e0649f7f56 100644 --- a/apps/settings/src/views/Apps.vue +++ b/apps/settings/src/views/Apps.vue @@ -31,10 +31,7 @@ </ul> </AppNavigation> <AppContent class="app-settings-content" :class="{ 'icon-loading': loadingList }"> - <AppList v-if="!loadingList" - :category="category" - :app="currentApp" - :search="searchQuery" /> + <AppList :category="category" :app="currentApp" :search="searchQuery" /> </AppContent> <AppSidebar v-if="id && currentApp" @close="hideAppDetails"> <AppDetails :category="category" :app="currentApp" /> @@ -137,20 +134,12 @@ export default { text: t('settings', 'Your apps') }, { - id: 'app-category-recommended', - classes: [], - router: { name: 'apps-category', params: { category: 'recommended' } }, - icon: 'icon-category-installed', - text: t('settings', 'Recommended apps') - }, - { id: 'app-category-enabled', classes: [], icon: 'icon-category-enabled', router: { name: 'apps-category', params: { category: 'enabled' } }, text: t('settings', 'Active apps') - }, - { + }, { id: 'app-category-disabled', classes: [], icon: 'icon-category-disabled', |