1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

feat: Log action when user is removed from card

This commit is contained in:
Maksim Eltyshev 2025-05-17 22:24:37 +02:00
parent eeb52d19bb
commit 3aedbff5d0
9 changed files with 86 additions and 17 deletions

View file

@ -113,6 +113,36 @@ const Item = React.memo(({ id }) => {
</Trans>
);
break;
case ActivityTypes.REMOVE_MEMBER_FROM_CARD:
contentNode =
user.id === activity.data.user.id ? (
<Trans
i18nKey="common.userLeftThisCard"
values={{
user: userName,
}}
>
<span className={styles.author}>{userName}</span>
<span className={styles.text}>{' left this card'}</span>
</Trans>
) : (
<Trans
i18nKey="common.userRemovedUserFromThisCard"
values={{
actorUser: userName,
removedUser: activity.data.user.name,
}}
>
<span className={styles.author}>{userName}</span>
<span className={styles.text}>
{' removed '}
{activity.data.user.name}
{' from this card'}
</span>
</Trans>
);
break;
default:
contentNode = null;

View file

@ -91,6 +91,7 @@ export const ActivityTypes = {
CREATE_CARD: 'createCard',
MOVE_CARD: 'moveCard',
ADD_MEMBER_TO_CARD: 'addMemberToCard',
REMOVE_MEMBER_FROM_CARD: 'removeMemberFromCard',
};
export const NotificationTypes = {

View file

@ -291,9 +291,12 @@ export default {
userAddedYouToCard: '{{user}} added you to <2>{{card}}</2>',
userJoinedThisCard: `<0>{{user}}</0><1> joined this card</1>`,
userLeftNewCommentToCard: '{{user}} left a new comment «{{comment}}» to <2>{{card}}</2>',
userLeftThisCard: '<0>{{user}}</0><1> left this card</1>',
userMovedCardFromListToList: '{{user}} moved <2>{{card}}</2> from {{fromList}} to {{toList}}',
userMovedThisCardFromListToList:
'<0>{{user}}</0><1> moved this card from {{fromList}} to {{toList}}</1>',
userRemovedUserFromThisCard:
'<0>{{actorUser}}</0><1> removed {{removedUser}} from this card</1>',
username: 'Username',
users: 'Users',
viewer: 'Viewer',

View file

@ -286,9 +286,12 @@ export default {
userAddedYouToCard: '{{user}} added you to <2>{{card}}</2>',
userJoinedThisCard: `<0>{{user}}</0><1> joined this card</1>`,
userLeftNewCommentToCard: '{{user}} left a new comment «{{comment}}» to <2>{{card}}</2>',
userLeftThisCard: '<0>{{user}}</0><1> left this card</1>',
userMovedCardFromListToList: '{{user}} moved <2>{{card}}</2> from {{fromList}} to {{toList}}',
userMovedThisCardFromListToList:
'<0>{{user}}</0><1> moved this card from {{fromList}} to {{toList}}</1>',
userRemovedUserFromThisCard:
'<0>{{actorUser}}</0><1> removed {{removedUser}} from this card</1>',
username: 'Username',
users: 'Users',
viewer: 'Viewer',