Show supported apps in app management

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Morris Jobke 2019-05-10 14:50:24 +02:00 committed by Christoph Wurst
parent 747721bb78
commit 0e8829b8df
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8
6 changed files with 25 additions and 4 deletions

View file

@ -71,6 +71,7 @@ class OC_App {
static private $altLogin = []; static private $altLogin = [];
static private $alreadyRegistered = []; static private $alreadyRegistered = [];
static public $autoDisabledApps = []; static public $autoDisabledApps = [];
const supportedApp = 300;
const officialApp = 200; const officialApp = 200;
/** /**
@ -704,6 +705,9 @@ class OC_App {
$appList = []; $appList = [];
$langCode = \OC::$server->getL10N('core')->getLanguageCode(); $langCode = \OC::$server->getL10N('core')->getLanguageCode();
$urlGenerator = \OC::$server->getURLGenerator(); $urlGenerator = \OC::$server->getURLGenerator();
/** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
$subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
$supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
foreach ($installedApps as $app) { foreach ($installedApps as $app) {
if (array_search($app, $blacklist) === false) { if (array_search($app, $blacklist) === false) {
@ -741,6 +745,10 @@ class OC_App {
$info['removable'] = true; $info['removable'] = true;
} }
if (in_array($app, $supportedApps)) {
$info['level'] = self::supportedApp;
}
$appPath = self::getAppPath($app); $appPath = self::getAppPath($app);
if($appPath !== false) { if($appPath !== false) {
$appIcon = $appPath . '/img/' . $app . '.svg'; $appIcon = $appPath . '/img/' . $app . '.svg';

View file

@ -682,11 +682,17 @@ span.version {
white-space: nowrap; white-space: nowrap;
} }
.official { .official {
border-color: #37ce02;
background-position: left center; background-position: left center;
background-position: 5px center; background-position: 5px center;
padding-left: 25px; padding-left: 25px;
} }
.supported {
border-color: var(--color-success);
background-position: left center;
background-position: 5px center;
padding-left: 25px;
color: var(--color-success) ;
}
} }
.app-score { .app-score {
@ -742,6 +748,7 @@ span.version {
.app-level { .app-level {
clear: right; clear: right;
width: 100%; width: 100%;
.supported,
.official { .official {
vertical-align: top; vertical-align: top;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -31,7 +31,10 @@
</svg> </svg>
{{ app.name }}</h2> {{ app.name }}</h2>
<img v-if="app.screenshot" :src="app.screenshot" width="100%" /> <img v-if="app.screenshot" :src="app.screenshot" width="100%" />
<div class="app-level" v-if="app.level === 200 || hasRating"> <div class="app-level" v-if="app.level === 300 || app.level === 200 || hasRating">
<span class="supported icon-checkmark-color" v-if="app.level === 300"
v-tooltip.auto="t('settings', 'This app is supported via your current Nextcloud subscription.')">
{{ t('settings', 'Supported') }}</span>
<span class="official icon-checkmark" v-if="app.level === 200" <span class="official icon-checkmark" v-if="app.level === 200"
v-tooltip.auto="t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.')"> v-tooltip.auto="t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.')">
{{ t('settings', 'Official') }}</span> {{ t('settings', 'Official') }}</span>

View file

@ -42,6 +42,9 @@
</div> </div>
<div class="app-level"> <div class="app-level">
<span class="supported icon-checkmark-color" v-if="app.level === 300"
v-tooltip.auto="t('settings', 'This app is supported via your current Nextcloud subscription.')">
{{ t('settings', 'Supported') }}</span>
<span class="official icon-checkmark" v-if="app.level === 200" <span class="official icon-checkmark" v-if="app.level === 200"
v-tooltip.auto="t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.')"> v-tooltip.auto="t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.')">
{{ t('settings', 'Official') }}</span> {{ t('settings', 'Official') }}</span>