mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 13:19:44 +02:00
feat: Add notification when user is added to card
This commit is contained in:
parent
f43785c3d0
commit
f6568ce41b
14 changed files with 169 additions and 39 deletions
|
@ -84,6 +84,36 @@ const Item = React.memo(({ id }) => {
|
|||
|
||||
break;
|
||||
}
|
||||
case ActivityTypes.ADD_MEMBER_TO_CARD:
|
||||
contentNode =
|
||||
user.id === activity.data.user.id ? (
|
||||
<Trans
|
||||
i18nKey="common.userJoinedThisCard"
|
||||
values={{
|
||||
user: userName,
|
||||
}}
|
||||
>
|
||||
<span className={styles.author}>{userName}</span>
|
||||
<span className={styles.text}>{' joined this card'}</span>
|
||||
</Trans>
|
||||
) : (
|
||||
<Trans
|
||||
i18nKey="common.userAddedUserToThisCard"
|
||||
values={{
|
||||
actorUser: userName,
|
||||
addedUser: activity.data.user.name,
|
||||
}}
|
||||
>
|
||||
<span className={styles.author}>{userName}</span>
|
||||
<span className={styles.text}>
|
||||
{' added '}
|
||||
{activity.data.user.name}
|
||||
{' to this card'}
|
||||
</span>
|
||||
</Trans>
|
||||
);
|
||||
|
||||
break;
|
||||
default:
|
||||
contentNode = null;
|
||||
}
|
||||
|
|
|
@ -103,6 +103,24 @@ const Item = React.memo(({ id, onClose }) => {
|
|||
|
||||
break;
|
||||
}
|
||||
case NotificationTypes.ADD_MEMBER_TO_CARD:
|
||||
contentNode = (
|
||||
<Trans
|
||||
i18nKey="common.userAddedYouToCard"
|
||||
values={{
|
||||
user: creatorUserName,
|
||||
card: cardName,
|
||||
}}
|
||||
>
|
||||
{creatorUserName}
|
||||
{` added you to `}
|
||||
<Link to={Paths.CARDS.replace(':id', notification.cardId)} onClick={onClose}>
|
||||
{cardName}
|
||||
</Link>
|
||||
</Trans>
|
||||
);
|
||||
|
||||
break;
|
||||
default:
|
||||
contentNode = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue