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

fix: resolve search issues #24

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
use Common\Service\Helper\TranslationHelperService;
use Common\Service\Script\ScriptFactory;
use Dvsa\Olcs\Utils\Translation\NiTextTranslation;
use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Olcs\Controller\Search\SearchController;
use LmcRbacMvc\Service\AuthorizationService;
use Psr\Container\ContainerInterface;

class SearchControllerFactory implements FactoryInterface
{
Expand Down
11 changes: 2 additions & 9 deletions module/Olcs/src/Form/Element/SearchDateRangeFieldsetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

namespace Olcs\Form\Element;

use Interop\Container\ContainerInterface;
use Common\Service\Data\Search\Search;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Psr\Container\ContainerInterface;

class SearchDateRangeFieldsetFactory implements FactoryInterface
{
protected $options;

public function __construct($options)
{
$this->options = $options;
}

/**
* @param ContainerInterface $container
* @param $requestedName
Expand All @@ -25,7 +18,7 @@ public function __construct($options)
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : SearchDateRangeFieldset
{
$fs = new SearchDateRangeFieldset($this->options['name'], $this->options);
$fs = new SearchDateRangeFieldset($options['name'], $options);
$fs->setSearchService($container->get('DataServiceManager')->get(Search::class));
return $fs;
}
Expand Down
11 changes: 2 additions & 9 deletions module/Olcs/src/Form/Element/SearchFilterFieldsetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

namespace Olcs\Form\Element;

use Interop\Container\ContainerInterface;
use Common\Service\Data\Search\Search;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Psr\Container\ContainerInterface;

class SearchFilterFieldsetFactory implements FactoryInterface
{
protected $options;

public function __construct($options)
{
$this->options = $options;
}

/**
* @param ContainerInterface $container
* @param $requestedName
Expand All @@ -25,7 +18,7 @@ public function __construct($options)
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : SearchFilterFieldset
{
$fs = new SearchFilterFieldset($this->options['name'], $this->options);
$fs = new SearchFilterFieldset($options['name'], $options);

$fs->setSearchService($container->get('DataServiceManager')->get(Search::class));
return $fs;
Expand Down
11 changes: 2 additions & 9 deletions module/Olcs/src/Form/Element/SearchOrderFieldsetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

namespace Olcs\Form\Element;

use Interop\Container\ContainerInterface;
use Common\Service\Data\Search\Search;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Psr\Container\ContainerInterface;

class SearchOrderFieldsetFactory implements FactoryInterface
{
protected $options;

public function __construct($options)
{
$this->options = $options;
}

/**
* @param ContainerInterface $container
* @param $requestedName
Expand All @@ -25,7 +18,7 @@ public function __construct($options)
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : SearchOrderFieldset
{
$fs = new SearchOrderFieldset($this->options['name'], $this->options);
$fs = new SearchOrderFieldset($options['name'], $options);
$fs->setSearchService($container->get('DataServiceManager')->get(Search::class));
return $fs;
}
Expand Down
2 changes: 1 addition & 1 deletion module/Olcs/src/Form/Model/Form/SimpleSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @Form\Name("simple-search")
* @Form\Attributes({"method":"post", "action":"", "role":"search"})
* @Form\Hydrator("Laminas\Stdlib\Hydrator\ArraySerializable")
* @Form\Hydrator("Laminas\Hydrator\ArraySerializableHydrator")
*/
class SimpleSearch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @Form\Name("transport-manager-application-resend")
* @Form\Attributes({"method":"post", "action":""})
* @Form\Hydrator("Laminas\Stdlib\Hydrator\ArraySerializable")
* @Form\Hydrator("Laminas\Hydrator\ArraySerializableHydrator")
*/
class TransportManagerApplicationResend
{
Expand Down
6 changes: 1 addition & 5 deletions module/Olcs/view/layouts/main-search-results.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ if(!empty($this->results)) {
$results = $this->results;
}


/** @var \Common\Service\Helper\TranslationHelperService $translationHlp */
$translationHlp = $this->getHelperPluginManager()->get('Helper\Translation');

echo $this->partial(
'partials/page-header-simple',
[
'pageTitle' => $this->translate('search.result.title.' . $this->index),
'pageHeaderText' =>
'<p>' . $translationHlp->translateReplace('search.result.subtitle.' . $this->index, [$count]) . '</p>' .
'<p>' . $this->translateReplace('search.result.subtitle.' . $this->index, [$count]) . '</p>' .
(
$this->index === 'publication'
? '<p>' . $this->translate('search.result.subtitle.publication.download') .'</p>'
Expand Down
8 changes: 2 additions & 6 deletions module/Olcs/view/olcs/user-forgot-username/check-email.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
<div class="page-header__wrapper">
<h1><?php echo $this->translate('user-forgot-username.page.check-email.title'); ?></h1>
<div class="page-header__text"><div class="govuk-inset-text"><p>
<?php echo $this->getHelperPluginManager()
->get('Helper\Translation')
->translateReplace('user-forgot-username.page.check-email.guidance', [$this->emailAddress]); ?>
<?php echo $this->translateReplace('user-forgot-username.page.check-email.guidance', [$this->emailAddress]); ?>
</p></div></div>
</div><!-- .page-header__wrapper -->
</div><!-- .page-header -->
<div class="two-thirds">
<div class="article">
<p>
<?php echo $this->getHelperPluginManager()
->get('Helper\Translation')
->translateReplace(
<?php echo $this->translateReplace(
'user-forgot-username.page.check-email.content',
[
$this->getHelperPluginManager()->get('Helper\Url')->fromRoute('auth/login/GET')
Expand Down
10 changes: 3 additions & 7 deletions module/Olcs/view/olcs/user-registration/check-email.phtml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
/** @var \Common\Service\Helper\TranslationHelperService $translationHlp */
$translationHlp = $this->getHelperPluginManager()->get('Helper\Translation');

echo $this->partial(
'partials/page-header-simple',
[
'pageTitle' => $this->pageTitle(),
'pageHeaderText' =>
'<div class="govuk-inset-text"><p>' .
$translationHlp->translateReplace(
$this->translateReplace(
'user-registration.page.check-email.guidance', [$this->emailAddress]
) .
'</p></div>',
Expand All @@ -18,13 +16,11 @@ echo $this->partial(
?>

<div class="row">

<div class="two-thirds">
<div class="article">
<p>
<?php echo $this->getHelperPluginManager()
->get('Helper\Translation')
->translateReplace(
<?php echo $this->translateReplace(
'user-registration.page.check-email.content',
[
$this->getHelperPluginManager()->get('Helper\Url')->fromRoute('auth/login/GET')
Expand Down
6 changes: 2 additions & 4 deletions module/Olcs/view/pages/fees/late.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ echo $this->partial(
]
);

/** @var \Common\Service\Helper\TranslationHelperService $translator */
$translator = $this->getHelperPluginManager()->get('Helper\Translation');
?>


<div class="row">

<div class="three-quarters">

<?php echo $translator->translateReplace(
<?php echo $this->translateReplace(
'markup-late-fee',
[$this->escapeHtml($licenceExpiryDate)]
); ?>

</div>

</div>
</div>
5 changes: 1 addition & 4 deletions module/Olcs/view/search/bus-browse-results.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
$count = $this->results->getTotal();
$results = $this->results;

/** @var \Common\Service\Helper\TranslationHelperService $translationHlp */
$translationHlp = $this->getHelperPluginManager()->get('Helper\Translation');

echo $this->partial(
'partials/page-header-simple',
[
'pageTitle' => $this->translate('selfserve.search.busreg.browse.result.title'),
'pageHeaderText' =>
'<p>' . $translationHlp->translateReplace('selfserve.search.busreg.browse.result.subtitle', [$count]) . '</p>',
'<p>' . $this->translateReplace('selfserve.search.busreg.browse.result.subtitle', [$count]) . '</p>',
'pageHeaderTextEscape' => false,
'backUrl' => [
'url' => $this->url($this->backRoute),
Expand Down
Loading