Skip to content

Commit

Permalink
Fix group leader name
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaisa Korpela committed Aug 2, 2021
1 parent e92d109 commit f91a7c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/components/Actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Actions = ({
groupGuid,
isFavourite,
actionsComponent,
name,
}) => {
const [showActions, setShowActions] = useState(false)
const tasks = useSelector(state => state.tasks)
Expand Down Expand Up @@ -90,6 +91,7 @@ const Actions = ({
task_guid: guid,
user_guid: userGuid,
completion_status: COMPLETION_STATUS.COMPLETED,
group_leader_name: name,
}
await postMemberTaskEntry(update)
setShowActions(false)
Expand Down
1 change: 1 addition & 0 deletions src/components/ListItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const ListItem = ({
actionsComponent={actionsComponent}
userGuid={userGuid}
groupGuid={groupGuid}
name={user.name}
/>
))}
</StyledActions>
Expand Down
12 changes: 1 addition & 11 deletions src/components/Notifications/TaskNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,14 @@ const getStateMessage = state => {

const TaskNotification = ({ notification, markRead }) => {
const itemsByGuid = useSelector(state => state.itemsByGuid)
const groups = useSelector(state => state.user.userGroups)
const task = itemsByGuid[notification.item_guid]
const timestamp = getTimestamp(notification.created_at)
const user = groups.reduce((cur, group) => {
if (cur) {
return cur
}
const found = group.members.find(member => {
return member.memberId.toString() === notification.created_by
})
return found
}, null)

return (
<Container>
<Message>
<span>
Ryhmänjohtaja {user.memberName} on{' '}
Ryhmänjohtaja {notification.group_leader_name} on{' '}
{getStateMessage(notification.notification_type)} tehtäväsi{' '}
</span>
<StyledLink to={getTaskUrl(task)} onClick={markRead}>
Expand Down

0 comments on commit f91a7c2

Please sign in to comment.