Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
feat: Messaging user level disable/enable (#37)
Browse files Browse the repository at this point in the history
* feat: Disable/enabling messaging

* feat: Show/hide menu disable/enable commands.

fix: Messaging around enable/disable

* fix: Side navigation to work for all conversation section

* fix: RouteParam added for all conversation controllers

* feat: Unit tests for cotroller and route param

* feat: Bump olcs-transfer
  • Loading branch information
wadedvsa authored Jan 30, 2024
1 parent 598ad36 commit 2b40632
Show file tree
Hide file tree
Showing 24 changed files with 1,166 additions and 127 deletions.
89 changes: 55 additions & 34 deletions module/Olcs/config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
use Olcs\Controller\Lva\Factory\Controller\Variation as LvaVariationControllerFactories;
use Olcs\Controller\Lva\Licence as LvaLicenceControllers;
use Olcs\Controller\Lva\Variation as LvaVariationControllers;
use Olcs\Controller\Messages\ApplicationConversationListController;
use Olcs\Controller\Messages\LicenceConversationListController;
use Olcs\Controller\Messages\LicenceConversationMessagesController;
use Olcs\Controller\Messages\LicenceEnableDisableMessagingController;
use Olcs\Controller\Messages\LicenceNewConversationController;
use Olcs\Controller\Operator as OperatorControllers;
use Olcs\Controller\Operator\HistoryController;
use Olcs\Controller\Operator\OperatorBusinessDetailsController;
Expand Down Expand Up @@ -289,27 +294,27 @@
LvaVariationControllers\SafetyController::class => LvaVariationControllerFactories\SafetyControllerFactory::class,
LvaVariationControllers\SubmitController::class => LvaVariationControllerFactories\SubmitControllerFactory::class,
LvaVariationControllers\TaxiPhvController::class => LvaVariationControllerFactories\TaxiPhvControllerFactory::class,
LvaVariationControllers\TransportManagersController::class => LvaVariationControllerFactories\TransportManagersControllerFactory::class,
LvaVariationControllers\TypeOfLicenceController::class => LvaVariationControllerFactories\TypeOfLicenceControllerFactory::class,
LvaVariationControllers\VehiclesController::class => LvaVariationControllerFactories\VehiclesControllerFactory::class,
LvaVariationControllers\VehiclesDeclarationsController::class => LvaVariationControllerFactories\VehiclesDeclarationsControllerFactory::class,
LvaVariationControllers\VehiclesPsvController::class => LvaVariationControllerFactories\VehiclesPsvControllerFactory::class,
LvaVariationControllers\WithdrawController::class => LvaVariationControllerFactories\WithdrawControllerFactory::class,
Olcs\Controller\IndexController::class => Olcs\Controller\Factory\IndexControllerFactory::class,
Olcs\Controller\Messages\LicenceConversationMessagesController::class => Olcs\Controller\Factory\Messages\LicenceConversationMessagesControllerFactory::class,
Olcs\Controller\Messages\ApplicationConversationListController::class => Olcs\Controller\Factory\Messages\ApplicationConversationListControllerFactory::class,
Olcs\Controller\Messages\LicenceConversationListController::class=> Olcs\Controller\Factory\Messages\LicenceConversationListControllerFactory::class,
Olcs\Controller\Messages\LicenceDisableConversationListController::class=> Olcs\Controller\Factory\Messages\LicenceDisableConversationListControllerFactory::class,
Olcs\Controller\Messages\LicenceNewConversationController::class=> Olcs\Controller\Factory\Messages\LicenceNewConversationControllerFactory::class,
Olcs\Controller\Messages\LicenceCloseConversationController::class => Olcs\Controller\Factory\Messages\LicenceCloseConversationControllerFactory::class,
OperatorControllers\OperatorFeesController::class => OperatorControllerFactories\OperatorFeesControllerFactory::class,
OperatorControllers\OperatorProcessingTasksController::class => OperatorControllerFactories\OperatorProcessingTasksControllerFactory::class,
OperatorControllers\UnlicensedBusinessDetailsController::class => OperatorControllerFactories\UnlicensedBusinessDetailsControllerFactory::class,
OperatorControllers\HistoryController::class => OperatorControllerFactories\HistoryControllerFactory::class,
OperatorControllers\Cases\UnlicensedCasesOperatorController::class => OperatorControllerFactories\Cases\UnlicensedCasesOperatorControllerFactory::class,
OperatorControllers\Docs\OperatorDocsController::class => OperatorControllerFactories\Docs\OperatorDocsControllerFactory::class,
OperatorControllers\OperatorController::class => OperatorControllerFactories\OperatorControllerFactory::class,
ApplicationControllers\ApplicationController::class => ApplicationControllerFactories\ApplicationControllerFactory::class,
LvaVariationControllers\TransportManagersController::class => LvaVariationControllerFactories\TransportManagersControllerFactory::class,
LvaVariationControllers\TypeOfLicenceController::class => LvaVariationControllerFactories\TypeOfLicenceControllerFactory::class,
LvaVariationControllers\VehiclesController::class => LvaVariationControllerFactories\VehiclesControllerFactory::class,
LvaVariationControllers\VehiclesDeclarationsController::class => LvaVariationControllerFactories\VehiclesDeclarationsControllerFactory::class,
LvaVariationControllers\VehiclesPsvController::class => LvaVariationControllerFactories\VehiclesPsvControllerFactory::class,
LvaVariationControllers\WithdrawController::class => LvaVariationControllerFactories\WithdrawControllerFactory::class,
Olcs\Controller\IndexController::class => Olcs\Controller\Factory\IndexControllerFactory::class,
Olcs\Controller\Messages\LicenceConversationMessagesController::class => Olcs\Controller\Factory\Messages\LicenceConversationMessagesControllerFactory::class,
Olcs\Controller\Messages\ApplicationConversationListController::class => Olcs\Controller\Factory\Messages\ApplicationConversationListControllerFactory::class,
Olcs\Controller\Messages\LicenceConversationListController::class => Olcs\Controller\Factory\Messages\LicenceConversationListControllerFactory::class,
Olcs\Controller\Messages\LicenceEnableDisableMessagingController::class => Olcs\Controller\Factory\Messages\LicenceEnableDisableMessagingControllerFactory::class,
Olcs\Controller\Messages\LicenceNewConversationController::class => Olcs\Controller\Factory\Messages\LicenceNewConversationControllerFactory::class,
Olcs\Controller\Messages\LicenceCloseConversationController::class => Olcs\Controller\Factory\Messages\LicenceCloseConversationControllerFactory::class,
OperatorControllers\OperatorFeesController::class => OperatorControllerFactories\OperatorFeesControllerFactory::class,
OperatorControllers\OperatorProcessingTasksController::class => OperatorControllerFactories\OperatorProcessingTasksControllerFactory::class,
OperatorControllers\UnlicensedBusinessDetailsController::class => OperatorControllerFactories\UnlicensedBusinessDetailsControllerFactory::class,
OperatorControllers\HistoryController::class => OperatorControllerFactories\HistoryControllerFactory::class,
OperatorControllers\Cases\UnlicensedCasesOperatorController::class => OperatorControllerFactories\Cases\UnlicensedCasesOperatorControllerFactory::class,
OperatorControllers\Docs\OperatorDocsController::class => OperatorControllerFactories\Docs\OperatorDocsControllerFactory::class,
OperatorControllers\OperatorController::class => OperatorControllerFactories\OperatorControllerFactory::class,
ApplicationControllers\ApplicationController::class => ApplicationControllerFactories\ApplicationControllerFactory::class,
ApplicationControllers\Docs\ApplicationDocsController::class => ApplicationControllerFactories\Docs\ApplicationDocsControllerFactory::class,
ApplicationControllers\Fees\ApplicationFeesController::class => ApplicationControllerFactories\Fees\ApplicationFeesControllerFactory::class,
ApplicationControllers\Processing\ApplicationProcessingOverviewController::class => ApplicationControllerFactories\Processing\ApplicationProcessingOverviewControllerFactory::class,
Expand Down Expand Up @@ -748,21 +753,22 @@
ApplicationFurniture::class => ApplicationFurniture::class,
LicenceFurniture::class => LicenceFurniture::class,
OrganisationFurniture::class => OrganisationFurniture::class,
VariationFurniture::class => VariationFurniture::class,
BusRegFurniture::class => BusRegFurniture::class,
CasesFurniture::class => CasesFurniture::class,
SubmissionsFurniture::class => SubmissionsFurniture::class,
TransportManagerFurniture::class => TransportManagerFurniture::class,
IrhpApplicationFurniture::class => IrhpApplicationFurniture::class,
Olcs\Listener\RouteParam\Cases::class => Olcs\Listener\RouteParam\Cases::class,
LicenceListener::class => LicenceListener::class,
'Olcs\Listener\RouteParam\CaseMarker' => 'Olcs\Listener\RouteParam\CaseMarker',
RouteParam\Organisation::class => RouteParam\Organisation::class,
'Olcs\Navigation\RightHandNavigation' => 'Olcs\Navigation\RightHandNavigationFactory',
HeaderSearch::class => HeaderSearch::class,
VariationFurniture::class => VariationFurniture::class,
BusRegFurniture::class => BusRegFurniture::class,
CasesFurniture::class => CasesFurniture::class,
SubmissionsFurniture::class => SubmissionsFurniture::class,
TransportManagerFurniture::class => TransportManagerFurniture::class,
IrhpApplicationFurniture::class => IrhpApplicationFurniture::class,
Olcs\Listener\RouteParam\Cases::class => Olcs\Listener\RouteParam\Cases::class,
LicenceListener::class => LicenceListener::class,
'Olcs\Listener\RouteParam\CaseMarker' => 'Olcs\Listener\RouteParam\CaseMarker',
RouteParam\Organisation::class => RouteParam\Organisation::class,
RouteParam\Conversation::class => RouteParam\Conversation::class,
'Olcs\Navigation\RightHandNavigation' => 'Olcs\Navigation\RightHandNavigationFactory',
HeaderSearch::class => HeaderSearch::class,
Olcs\Data\Mapper\BilateralApplicationValidationModifier::class =>
Olcs\Data\Mapper\BilateralApplicationValidationModifierFactory::class,
Olcs\Data\Mapper\IrhpApplication::class =>
Olcs\Data\Mapper\IrhpApplication::class =>
Olcs\Data\Mapper\IrhpApplicationFactory::class,

Olcs\Service\Permits\Bilateral\ApplicationFormPopulator::class =>
Expand Down Expand Up @@ -872,6 +878,21 @@
RouteParam\LicenceFurniture::class,
RouteParam\Licence::class,
],
LicenceEnableDisableMessagingController::class => [
RouteParam\Conversation::class,
],
ApplicationConversationListController::class => [
RouteParam\Conversation::class,
],
LicenceConversationListController::class => [
RouteParam\Conversation::class,
],
LicenceConversationMessagesController::class => [
RouteParam\Conversation::class,
],
LicenceNewConversationController::class => [
RouteParam\Conversation::class,
],
],
'search' => [
'invokables' => [
Expand Down
7 changes: 7 additions & 0 deletions module/Olcs/config/navigation.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,13 @@
'route' => 'licence/conversation/disable',
'class' => 'govuk-link--no-visited-state',
'use_route_match' => true,
],
[
'id' => 'conversation_list_enable_messaging',
'label' => 'Enable Messaging',
'route' => 'licence/conversation/enable',
'class' => 'govuk-link--no-visited-state',
'use_route_match' => true,
]
],
],
Expand Down
64 changes: 54 additions & 10 deletions module/Olcs/config/routes.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,59 @@
],
'disable' => [
'type' => 'segment',
'options' => [
'route' => 'disable[/]',
'verb' => 'GET',
'defaults' => [
'controller' => Olcs\Controller\Messages\LicenceDisableConversationListController::class,
'action' => 'index'
]
],
'may_terminate' => true,
'options' => [
'route' => 'disable[/]',
'verb' => 'GET',
'defaults' => [
'controller' => Olcs\Controller\Messages\LicenceEnableDisableMessagingController::class,
'action' => 'index',
'type' => 'disable',
]
],
'may_terminate' => true,
'child_routes' => [
'popup' => [
'type' => 'segment',
'options' => [
'route' => 'popup[/]',
'verb' => 'POST',
'defaults' => [
'controller' => Olcs\Controller\Messages\LicenceEnableDisableMessagingController::class,
'action' => 'popup',
'type' => 'disable',
],
],
'may_terminate' => true,
],
],
],
'enable' => [
'type' => 'segment',
'options' => [
'route' => 'enable[/]',
'verb' => 'GET',
'defaults' => [
'controller' => Olcs\Controller\Messages\LicenceEnableDisableMessagingController::class,
'action' => 'index',
'type' => 'enable',
]
],
'may_terminate' => true,
'child_routes' => [
'popup' => [
'type' => 'segment',
'options' => [
'route' => 'popup[/]',
'verb' => 'POST',
'defaults' => [
'controller' => Olcs\Controller\Messages\LicenceEnableDisableMessagingController::class,
'action' => 'popup',
'type' => 'enable',
],
],
'may_terminate' => true,
],
],
],
],
],
Expand Down Expand Up @@ -2642,7 +2686,7 @@
'route' => 'disable[/]',
'verb' => 'GET',
'defaults' => [
'controller' => Olcs\Controller\Messages\LicenceDisableConversationListController::class,
'controller' => Olcs\Controller\Messages\LicenceEnableDisableMessagingController::class,
'action' => 'index'
],
],
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

