aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-07-19 08:40:31 +0200
committerprovokateurin <kate@provokateurin.de>2024-07-19 09:01:32 +0200
commitf53814b2f989736ed535e9b79415ed93d0403a41 (patch)
treea29c8e9118d7853be0b2b167e7c3946226f7b46d
parent1987e4d39b60788ecf8f907e6d75f2d17ac8195f (diff)
downloadnextcloud-server-feat/core/features-api.tar.gz
nextcloud-server-feat/core/features-api.zip
feat(dashboard): Document supported API versions and featuresfeat/core/features-api
Signed-off-by: provokateurin <kate@provokateurin.de>
-rw-r--r--apps/dashboard/appinfo/info.xml3
-rw-r--r--apps/dashboard/composer/composer/autoload_classmap.php2
-rw-r--r--apps/dashboard/composer/composer/autoload_static.php2
-rw-r--r--apps/dashboard/lib/AppInfo/Application.php31
-rw-r--r--apps/dashboard/lib/Capabilities.php38
-rw-r--r--apps/dashboard/openapi.json19
6 files changed, 95 insertions, 0 deletions
diff --git a/apps/dashboard/appinfo/info.xml b/apps/dashboard/appinfo/info.xml
index 7037a14ee42..56a6f6342c2 100644
--- a/apps/dashboard/appinfo/info.xml
+++ b/apps/dashboard/appinfo/info.xml
@@ -13,6 +13,9 @@
The Nextcloud Dashboard is your starting point of the day, giving you an overview of your upcoming appointments, urgent emails, chat messages, incoming tickets, latest tweets and much more! People can add the widgets they like and change the background to their liking.]]>
</description>
<version>7.10.0</version>
+ <api-version>1</api-version>
+ <api-version>2</api-version>
+ <api-version>3</api-version>
<licence>agpl</licence>
<author>Julius Härtl</author>
<namespace>Dashboard</namespace>
diff --git a/apps/dashboard/composer/composer/autoload_classmap.php b/apps/dashboard/composer/composer/autoload_classmap.php
index 4a8609daeb0..334612fdda9 100644
--- a/apps/dashboard/composer/composer/autoload_classmap.php
+++ b/apps/dashboard/composer/composer/autoload_classmap.php
@@ -7,6 +7,8 @@ $baseDir = $vendorDir;
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+ 'OCA\\Dashboard\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
+ 'OCA\\Dashboard\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
'OCA\\Dashboard\\Controller\\DashboardApiController' => $baseDir . '/../lib/Controller/DashboardApiController.php',
'OCA\\Dashboard\\Controller\\DashboardController' => $baseDir . '/../lib/Controller/DashboardController.php',
'OCA\\Dashboard\\ResponseDefinitions' => $baseDir . '/../lib/ResponseDefinitions.php',
diff --git a/apps/dashboard/composer/composer/autoload_static.php b/apps/dashboard/composer/composer/autoload_static.php
index 72f839d3315..b1c935aae0b 100644
--- a/apps/dashboard/composer/composer/autoload_static.php
+++ b/apps/dashboard/composer/composer/autoload_static.php
@@ -22,6 +22,8 @@ class ComposerStaticInitDashboard
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ 'OCA\\Dashboard\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
+ 'OCA\\Dashboard\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
'OCA\\Dashboard\\Controller\\DashboardApiController' => __DIR__ . '/..' . '/../lib/Controller/DashboardApiController.php',
'OCA\\Dashboard\\Controller\\DashboardController' => __DIR__ . '/..' . '/../lib/Controller/DashboardController.php',
'OCA\\Dashboard\\ResponseDefinitions' => __DIR__ . '/..' . '/../lib/ResponseDefinitions.php',
diff --git a/apps/dashboard/lib/AppInfo/Application.php b/apps/dashboard/lib/AppInfo/Application.php
new file mode 100644
index 00000000000..cff3452c8b0
--- /dev/null
+++ b/apps/dashboard/lib/AppInfo/Application.php
@@ -0,0 +1,31 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCA\Dashboard\AppInfo;
+
+use OCA\Dashboard\Capabilities;
+use OCP\AppFramework\App;
+use OCP\AppFramework\Bootstrap\IBootContext;
+use OCP\AppFramework\Bootstrap\IBootstrap;
+use OCP\AppFramework\Bootstrap\IRegistrationContext;
+
+class Application extends App implements IBootstrap {
+ public const APP_ID = 'dashboard';
+
+ public function __construct(array $urlParams = []) {
+ parent::__construct(self::APP_ID, $urlParams);
+ }
+
+ public function register(IRegistrationContext $context): void {
+ $context->registerCapability(Capabilities::class);
+ }
+
+ public function boot(IBootContext $context): void {
+ }
+}
diff --git a/apps/dashboard/lib/Capabilities.php b/apps/dashboard/lib/Capabilities.php
new file mode 100644
index 00000000000..adcbc123648
--- /dev/null
+++ b/apps/dashboard/lib/Capabilities.php
@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCA\Dashboard;
+
+use OCP\Capabilities\ICapability;
+use OCP\Capabilities\IFeature;
+
+class Capabilities implements ICapability, IFeature {
+ /**
+ * @return array{dashboard: array{enabled: bool}}
+ */
+ public function getCapabilities(): array {
+ return [
+ 'dashboard' => [
+ 'enabled' => true,
+ ],
+ ];
+ }
+
+ public function getFeatures(): array {
+ return [
+ 'dashboard' => [
+ 'widgets-v1',
+ 'widget-items-v1',
+ 'widget-items-v2',
+ 'layout-v3',
+ 'statuses-v3',
+ ],
+ ];
+ }
+}
diff --git a/apps/dashboard/openapi.json b/apps/dashboard/openapi.json
index 3351e0a3e3c..0777ce78fb2 100644
--- a/apps/dashboard/openapi.json
+++ b/apps/dashboard/openapi.json
@@ -20,6 +20,25 @@
}
},
"schemas": {
+ "Capabilities": {
+ "type": "object",
+ "required": [
+ "dashboard"
+ ],
+ "properties": {
+ "dashboard": {
+ "type": "object",
+ "required": [
+ "enabled"
+ ],
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ },
"OCSMeta": {
"type": "object",
"required": [