From 8b919ecdc4624d13423f6fd6bb00a48bf3f48c62 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Fri, 25 May 2018 16:27:45 +0200 Subject: Properly search for other apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- settings/Controller/AppSettingsController.php | 1 + settings/src/components/appDetails.vue | 18 +++++++++++++----- settings/src/components/appList.vue | 11 ++++++++--- settings/src/components/appList/appItem.vue | 1 - 4 files changed, 22 insertions(+), 9 deletions(-) (limited to 'settings') diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index a44a252a747..6784a53aee9 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -485,6 +485,7 @@ class AppSettingsController extends Controller { $apps = array_map(function($appData) use ($manager) { $appStoreData = $manager->getApp($appData['id']); $appData['appstoreData'] = $appStoreData; + $appData['license'] = $appStoreData['releases'][0]['licenses']; $appData['preview'] = isset($appStoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($appStoreData['screenshots'][0]['url']) : ''; return $appData; }, $apps); diff --git a/settings/src/components/appDetails.vue b/settings/src/components/appDetails.vue index 1595be7ac13..3370ee055e4 100644 --- a/settings/src/components/appDetails.vue +++ b/settings/src/components/appDetails.vue @@ -28,11 +28,11 @@
{{ t('settings', 'by') }} - - {{ a['@value'] }}   + + {{ a['@value'] }} {{ a['@value'] }} +   - {{ author }}
{{ licence }}
@@ -103,7 +103,6 @@ export default { }, computed: { groups() { - console.log(this.$store.getters.getGroups); return this.$store.getters.getGroups .filter(group => group.id !== 'disabled') .sort((a, b) => a.name.localeCompare(b.name)); @@ -112,8 +111,17 @@ export default { return this.app.license + t('settings', '-licensed'); }, author() { + if (typeof this.app.author === 'string') { + return [ + { + '@value': this.app.author + } + ] + } + if (this.app.author['@value']) { + return [this.app.author]; + } return this.app.author; - return t('settings', 'by') + ' ' + this.app.author; }, renderMarkdown() { // TODO: bundle marked as well diff --git a/settings/src/components/appList.vue b/settings/src/components/appList.vue index 760bc8a66a1..56e169c7dde 100644 --- a/settings/src/components/appList.vue +++ b/settings/src/components/appList.vue @@ -45,7 +45,7 @@
-
+

{{ t('settings', 'Results from other categories') }}

@@ -95,10 +95,15 @@ export default { }, searchApps() { return this.$store.getters.getAllApps - .filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1) + .filter(app => { + if (app.name.toLowerCase().search(this.search.toLowerCase()) !== -1) { + return (!this.apps.find(_app => _app.id === app.id)); + } + return false; + + }); }, groups() { - console.log(this.$store.getters.getGroups); return this.$store.getters.getGroups .filter(group => group.id !== 'disabled') .sort((a, b) => a.name.localeCompare(b.name)); diff --git a/settings/src/components/appList/appItem.vue b/settings/src/components/appList/appItem.vue index 25e9a4602c2..35f06f76512 100644 --- a/settings/src/components/appList/appItem.vue +++ b/settings/src/components/appList/appItem.vue @@ -23,7 +23,6 @@