Skip to content

Commit

Permalink
fix: Disable reply on closed conversations (dvsa/olcs-internal#88)
Browse files Browse the repository at this point in the history
* feat: OLCS packages to dev-project/messaging (dvsa/olcs-internal#24)

* feat: Internal messaging - Reply to a message - MVP (dvsa/olcs-internal#18)

* feat: Conversation Reply. Form complete with post to non functional BE.

* feat: Dispatch reply to BE. Hide attachment.

* feat: .phpstorm.meta.php for ocls-internal

* fix: Alias Create for readability

* fix: Remove strong type from close factory (dvsa/olcs-internal#25)

* fix: On successful message reply, clear the textarea (dvsa/olcs-internal#33)

* feat: Composer update for transfer/common after main merge

* fix: After replying to a conversation, redirect to prevent re-submit (dvsa/olcs-internal#41)

* fix: After replying to a conversation, redirect to prevent re-submit

* feat: Add flash message

* feat: Messaging user level disable/enable (dvsa/olcs-internal#37)

* 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

* fix: Non local white screens when using strong types for the container (dvsa/olcs-internal#45)

* fix: Non local white screens when using strong types for the container (tests) (dvsa/olcs-internal#47)

* feat: Update messaging disable text for new AC. (dvsa/olcs-internal#48)

* feat: Create Conversation form & template (dvsa/olcs-internal#6)

* First Commit of form

* Changed route to get add action

* Organisation form list service

* Added connection to query

* modified category

* Added organisatin and drop down sub category

* added new controller form alter fn, removed organisation

* removed broken query

* Add usage of ByLicenceToOrganisation for licence list

* Review suggestions

* Remove extra case; Whitespace edits

* Choose query based on param presence

* Abstract & split controller

* Review comments and housekeeping

* Remove unused code for tweaking route match

* Remove asserts; Whitespace

* fix: Remove strong type from close factory

* Fix inconsistent label

* Renaming

* Add data service and use in form

* Update transfer

* wip: so far

* fix: introduced redirect by mistake for localtest

* fix: reverted EnvironmentComplaintController to main

* fix: remove dd

* Redirection config

* Whitespace

* Remove unused from config

* Use licence id from response to redirect

* Bump transfer & common

* Review suggestions

---------

Co-authored-by: Jamie_gordon_1 <[email protected]>
Co-authored-by: Saul Wilcox <[email protected]>
Co-authored-by: wadedvsa <[email protected]>
Co-authored-by: James Wragg <[email protected]>

* fix: Listeners for Create Conversation controllers (dvsa/olcs-internal#58)

* Fix config to use listeners

* Remove old class

---------

Co-authored-by: Saul Wilcox <[email protected]>

* fix: Add horizontal navgation to enable/disable messaging page (dvsa/olcs-internal#72)

* feat: Task messaging filter (home page) (dvsa/olcs-internal#76)

* feat: Task messaging filter (home page)

* feat: olcs-transfer composer bump

* chore: removed DataService and use one in common

* Revert "chore: removed DataService and use one in common"

This reverts commit 12898f1a8d72d96f1cb448e0d0bbd1da45e8908b.

* chore: moved dataservice for applicno to common (dvsa/olcs-internal#80)

* chore: removed DataService and use one in common

* bump: olcs-common

* chore: bump olcs-common and olcs-transfer

* feat: Extend messaging to applications (dvsa/olcs-internal#81)

* feat: Extend support of messaging to application nav

* feat: Extend support of messaging to application nav

* feat: Strong type aliases

* fix: Cleaner controller code

* fix: declare strict_types

* Revert "fix: Cleaner controller code"

This reverts commit 7650b454036e4c1f2c1badae5b416434c5b82270.

* fix: PR change to thrown exception

* feat: Bump olcs-common

* fix: Update route param test for application routes (dvsa/olcs-internal#83)

* fix: Add missing licence (and application) headers to a few messaging pages (dvsa/olcs-internal#85)

* fix: Disable reply on closed conversations

* fix: Merge bug

* fix: Merge issues

* fix: Merge bugs

* fix: Merge error

* chore: Factory cleanup

---------

Co-authored-by: Saul Wilcox <[email protected]>
Co-authored-by: Jamie_gordon_1 <[email protected]>
Co-authored-by: Saul Wilcox <[email protected]>
Co-authored-by: James Wragg <[email protected]>
Co-authored-by: James Wragg <[email protected]>
  • Loading branch information
6 people authored Feb 19, 2024
1 parent 7cd8fb9 commit aa69102
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Olcs\Controller\Factory\Messages;

use Common\Service\Helper\FlashMessengerHelperService;
Expand All @@ -11,22 +13,11 @@

class ApplicationCreateConversationControllerFactory implements FactoryInterface
{
/**
* @param ContainerInterface $container
* @param $requestedName
* @param array|null $options
* @return ApplicationCreateConversationController
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): ApplicationCreateConversationController
{
$container = method_exists($container, 'getServiceLocator') ? $container->getServiceLocator() : $container;

$formHelper = $container->get(FormHelperService::class);

$translationHelper = $container->get(TranslationHelperService::class);

$flashMessenger = $container->get(FlashMessengerHelperService::class);

$navigation = $container->get('navigation');

return new ApplicationCreateConversationController(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Common\Service\Helper\UrlHelperService;
use Common\Service\Script\ScriptFactory;
use Common\Service\Table\TableFactory;
use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\View\HelperPluginManager;
use Olcs\Controller\Messages\ApplicationEnableDisableMessagingController;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
<?php

declare(strict_types=1);

namespace Olcs\Controller\Factory\Messages;

use Common\Service\Helper\FlashMessengerHelperService;
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\TranslationHelperService;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Olcs\Controller\Messages\LicenceCreateConversationController;
use Psr\Container\NotFoundExceptionInterface;

class LicenceCreateConversationControllerFactory implements FactoryInterface
{
/**
* @param ContainerInterface $container
* @param $requestedName
* @param array|null $options
* @return LicenceCreateConversationController
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): LicenceCreateConversationController
{
$formHelper = $container->get(FormHelperService::class);

$translationHelper = $container->get(TranslationHelperService::class);

$flashMessenger = $container->get(FlashMessengerHelperService::class);

$navigation = $container->get('navigation');

return new LicenceCreateConversationController(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ public function indexAction()
$actionsForm = $this->getForm(LicenceMessageActions::class);
$actionsForm->get('id')->setValue($this->params()->fromRoute('conversation'));

$this->placeholder()->setPlaceholder('can-reply', true);
if ($response->getResult()['extra']['conversation']['isClosed']) {
$actionsForm->get('form-actions')->get('close')->setAttribute('disabled', 'disabled');
$actionsForm->get('form-actions')->get('close')->setAttribute(
'class',
'govuk-button govuk-button--warning govuk-button--disabled'
);
$this->placeholder()->setPlaceholder('can-reply', false);
}

$this->placeholder()->setPlaceholder('message-actions', $actionsForm);
Expand Down
27 changes: 15 additions & 12 deletions app/internal/module/Olcs/view/pages/conversation/messages.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@
</div>
</div>

<details class="govuk-details" data-module="govuk-details">
<summary class="govuk-details__summary" aria-controls="details-content-operating-centre">

<?php if ($this->placeholder('can-reply')->getValue()): ?>
<details class="govuk-details" data-module="govuk-details">
<summary class="govuk-details__summary" aria-controls="details-content-operating-centre">
<span class="govuk-details__summary-text">
Send a reply
</span>
</summary>
<div class="govuk-details__text" id="details-content-operating-centre">
<?php
/** @var \Common\Form\Form $replyForm */
$replyForm = $this->placeholder('send-reply')->getValue();
</summary>
<div class="govuk-details__text" id="details-content-operating-centre">
<?php
/** @var \Common\Form\Form $replyForm */
$replyForm = $this->placeholder('send-reply')->getValue();

echo $this->formErrors($replyForm);
echo $this->form($replyForm);
?>
</div>
</details>
echo $this->formErrors($replyForm);
echo $this->form($replyForm);
?>
</div>
</details>
<?php endif; ?>

<?php echo $this->placeholder('table')->getValue(); ?>

0 comments on commit aa69102

Please sign in to comment.