Skip to content

Commit

Permalink
Merge pull request #42 from ConductionNL/feature/dashboard-widgets
Browse files Browse the repository at this point in the history
feature/dashboard-widgets
  • Loading branch information
remko48 authored Oct 23, 2024
2 parents 89ff961 + 305ff73 commit 596949c
Show file tree
Hide file tree
Showing 28 changed files with 614 additions and 247 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Create a [feature request](https://github.com/OpenCatalogi/.github/issues/new/ch
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://www.conduction.nl/">Conduction</author>
<namespace>ZaakAfhandelApp</namespace>
<category>organisation</category>
<category>organization</category>
<website>https://github.com/ConductionNL/zaakafhandelapp</website>
<bugs>https://github.com/ConductionNL/zaakafhandelapp/issues</bugs>
<repository type="git">https://github.com/ConductionNL/zaakafhandelapp.git</repository>
Expand Down
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');
}
}
1 change: 1 addition & 0 deletions src/entities/zaak/zaak.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TZaak } from './zaak.types'

export const mockZaakData = (): TZaak[] => [
{
id: '15551d6f-44e3-43f3-a9d2-59e583c91eb0',
uuid: '15551d6f-44e3-43f3-a9d2-59e583c91eb0',
omschrijving: 'Zaak 3',
url: 'http://example.com',
Expand Down
3 changes: 3 additions & 0 deletions src/entities/zaak/zaak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TZaak, zaakTypeID } from './zaak.types'

export class Zaak implements TZaak {

public id: string
public uuid: string
public omschrijving: string
public identificatie: string
Expand All @@ -26,6 +27,7 @@ export class Zaak implements TZaak {
public hoofdzaak: string

constructor(source: TZaak) {
this.id = source.id || ''
this.uuid = source.uuid || ''
this.omschrijving = source.omschrijving || ''
this.identificatie = source.identificatie || ''
Expand All @@ -51,6 +53,7 @@ export class Zaak implements TZaak {

public validate(): SafeParseReturnType<TZaak, unknown> {
const schema = z.object({
id: z.string().optional(),
uuid: z.string().optional(),
omschrijving: z.string().min(1),
identificatie: z.string().min(1),
Expand Down
1 change: 1 addition & 0 deletions src/entities/zaak/zaak.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type zaakTypeID = string // create an alias for string called ZaakTypeID to make it easier for developers to understand that this is a ID from a ZaakType

export type TZaak = {
id: string;
uuid: string;
omschrijving: string;
identificatie: string;
Expand Down
6 changes: 3 additions & 3 deletions src/modals/Modals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { navigationStore } from '../store/store.js'
<template>
<!-- Placeholder -->
<div>
<ZaakForm v-if="navigationStore.modal === 'zaakForm'" />
<EditZaakType />
<EditKlant />
<ViewKlantAuditTrail v-if="navigationStore.modal === 'viewKlantAuditTrail'" />
Expand All @@ -13,12 +14,12 @@ import { navigationStore } from '../store/store.js'
<EditTaak />
<ViewTaakAuditTrail v-if="navigationStore.modal === 'viewTaakAuditTrail'" />
<EditRol />
<EditZaak />
<ViewZaakAuditTrail v-if="navigationStore.modal === 'viewZaakAuditTrail'" />
</div>
</template>

<script>
import ZaakForm from './zaken/ZaakForm.vue'
import EditZaakType from './zaakTypen/EditZaakType.vue'
import EditKlant from './klanten/EditKlant.vue'
import ViewKlantAuditTrail from './klanten/ViewKlantAuditTrail.vue'
Expand All @@ -27,12 +28,12 @@ import ViewBerichtAuditTrail from './berichten/ViewBerichtAuditTrail.vue'
import EditTaak from './taken/EditTaak.vue'
import ViewTaakAuditTrail from './taken/ViewTaakAuditTrail.vue'
import EditRol from './rollen/EditRol.vue'
import EditZaak from './zaken/EditZaak.vue'
import ViewZaakAuditTrail from './zaken/ViewZaakAuditTrail.vue'
export default {
name: 'Modals',
components: {
ZaakForm,
EditZaakType,
EditKlant,
ViewKlantAuditTrail,
Expand All @@ -41,7 +42,6 @@ export default {
EditTaak,
ViewTaakAuditTrail,
EditRol,
EditZaak,
ViewZaakAuditTrail,
},
}
Expand Down
Loading

0 comments on commit 596949c

Please sign in to comment.