use assignment notification parameter for collaborator notifications

This commit is contained in:
Yuri Kuznetsov
2025-11-27 17:16:43 +02:00
parent 3581736bd5
commit b7a079b9d3
3 changed files with 49 additions and 14 deletions
@@ -132,14 +132,6 @@ class RecordService
$groupedCount = $groupedCountMap[$entity->getActionId()] ?? 0;
}
if ($entity->getRelated() && $entity->getData()?->relatedName) {
$entity->set('relatedName', $entity->getData()->relatedName);
}
if ($entity->getCreatedBy() && $entity->getData()?->createdByName) {
$entity->set('createdByName', $entity->getData()->createdByName);
}
$entity->set('groupedCount', $groupedCount);
}
@@ -218,6 +210,8 @@ class RecordService
User $user
): void {
$this->prepareSetFields($entity);
$noteId = $this->getNoteId($entity);
if (!$noteId) {
@@ -471,4 +465,15 @@ class RecordService
// @todo Param in preferences?
return (bool) ($this->config->get('notificationGrouping') ?? true);
}
private function prepareSetFields(Notification $entity): void
{
if ($entity->getRelated() && $entity->getData()?->relatedName) {
$entity->set('relatedName', $entity->getData()->relatedName);
}
if ($entity->getCreatedBy() && $entity->getData()?->createdByName) {
$entity->set('createdByName', $entity->getData()->createdByName);
}
}
}