diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue index 377903c01..f212043c1 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue @@ -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"; } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php index 2f6d57db1..c13208cc9 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php @@ -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),