|
7 | 7 | use MichalSpacekCz\Form\DeletePersonalDataFormFactory; |
8 | 8 | use MichalSpacekCz\Form\TrainingApplicationAdminFormFactory; |
9 | 9 | use MichalSpacekCz\Form\TrainingApplicationMultipleFormFactory; |
10 | | -use MichalSpacekCz\Form\TrainingDateFormFactory; |
11 | 10 | use MichalSpacekCz\Form\TrainingFileFormFactory; |
12 | 11 | use MichalSpacekCz\Form\TrainingStatusesFormFactory; |
13 | 12 | use MichalSpacekCz\Training\Applications; |
14 | 13 | use MichalSpacekCz\Training\DateList\DateListOrder; |
15 | 14 | use MichalSpacekCz\Training\DateList\TrainingApplicationsList; |
16 | 15 | use MichalSpacekCz\Training\DateList\TrainingApplicationsListFactory; |
17 | 16 | use MichalSpacekCz\Training\Dates\TrainingDate; |
| 17 | +use MichalSpacekCz\Training\Dates\TrainingDateInputs; |
| 18 | +use MichalSpacekCz\Training\Dates\TrainingDateInputsFactory; |
18 | 19 | use MichalSpacekCz\Training\Dates\TrainingDates; |
19 | 20 | use MichalSpacekCz\Training\Dates\UpcomingTrainingDates; |
20 | 21 | use MichalSpacekCz\Training\Exceptions\TrainingApplicationDoesNotExistException; |
@@ -70,7 +71,7 @@ public function __construct( |
70 | 71 | private readonly TrainingApplicationAdminFormFactory $trainingApplicationAdminFactory, |
71 | 72 | private readonly TrainingApplicationMultipleFormFactory $trainingApplicationMultipleFormFactory, |
72 | 73 | private readonly TrainingFileFormFactory $trainingFileFormFactory, |
73 | | - private readonly TrainingDateFormFactory $trainingDateFormFactory, |
| 74 | + private readonly TrainingDateInputsFactory $trainingDateInputsFactory, |
74 | 75 | private readonly TrainingStatusesFormFactory $trainingStatusesFormFactory, |
75 | 76 | private readonly TrainingApplicationsListFactory $trainingApplicationsListFactory, |
76 | 77 | private readonly TrainingReviewInputsFactory $trainingReviewInputsFactory, |
@@ -295,25 +296,15 @@ function (Html|string $message, string $type): never { |
295 | 296 | } |
296 | 297 |
|
297 | 298 |
|
298 | | - protected function createComponentEditDate(): Form |
| 299 | + protected function createComponentEditTrainingDateInputs(): TrainingDateInputs |
299 | 300 | { |
300 | | - return $this->trainingDateFormFactory->create( |
301 | | - function (): never { |
302 | | - $this->flashMessage('Termín upraven'); |
303 | | - $this->redirect($this->getAction(), $this->redirectParam); |
304 | | - }, |
305 | | - $this->training, |
306 | | - ); |
| 301 | + return $this->trainingDateInputsFactory->createFor($this->training, $this->redirectParam); |
307 | 302 | } |
308 | 303 |
|
309 | 304 |
|
310 | | - protected function createComponentAddDate(): Form |
| 305 | + protected function createComponentAddTrainingDateInputs(): TrainingDateInputs |
311 | 306 | { |
312 | | - return $this->trainingDateFormFactory->create( |
313 | | - function (): never { |
314 | | - $this->redirect('Trainings:'); |
315 | | - }, |
316 | | - ); |
| 307 | + return $this->trainingDateInputsFactory->create(); |
317 | 308 | } |
318 | 309 |
|
319 | 310 |
|
|
0 commit comments