From 5bfdee0c286d8bd32f37a1cdab3b97ab55f710ff Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 28 Jan 2022 11:09:14 +0100 Subject: [PATCH] corrections review --- .../Controller/PersonResourceController.php | 2 -- .../Controller/UserAccompanyingPeriodController.php | 8 +++++--- src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php | 6 ------ .../Resources/views/PersonResource/list.html.twig | 4 +--- src/Bundle/ChillPersonBundle/config/routes.yaml | 4 ---- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php index 577a271e8..210b507e5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php @@ -148,8 +148,6 @@ final class PersonResourceController extends AbstractController $comment = $form['comment']->getData(); $kind = $form['kind']->getData(); - dump($person); - $personResource->setKind($kind); $personResource->setPerson($person); $personResource->setThirdParty($thirdparty); diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index 956849efc..9c24e127f 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -15,6 +15,7 @@ namespace Chill\PersonBundle\Controller; use Chill\PersonBundle\Repository\AccompanyingPeriodRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class UserAccompanyingPeriodController extends AbstractController { @@ -26,12 +27,13 @@ class UserAccompanyingPeriodController extends AbstractController $this->accompanyingPeriodRepository = $accompanyingPeriodRepository; } + /** + * @Route("/{_locale}/accompanying-periods", name="chill_person_accompanying_period_user") + */ public function listAction(Request $request) { - $userId = $this->getUser()->getId(); - $accompanyingPeriods = []; - $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(['user' => $userId]); + $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(['user' => $this->getUser()]); return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [ 'accompanyingPeriods' => $accompanyingPeriods diff --git a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php index e7dd210df..1b86135b8 100644 --- a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php @@ -41,14 +41,8 @@ class UserMenuBuilder implements LocalMenuBuilderInterface public $translator; public function __construct( - CountNotificationTask $counter, - TokenStorageInterface $tokenStorage, - TranslatorInterface $translator, AuthorizationCheckerInterface $authorizationChecker ) { - $this->counter = $counter; - $this->tokenStorage = $tokenStorage; - $this->translator = $translator; $this->authorizationChecker = $authorizationChecker; } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig index 5964cef54..820da9179 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig @@ -52,9 +52,7 @@ {% if resource.comment.comment is not empty %}
-
-
{{ resource.comment.comment }}
-
+
{{ resource.comment|chill_entity_render_box }}
{% endif %} diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index 13539f6c2..13d1c1227 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -55,10 +55,6 @@ chill_person_accompanying_period_re_open: path: /{_locale}/person/{person_id}/accompanying-period/{period_id}/re-open controller: Chill\PersonBundle\Controller\AccompanyingPeriodController::reOpenAction -chill_person_accompanying_period_user: - path: /{_locale}/accompanying-periods - controller: Chill\PersonBundle\Controller\UserAccompanyingPeriodController::listAction - chill_person_resource_list: path: /{_locale}/person/{person_id}/resources/list controller: Chill\PersonBundle\Controller\PersonResourceController::listAction