add todos from github

This commit is contained in:
Dennis Eichhorn 2019-12-31 19:54:45 +01:00
parent 0fadb05065
commit abab8cd7d1
3 changed files with 61 additions and 5 deletions

View File

@ -32,6 +32,14 @@ use phpOMS\Model\Message\FormValidation;
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*
* @todo Orange-Management/Modules#12
* Dynamic providing should be handled in the DB
* Providing for the dashboard is dynamic and can be customized by the user himself.
* Hence the loading of the plugins should be handled in the module manager and database.
* Module specific providing could remain the same? Maybe even create a dashboard table just for this like the navigation module.
* This way modules can tell the dashboard that there is a plugin it can use.
* In this table it also should be possible to specify additional information.
*/
final class ApiController extends Controller
{

View File

@ -15,11 +15,11 @@ declare(strict_types=1);
namespace Modules\Dashboard\Controller;
use Modules\Dashboard\Models\DashboardBoardMapper;
use Modules\Dashboard\Models\DashboardElementInterface;
use Modules\Dashboard\Models\NullDashboardBoard;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\NullModule;
use phpOMS\Views\View;
/**
@ -29,6 +29,10 @@ use phpOMS\Views\View;
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*
* @todo Orange-Management/Modules#137
* Default dashboard styles
* Allow default dashboard templates which users can select
*/
final class BackendController extends Controller
{
@ -41,6 +45,10 @@ final class BackendController extends Controller
*
* @return RenderableInterface
*
* @todo Orange-Management/Modules#57
* Users should be able to customize their dashboard.
* This includes drag and drop and module selection.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
@ -62,10 +70,7 @@ final class BackendController extends Controller
foreach ($boardComponents as $component) {
$module = $this->app->moduleManager->get($component->getModule());
// todo: check if this should be done with instanceof DashboardView -> instanceof DashboardView
if ($module instanceof NullModule
|| !\method_exists($module, 'viewDashboard')
) {
if (!($module instanceof DashboardElementInterface)) {
continue;
}

View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Dashboard\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Dashboard\Models;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Contract\RenderableInterface;
/**
* Dashboard element interface.
*
* @package Modules\Dashboard\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
interface DashboardElementInterface
{
/**
* Get renderable dashboard element.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
*/
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface;
}