Skip to content

Commit

Permalink
Update knihoven, webloader -> webpack, nette.ajax -> naja (#777)
Browse files Browse the repository at this point in the history
* instalace javascript yarn

* instalace javascript yarn

* rebase

* rebase

* webpack fixes

* tinymce fix

* components fixed

* jquery import fixed

* vue components rendering skip if not needed

* coding standard fix

* update knihoven

* update knihoven

* update knihoven

* oprava qr kod

* oprava redirect inline add/edit

* cs fix

* css, fontawesome 6

* cleanup

* fontawesome speedup

* babel

* oprava pull->float, zarovnání spinneru

* oprava hledani ucastniku, confirm skautis disconnect

* oprava zadavani slevy

* static validatory jako prvni

* oprava validatoru

* phpstan fix

* itranslator replacement

* istorage replacement

* identity replacement

* throws cleanup

* throws cleanup

* cs fix

* cleanup

* cleanup

* cs fix

* oprava gps picker

* oprava mapy

* webloader removed

* frontend libs removed from composer

* webloader extension removed

* opravy chyb

* oprava redirectu

* cs fix

* oprava multiselecct akce, fileinput zarovnani

* workflow renamed
  • Loading branch information
jan-stanek authored Mar 3, 2022
1 parent fa98120 commit 3455df1
Show file tree
Hide file tree
Showing 308 changed files with 4,976 additions and 15,045 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy-production
name: deploy-manual

on:
workflow_dispatch:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
deploy:
name: "Deploy to production"
name: "Manual deployment"
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-18.04
container:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Skautský rezervační systém
[![test](https://github.com/skaut/SRS/actions/workflows/test.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/test.yml) [![deploy-dev](https://github.com/skaut/SRS/actions/workflows/deploy-dev.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/deploy-dev.yml) [![deploy-staging](https://github.com/skaut/SRS/actions/workflows/deploy-staging.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/deploy-staging.yml) [![deploy-production](https://github.com/skaut/SRS/actions/workflows/deploy-production.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/deploy-production.yml) [![codecov](https://codecov.io/gh/skaut/SRS/branch/master/graph/badge.svg)](https://codecov.io/gh/skaut/SRS)
[![test](https://github.com/skaut/SRS/actions/workflows/test.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/test.yml) [![deploy-dev](https://github.com/skaut/SRS/actions/workflows/deploy-dev.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/deploy-dev.yml) [![deploy-staging](https://github.com/skaut/SRS/actions/workflows/deploy-staging.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/deploy-staging.yml) [![deploy-manual](https://github.com/skaut/SRS/actions/workflows/deploy-manual.yml/badge.svg)](https://github.com/skaut/SRS/actions/workflows/deploy-manual.yml) [![codecov](https://codecov.io/gh/skaut/SRS/branch/master/graph/badge.svg)](https://codecov.io/gh/skaut/SRS)

Skautský rezervační systém (neboli SRS) byl vytvořen jako webový nástroj pro podporu vzdělávacích seminářů Junáka - českého skauta, na které se typicky přihlašují účastníci, kteří si následně vybírají vlastní podobu programu, kterou na akci absolvovat. Cílem tohoto webového systému je zjednodušit či zautomatizovat organizační procesy, kterými musí každý seminář projít.

Expand Down
2 changes: 0 additions & 2 deletions app/ActionModule/Presenters/MailingPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Model\Acl\Permission;
use App\Model\Acl\SrsResource;
use App\Model\Settings\Commands\SetSettingStringValue;
use App\Model\Settings\Exceptions\SettingsItemNotFoundException;
use App\Model\Settings\Queries\SettingStringValueQuery;
use App\Model\Settings\Settings;
use App\Services\CommandBus;
Expand All @@ -29,7 +28,6 @@ class MailingPresenter extends ActionBasePresenter
/**
* Ověří e-mail semináře.
*
* @throws SettingsItemNotFoundException
* @throws AbortException
* @throws Throwable
*/
Expand Down
5 changes: 0 additions & 5 deletions app/ActionModule/Presenters/MaturityPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use App\Model\Enums\ApplicationState;
use App\Model\Mailing\Template;
use App\Model\Mailing\TemplateVariable;
use App\Model\Settings\Exceptions\SettingsItemNotFoundException;
use App\Model\Settings\Queries\SettingIntValueQuery;
use App\Model\Settings\Queries\SettingStringValueQuery;
use App\Model\Settings\Settings;
Expand All @@ -23,7 +22,6 @@
use Doctrine\ORM\EntityManagerInterface;
use Nette\Application\Responses\TextResponse;
use Throwable;
use Ublaboo\Mailing\Exception\MailingMailCreationException;

/**
* Presenter obsluhující kontrolu splatnosti přihlášek.
Expand Down Expand Up @@ -51,7 +49,6 @@ class MaturityPresenter extends ActionBasePresenter
/**
* Zruší přihlášky po splatnosti.
*
* @throws SettingsItemNotFoundException
* @throws Throwable
*/
public function actionCancelApplications(): void
Expand Down Expand Up @@ -108,9 +105,7 @@ public function actionCancelApplications(): void
/**
* Rozešle přípomínky splatnosti.
*
* @throws SettingsItemNotFoundException
* @throws Throwable
* @throws MailingMailCreationException
*/
public function actionSendReminders(): void
{
Expand Down
26 changes: 8 additions & 18 deletions app/AdminModule/CmsModule/Components/DocumentTagsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
use App\Model\Cms\Repositories\TagRepository;
use App\Model\Cms\Tag;
use App\Services\AclService;
use Doctrine\ORM\ORMException;
use Nette\Application\AbortException;
use Nette\Application\UI\Control;
use Nette\Application\UI\Form;
use Nette\Forms\Container;
use Nette\Forms\Controls\TextInput;
use Nette\Localization\ITranslator;
use Nette\Localization\Translator;
use stdClass;
use Ublaboo\DataGrid\DataGrid;
use Ublaboo\DataGrid\Exception\DataGridException;
Expand All @@ -28,7 +27,7 @@
*/
class DocumentTagsGridControl extends Control
{
private ITranslator $translator;
private Translator $translator;

private RoleRepository $roleRepository;

Expand All @@ -37,7 +36,7 @@ class DocumentTagsGridControl extends Control
private TagRepository $tagRepository;

public function __construct(
ITranslator $translator,
Translator $translator,
RoleRepository $roleRepository,
AclService $aclService,
TagRepository $tagRepository
Expand Down Expand Up @@ -121,9 +120,6 @@ public function createComponentDocumentTagsGrid(string $name): void

/**
* Zpracuje přidání štítku dokumentu.
*
* @throws ORMException
* @throws AbortException
*/
public function add(stdClass $values): void
{
Expand All @@ -135,15 +131,11 @@ public function add(stdClass $values): void
$this->tagRepository->save($tag);

$this->getPresenter()->flashMessage('admin.cms.documents.tags.message.save_success', 'success');

$this->redirect('this');
$this->getPresenter()->redrawControl('flashes');
}

/**
* Zpracuje úpravu štítku dokumentu.
*
* @throws ORMException
* @throws AbortException
*/
public function edit(string $id, stdClass $values): void
{
Expand All @@ -155,23 +147,21 @@ public function edit(string $id, stdClass $values): void
$this->tagRepository->save($tag);

$this->getPresenter()->flashMessage('admin.cms.documents.tags.message.save_success', 'success');

$this->redirect('this');
$this->getPresenter()->redrawControl('flashes');
}

/**
* Zpracuje odstranění štítku dokumentu.
*
* @throws ORMException
* @throws AbortException
*/
public function handleDelete(int $id): void
{
$tag = $this->tagRepository->findById($id);
$this->tagRepository->remove($tag);

$this->getPresenter()->flashMessage('admin.cms.documents.tags.message.delete_success', 'success');

$this->redirect('this');
$p = $this->getPresenter();
$p->flashMessage('admin.cms.documents.tags.message.delete_success', 'success');
$p->redirect('this');
}
}
28 changes: 9 additions & 19 deletions app/AdminModule/CmsModule/Components/DocumentsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
use App\Services\FilesService;
use App\Utils\Helpers;
use DateTimeImmutable;
use Doctrine\ORM\ORMException;
use Nette\Application\AbortException;
use Nette\Application\UI\Control;
use Nette\Application\UI\Form;
use Nette\Forms\Container;
use Nette\Http\FileUpload;
use Nette\Localization\ITranslator;
use Nette\Localization\Translator;
use Nette\Utils\Html;
use stdClass;
use Ublaboo\DataGrid\DataGrid;
Expand All @@ -32,7 +31,7 @@
*/
class DocumentsGridControl extends Control
{
private ITranslator $translator;
private Translator $translator;

private DocumentRepository $documentRepository;

Expand All @@ -41,7 +40,7 @@ class DocumentsGridControl extends Control
private TagRepository $tagRepository;

public function __construct(
ITranslator $translator,
Translator $translator,
DocumentRepository $documentRepository,
TagRepository $tagRepository,
FilesService $filesService
Expand Down Expand Up @@ -95,7 +94,7 @@ public function createComponentDocumentsGrid(string $name): void
->setAttribute('href', $document->getFile())
->setAttribute('target', '_blank')
->setAttribute('class', 'btn btn-xs btn-secondary')
->addHtml(Html::el('span')->setAttribute('class', 'fa fa-download'))
->addHtml(Html::el('span')->setAttribute('class', 'fa fa-file-arrow-down'))
->addText(' ' . basename($document->getFile()));
});

Expand Down Expand Up @@ -152,9 +151,6 @@ public function createComponentDocumentsGrid(string $name): void

/**
* Zpracuje přidání dokumentu.
*
* @throws ORMException
* @throws AbortException
*/
public function add(stdClass $values): void
{
Expand All @@ -172,15 +168,11 @@ public function add(stdClass $values): void
$this->documentRepository->save($document);

$this->getPresenter()->flashMessage('admin.cms.documents.message.save_success', 'success');

$this->redirect('this');
$this->getPresenter()->redrawControl('flashes');
}

/**
* Zpracuje úpravu dokumentu.
*
* @throws ORMException
* @throws AbortException
*/
public function edit(string $id, stdClass $values): void
{
Expand All @@ -202,14 +194,12 @@ public function edit(string $id, stdClass $values): void
$this->documentRepository->save($document);

$this->getPresenter()->flashMessage('admin.cms.documents.message.save_success', 'success');

$this->redirect('this');
$this->getPresenter()->redrawControl('flashes');
}

/**
* Zpracuje odstranění dokumentu.
*
* @throws ORMException
* @throws AbortException
*/
public function handleDelete(int $id): void
Expand All @@ -218,8 +208,8 @@ public function handleDelete(int $id): void
$this->filesService->delete($document->getFile());
$this->documentRepository->remove($document);

$this->getPresenter()->flashMessage('admin.cms.documents.message.delete_success', 'success');

$this->redirect('this');
$p = $this->getPresenter();
$p->flashMessage('admin.cms.documents.message.delete_success', 'success');
$p->redirect('this');
}
}
23 changes: 10 additions & 13 deletions app/AdminModule/CmsModule/Components/FaqGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Doctrine\ORM\ORMException;
use Nette\Application\AbortException;
use Nette\Application\UI\Control;
use Nette\Localization\ITranslator;
use Nette\Localization\Translator;
use Ublaboo\DataGrid\DataGrid;
use Ublaboo\DataGrid\Exception\DataGridColumnStatusException;
use Ublaboo\DataGrid\Exception\DataGridException;
Expand All @@ -19,11 +19,11 @@
*/
class FaqGridControl extends Control
{
private ITranslator $translator;
private Translator $translator;

private FaqRepository $faqRepository;

public function __construct(ITranslator $translator, FaqRepository $faqRepository)
public function __construct(Translator $translator, FaqRepository $faqRepository)
{
$this->translator = $translator;
$this->faqRepository = $faqRepository;
Expand Down Expand Up @@ -93,17 +93,16 @@ public function createComponentFaqGrid(string $name): DataGrid
/**
* Zpracuje odstranění otázky.
*
* @throws ORMException
* @throws AbortException
*/
public function handleDelete(int $id): void
{
$faq = $this->faqRepository->findById($id);
$this->faqRepository->remove($faq);

$this->getPresenter()->flashMessage('admin.cms.faq.message.delete_success', 'success');

$this->redirect('this');
$p = $this->getPresenter();
$p->flashMessage('admin.cms.faq.message.delete_success', 'success');
$p->redirect('this');
}

/**
Expand All @@ -121,10 +120,9 @@ public function handleSort(?string $item_id, ?string $prev_id, ?string $next_id)

if ($p->isAjax()) {
$p->redrawControl('flashes');
$faqGrid = $this->getComponent('faqGrid');
$faqGrid->reload();
$this->getComponent('faqGrid')->reload();
} else {
$this->redirect('this');
$p->redirect('this');
}
}

Expand All @@ -146,10 +144,9 @@ public function changeStatus(string $id, string $public): void

if ($p->isAjax()) {
$p->redrawControl('flashes');
$faqGrid = $this->getComponent('faqGrid');
$faqGrid->redrawItem($id);
$this->getComponent('faqGrid')->redrawItem($id);
} else {
$this->redirect('this');
$p->redirect('this');
}
}
}
18 changes: 8 additions & 10 deletions app/AdminModule/CmsModule/Components/NewsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Doctrine\ORM\ORMException;
use Nette\Application\AbortException;
use Nette\Application\UI\Control;
use Nette\Localization\ITranslator;
use Nette\Localization\Translator;
use Ublaboo\DataGrid\DataGrid;
use Ublaboo\DataGrid\Exception\DataGridColumnStatusException;
use Ublaboo\DataGrid\Exception\DataGridException;
Expand All @@ -19,11 +19,11 @@
*/
class NewsGridControl extends Control
{
private ITranslator $translator;
private Translator $translator;

private NewsRepository $newsRepository;

public function __construct(ITranslator $translator, NewsRepository $newsRepository)
public function __construct(Translator $translator, NewsRepository $newsRepository)
{
$this->translator = $translator;
$this->newsRepository = $newsRepository;
Expand Down Expand Up @@ -89,17 +89,16 @@ public function createComponentNewsGrid(string $name): DataGrid
/**
* Zpracuje odstranění aktuality.
*
* @throws ORMException
* @throws AbortException
*/
public function handleDelete(int $id): void
{
$news = $this->newsRepository->findById($id);
$this->newsRepository->remove($news);

$this->getPresenter()->flashMessage('admin.cms.news.message.delete_success', 'success');

$this->redirect('this');
$p = $this->getPresenter();
$p->flashMessage('admin.cms.news.message.delete_success', 'success');
$p->redirect('this');
}

/**
Expand All @@ -119,10 +118,9 @@ public function changePinned(string $id, string $pinned): void

if ($p->isAjax()) {
$p->redrawControl('flashes');
$newsGrid = $this->getComponent('newsGrid');
$newsGrid->redrawItem($id);
$this->getComponent('newsGrid')->redrawItem($id);
} else {
$this->redirect('this');
$p->redirect('this');
}
}
}
Loading

0 comments on commit 3455df1

Please sign in to comment.