mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
Feature: show comment in #docgen generation for accompanying periods
This commit is contained in:
parent
b3da9611ce
commit
5f6c11bde9
@ -40,7 +40,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"read", "write"})
|
||||
* @Groups({"read", "write", "docgen:read"})
|
||||
* @Assert\NotBlank
|
||||
* @Assert\NotNull
|
||||
*/
|
||||
@ -48,14 +48,14 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private $createdAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private $creator;
|
||||
|
||||
@ -63,7 +63,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private $id;
|
||||
|
||||
|
@ -71,6 +71,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'location' => Address::class,
|
||||
'locationPerson' => Person::class,
|
||||
'administrativeLocation' => Location::class,
|
||||
'pinnedComment' => AccompanyingPeriod\Comment::class,
|
||||
];
|
||||
|
||||
private ClosingMotiveRender $closingMotiveRender;
|
||||
@ -164,6 +165,8 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'location' => $this->normalizer->normalize($period->getLocation(), $format, $addressContext),
|
||||
'administrativeLocation' => $this->normalizer->normalize($period->getAdministrativeLocation(), $format, $administrativeLocationContext),
|
||||
'works' => $this->normalizer->normalize($period->getWorks(), $format, $workContext),
|
||||
'comments' => $this->normalizer->normalize($period->getComments(), $format, array_merge($context, ['docgen:expects' => AccompanyingPeriod\Comment::class])),
|
||||
'pinnedComment' => $this->normalizer->normalize($period->getPinnedComment(), $format, array_merge($context, ['docgen:expects' => AccompanyingPeriod\Comment::class])),
|
||||
];
|
||||
}
|
||||
|
||||
@ -183,6 +186,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
|
||||
'hasLocationPerson' => false,
|
||||
'hasAdministrativeLocation' => false,
|
||||
'works' => [],
|
||||
'comments' => [],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -68,6 +68,8 @@ final class AccompanyingPeriodDocGenNormalizerTest extends KernelTestCase
|
||||
'closingMotive' => '@ignored',
|
||||
'confidential' => true,
|
||||
'confidentialText' => 'confidentiel',
|
||||
'comments' => '@ignored',
|
||||
'pinnedComment' => '@ignored',
|
||||
'createdAt' => '@ignored',
|
||||
'createdBy' => '@ignored',
|
||||
'emergency' => true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user