diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe2e95ad..96685b5f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to ## Unreleased +* [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493) +* [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477) +* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) * [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) * [person] Add url in accompanying period work evaluations entity and form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/476) * [person] Add document generation in admin and in person/{id}/document (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/464) @@ -30,14 +33,18 @@ and this project adheres to * [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue) * [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474) * [template] do not list inactive templates (for doc generator) +* [household] bugfix if position of member is null, renderbox no longer throws an error (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/480) * [parcours] location cannot be removed if linked to a user (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/478) * [person] email added to twig personRenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/490) * [person] Add link to current household in person banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/484) +* [address] person badge in address history changed to open OnTheFly with all person info (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/489) * [person] Change 'personne' with 'usager' and '&' with 'ET' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/499) * [thirdparty] Add parameter condition to display centers or not (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/500) * [phonenumber] Remove placeholder in phonenumber field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/496) +* [person_resource] separate create page created to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/504) * [contact] add contact button color changed plus the pipe at the side removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/506) * [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505) +* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486) ## Test releases diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js index 67f3e2f42..75f1a21c8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js @@ -1,17 +1,22 @@ /** * Generic api method that can be adapted to any fetch request */ -const makeFetch = (method, url, body) => { - return fetch(url, { +const makeFetch = (method, url, body, options) => { + let opts = { method: method, headers: { 'Content-Type': 'application/json;charset=utf-8' }, body: (body !== null) ? JSON.stringify(body) : null - }) + }; + + if (typeof options !== 'undefined') { + opts = Object.assign(opts, options); + } + + return fetch(url, opts) .then(response => { if (response.ok) { - console.log('200 error') return response.json(); } diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss b/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss index a53ea69d9..9f2ef7bbe 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss @@ -1,37 +1,26 @@ .confidential { display: flex; position: relative; -} -.toggle-far-twig { - i { - bottom: 0px; - right: -30px; - } + margin-right: 20px } -.toggle-close-twig { - i { - bottom: 0px; - right: -5px; - } +.toggle-container { + position: absolute; + width: 100%; + top: 0; + left: 0; + cursor: pointer; + z-index: 5; + padding-right: 1rem; } .toggle{ - margin-left: 30px; - margin-top: 5px; - cursor: pointer; position: absolute; - z-index: 5; - right: -30px -} - -.toggle-far { - bottom: 0px; - right: 20px !important; -} - -.toggle-close { - bottom: 125px; - right: 15px !important; + right: 4px; + &-twig { + position: absolute; + right: -25px; + bottom: 20px; + } } .blur { diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/blur/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/blur/index.js index 1d66d25e6..3245512e9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/blur/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/blur/index.js @@ -2,18 +2,19 @@ require('./blur.scss'); document.querySelectorAll('.confidential').forEach(function (el) { let i = document.createElement('i'); - const classes = ['fa', 'fa-eye', 'toggle']; + const classes = ['fa', 'fa-eye-slash', 'toggle-twig']; i.classList.add(...classes); el.appendChild(i); + const toggleBlur = function(e) { for (let child of el.children) { - if (!child.classList.contains('toggle')) { + if (!child.classList.contains('toggle-twig')) { child.classList.toggle('blur'); } } - i.classList.toggle('fa-eye'); i.classList.toggle('fa-eye-slash'); + i.classList.toggle('fa-eye'); } i.addEventListener('click', toggleBlur); toggleBlur(); -}); +}); \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/api.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/api.js index 1dbc85dee..b1489bfb6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/api.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/api.js @@ -22,6 +22,7 @@ const fetchCountries = () => { */ const fetchCities = (country) => { //console.log('<<< fetching cities for', country); + // warning: do not use fetchResults (in apiMethods): we need only a **part** of the results in the db const url = `/api/1.0/main/postal-code.json?item_per_page=1000&country=${country.id}`; return fetch(url) .then(response => { diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue index f5a555520..837440524 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue @@ -3,8 +3,8 @@
-
- +
+
@@ -12,28 +12,24 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig index 54a0b86b7..3dfc27d2f 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig @@ -59,7 +59,7 @@ must be shown in such list #} {%- if render == 'list' -%} -
  • +
  • {% if options['with_picto'] %} {% endif %} @@ -68,7 +68,7 @@ {%- endif -%} {%- if render == 'inline' -%} - + {% if options['with_picto'] %} {% endif %} @@ -77,7 +77,7 @@ {%- endif -%} {%- if render == 'bloc' -%} -
    +
    {% if options['has_no_address'] == true and address.isNoAddress == true %} {% if address.postCode is not empty %}
    diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index bb0081c27..c34702ad1 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -222,6 +222,10 @@ class AccompanyingPeriodController extends AbstractController $accompanyingPeriodsRaw = $this->accompanyingPeriodACLAwareRepository ->findByPerson($person, AccompanyingPeriodVoter::SEE); + usort($accompanyingPeriodsRaw, static function ($a, $b) { + return $b->getOpeningDate() > $a->getOpeningDate(); + }); + // filter visible or not visible $accompanyingPeriods = array_filter($accompanyingPeriodsRaw, function (AccompanyingPeriod $ap) { return $this->isGranted(AccompanyingPeriodVoter::SEE, $ap); diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index 07fa34b5a..0a8b7eea1 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -78,6 +78,10 @@ class HouseholdController extends AbstractController } } + usort($accompanyingPeriods, static function ($a, $b) { + return $b->getOpeningDate() > $a->getOpeningDate(); + }); + $oldMembers = $household->getNonCurrentMembers(); $accompanyingPeriodsOld = []; diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php index 210b507e5..004961594 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php @@ -133,6 +133,19 @@ final class PersonResourceController extends AbstractController $personResources = []; $personResources = $this->personResourceRepository->findBy(['personOwner' => $personOwner->getId()]); + return $this->render( + 'ChillPersonBundle:PersonResource:list.html.twig', + [ + 'person' => $personOwner, + 'personResources' => $personResources, + ] + ); + } + + public function newAction(Request $request, $person_id) + { + $personOwner = $this->personRepository->find($person_id); + $form = $this->createForm(PersonResourceType::class); $form->handleRequest($request); @@ -165,11 +178,10 @@ final class PersonResourceController extends AbstractController } return $this->render( - 'ChillPersonBundle:PersonResource:list.html.twig', + 'ChillPersonBundle:PersonResource:create.html.twig', [ - 'person' => $personOwner, - 'personResources' => $personResources, 'form' => $form->createView(), + 'person' => $personOwner, ] ); } diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index b05da5626..1f85e4ad0 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -15,6 +15,7 @@ use Chill\MainBundle\DependencyInjection\MissingBundleException; use Chill\MainBundle\Security\Authorization\ChillExportVoter; use Chill\PersonBundle\Controller\HouseholdCompositionTypeApiController; use Chill\PersonBundle\Doctrine\DQL\AddressPart; +use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodResourceVoter; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter; @@ -415,6 +416,25 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Comment::class, + 'name' => 'accompanying_period_comment', + 'base_path' => '/api/1.0/person/accompanying-period/comment', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_entity' => [ + 'methods' => [ + Request::METHOD_GET => false, + Request::METHOD_PATCH => true, + Request::METHOD_HEAD => false, + Request::METHOD_DELETE => false, + ], + 'roles' => [ + Request::METHOD_PATCH => AccompanyingPeriodCommentVoter::EDIT, + ], + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class, 'name' => 'accompanying_period_resource', diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index d75ade12b..bd3211c5d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -257,9 +257,11 @@ class AccompanyingPeriod implements /** * @ORM\ManyToOne( - * targetEntity=Comment::class + * targetEntity=Comment::class, + * cascade={"persist"}, * ) * @Groups({"read"}) + * @ORM\JoinColumn(onDelete="SET NULL") */ private ?Comment $pinnedComment = null; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index fab4b2845..7297754bd 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -109,6 +109,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * @ORM\OneToMany(targetEntity=AccompanyingPeriodParticipation::class, * mappedBy="person", * cascade={"persist", "remove", "merge", "detach"}) + * @ORM\OrderBy({"startDate" = "DESC"}) */ private $accompanyingPeriodParticipations; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index 92542f178..fba0516a7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -33,6 +33,8 @@ div.banner { padding-top: 1em; padding-bottom: 1em; div.contact { + display: flex; + align-content: center; & > * { margin-right: 1em; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue index a852d71a0..8ae7dfff4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue @@ -14,24 +14,27 @@ -