diff --git a/src/Components/Activities/getRecipientHref.js b/src/Components/Activities/getRecipientHref.js new file mode 100644 index 0000000000000000000000000000000000000000..0239307756716ee989bd0be908bb425a94af1a26 --- /dev/null +++ b/src/Components/Activities/getRecipientHref.js @@ -0,0 +1,5 @@ +export function getRecipientHref (notification) { + if (notification.trackable_type === 'CuratorAssignment') { + return `/recurso/${notification.recipient.id}` + } +} diff --git a/src/Components/Notifications.js b/src/Components/Notifications.js index cf8a2f055f3fc17d46b9ba856d05c3bfa96b7b8d..09b1f99b4caf1e4fffd7dafe130713af08bfe87c 100644 --- a/src/Components/Notifications.js +++ b/src/Components/Notifications.js @@ -26,6 +26,7 @@ import ActivityListItem from './ActivityListItem.js' import {getRequest} from './HelperFunctions/getAxiosConfig.js' import { withStyles } from '@material-ui/core/styles'; import {Link} from 'react-router-dom' +import {getRecipientHref} from './Activities/getRecipientHref.js' const StyledBadge = styled(Badge) ` .MuiBadge-dot-45{ @@ -132,6 +133,7 @@ export default function Notification (props) { ownerName = {notification.owner.name} ownerHref = {'/usuario-publico/' + notification.owner.id} recipientName = {notification.recipient.name} + recipientHref = {getRecipientHref(notification)} /> ) } diff --git a/src/Components/TabPanels/UserPageTabs/PanelAtividades.js b/src/Components/TabPanels/UserPageTabs/PanelAtividades.js index d43ce0da3f4f9023da4def6794f69cadf3195c3e..7fc15c9ec3ce8c020b15c1bf6321697f50fa4d10 100644 --- a/src/Components/TabPanels/UserPageTabs/PanelAtividades.js +++ b/src/Components/TabPanels/UserPageTabs/PanelAtividades.js @@ -26,6 +26,7 @@ import LoadingSpinner from '../../LoadingSpinner.js' import ActivityListItem from '../../ActivityListItem.js' import List from '@material-ui/core/List'; import {getRequest} from '../../HelperFunctions/getAxiosConfig.js' +import {getRecipientHref} from '../../Activities/getRecipientHref.js' export default function TabPanelAtividades (props) { const [loading, handleLoading] = useState(true) @@ -109,6 +110,7 @@ export default function TabPanelAtividades (props) { ownerName = {notification.owner.name} ownerHref = {'/usuario-publico/' + notification.owner.id} recipientName = {notification.recipient.name} + recipientHref = {getRecipientHref(notification)} /> ) }