mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 18:39:43 +00:00
Fix the notification dashboard widget to include task related notifications
This commit is contained in:
@@ -69,6 +69,7 @@ export default {
|
|||||||
return `/fr/notification/${n.id}/show`;
|
return `/fr/notification/${n.id}/show`;
|
||||||
},
|
},
|
||||||
getEntityName(n) {
|
getEntityName(n) {
|
||||||
|
console.log('entity class', n.relatedEntityClass);
|
||||||
switch (n.relatedEntityClass) {
|
switch (n.relatedEntityClass) {
|
||||||
case "Chill\\ActivityBundle\\Entity\\Activity":
|
case "Chill\\ActivityBundle\\Entity\\Activity":
|
||||||
return appMessages.fr.the_activity;
|
return appMessages.fr.the_activity;
|
||||||
@@ -80,11 +81,15 @@ export default {
|
|||||||
return appMessages.fr.the_evaluation_document;
|
return appMessages.fr.the_evaluation_document;
|
||||||
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
|
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
|
||||||
return appMessages.fr.the_workflow;
|
return appMessages.fr.the_workflow;
|
||||||
|
case "Chill\\TaskBundle\\Entity\\SingleTask":
|
||||||
|
return appMessages.fr.the_task;
|
||||||
default:
|
default:
|
||||||
throw "notification type unknown";
|
throw "notification type unknown";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getEntityUrl(n) {
|
getEntityUrl(n) {
|
||||||
|
console.log('entity class', n.relatedEntityClass);
|
||||||
|
|
||||||
switch (n.relatedEntityClass) {
|
switch (n.relatedEntityClass) {
|
||||||
case "Chill\\ActivityBundle\\Entity\\Activity":
|
case "Chill\\ActivityBundle\\Entity\\Activity":
|
||||||
return `/fr/activity/${n.relatedEntityId}/show`;
|
return `/fr/activity/${n.relatedEntityId}/show`;
|
||||||
@@ -96,6 +101,8 @@ export default {
|
|||||||
return `/fr/person/accompanying-period/work/evaluation/document/${n.relatedEntityId}/show`;
|
return `/fr/person/accompanying-period/work/evaluation/document/${n.relatedEntityId}/show`;
|
||||||
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
|
case "Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow":
|
||||||
return `/fr/main/workflow/${n.relatedEntityId}/show`;
|
return `/fr/main/workflow/${n.relatedEntityId}/show`;
|
||||||
|
case "Chill\\TaskBundle\\Entity\\SingleTask":
|
||||||
|
return `/fr/task/single-task/${n.relatedEntityId}/show`;
|
||||||
default:
|
default:
|
||||||
throw "notification type unknown";
|
throw "notification type unknown";
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte
|
|||||||
->find($object->getRelatedEntityId());
|
->find($object->getRelatedEntityId());
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'type' => 'notification',
|
'type' => $object->getType(),
|
||||||
'id' => $object->getId(),
|
'id' => $object->getId(),
|
||||||
'addressees' => $this->normalizer->normalize($object->getAddressees(), $format, $context),
|
'addressees' => $this->normalizer->normalize($object->getAddressees(), $format, $context),
|
||||||
'date' => $this->normalizer->normalize($object->getDate(), $format, $context),
|
'date' => $this->normalizer->normalize($object->getDate(), $format, $context),
|
||||||
|
Reference in New Issue
Block a user