diff --git a/js/src/components/Activity/EventActivityItem.vue b/js/src/components/Activity/EventActivityItem.vue index 4c9f1a359..cdb13264e 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 e433a581c..223da0cc1 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 e9a489b7c..383d7d25f 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 4e8128eb4..b1459ff2b 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 dc52d2ec0..58d487f1f 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 bc91b3b8e..32fee266e 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -151,7 +151,7 @@ "Attending": "Participant⋅e", "Authorize": "Autoriser", "Authorize application": "Autoriser l'application", - "Authorized on {authorization_date}": "Authorisée le {authorization_date}", + "Authorized on {authorization_date}": "Autorisée le {authorization_date}", "Autorize this application to access your account?": "Autoriser cette application à accéder à votre compte ?", "Avatar": "Avatar", "Back to group list": "Retour à la liste des groupes", @@ -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/i18n/pl.json b/js/src/i18n/pl.json index 8a247c84e..86132161b 100644 --- a/js/src/i18n/pl.json +++ b/js/src/i18n/pl.json @@ -101,6 +101,7 @@ "Allow all comments from users with accounts": "Pozwalaj na wszystkie komentarze od zalogowanych użytkowników lub użytkowniczek", "Allow registrations": "Pozwól na rejestrację", "An URL to an external ticketing platform": "Adres URL do zewnętrznej platformy sprzedaży biletów", + "An anonymous profile joined the event {event}.": "Anonimowy profil przystąpił do wydarzenia {event}.", "An error has occured while refreshing the page.": "Wystąpił błąd podczas odświeżania strony.", "An error has occured. Sorry about that. You may try to reload the page.": "Przepraszamy, ale wystąpił błąd. Możesz spróbować odświeżyć stronę.", "An ethical alternative": "Etyczna alternatywa", @@ -696,7 +697,7 @@ "No group found": "Nie znaleziono grupy", "No group matches the filters": "Żadna grupa nie spełnia kryteriów filtra", "No group member found": "Nie znaleziono żadnego członka ani członkini grupy", - "No groups found": "Nie znaleziono grup", + "No groups found": "Nie zna­le­zio­no grup", "No groups found for {search}": "Nie znaleziono grup dla {search}", "No information": "nie podano", "No instance follows your instance yet.": "Żadna instancja nie obserwuje jeszcze Twojej instancji.", @@ -1183,7 +1184,7 @@ "This user was not found": "Ten użytkownik / użytkowniczka nie została znaleziona", "This website isn't moderated and the data that you enter will be automatically destroyed every day at 00:01 (Paris timezone).": "Ta strona nie jest moderowana i wszelkie dane które wprowadzasz będą automatycznie usuwane każdego dnia o 00:001 (strefa czasowa Paryża).", "This week": "W tym tygodniu", - "This weekend": "Ten weekend", + "This weekend": "W najbliższy weekend", "This will delete / anonymize all content (events, comments, messages, participations…) created from this identity.": "Ta opcja usunie/zanonimizuje całą zawartość (wydarzenia, komentarze, wiadomości, deklaracje udziału…) utworzone z tej tożsamości.", "Time in your timezone ({timezone})": "Czas w Twojej strefie czasowej ({timezone})", "Times in your timezone ({timezone})": "Czasy w Twojej strefie czasowej ({timezone})", @@ -1372,6 +1373,7 @@ "You have one event tomorrow.": "Nie masz jutro żadnych wydarzeń | Masz jutro jedno wydarzenie. | Masz jutro {count} wydarzeń", "You haven't interacted with other instances yet.": "Nie wchodziłeś(-aś) jeszcze w interakcje z innymi instancjami.", "You invited {member}.": "Zaprosiłeś(-aś) {member}.", + "You joined the event {event}.": "Ty przystąpiłeś(-aś) do wydarzenia {event}.", "You may also:": "Możesz także:", "You may clear all participation information for this device with the buttons below.": "Wszystkie informacje o uczestnictwie zapisane na tym urządzeniu można usunąć przyciskami poniżej.", "You may now close this page or {return_to_the_homepage}.": "Teraz możesz zamknąć tę stronę lub {return_to_the_homepage}.", @@ -1556,6 +1558,7 @@ "{profile} demoted {member} to moderator.": "{profile} zdegradował(a)(o) {member} do roli moderatora(-ki).", "{profile} demoted {member} to simple member.": "{profile} zdegradował(a)(o) {member} do roli zwykłego członka / zwykłej członkini.", "{profile} excluded member {member}.": "{profile} wykluczył(a)(o) członka / członkinię {member}.", + "{profile} joined the the event {event}.": "Profil {profile} przystąpił do wydarzenia {event}.", "{profile} moved the folder {resource} into {new_path}.": "Katalog {resource} został przeniesiony do {new_path} przez {profile}.", "{profile} moved the folder {resource} to the root folder.": "Katalog {resource} został przeniesiony do katalogu głównego przez {profile}.", "{profile} moved the resource {resource} into {new_path}.": "Zasób {resource} został przeniesiony do {new_path} przez {profile}.", diff --git a/js/src/services/push-subscription.ts b/js/src/services/push-subscription.ts index 0abb0d3c4..437a5867d 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 c5c218757..f3ecb913e 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 0eb3841bb..dc551f3f9 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 3b859bfa3..f89562787 100644 --- a/js/src/views/Event/ParticipantsView.vue +++ b/js/src/views/Event/ParticipantsView.vue @@ -21,7 +21,7 @@
-