Implement dashboard panel

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-07-11 10:43:21 +02:00
parent b14bba2112
commit 527181240a
6 changed files with 260 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ use OCA\Deck\Activity\CommentEventHandler;
use OCA\Deck\Capabilities;
use OCA\Deck\Collaboration\Resources\ResourceProvider;
use OCA\Deck\Collaboration\Resources\ResourceProviderCard;
use OCA\Deck\Dashboard\DeckPanel;
use OCA\Deck\Db\Acl;
use OCA\Deck\Db\AclMapper;
use OCA\Deck\Db\AssignedUsersMapper;
@@ -43,6 +44,7 @@ use OCP\AppFramework\App;
use OCP\Collaboration\Resources\IManager;
use OCP\Collaboration\Resources\IProviderManager;
use OCP\Comments\CommentsEntityEvent;
use OCP\Dashboard\RegisterPanelEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\FullTextSearch\IFullTextSearchManager;
@@ -85,6 +87,16 @@ class Application extends App {
$container->registerService('database4ByteSupport', static function () use ($server) {
return $server->getDatabaseConnection()->supports4ByteText();
});
$version = OC_Util::getVersion()[0];
if ($version >= 20) {
/** @var IEventDispatcher $dispatcher */
$dispatcher = $container->getServer()->query(IEventDispatcher::class);
$dispatcher->addListener(RegisterPanelEvent::class, function (RegisterPanelEvent $event) use ($container) {
\OCP\Util::addScript('myapp', 'dashboard');
$event->registerPanel(DeckPanel::class);
});
}
}
public function register(): void {