bug fixes

This commit is contained in:
Dennis Eichhorn 2024-05-12 00:06:29 +00:00
parent da39cf2892
commit bc9ddd0ea6
4 changed files with 82 additions and 73 deletions

View File

@ -9,5 +9,5 @@ jobs:
- uses: actions/first-interaction@v1 - uses: actions/first-interaction@v1
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
pr-message: 'Thank you for your pull request. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.'

View File

@ -126,7 +126,14 @@ final class Installer extends InstallerAbstract
/** @noinspection PhpIncludeInspection */ /** @noinspection PhpIncludeInspection */
$moduleRoutes = include $data['path']; $moduleRoutes = include $data['path'];
self::$commands = \array_merge_recursive(self::$commands, $moduleRoutes); $tmp = \array_merge_recursive(self::$commands, $moduleRoutes);
foreach ($tmp as $route => $endpoints) {
\usort($endpoints, function (array $a, array $b) {
return ($a['order'] ?? 0) <=> ($b['order'] ?? 0);
});
self::$commands[$route] = $endpoints;
}
\file_put_contents(__DIR__ . '/SearchCommands.php', '<?php return ' . ArrayParser::serializeArray(self::$commands) . ';', \LOCK_EX); \file_put_contents(__DIR__ . '/SearchCommands.php', '<?php return ' . ArrayParser::serializeArray(self::$commands) . ';', \LOCK_EX);

View File

@ -53,9 +53,6 @@ final class BackendController extends Controller
* *
* @api * @api
* *
* @todo Search prioritization
* https://github.com/Karaka-Management/oms-Search/issues/1
*
* @since 1.0.0 * @since 1.0.0
*/ */
public function search(HttpRequest $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function search(HttpRequest $request, ResponseAbstract $response, array $data = []) : RenderableInterface
@ -74,8 +71,6 @@ final class BackendController extends Controller
? [] ? []
: $this->routeSearch($internalRequest, $internalResponse, $data); : $this->routeSearch($internalRequest, $internalResponse, $data);
$response->header = $internalResponse->header;
$responseData = \reset($temp); $responseData = \reset($temp);
$view->data = empty($temp) || !\is_array($responseData) ? [] : $responseData; $view->data = empty($temp) || !\is_array($responseData) ? [] : $responseData;

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Jingga * Jingga
* *
@ -10,6 +11,7 @@
* @version 1.0.0 * @version 1.0.0
* @link https://jingga.app * @link https://jingga.app
*/ */
declare(strict_types=1); declare(strict_types=1);
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;
@ -24,16 +26,17 @@ foreach ($this->data as $controller) :
$first = \reset($controller); $first = \reset($controller);
?> ?>
<div class="row"> <div class="row">
<div class="box col-xs-12"> <div class="box col-xs-12">
<h1><?= $first['module']; ?></h1> <h1><?= $first['module']; ?></h1>
</div> </div>
</div> </div>
<?php if ($first['type'] === 'list_links') : ?> <?php if ($first['type'] === 'list_links') : ?>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <section class="portlet">
<table class="default sticky"><tbody> <table class="default sticky">
<tbody>
<?php foreach ($controller as $data) : <?php foreach ($controller as $data) :
if (empty($data)) { if (empty($data)) {
continue; continue;
@ -62,7 +65,7 @@ foreach ($this->data as $controller) :
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
</div> </section>
</div> </div>
</div> </div>
<?php elseif ($first['type'] === 'list_accounts') : ?> <?php elseif ($first['type'] === 'list_accounts') : ?>
@ -78,8 +81,7 @@ foreach ($this->data as $controller) :
<section class="portlet"> <section class="portlet">
<div class="<?= empty($data['email']) && empty($data['phone']) && empty($data['city']) ? 'portlet-body' : 'portlet-head'; ?>"> <div class="<?= empty($data['email']) && empty($data['phone']) && empty($data['city']) ? 'portlet-body' : 'portlet-head'; ?>">
<a style="display: flex; align-items: center;" href="<?= UriFactory::build($data['link']); ?>"> <a style="display: flex; align-items: center;" href="<?= UriFactory::build($data['link']); ?>">
<img class="profile-image" alt="account" loading="lazy" <img class="profile-image" alt="account" loading="lazy" src="<?= UriFactory::build($data['image']); ?>">
src="<?= UriFactory::build($data['image']); ?>">
<span style="margin-left: .5rem;"><?= $this->printHtml($data['title']); ?></span> <span style="margin-left: .5rem;"><?= $this->printHtml($data['title']); ?></span>
</a> </a>
</div> </div>
@ -87,9 +89,14 @@ foreach ($this->data as $controller) :
<div class="portlet-body"> <div class="portlet-body">
<div> <div>
<table class="wf-100" style="font-size: .9rem;"> <table class="wf-100" style="font-size: .9rem;">
<?php if (!empty($data['email'])) : ?><tr><td><a href=""><?= $this->printHtml($data['email']); ?></a><?php endif; ?> <?php if (!empty($data['email'])) : ?><tr>
<?php if (!empty($data['phone'])) : ?><tr><td><?= $this->printHtml($data['phone']); ?><?php endif; ?> <td><a href=""><?= $this->printHtml($data['email']); ?></a><?php endif; ?>
<?php if (!empty($data['city'])) : ?><tr><td><?= $this->printHtml($data['city']); ?><?php endif; ?> <?php if (!empty($data['phone'])) : ?>
<tr>
<td><?= $this->printHtml($data['phone']); ?><?php endif; ?>
<?php if (!empty($data['city'])) : ?>
<tr>
<td><?= $this->printHtml($data['city']); ?><?php endif; ?>
</table> </table>
</div> </div>
</div> </div>