diff --git a/js/src/components/Activity/EventActivityItem.vue b/js/src/components/Activity/EventActivityItem.vue index 4c9f1a35..cdb13264 100644 --- a/js/src/components/Activity/EventActivityItem.vue +++ b/js/src/components/Activity/EventActivityItem.vue @@ -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; } diff --git a/js/src/components/Participation/ConfirmParticipation.vue b/js/src/components/Participation/ConfirmParticipation.vue index e433a581..223da0cc 100644 --- a/js/src/components/Participation/ConfirmParticipation.vue +++ b/js/src/components/Participation/ConfirmParticipation.vue @@ -67,7 +67,7 @@ import { EventJoinOptions } from "@/types/enums"; import { IParticipant } from "../../types/participant.model"; import RouteName from "../../router/name"; import { CONFIRM_PARTICIPATION } from "../../graphql/event"; -import { computed, ref } from "vue"; +import { computed, ref, watchEffect } from "vue"; import { useMutation } from "@vue/apollo-composable"; import { useI18n } from "vue-i18n"; import { useHead } from "@vueuse/head"; @@ -90,9 +90,15 @@ const { onDone, onError, mutate } = useMutation<{ confirmParticipation: IParticipant; }>(CONFIRM_PARTICIPATION); -mutate(() => ({ - token: props.token, -})); +const participationToken = computed(() => props.token); + +watchEffect(() => { + if (participationToken.value) { + mutate({ + token: participationToken.value, + }); + } +}); onDone(async ({ data }) => { participation.value = data?.confirmParticipation; diff --git a/js/src/components/Settings/SettingsOnboarding.vue b/js/src/components/Settings/SettingsOnboarding.vue index e9a489b7..383d7d25 100644 --- a/js/src/components/Settings/SettingsOnboarding.vue +++ b/js/src/components/Settings/SettingsOnboarding.vue @@ -70,14 +70,16 @@ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; const { loggedUser } = useUserSettings(); +const { mutate: doUpdateLocale } = updateLocale(); + onMounted(() => { - updateLocale(locale as unknown as string); + doUpdateLocale({ locale: locale as unknown as string }); doUpdateSetting({ timezone }); }); watch(locale, () => { if (locale.value) { - updateLocale(locale.value as string); + doUpdateLocale({ locale: locale as unknown as string }); saveLocaleData(locale.value as string); } }); diff --git a/js/src/composition/apollo/user.ts b/js/src/composition/apollo/user.ts index 4e8128eb..b1459ff2 100644 --- a/js/src/composition/apollo/user.ts +++ b/js/src/composition/apollo/user.ts @@ -59,12 +59,8 @@ export async function doUpdateSetting( })); } -export async function updateLocale(locale: string) { - useMutation<{ id: string; locale: string }>(UPDATE_USER_LOCALE, () => ({ - variables: { - locale, - }, - })); +export function updateLocale() { + return useMutation<{ id: string; locale: string }>(UPDATE_USER_LOCALE); } export function registerAccount() { diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index dc52d2ec..58d487f1 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -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}." } \ No newline at end of file diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 9552c837..32fee266 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -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}." } diff --git a/js/src/services/push-subscription.ts b/js/src/services/push-subscription.ts index 0abb0d3c..437a5867 100644 --- a/js/src/services/push-subscription.ts +++ b/js/src/services/push-subscription.ts @@ -32,9 +32,8 @@ export async function subscribeUserToPush(): Promise { }; const registration = await navigator.serviceWorker.ready; try { - const pushSubscription = await registration.pushManager.subscribe( - subscribeOptions - ); + const pushSubscription = + await registration.pushManager.subscribe(subscribeOptions); console.debug("Received PushSubscription: ", pushSubscription); resolve(pushSubscription); } catch (e) { diff --git a/js/src/types/activity.model.ts b/js/src/types/activity.model.ts index c5c21875..f3ecb913 100644 --- a/js/src/types/activity.model.ts +++ b/js/src/types/activity.model.ts @@ -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; diff --git a/js/src/types/enums.ts b/js/src/types/enums.ts index 0eb3841b..dc551f3f 100644 --- a/js/src/types/enums.ts +++ b/js/src/types/enums.ts @@ -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", diff --git a/js/src/views/Event/ParticipantsView.vue b/js/src/views/Event/ParticipantsView.vue index 3b859bfa..f8956278 100644 --- a/js/src/views/Event/ParticipantsView.vue +++ b/js/src/views/Event/ParticipantsView.vue @@ -21,7 +21,7 @@
-