Fix the notification dashboard widget to include task related notifications

This commit is contained in:
2025-09-29 15:44:49 +02:00
parent 13a4795333
commit 2434d91e4a
2 changed files with 8 additions and 1 deletions

View File

@@ -69,6 +69,7 @@ export default {
return `/fr/notification/${n.id}/show`;
},
getEntityName(n) {
console.log('entity class', n.relatedEntityClass);
switch (n.relatedEntityClass) {
case "Chill\\ActivityBundle\\Entity\\Activity":
return appMessages.fr.the_activity;
@@ -80,11 +81,15 @@ export default {
return appMessages.fr.the_evaluation_document;
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
return appMessages.fr.the_workflow;
case "Chill\\TaskBundle\\Entity\\SingleTask":
return appMessages.fr.the_task;
default:
throw "notification type unknown";
}
},
getEntityUrl(n) {
console.log('entity class', n.relatedEntityClass);
switch (n.relatedEntityClass) {
case "Chill\\ActivityBundle\\Entity\\Activity":
return `/fr/activity/${n.relatedEntityId}/show`;
@@ -96,6 +101,8 @@ export default {
return `/fr/person/accompanying-period/work/evaluation/document/${n.relatedEntityId}/show`;
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
return `/fr/main/workflow/${n.relatedEntityId}/show`;
case "Chill\\TaskBundle\\Entity\\SingleTask":
return `/fr/task/single-task/${n.relatedEntityId}/show`;
default:
throw "notification type unknown";
}

View File

@@ -37,7 +37,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte
->find($object->getRelatedEntityId());
return [
'type' => 'notification',
'type' => $object->getType(),
'id' => $object->getId(),
'addressees' => $this->normalizer->normalize($object->getAddressees(), $format, $context),
'date' => $this->normalizer->normalize($object->getDate(), $format, $context),