Skip to content

Commit

Permalink
Merge pull request #120 from ConductionNL/feature/PC108-141/deeplinken
Browse files Browse the repository at this point in the history
ZAA router
  • Loading branch information
remko48 authored Dec 20, 2024
2 parents 437cbc3 + 49edb86 commit e7d9d32
Show file tree
Hide file tree
Showing 50 changed files with 1,095 additions and 598 deletions.
14 changes: 12 additions & 2 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,24 @@
['name' => 'dashboard#page', 'url' => '/', 'verb' => 'GET'],
['name' => 'configuration#index', 'url' => '/api/configuration', 'verb' => 'GET'],
['name' => 'configuration#create', 'url' => '/api/configuration', 'verb' => 'POST'],
['name' => 'contactMomenten#page', 'url' => '/contactmomenten', 'verb' => 'GET'],
['name' => 'contactMomenten#page', 'postfix' => 'details', 'url' => '/contactmomenten/{id}', 'verb' => 'GET'],
['name' => 'zaken#page', 'url' => '/zaken', 'verb' => 'GET'],
['name' => 'zaken#page', 'postfix' => 'details', 'url' => '/zaken/{id}', 'verb' => 'GET'],
['name' => 'rollen#page', 'url' => '/rollen', 'verb' => 'GET'],
['name' => 'statussen#page', 'url' => '/statussen', 'verb' => 'GET'],
['name' => 'zaakinformatieobjecten#page', 'url' => '/zaakinformatieobjecten', 'verb' => 'GET'],
['name' => 'zaakTypen#page','url' => '/zaak_typen', 'verb' => 'GET'],
['name' => 'zaakTypen#page','url' => '/zaaktypen', 'verb' => 'GET'],
['name' => 'zaakTypen#page','postfix' => 'details', 'url' => '/zaaktypen/{id}', 'verb' => 'GET'],
['name' => 'taken#page','url' => '/taken', 'verb' => 'GET'],
['name' => 'taken#page','postfix' => 'details', 'url' => '/taken/{id}', 'verb' => 'GET'],
['name' => 'klanten#page','url' => '/klanten', 'verb' => 'GET'],
['name' => 'berichten#index','url' => '/berichten', 'verb' => 'GET'],
['name' => 'klanten#page','postfix' => 'details', 'url' => '/klanten/{id}', 'verb' => 'GET'],
['name' => 'medewerkers#page','url' => '/medewerkers', 'verb' => 'GET'],
['name' => 'medewerkers#page','postfix' => 'details', 'url' => '/medewerkers/{id}', 'verb' => 'GET'],
['name' => 'berichten#page','url' => '/berichten', 'verb' => 'GET'],
['name' => 'berichten#page','postfix' => 'details', 'url' => '/berichten/{id}', 'verb' => 'GET'],
['name' => 'dashboard#page', 'postfix' => 'search', 'url' => '/zoeken', 'verb' => 'GET'],
// user Settings
['name' => 'settings#index','url' => '/settings', 'verb' => 'GET'],
['name' => 'settings#create', 'url' => '/settings', 'verb' => 'POST'],
Expand Down
38 changes: 38 additions & 0 deletions lib/Controller/BerichtenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\ContentSecurityPolicy;

class BerichtenController extends Controller
{
Expand Down Expand Up @@ -39,6 +41,42 @@ public function index(): JSONResponse
return new JSONResponse($data);
}

/**
* Render no page.
*
* @param string|null $getParameter Optional GET parameter
* @return TemplateResponse The rendered template response
*
* @NoAdminRequired
* @NoCSRFRequired
*/
public function page(?string $getParameter): TemplateResponse
{
try {
// Create a new TemplateResponse for the index page
$response = new TemplateResponse(
$this->appName,
'index',
[]
);

// Set up Content Security Policy
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$response->setContentSecurityPolicy($csp);

return $response;
} catch (\Exception $e) {
// Return an error template response if an exception occurs
return new TemplateResponse(
$this->appName,
'error',
['error' => $e->getMessage()],
'500'
);
}
}

/**
* Read a single object
*
Expand Down
38 changes: 38 additions & 0 deletions lib/Controller/ContactMomentenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\ContentSecurityPolicy;

/**
* Controller for handling contact moments (contactmomenten) operations
Expand Down Expand Up @@ -41,6 +43,42 @@ public function index(): JSONResponse
return new JSONResponse($data);
}

/**
* Render no page.
*
* @param string|null $getParameter Optional GET parameter
* @return TemplateResponse The rendered template response
*
* @NoAdminRequired
* @NoCSRFRequired
*/
public function page(?string $getParameter): TemplateResponse
{
try {
// Create a new TemplateResponse for the index page
$response = new TemplateResponse(
$this->appName,
'index',
[]
);

// Set up Content Security Policy
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$response->setContentSecurityPolicy($csp);

return $response;
} catch (\Exception $e) {
// Return an error template response if an exception occurs
return new TemplateResponse(
$this->appName,
'error',
['error' => $e->getMessage()],
'500'
);
}
}

/**
* Read a single contact moment
*
Expand Down
38 changes: 38 additions & 0 deletions lib/Controller/KlantenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\ContentSecurityPolicy;

class KlantenController extends Controller
{
Expand Down Expand Up @@ -41,6 +43,42 @@ public function index(): JSONResponse
return new JSONResponse($data);
}

/**
* Render no page.
*
* @param string|null $getParameter Optional GET parameter
* @return TemplateResponse The rendered template response
*
* @NoAdminRequired
* @NoCSRFRequired
*/
public function page(?string $getParameter): TemplateResponse
{
try {
// Create a new TemplateResponse for the index page
$response = new TemplateResponse(
$this->appName,
'index',
[]
);

// Set up Content Security Policy
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$response->setContentSecurityPolicy($csp);

return $response;
} catch (\Exception $e) {
// Return an error template response if an exception occurs
return new TemplateResponse(
$this->appName,
'error',
['error' => $e->getMessage()],
'500'
);
}
}

/**
* Read a single object
*
Expand Down
38 changes: 38 additions & 0 deletions lib/Controller/MedewerkersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\ContentSecurityPolicy;

/**
* Controller for handling employees (medewerkers) operations
Expand Down Expand Up @@ -41,6 +43,42 @@ public function index(): JSONResponse
return new JSONResponse($data);
}

/**
* Render no page.
*
* @param string|null $getParameter Optional GET parameter
* @return TemplateResponse The rendered template response
*
* @NoAdminRequired
* @NoCSRFRequired
*/
public function page(?string $getParameter): TemplateResponse
{
try {
// Create a new TemplateResponse for the index page
$response = new TemplateResponse(
$this->appName,
'index',
[]
);

// Set up Content Security Policy
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$response->setContentSecurityPolicy($csp);

return $response;
} catch (\Exception $e) {
// Return an error template response if an exception occurs
return new TemplateResponse(
$this->appName,
'error',
['error' => $e->getMessage()],
'500'
);
}
}

/**
* Read a single employee
*
Expand Down
Loading

0 comments on commit e7d9d32

Please sign in to comment.