Skip to content

Commit

Permalink
Added widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Sep 5, 2024
1 parent ca561c1 commit 6c21b5e
Show file tree
Hide file tree
Showing 15 changed files with 612 additions and 319 deletions.
9 changes: 9 additions & 0 deletions css/dashboardWidgets.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.icon-zaken-widget {
background-image: url("../img/app-dark.svg");
filter: var(--background-invert-if-dark);
}

body.theme--dark .icon-zaken-widget {
background-image: url("../img/app.svg");
}

1 change: 1 addition & 0 deletions img/briefcase-account-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/calendar-month-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCA\ZaakAfhandelApp\Dashboard\ZakenWidget;
use OCA\ZaakAfhandelApp\Dashboard\TakenWidget;
use OCA\ZaakAfhandelApp\Dashboard\OpenZakenWidget;

/**
* Class Application
Expand All @@ -28,6 +31,10 @@ public function __construct(array $urlParams = [])

public function register(IRegistrationContext $context): void
{
$context->registerDashboardWidget(ZakenWidget::class);
$context->registerDashboardWidget(TakenWidget::class);
$context->registerDashboardWidget(OpenZakenWidget::class);

}

public function boot(IBootContext $context): void
Expand Down
69 changes: 69 additions & 0 deletions lib/Dashboard/OpenZakenWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php


namespace OCA\ZaakAfhandelApp\Dashboard;

use OCP\Dashboard\IWidget;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Util;

use OCA\ZaakAfhandelApp\AppInfo\Application;

class OpenZakenWidget implements IWidget
{

public function __construct(
private IL10N $l10n,
private IURLGenerator $url
) {}

/**
* @inheritDoc
*/
public function getId(): string
{
return 'zaakAfhandelApp_openzaak_widget';
}

/**
* @inheritDoc
*/
public function getTitle(): string
{
return $this->l10n->t('Open zaken');
}

/**
* @inheritDoc
*/
public function getOrder(): int
{
return 10;
}

/**
* @inheritDoc
*/
public function getIconClass(): string
{
return 'icon-zaken-widget';
}

/**
* @inheritDoc
*/
public function getUrl(): ?string
{
return null;
}

/**
* @inheritDoc
*/
public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-openZakenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
}
}
69 changes: 69 additions & 0 deletions lib/Dashboard/TakenWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php


namespace OCA\ZaakAfhandelApp\Dashboard;

use OCP\Dashboard\IWidget;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Util;

use OCA\ZaakAfhandelApp\AppInfo\Application;

class TakenWidget implements IWidget
{

public function __construct(
private IL10N $l10n,
private IURLGenerator $url
) {}

/**
* @inheritDoc
*/
public function getId(): string
{
return 'zaakAfhandelApp_taak_widget';
}

/**
* @inheritDoc
*/
public function getTitle(): string
{
return $this->l10n->t('Uw taken');
}

/**
* @inheritDoc
*/
public function getOrder(): int
{
return 10;
}

/**
* @inheritDoc
*/
public function getIconClass(): string
{
return 'icon-zaken-widget';
}

/**
* @inheritDoc
*/
public function getUrl(): ?string
{
return null;
}

/**
* @inheritDoc
*/
public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-takenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
}
}
69 changes: 69 additions & 0 deletions lib/Dashboard/ZakenWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php


namespace OCA\ZaakAfhandelApp\Dashboard;

use OCP\Dashboard\IWidget;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Util;

use OCA\ZaakAfhandelApp\AppInfo\Application;

class ZakenWidget implements IWidget
{

public function __construct(
private IL10N $l10n,
private IURLGenerator $url
) {}

/**
* @inheritDoc
*/
public function getId(): string
{
return 'zaakAfhandelApp_zaak_widget';
}

/**
* @inheritDoc
*/
public function getTitle(): string
{
return $this->l10n->t('Uw zaken');
}

/**
* @inheritDoc
*/
public function getOrder(): int
{
return 10;
}

/**
* @inheritDoc
*/
public function getIconClass(): string
{
return 'icon-zaken-widget';
}

/**
* @inheritDoc
*/
public function getUrl(): ?string
{
return null;
}

/**
* @inheritDoc
*/
public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-zakenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
}
}
Loading

0 comments on commit 6c21b5e

Please sign in to comment.