prepare vue_visgraph component, with store, dataset and display basic graph

This commit is contained in:
2021-10-18 15:47:57 +02:00
parent 8be11314c3
commit 1b0c19a68f
11 changed files with 250 additions and 59 deletions

View File

@@ -9,6 +9,8 @@ use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Chill\PersonBundle\Entity\Household\Household;
@@ -24,11 +26,16 @@ class HouseholdController extends AbstractController
private PositionRepository $positionRepository;
public function __construct(TranslatorInterface $translator, PositionRepository $positionRepository)
private SerializerInterface $serializer;
{
public function __construct(
TranslatorInterface $translator,
PositionRepository $positionRepository,
SerializerInterface $serializer
) {
$this->translator = $translator;
$this->positionRepository = $positionRepository;
$this->serializer = $serializer;
}
/**
@@ -177,9 +184,13 @@ class HouseholdController extends AbstractController
*/
public function showRelationship(Request $request, Household $household)
{
$jsonString = $this->serializer->serialize($household->getCurrentPersons(),
'json', [ AbstractNormalizer::GROUPS => ['read']]);
return $this->render('@ChillPerson/Household/relationship.html.twig',
[
'household' => $household
'household' => $household,
'persons' => $jsonString
]
);
}