namespace Olcs\Controller\Factory\Messages;

use Common\Service\Data\PluginManager;
use Common\Service\Helper\ComplaintsHelperService;
use Common\Service\Helper\FlashMessengerHelperService;
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\OppositionHelperService;
use Common\Service\Helper\UrlHelperService;
use Common\Service\Script\ScriptFactory;
use Common\Service\Table\TableFactory;
use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\View\HelperPluginManager;
use Olcs\Controller\Messages\LicenceEnableDisableMessagingController;

class LicenceEnableDisableMessagingControllerFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): LicenceEnableDisableMessagingController
{
$scriptFactory = $container->get(ScriptFactory::class);
$formHelper = $container->get(FormHelperService::class);
$tableFactory = $container->get(TableFactory::class);
$viewHelperManager = $container->get(HelperPluginManager::class);
$dataServiceManager = $container->get(PluginManager::class);
$oppositionHelper = $container->get(OppositionHelperService::class);
$complaintsHelper = $container->get(ComplaintsHelperService::class);
$flashMessengerHelper = $container->get(FlashMessengerHelperService::class);
$urlHelper = $container->get(UrlHelperService::class);

return new LicenceEnableDisableMessagingController(
$scriptFactory,
$formHelper,
$tableFactory,
$viewHelperManager,
$dataServiceManager,
$oppositionHelper,
$complaintsHelper,
$flashMessengerHelper,
$urlHelper,
);
}
}
Loading

0 comments on commit 2b40632

Please sign in to comment.