Skip to content

Commit 3455df1

Browse files
authored
Update knihoven, webloader -> webpack, nette.ajax -> naja (#777)
* 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
1 parent fa98120 commit 3455df1

File tree

308 files changed

+4976
-15045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+4976
-15045
lines changed

.github/workflows/deploy-production.yml .github/workflows/deploy-manual.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: deploy-production
1+
name: deploy-manual
22

33
on:
44
workflow_dispatch:
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
deploy:
13-
name: "Deploy to production"
13+
name: "Manual deployment"
1414
environment: ${{ github.event.inputs.environment }}
1515
runs-on: ubuntu-18.04
1616
container:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Skautský rezervační systém
2-
[![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)
2+
[![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)
33

44
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.
55

app/ActionModule/Presenters/MailingPresenter.php

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use App\Model\Acl\Permission;
88
use App\Model\Acl\SrsResource;
99
use App\Model\Settings\Commands\SetSettingStringValue;
10-
use App\Model\Settings\Exceptions\SettingsItemNotFoundException;
1110
use App\Model\Settings\Queries\SettingStringValueQuery;
1211
use App\Model\Settings\Settings;
1312
use App\Services\CommandBus;
@@ -29,7 +28,6 @@ class MailingPresenter extends ActionBasePresenter
2928
/**
3029
* Ověří e-mail semináře.
3130
*
32-
* @throws SettingsItemNotFoundException
3331
* @throws AbortException
3432
* @throws Throwable
3533
*/

app/ActionModule/Presenters/MaturityPresenter.php

-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use App\Model\Enums\ApplicationState;
1010
use App\Model\Mailing\Template;
1111
use App\Model\Mailing\TemplateVariable;
12-
use App\Model\Settings\Exceptions\SettingsItemNotFoundException;
1312
use App\Model\Settings\Queries\SettingIntValueQuery;
1413
use App\Model\Settings\Queries\SettingStringValueQuery;
1514
use App\Model\Settings\Settings;
@@ -23,7 +22,6 @@
2322
use Doctrine\ORM\EntityManagerInterface;
2423
use Nette\Application\Responses\TextResponse;
2524
use Throwable;
26-
use Ublaboo\Mailing\Exception\MailingMailCreationException;
2725

2826
/**
2927
* Presenter obsluhující kontrolu splatnosti přihlášek.
@@ -51,7 +49,6 @@ class MaturityPresenter extends ActionBasePresenter
5149
/**
5250
* Zruší přihlášky po splatnosti.
5351
*
54-
* @throws SettingsItemNotFoundException
5552
* @throws Throwable
5653
*/
5754
public function actionCancelApplications(): void
@@ -108,9 +105,7 @@ public function actionCancelApplications(): void
108105
/**
109106
* Rozešle přípomínky splatnosti.
110107
*
111-
* @throws SettingsItemNotFoundException
112108
* @throws Throwable
113-
* @throws MailingMailCreationException
114109
*/
115110
public function actionSendReminders(): void
116111
{

app/AdminModule/CmsModule/Components/DocumentTagsGridControl.php

+8-18
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
use App\Model\Cms\Repositories\TagRepository;
99
use App\Model\Cms\Tag;
1010
use App\Services\AclService;
11-
use Doctrine\ORM\ORMException;
1211
use Nette\Application\AbortException;
1312
use Nette\Application\UI\Control;
1413
use Nette\Application\UI\Form;
1514
use Nette\Forms\Container;
1615
use Nette\Forms\Controls\TextInput;
17-
use Nette\Localization\ITranslator;
16+
use Nette\Localization\Translator;
1817
use stdClass;
1918
use Ublaboo\DataGrid\DataGrid;
2019
use Ublaboo\DataGrid\Exception\DataGridException;
@@ -28,7 +27,7 @@
2827
*/
2928
class DocumentTagsGridControl extends Control
3029
{
31-
private ITranslator $translator;
30+
private Translator $translator;
3231

3332
private RoleRepository $roleRepository;
3433

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

3938
public function __construct(
40-
ITranslator $translator,
39+
Translator $translator,
4140
RoleRepository $roleRepository,
4241
AclService $aclService,
4342
TagRepository $tagRepository
@@ -121,9 +120,6 @@ public function createComponentDocumentTagsGrid(string $name): void
121120

122121
/**
123122
* Zpracuje přidání štítku dokumentu.
124-
*
125-
* @throws ORMException
126-
* @throws AbortException
127123
*/
128124
public function add(stdClass $values): void
129125
{
@@ -135,15 +131,11 @@ public function add(stdClass $values): void
135131
$this->tagRepository->save($tag);
136132

137133
$this->getPresenter()->flashMessage('admin.cms.documents.tags.message.save_success', 'success');
138-
139-
$this->redirect('this');
134+
$this->getPresenter()->redrawControl('flashes');
140135
}
141136

142137
/**
143138
* Zpracuje úpravu štítku dokumentu.
144-
*
145-
* @throws ORMException
146-
* @throws AbortException
147139
*/
148140
public function edit(string $id, stdClass $values): void
149141
{
@@ -155,23 +147,21 @@ public function edit(string $id, stdClass $values): void
155147
$this->tagRepository->save($tag);
156148

157149
$this->getPresenter()->flashMessage('admin.cms.documents.tags.message.save_success', 'success');
158-
159-
$this->redirect('this');
150+
$this->getPresenter()->redrawControl('flashes');
160151
}
161152

162153
/**
163154
* Zpracuje odstranění štítku dokumentu.
164155
*
165-
* @throws ORMException
166156
* @throws AbortException
167157
*/
168158
public function handleDelete(int $id): void
169159
{
170160
$tag = $this->tagRepository->findById($id);
171161
$this->tagRepository->remove($tag);
172162

173-
$this->getPresenter()->flashMessage('admin.cms.documents.tags.message.delete_success', 'success');
174-
175-
$this->redirect('this');
163+
$p = $this->getPresenter();
164+
$p->flashMessage('admin.cms.documents.tags.message.delete_success', 'success');
165+
$p->redirect('this');
176166
}
177167
}

app/AdminModule/CmsModule/Components/DocumentsGridControl.php

+9-19
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
use App\Services\FilesService;
1111
use App\Utils\Helpers;
1212
use DateTimeImmutable;
13-
use Doctrine\ORM\ORMException;
1413
use Nette\Application\AbortException;
1514
use Nette\Application\UI\Control;
1615
use Nette\Application\UI\Form;
1716
use Nette\Forms\Container;
1817
use Nette\Http\FileUpload;
19-
use Nette\Localization\ITranslator;
18+
use Nette\Localization\Translator;
2019
use Nette\Utils\Html;
2120
use stdClass;
2221
use Ublaboo\DataGrid\DataGrid;
@@ -32,7 +31,7 @@
3231
*/
3332
class DocumentsGridControl extends Control
3433
{
35-
private ITranslator $translator;
34+
private Translator $translator;
3635

3736
private DocumentRepository $documentRepository;
3837

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

4342
public function __construct(
44-
ITranslator $translator,
43+
Translator $translator,
4544
DocumentRepository $documentRepository,
4645
TagRepository $tagRepository,
4746
FilesService $filesService
@@ -95,7 +94,7 @@ public function createComponentDocumentsGrid(string $name): void
9594
->setAttribute('href', $document->getFile())
9695
->setAttribute('target', '_blank')
9796
->setAttribute('class', 'btn btn-xs btn-secondary')
98-
->addHtml(Html::el('span')->setAttribute('class', 'fa fa-download'))
97+
->addHtml(Html::el('span')->setAttribute('class', 'fa fa-file-arrow-down'))
9998
->addText(' ' . basename($document->getFile()));
10099
});
101100

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

153152
/**
154153
* Zpracuje přidání dokumentu.
155-
*
156-
* @throws ORMException
157-
* @throws AbortException
158154
*/
159155
public function add(stdClass $values): void
160156
{
@@ -172,15 +168,11 @@ public function add(stdClass $values): void
172168
$this->documentRepository->save($document);
173169

174170
$this->getPresenter()->flashMessage('admin.cms.documents.message.save_success', 'success');
175-
176-
$this->redirect('this');
171+
$this->getPresenter()->redrawControl('flashes');
177172
}
178173

179174
/**
180175
* Zpracuje úpravu dokumentu.
181-
*
182-
* @throws ORMException
183-
* @throws AbortException
184176
*/
185177
public function edit(string $id, stdClass $values): void
186178
{
@@ -202,14 +194,12 @@ public function edit(string $id, stdClass $values): void
202194
$this->documentRepository->save($document);
203195

204196
$this->getPresenter()->flashMessage('admin.cms.documents.message.save_success', 'success');
205-
206-
$this->redirect('this');
197+
$this->getPresenter()->redrawControl('flashes');
207198
}
208199

209200
/**
210201
* Zpracuje odstranění dokumentu.
211202
*
212-
* @throws ORMException
213203
* @throws AbortException
214204
*/
215205
public function handleDelete(int $id): void
@@ -218,8 +208,8 @@ public function handleDelete(int $id): void
218208
$this->filesService->delete($document->getFile());
219209
$this->documentRepository->remove($document);
220210

221-
$this->getPresenter()->flashMessage('admin.cms.documents.message.delete_success', 'success');
222-
223-
$this->redirect('this');
211+
$p = $this->getPresenter();
212+
$p->flashMessage('admin.cms.documents.message.delete_success', 'success');
213+
$p->redirect('this');
224214
}
225215
}

app/AdminModule/CmsModule/Components/FaqGridControl.php

+10-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Doctrine\ORM\ORMException;
1010
use Nette\Application\AbortException;
1111
use Nette\Application\UI\Control;
12-
use Nette\Localization\ITranslator;
12+
use Nette\Localization\Translator;
1313
use Ublaboo\DataGrid\DataGrid;
1414
use Ublaboo\DataGrid\Exception\DataGridColumnStatusException;
1515
use Ublaboo\DataGrid\Exception\DataGridException;
@@ -19,11 +19,11 @@
1919
*/
2020
class FaqGridControl extends Control
2121
{
22-
private ITranslator $translator;
22+
private Translator $translator;
2323

2424
private FaqRepository $faqRepository;
2525

26-
public function __construct(ITranslator $translator, FaqRepository $faqRepository)
26+
public function __construct(Translator $translator, FaqRepository $faqRepository)
2727
{
2828
$this->translator = $translator;
2929
$this->faqRepository = $faqRepository;
@@ -93,17 +93,16 @@ public function createComponentFaqGrid(string $name): DataGrid
9393
/**
9494
* Zpracuje odstranění otázky.
9595
*
96-
* @throws ORMException
9796
* @throws AbortException
9897
*/
9998
public function handleDelete(int $id): void
10099
{
101100
$faq = $this->faqRepository->findById($id);
102101
$this->faqRepository->remove($faq);
103102

104-
$this->getPresenter()->flashMessage('admin.cms.faq.message.delete_success', 'success');
105-
106-
$this->redirect('this');
103+
$p = $this->getPresenter();
104+
$p->flashMessage('admin.cms.faq.message.delete_success', 'success');
105+
$p->redirect('this');
107106
}
108107

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

122121
if ($p->isAjax()) {
123122
$p->redrawControl('flashes');
124-
$faqGrid = $this->getComponent('faqGrid');
125-
$faqGrid->reload();
123+
$this->getComponent('faqGrid')->reload();
126124
} else {
127-
$this->redirect('this');
125+
$p->redirect('this');
128126
}
129127
}
130128

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

147145
if ($p->isAjax()) {
148146
$p->redrawControl('flashes');
149-
$faqGrid = $this->getComponent('faqGrid');
150-
$faqGrid->redrawItem($id);
147+
$this->getComponent('faqGrid')->redrawItem($id);
151148
} else {
152-
$this->redirect('this');
149+
$p->redirect('this');
153150
}
154151
}
155152
}

app/AdminModule/CmsModule/Components/NewsGridControl.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Doctrine\ORM\ORMException;
1010
use Nette\Application\AbortException;
1111
use Nette\Application\UI\Control;
12-
use Nette\Localization\ITranslator;
12+
use Nette\Localization\Translator;
1313
use Ublaboo\DataGrid\DataGrid;
1414
use Ublaboo\DataGrid\Exception\DataGridColumnStatusException;
1515
use Ublaboo\DataGrid\Exception\DataGridException;
@@ -19,11 +19,11 @@
1919
*/
2020
class NewsGridControl extends Control
2121
{
22-
private ITranslator $translator;
22+
private Translator $translator;
2323

2424
private NewsRepository $newsRepository;
2525

26-
public function __construct(ITranslator $translator, NewsRepository $newsRepository)
26+
public function __construct(Translator $translator, NewsRepository $newsRepository)
2727
{
2828
$this->translator = $translator;
2929
$this->newsRepository = $newsRepository;
@@ -89,17 +89,16 @@ public function createComponentNewsGrid(string $name): DataGrid
8989
/**
9090
* Zpracuje odstranění aktuality.
9191
*
92-
* @throws ORMException
9392
* @throws AbortException
9493
*/
9594
public function handleDelete(int $id): void
9695
{
9796
$news = $this->newsRepository->findById($id);
9897
$this->newsRepository->remove($news);
9998

100-
$this->getPresenter()->flashMessage('admin.cms.news.message.delete_success', 'success');
101-
102-
$this->redirect('this');
99+
$p = $this->getPresenter();
100+
$p->flashMessage('admin.cms.news.message.delete_success', 'success');
101+
$p->redirect('this');
103102
}
104103

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

120119
if ($p->isAjax()) {
121120
$p->redrawControl('flashes');
122-
$newsGrid = $this->getComponent('newsGrid');
123-
$newsGrid->redrawItem($id);
121+
$this->getComponent('newsGrid')->redrawItem($id);
124122
} else {
125-
$this->redirect('this');
123+
$p->redirect('this');
126124
}
127125
}
128126
}

0 commit comments

Comments
 (0)