-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# This is a combination of 13 commits.
# This is the 1st commit message: WIP # This is the commit message dvsa/olcs-internal#2: WIP # This is the commit message dvsa/olcs-internal#3: WIP # This is the commit message dvsa/olcs-internal#4: WIP # This is the commit message dvsa/olcs-internal#5: WIP # This is the commit message dvsa/olcs-internal#6: WIP # This is the commit message dvsa/olcs-internal#7: WIP # This is the commit message dvsa/olcs-internal#8: WIP # This is the commit message dvsa/olcs-internal#9: WIP # This is the commit message dvsa/olcs-internal#10: WIP # This is the commit message dvsa/olcs-internal#11: WIP # This is the commit message dvsa/olcs-internal#12: WIP # This is the commit message dvsa/olcs-internal#13: WIP WIP WIP WIP WIP VOL-3915: refactor ApplicationProcessingInspectionRequestController and a new factory VOL-3915: add factories in OLCS/src/Controller/Application VOL-3915: fix ApplicationProcessingOverviewControllerTest tests VOL-3915: remove all getServiceLocators in ApplicationController and corresponding factory and test VOL-3915: remove getServiceLocators in Controller\Bus and corresponding factories VOL-3915: tidy tests and controllers (BusDetails/BusProcessing/BusService) VOL-3915: AbstractHistory controller and factory VOL-3915: fix ConfirmTest unit tests VOL-3915: fix construct for ConditionUndertakingController and factory VOL-3915: remove all getServiceLocators in Application/Overview and Penalty Controllers and corresponding factories VOL-3915: CasesController and corresponding factory VOL-3915: remove all getServiceLocators in ApplicationProcessingController and corresponding factory VOL-3915: remove all getServiceLocators in IrhpApplicationController and corresponding factory VOL-3915: remove all getServiceLocators in ApplicationProcessingController, LicenceController and SurrenderControllers VOL-3915: remove all getServiceLocators in OperatorController and LicenceController VOL-3915: remove all getServiceLocators in Application/ProcessingController and TransportManagerController VOL-3915: replaced routes declared in invokable with abstractInternalController and corresponding files VOL-3915: tidy up of modules and factories VOL-3915: replaced invokable and strings that extended abstractHistoryController VOL-3915: add factories for Applications/ Cases/ IrhpPermits/ Operator VOL-3915: tidy up - add factories for Bus/ Cases/ TransportManager VOL-3915: fix unit test (ConfirmTest) VOL-3915: add factories for Applications/ Cases/ IrhpPermits/ Operator VOL-3915: add correct path to navigation VOL-3915: add factories for Sla directory VOL-3915: /Admin add factories for DataRetention and controller Remove gSL and add factories for History & Disqualify controllers Fix disqualify & others Revert "Fix disqualify & others" This reverts commit e0fb5f90c384d54681e63fa1d133b3065e1bdd08. VOL-3915: add factories for rest of Admin directory VOL-3915: white screen corrections WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP
- Loading branch information
Showing
576 changed files
with
23,103 additions
and
4,122 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/internal/module/Admin/src/Controller/BusNoticePeriodControllerFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Admin\Controller; | ||
|
||
use Common\Service\Helper\FlashMessengerHelperService; | ||
use Common\Service\Helper\FormHelperService; | ||
use Common\Service\Helper\TranslationHelperService; | ||
use Interop\Container\ContainerInterface; | ||
use Laminas\Navigation\Navigation; | ||
use Laminas\ServiceManager\FactoryInterface; | ||
use Laminas\ServiceManager\ServiceLocatorInterface; | ||
|
||
class BusNoticePeriodControllerFactory implements FactoryInterface | ||
{ | ||
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): BusNoticePeriodController | ||
{ | ||
$translationHelper = $container->get(TranslationHelperService::class); | ||
assert($translationHelper instanceof TranslationHelperService); | ||
|
||
$formHelperService = $container->get(FormHelperService::class); | ||
assert($formHelperService instanceof FormHelperService); | ||
|
||
$flashMessenger = $container->get(FlashMessengerHelperService::class); | ||
assert($flashMessenger instanceof FlashMessengerHelperService); | ||
|
||
$navigation = $container->get('navigation'); | ||
assert($navigation instanceof Navigation); | ||
|
||
return new BusNoticePeriodController( | ||
$translationHelper, | ||
$formHelperService, | ||
$flashMessenger, | ||
$navigation | ||
); | ||
} | ||
public function createService(ServiceLocatorInterface $serviceLocator): BusNoticePeriodController | ||
{ | ||
$container = method_exists($serviceLocator, 'getServiceLocator') ? $serviceLocator->getServiceLocator() : $serviceLocator; | ||
|
||
return $this->__invoke( | ||
$container, | ||
BusNoticePeriodController::class | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/internal/module/Admin/src/Controller/CompaniesHouseAlertControllerFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Admin\Controller; | ||
|
||
use Common\Service\Helper\FlashMessengerHelperService; | ||
use Common\Service\Helper\FormHelperService; | ||
use Common\Service\Helper\TranslationHelperService; | ||
use Interop\Container\ContainerInterface; | ||
use Laminas\Navigation\Navigation; | ||
use Laminas\ServiceManager\FactoryInterface; | ||
use Laminas\ServiceManager\ServiceLocatorInterface; | ||
use Laminas\View\HelperPluginManager; | ||
|
||
class CompaniesHouseAlertControllerFactory implements FactoryInterface | ||
{ | ||
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): CompaniesHouseAlertController | ||
{ | ||
$translationHelperService = $container->get(TranslationHelperService::class); | ||
assert($translationHelperService instanceof TranslationHelperService); | ||
|
||
$formHelperService = $container->get(FormHelperService::class); | ||
assert($formHelperService instanceof FormHelperService); | ||
|
||
$flashMessengerHelperService = $container->get(FlashMessengerHelperService::class); | ||
assert($flashMessengerHelperService instanceof FlashMessengerHelperService); | ||
|
||
$navigation = $container->get('navigation'); | ||
assert($navigation instanceof Navigation); | ||
|
||
$viewHelperManager = $container->get('ViewHelperManager'); | ||
assert($viewHelperManager instanceof HelperPluginManager); | ||
|
||
return new CompaniesHouseAlertController( | ||
$translationHelperService, | ||
$formHelperService, | ||
$flashMessengerHelperService, | ||
$navigation, | ||
$viewHelperManager | ||
); | ||
} | ||
public function createService(ServiceLocatorInterface $serviceLocator): CompaniesHouseAlertController | ||
{ | ||
$container = method_exists($serviceLocator, 'getServiceLocator') ? $serviceLocator->getServiceLocator() : $serviceLocator; | ||
|
||
return $this->__invoke( | ||
$container, | ||
CompaniesHouseAlertController::class | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,49 @@ | |
|
||
namespace Admin\Controller; | ||
|
||
use Laminas\View\Model\ViewModel; | ||
use Common\Controller\Lva\Traits\CrudActionTrait; | ||
use Dvsa\Olcs\Transfer\Query\ContinuationDetail\ChecklistReminders as ChecklistRemindersQry; | ||
use Common\Service\Helper\DateHelperService; | ||
use Common\Service\Helper\FlashMessengerHelperService; | ||
use Common\Service\Helper\FormHelperService; | ||
use Common\Service\Helper\ResponseHelperService; | ||
use Common\Service\Script\ScriptFactory; | ||
use Common\Service\Table\TableFactory; | ||
use Dvsa\Olcs\Transfer\Command\ContinuationDetail\Queue as QueueCmd; | ||
use Dvsa\Olcs\Transfer\Query\ContinuationDetail\ChecklistReminders as ChecklistRemindersQry; | ||
use Laminas\View\Helper\Placeholder; | ||
use Laminas\View\Model\ViewModel; | ||
|
||
/** | ||
* ContinuationChecklistReminderController | ||
* | ||
* @author Mat Evans <[email protected]> | ||
* @author Alex Peshkov <[email protected]> | ||
*/ | ||
class ContinuationChecklistReminderController extends AbstractController | ||
{ | ||
const TYPE_CONT_CHECKLIST_REMINDER_GENERATE_LETTER = 'que_typ_cont_check_rem_gen_let'; | ||
public const TYPE_CONT_CHECKLIST_REMINDER_GENERATE_LETTER = 'que_typ_cont_check_rem_gen_let'; | ||
|
||
use CrudActionTrait; | ||
|
||
protected DateHelperService $dateHelper; | ||
protected FlashMessengerHelperService $flashMessengerHelper; | ||
protected ScriptFactory $scriptFactory; | ||
protected FormHelperService $formHelper; | ||
protected ResponseHelperService $responseHelper; | ||
protected TableFactory $tableFactory; | ||
|
||
public function __construct( | ||
Placeholder $placeholder, | ||
DateHelperService $dateHelper, | ||
FlashMessengerHelperService $flashMessengerHelper, | ||
ScriptFactory $scriptFactory, | ||
FormHelperService $formHelper, | ||
ResponseHelperService $responseHelper, | ||
TableFactory $tableFactory | ||
) { | ||
parent::__construct($placeholder); | ||
$this->dateHelper = $dateHelper; | ||
$this->flashMessengerHelper = $flashMessengerHelper; | ||
$this->scriptFactory = $scriptFactory; | ||
$this->formHelper = $formHelper; | ||
$this->responseHelper = $responseHelper; | ||
$this->tableFactory = $tableFactory; | ||
} | ||
|
||
/** | ||
* Display a list of Continuation checklist reminders | ||
* | ||
|
@@ -37,7 +63,7 @@ public function indexAction() | |
} | ||
} | ||
|
||
$nowDate = $this->getServiceLocator()->get('Helper\Date')->getDate('Y-m'); | ||
$nowDate = $this->dateHelper->getDate('Y-m'); | ||
list($year, $month) = explode('-', $nowDate); | ||
|
||
$filterForm = $this->getChecklistReminderFilterForm($month, $year); | ||
|
@@ -54,7 +80,7 @@ public function indexAction() | |
) | ||
); | ||
if ($response->isServerError() || $response->isClientError()) { | ||
$this->getServiceLocator()->get('Helper\FlashMessenger')->addErrorMessage('unknown-error'); | ||
$this->flashMessengerHelper->addErrorMessage('unknown-error'); | ||
} | ||
$results = []; | ||
$total = 0; | ||
|
@@ -67,13 +93,12 @@ public function indexAction() | |
$subTitle = date('M Y', strtotime($year . '-' . $month . '-01')); | ||
$table->setVariable('title', $subTitle .': '. $total . ' licence(s)'); | ||
|
||
$this->getServiceLocator()->get('Script')->loadFiles(['forms/filter', 'forms/crud-table-handler']); | ||
$this->scriptFactory->loadFiles(['forms/filter', 'forms/crud-table-handler']); | ||
|
||
$view = new ViewModel(['table' => $table, 'filterForm' => $filterForm]); | ||
$view->setTemplate('pages/table'); | ||
|
||
$this->getServiceLocator()->get('viewHelperManager')->get('placeholder') | ||
->getContainer('tableFilters')->set($filterForm); | ||
$this->placeholder->getContainer('tableFilters')->set($filterForm); | ||
$this->setNavigationId('admin-dashboard/continuations'); | ||
|
||
return $this->renderView($view, 'admin-generate-continuation-details-title'); | ||
|
@@ -99,7 +124,7 @@ protected function getChecklistReminderFilterForm($defaultMonth, $defaultYear) | |
|
||
$filters = array_merge($defaults, $queryData); | ||
|
||
$formHelper = $this->getServiceLocator()->get('Helper\Form'); | ||
$formHelper = $this->formHelper; | ||
$form = $formHelper->createForm('ChecklistReminderFilter', false) | ||
->setData(['filters' => $filters]); | ||
|
||
|
@@ -129,7 +154,7 @@ public function generateLettersAction() | |
] | ||
) | ||
); | ||
$flashMessenger = $this->getServiceLocator()->get('Helper\FlashMessenger'); | ||
$flashMessenger = $this->flashMessengerHelper; | ||
if ($response->isClientError() || $response->isServerError()) { | ||
$flashMessenger->addErrorMessage('The checklist reminder letters could not be generated, please try again'); | ||
} | ||
|
@@ -154,7 +179,7 @@ public function exportAction() | |
ChecklistRemindersQry::create(['ids' => $continuationDetailIds]) | ||
); | ||
if ($response->isServerError() || $response->isClientError()) { | ||
$this->getServiceLocator()->get('Helper\FlashMessenger')->addErrorMessage('unknown-error'); | ||
$this->flashMessengerHelper->addErrorMessage('unknown-error'); | ||
return $this->redirect()->toRouteAjax(null, ['action' => null, 'child_id' => null], [], true); | ||
} | ||
$results = []; | ||
|
@@ -164,7 +189,7 @@ public function exportAction() | |
|
||
$table = $this->getTable($results); | ||
|
||
$helper = $this->getServiceLocator()->get('Helper\Response'); | ||
$helper = $this->responseHelper; | ||
return $helper->tableToCsv($this->getResponse(), $table, 'Checklist reminder list'); | ||
} | ||
|
||
|
@@ -177,8 +202,7 @@ public function exportAction() | |
*/ | ||
protected function getTable($results) | ||
{ | ||
$table = $this->getServiceLocator()->get('Table') | ||
->prepareTable('admin-continuations-checklist', $results); | ||
$table = $this->tableFactory->prepareTable('admin-continuations-checklist', $results); | ||
|
||
return $table; | ||
} | ||
|
Oops, something went wrong.