1
0
Fork 0
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:
Maksim Eltyshev 2025-05-17 01:50:40 +02:00
parent f43785c3d0
commit f6568ce41b
14 changed files with 169 additions and 39 deletions

View file

@ -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;
}

View file

@ -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;
}