bug fixes
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled

This commit is contained in:
Dennis Eichhorn 2024-10-11 19:17:40 +00:00
parent 9136fbabd3
commit 32b4dab4cd
2 changed files with 165 additions and 1 deletions

161
Admin/Routes/Web/Api.php Normal file
View File

@ -0,0 +1,161 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use Modules\Kanban\Controller\ApiController;
use Modules\Kanban\Models\PermissionCategory;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/kanban(\?.*|$)' => [
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanBoardCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanBoardUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanBoardDelete',
'verb' => RouteVerb::DELETE,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::DELETE,
'state' => PermissionCategory::BOARD,
],
],
],
'^.*/kanban/column(\?.*|$)' => [
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanColumnCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanColumnUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanColumnDelete',
'verb' => RouteVerb::DELETE,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::DELETE,
'state' => PermissionCategory::BOARD,
],
],
],
'^.*/kanban/card(\?.*|$)' => [
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanCardCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanCardUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanCardDelete',
'verb' => RouteVerb::DELETE,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::DELETE,
'state' => PermissionCategory::BOARD,
],
],
],
'^.*/kanban/comment(\?.*|$)' => [
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanCommentCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanCommentUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::BOARD,
],
],
[
'dest' => '\Modules\Kanban\Controller\ApiController:apiKanbanCommentDelete',
'verb' => RouteVerb::DELETE,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::DELETE,
'state' => PermissionCategory::BOARD,
],
],
]
];

View File

@ -23,7 +23,10 @@ echo $this->data['nav']->render();
<div class="row">
<div class="col-xs-12 col-md-6 col-lg-4">
<section class="portlet">
<form action="<?= \phpOMS\Uri\UriFactory::build('{/api}kanban?csrf={$CSRF}'); ?>" method="<?= $isNew ? 'PUT' : 'POST'; ?>">
<form
action="<?= \phpOMS\Uri\UriFactory::build('{/api}kanban?csrf={$CSRF}'); ?>"
method="<?= $isNew ? 'PUT' : 'POST'; ?>"
<?= $isNew ? 'data-redirect="' . UriFactory::build('{/base}/kanban/board') . '?id={/0/response/id}"' : ''; ?>>
<div class="portlet-head"><?= $this->getHtml('Board'); ?></div>
<div class="portlet-body">
<div class="form-group">