diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 9aacabcb1..d4a906230 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -2,10 +2,10 @@ namespace Chill\CalendarBundle\Entity; -use Chill\CalendarBundle\Repository\CalendarRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\Collection; +use Symfony\Component\Serializer\Annotation\Groups; use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; @@ -15,6 +15,7 @@ use Chill\CalendarBundle\Entity\CancelReason; use Chill\CalendarBundle\Entity\CalendarRange; use Chill\CalendarBundle\Entity\Invite; use Chill\ActivityBundle\Entity\Activity; +use Chill\CalendarBundle\Repository\CalendarRepository; /** * @ORM\Table(name="chill_calendar.calendar") @@ -36,6 +37,7 @@ class Calendar /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod") + * @Groups({"read"}) */ private AccompanyingPeriod $accompanyingPeriod; @@ -50,6 +52,7 @@ class Calendar * targetEntity="Chill\PersonBundle\Entity\Person", * cascade={"persist", "remove", "merge", "detach"}) * @ORM\JoinTable(name="chill_calendar.calendar_to_persons") + * @Groups({"read"}) */ private Collection $persons; @@ -68,6 +71,7 @@ class Calendar * targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", * cascade={"persist", "remove", "merge", "detach"}) * @ORM\JoinTable(name="chill_calendar.calendar_to_thirdparties") + * @Groups({"read"}) */ private Collection $professionals; @@ -77,6 +81,7 @@ class Calendar * targetEntity="Invite", * cascade={"persist", "remove", "merge", "detach"}) * @ORM\JoinTable(name="chill_calendar.calendar_to_invites") + * @Groups({"read"}) */ private Collection $invites; diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js index 1eff54f8a..99a9da5d8 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store.js @@ -17,19 +17,18 @@ const removeIdFromValue = (string, id) => { return str; }; -// const activity = { -// accompanyingPeriod: window.accompanyingPeriod, -// persons: [], -// thirdParties: [], -// users: [] -// }; // TODO: get this object from window.activity ? - -console.log(window.entity) +/* +* Assign missing keys for the ConcernedGroups component +*/ +const mapEntity = (entity) => { + Object.assign(entity, {thirdParties: entity.professionals, users: entity.invites}); + return entity; +}; const store = createStore({ strict: debug, state: { - activity: window.entity, + activity: mapEntity(window.entity), }, mutations: {