feat(notifications): add missing notifications when an user registers to an event

Closes #1344

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-08-24 11:42:03 +02:00
parent f99267c611
commit da532c7059
15 changed files with 149 additions and 15 deletions

View File

@@ -42,6 +42,7 @@ import { usernameWithDomain } from "@/types/actor";
import { formatTimeString } from "@/filters/datetime";
import {
ActivityEventCommentSubject,
ActivityEventParticipantSubject,
ActivityEventSubject,
} from "@/types/enums";
import { computed } from "vue";
@@ -90,6 +91,14 @@ const translation = computed((): string | undefined => {
return "You posted a comment on the event {event}.";
}
return "{profile} posted a comment on the event {event}.";
case ActivityEventParticipantSubject.EVENT_NEW_PARTICIPATION:
if (isAuthorCurrentActor.value) {
return "You joined the event {event}.";
}
if (props.activity.author.preferredUsername === "anonymous") {
return "An anonymous profile joined the event {event}.";
}
return "{profile} joined the the event {event}.";
default:
return undefined;
}

View File

@@ -1579,5 +1579,8 @@
"Access drafts events": "Access drafts events",
"This application will be allowed to list and view your draft events": "This application will be allowed to list and view your draft events",
"Access group suggested events": "Access group suggested events",
"This application will be allowed to list your suggested group events": "This application will be allowed to list your suggested group events"
"This application will be allowed to list your suggested group events": "This application will be allowed to list your suggested group events",
"{profile} joined the the event {event}.": "{profile} joined the the event {event}.",
"You joined the event {event}.": "You joined the event {event}.",
"An anonymous profile joined the event {event}.": "An anonymous profile joined the event {event}."
}

View File

@@ -1575,5 +1575,8 @@
"Access drafts events": "Accéder aux événements brouillons",
"This application will be allowed to list and view your draft events": "Cetta application sera autorisée à lister et accéder à vos événements brouillons",
"Access group suggested events": "Accéder aux événements des groupes suggérés",
"This application will be allowed to list your suggested group events": "Cetta application sera autorisée à lister les événements de vos groupes qui vous sont suggérés"
"This application will be allowed to list your suggested group events": "Cetta application sera autorisée à lister les événements de vos groupes qui vous sont suggérés",
"{profile} joined the the event {event}.": "{profile} a rejoint l'événement {event}.",
"You joined the event {event}.": "Vous avez rejoint l'événement {event}.",
"An anonymous profile joined the event {event}.": "Un profil anonyme a rejoint l'événement {event}."
}

View File

@@ -3,6 +3,7 @@ import { IMember } from "./actor/member.model";
import {
ActivityDiscussionSubject,
ActivityEventCommentSubject,
ActivityEventParticipantSubject,
ActivityEventSubject,
ActivityGroupSubject,
ActivityMemberSubject,
@@ -21,7 +22,8 @@ export type ActivitySubject =
| ActivityResourceSubject
| ActivityDiscussionSubject
| ActivityGroupSubject
| ActivityEventCommentSubject;
| ActivityEventCommentSubject
| ActivityEventParticipantSubject;
export interface IActivity {
id: string;

View File

@@ -200,6 +200,10 @@ export enum ActivityEventCommentSubject {
COMMENT_POSTED = "comment_posted",
}
export enum ActivityEventParticipantSubject {
EVENT_NEW_PARTICIPATION = "event_new_participation",
}
export enum ActivityPostSubject {
POST_CREATED = "post_created",
POST_UPDATED = "post_updated",