Skip to content

Commit 3618366

Browse files
committed
Show supported apps in app management
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
1 parent 74ad4cc commit 3618366

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

lib/private/legacy/app.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class OC_App {
7171
static private $altLogin = [];
7272
static private $alreadyRegistered = [];
7373
static public $autoDisabledApps = [];
74+
const supportedApp = 300;
7475
const officialApp = 200;
7576

7677
/**
@@ -704,6 +705,9 @@ public function listAllApps(): array {
704705
$appList = [];
705706
$langCode = \OC::$server->getL10N('core')->getLanguageCode();
706707
$urlGenerator = \OC::$server->getURLGenerator();
708+
/** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
709+
$subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
710+
$supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
707711

708712
foreach ($installedApps as $app) {
709713
if (array_search($app, $blacklist) === false) {
@@ -741,6 +745,10 @@ public function listAllApps(): array {
741745
$info['removable'] = true;
742746
}
743747

748+
if (in_array($app, $supportedApps)) {
749+
$info['level'] = self::supportedApp;
750+
}
751+
744752
$appPath = self::getAppPath($app);
745753
if($appPath !== false) {
746754
$appIcon = $appPath . '/img/' . $app . '.svg';

settings/css/settings.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,17 @@ span.version {
682682
white-space: nowrap;
683683
}
684684
.official {
685-
border-color: #37ce02;
686685
background-position: left center;
687686
background-position: 5px center;
688687
padding-left: 25px;
689688
}
689+
.supported {
690+
border-color: var(--color-success);
691+
background-position: left center;
692+
background-position: 5px center;
693+
padding-left: 25px;
694+
color: var(--color-success) ;
695+
}
690696
}
691697

692698
.app-score {
@@ -742,6 +748,7 @@ span.version {
742748
.app-level {
743749
clear: right;
744750
width: 100%;
751+
.supported,
745752
.official {
746753
vertical-align: top;
747754
}

settings/js/vue-4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/vue-4.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/src/components/appDetails.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
</svg>
3232
{{ app.name }}</h2>
3333
<img v-if="app.screenshot" :src="app.screenshot" width="100%" />
34-
<div class="app-level" v-if="app.level === 200 || hasRating">
34+
<div class="app-level" v-if="app.level === 300 || app.level === 200 || hasRating">
35+
<span class="supported icon-checkmark-color" v-if="app.level === 300"
36+
v-tooltip.auto="t('settings', 'This app is supported via your current Nextcloud subscription.')">
37+
{{ t('settings', 'Supported') }}</span>
3538
<span class="official icon-checkmark" v-if="app.level === 200"
3639
v-tooltip.auto="t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.')">
3740
{{ t('settings', 'Official') }}</span>

settings/src/components/appList/appItem.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
</div>
4343

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

0 commit comments

Comments
 (0)