diff --git a/lib/private/App/AppStore/Manager.php b/lib/private/App/AppStore/Manager.php index 1c7f09a817e..4498918da70 100644 --- a/lib/private/App/AppStore/Manager.php +++ b/lib/private/App/AppStore/Manager.php @@ -29,10 +29,13 @@ use OC\App\AppStore\Fetcher\AppFetcher; class Manager { public function __construct(AppFetcher $appFetcher) { - $this->apps = $appFetcher->get(); + $apps = $appFetcher->get(); + foreach ($apps as $app) { + $this->apps[$app['id']] = $app; + } } public function getApp(string $appId) { - return $this->apps; + return $this->apps[$appId]; } } \ No newline at end of file diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index ac6e5d1850d..a44a252a747 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -334,12 +334,12 @@ class AppSettingsController extends Controller { */ public function listApps($category = '') { $appClass = new \OC_App(); + $manager = \OC::$server->query(\OC\App\AppStore\Manager::class); switch ($category) { // installed apps case 'installed': $apps = $appClass->listAllApps(); - foreach($apps as $key => $app) { $newVersion = $this->installer->isUpdateAvailable($app['id']); $apps[$key]['update'] = $newVersion; @@ -481,6 +481,14 @@ class AppSettingsController extends Controller { return $app; }, $apps); + // Add app store dump for app to data + $apps = array_map(function($appData) use ($manager) { + $appStoreData = $manager->getApp($appData['id']); + $appData['appstoreData'] = $appStoreData; + $appData['preview'] = isset($appStoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($appStoreData['screenshots'][0]['url']) : ''; + return $appData; + }, $apps); + return new JSONResponse(['apps' => $apps, 'status' => 'success']); } diff --git a/settings/src/components/appDetails.vue b/settings/src/components/appDetails.vue index 5467b1ffb10..70078d87c64 100644 --- a/settings/src/components/appDetails.vue +++ b/settings/src/components/appDetails.vue @@ -25,7 +25,7 @@ Close
{{ t('settings', 'Visit website') }} ↗ {{ t('settings', 'Report a bug') }} ↗ @@ -65,7 +78,9 @@ diff --git a/settings/src/components/appList/appItem.vue b/settings/src/components/appList/appItem.vue index 8797fd88bd9..b2fb86f955a 100644 --- a/settings/src/components/appList/appItem.vue +++ b/settings/src/components/appList/appItem.vue @@ -26,8 +26,8 @@