]> source.dussan.org Git - nextcloud-server.git/commitdiff
add 'supported'-label to all supported apps, also if they are not downloaded yet 29028/head
authorBjoern Schiessle <bjoern@schiessle.org>
Wed, 8 Sep 2021 21:43:17 +0000 (23:43 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Wed, 6 Oct 2021 20:17:50 +0000 (22:17 +0200)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/settings/lib/Controller/AppSettingsController.php
lib/private/legacy/OC_App.php

index 78326c2e25a2fdfc94e702fc10d1fa4552f92e46..5ed25ec2e2a001d5213a2dad3759ffc4b3549852 100644 (file)
@@ -204,6 +204,7 @@ class AppSettingsController extends Controller {
                }
 
                $apps = $this->getAppsForCategory('');
+               $supportedApps = $appClass->getSupportedApps();
                foreach ($apps as $app) {
                        $app['appstore'] = true;
                        if (!array_key_exists($app['id'], $this->allApps)) {
@@ -211,6 +212,10 @@ class AppSettingsController extends Controller {
                        } else {
                                $this->allApps[$app['id']] = array_merge($app, $this->allApps[$app['id']]);
                        }
+
+                       if (in_array($app['id'], $supportedApps)) {
+                               $this->allApps[$app['id']]['level'] = \OC_App::supportedApp;
+                       }
                }
 
                // add bundle information
index 811703570a2d38fce4cdfb274559cc6bd893c514..101523fcfe789fb2484b21a97a92c863e66693f3 100644 (file)
@@ -773,6 +773,18 @@ class OC_App {
                return $apps;
        }
 
+       /**
+        * List all supported apps
+        *
+        * @return array
+        */
+       public function getSupportedApps(): array {
+               /** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
+               $subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
+               $supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
+               return $supportedApps;
+       }
+
        /**
         * List all apps, this is used in apps.php
         *
@@ -787,9 +799,7 @@ class OC_App {
                $appList = [];
                $langCode = \OC::$server->getL10N('core')->getLanguageCode();
                $urlGenerator = \OC::$server->getURLGenerator();
-               /** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
-               $subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
-               $supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
+               $supportedApps = $this->getSupportedApps();
 
                foreach ($installedApps as $app) {
                        if (array_search($app, $blacklist) === false) {