more tests and some fixes

This commit is contained in:
Dennis Eichhorn 2024-04-24 03:20:46 +00:00
parent f820d00692
commit 59e7126b8d
7 changed files with 31 additions and 38 deletions

View File

@ -13,10 +13,15 @@ on:
- cron: '0 0 1,15 * *' - cron: '0 0 1,15 * *'
jobs: jobs:
general_module_workflow: general_module_workflow_php:
uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop
secrets: secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }} GH_PAT: ${{ secrets.GH_PAT }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
general_module_workflow_js:
uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@ -72,6 +72,14 @@ final class BackendController extends Controller
$head->addAsset(AssetType::JSLATE, 'Modules/Help/Controller/Controller.js?v=' . self::VERSION, ['nonce' => $nonce, 'type' => 'module']); $head->addAsset(AssetType::JSLATE, 'Modules/Help/Controller/Controller.js?v=' . self::VERSION, ['nonce' => $nonce, 'type' => 'module']);
} }
private function loadMermaid(ResponseAbstract $response) : void
{
$head = $response->data['Content']->head;
$nonce = $this->app->appSettings->getOption('script-nonce');
$head->addAsset(AssetType::JSLATE, 'Resources/mermaid/mermaid.min.js?v=' . $this->app->version, ['nonce' => $nonce]);
}
/** /**
* Routing end-point for application behavior. * Routing end-point for application behavior.
* *
@ -274,10 +282,16 @@ final class BackendController extends Controller
$toParse = \file_get_contents($path); $toParse = \file_get_contents($path);
$summary = \file_get_contents(__DIR__ . '/../../../Developer-Guide/SUMMARY.md'); $summary = \file_get_contents(__DIR__ . '/../../../Developer-Guide/SUMMARY.md');
$content = Markdown::parse($toParse === false ? '' : $toParse); if (\stripos($toParse, '```mermaid') !== false) {
$this->loadMermaid($response);
}
$markdown = new Markdown();
$content = $markdown->parse($toParse === false ? '' : $toParse);
$navigation = Markdown::parse($summary === false ? '' : $summary); $navigation = Markdown::parse($summary === false ? '' : $summary);
$view->setTemplate('/Modules/Help/Theme/Backend/help-developer'); $view->setTemplate('/Modules/Help/Theme/Backend/help-general');
$view->data['content'] = $content; $view->data['content'] = $content;
$view->data['navigation'] = $navigation; $view->data['navigation'] = $navigation;

View File

@ -2,6 +2,7 @@ import { Autoloader } from '../../../jsOMS/Autoloader.js';
Autoloader.defineNamespace('omsApp.Modules'); Autoloader.defineNamespace('omsApp.Modules');
/* global omsApp */
omsApp.Modules.Help = class { omsApp.Modules.Help = class {
/** /**
* @constructor * @constructor
@ -13,17 +14,11 @@ omsApp.Modules.Help = class {
this.app = app; this.app = app;
}; };
bind (id) bind ()
{ {
const e = typeof id === 'undefined' ? document.getElementsByTagName('code') : [document.getElementById(id)], /* global hljs */
length = e.length;
hljs.highlightAll(); hljs.highlightAll();
}; };
bindElement (code)
{
};
}; };
window.omsApp.moduleManager.get('Help').bind(); window.omsApp.moduleManager.get('Help').bind();

View File

@ -1,17 +0,0 @@
<div class="row">
<div class="col-xs-12 col-md-8 col-lg-9">
<section class="portlet">
<article>
<?= $this->data['content']; ?>
</article>
</section>
</div>
<div class="col-xs-12 col-md-4 col-lg-3 pH">
<section class="portlet">
<article>
<?= $this->data['navigation']; ?>
</article>
</section>
</div>
</div>

View File

@ -9,9 +9,9 @@
<div class="col-xs-12 col-md-4 col-lg-3 pH"> <div class="col-xs-12 col-md-4 col-lg-3 pH">
<section class="portlet"> <section class="portlet">
<article> <nav class="content-side-nav">
<?= $this->data['navigation']; ?> <?= $this->data['navigation']; ?>
</article> </nav>
</section> </section>
</div> </div>
</div> </div>

View File

@ -18,17 +18,13 @@
<?php if (!empty($this->data['navigation'] ?? '')) : ?> <?php if (!empty($this->data['navigation'] ?? '')) : ?>
<section class="portlet"> <section class="portlet">
<div class="portlet-body"> <nav class="content-side-nav"><?= $this->data['navigation']; ?></nav>
<article><?= $this->data['navigation']; ?></article>
</div>
</section> </section>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($this->data['devNavigation'] ?? '')) : ?> <?php if (!empty($this->data['devNavigation'] ?? '')) : ?>
<section class="portlet"> <section class="portlet">
<div class="portlet-body"> <nav class="content-side-nav"><?= $this->data['devNavigation']; ?></nav>
<article><?= $this->data['devNavigation']; ?></article>
</div>
</section> </section>
<?php endif; ?> <?php endif; ?>
</div> </div>