Merge remote-tracking branch 'origin/master' into issue491_thirdparty_edit_modal

This commit is contained in:
Julie Lenaerts 2022-03-24 10:56:51 +01:00
commit 287ea80be9
7 changed files with 20 additions and 16 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to
## Unreleased ## Unreleased
<!-- write down unreleased development here --> <!-- write down unreleased development here -->
* [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576
* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554) * [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554)
* [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553) * [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553)
* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517) * [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517)
@ -59,6 +60,7 @@ and this project adheres to
* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512) * [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512)
* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560) * [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560)
* [person_resource] bugfix when adding thirdparty or freetext resource (no issue) * [person_resource] bugfix when adding thirdparty or freetext resource (no issue)
* [aside_activity] style correction + sticky-form create button (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/529)
## Test releases ## Test releases

View File

@ -250,11 +250,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Entity/Address.php path: src/Bundle/ChillMainBundle/Entity/Address.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1

View File

@ -40,7 +40,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="item-col"> <div class="item-col" style="justify-content: flex-end;">
<div class="box"> <div class="box">
<ul class="list-content fa-ul"> <ul class="list-content fa-ul">
<li> <li>
@ -79,7 +79,7 @@
{{ chill_pagination(paginator) }} {{ chill_pagination(paginator) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ chill_path_add_return_path('chill_crud_aside_activity_new') }}" class="btn btn-create"> <a href="{{ chill_path_add_return_path('chill_crud_aside_activity_new') }}" class="btn btn-create">
{{ 'Create'|trans }} {{ 'Create'|trans }}

View File

@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Search; namespace Chill\MainBundle\Search;
use Chill\MainBundle\Pagination\Paginator;
use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Serializer\Model\Collection; use Chill\MainBundle\Serializer\Model\Collection;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
@ -102,9 +103,9 @@ class SearchApi
return $items; return $items;
} }
private function buildUnionQuery(array $queries, $types, $parameters) private function buildUnionQuery(array $queries, $types, $parameters, Paginator $paginator)
{ {
$query = '{unions} ORDER BY pertinence DESC'; $query = '{unions} ORDER BY pertinence DESC LIMIT ? OFFSET ?';
$unions = []; $unions = [];
$parameters = []; $parameters = [];
@ -113,6 +114,10 @@ class SearchApi
$parameters = array_merge($parameters, $q->buildParameters()); $parameters = array_merge($parameters, $q->buildParameters());
} }
// add pagination limit
$parameters[] = $paginator->getItemsPerPage();
$parameters[] = $paginator->getCurrentPageFirstItemNumber();
$union = implode(' UNION ', $unions); $union = implode(' UNION ', $unions);
return [ return [
@ -132,9 +137,9 @@ class SearchApi
return (int) $countNq->getSingleScalarResult(); return (int) $countNq->getSingleScalarResult();
} }
private function fetchRawResult($queries, $types, $parameters, $paginator): array private function fetchRawResult($queries, $types, $parameters, Paginator $paginator): array
{ {
[$union, $parameters] = $this->buildUnionQuery($queries, $types, $parameters); [$union, $parameters] = $this->buildUnionQuery($queries, $types, $parameters, $paginator);
$rsm = new ResultSetMappingBuilder($this->em); $rsm = new ResultSetMappingBuilder($this->em);
$rsm->addScalarResult('key', 'key', Types::STRING) $rsm->addScalarResult('key', 'key', Types::STRING)
->addScalarResult('metadata', 'metadata', Types::JSON) ->addScalarResult('metadata', 'metadata', Types::JSON)

View File

@ -13,9 +13,8 @@ services:
- { name: 'chill.menu_builder' } - { name: 'chill.menu_builder' }
Chill\MainBundle\Routing\MenuBuilder\SectionMenuBuilder: Chill\MainBundle\Routing\MenuBuilder\SectionMenuBuilder:
arguments: autowire: true
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' autoconfigure: true
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
tags: tags:
- { name: 'chill.menu_builder' } - { name: 'chill.menu_builder' }

View File

@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Doctrine\ORM\Query\Parameter;
use Knp\Menu\MenuItem; use Knp\Menu\MenuItem;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
@ -27,6 +28,8 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
protected TranslatorInterface $translator; protected TranslatorInterface $translator;
protected ParameterBagInterface $parameterBag;
/** /**
* SectionMenuBuilder constructor. * SectionMenuBuilder constructor.
*/ */

View File

@ -116,7 +116,7 @@ class PersonDocGenNormalizer implements
'memo' => $person->getMemo(), 'memo' => $person->getMemo(),
'numberOfChildren' => (string) $person->getNumberOfChildren(), 'numberOfChildren' => (string) $person->getNumberOfChildren(),
'address' => $this->normalizer->normalize($person->getCurrentPersonAddress(), $format, $addressContext), 'address' => $this->normalizer->normalize($person->getCurrentPersonAddress(), $format, $addressContext),
'resources' => $this->normalizer->normalize($person->getResources(), $format, $personResourceContext), //'resources' => $this->normalizer->normalize($person->getResources(), $format, $personResourceContext),
]; ];
if ($context['docgen:person:with-household'] ?? false) { if ($context['docgen:person:with-household'] ?? false) {
@ -193,7 +193,7 @@ class PersonDocGenNormalizer implements
$data = $normalizer->normalize($attributes, $format, $context); $data = $normalizer->normalize($attributes, $format, $context);
$data['resources'] = []; //$data['resources'] = [];
if ($context['docgen:person:with-relations'] ?? false) { if ($context['docgen:person:with-relations'] ?? false) {
$data['relations'] = []; $data['relations'] = [];