Merge pull request #29028 from nextcloud/add-supported-label-to-all-apps

add 'supported'-label to all supported apps
pull/29185/head
Björn Schießle 2021-10-12 10:52:58 +07:00 committed by GitHub
commit da1b97decd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

@ -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

@ -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) {