From 83e8136b0efd6992751feeff36809ecaf857c111 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 08:36:48 +0100 Subject: [PATCH 1/8] Fix spacing in organizer picker Closes #929 Signed-off-by: Thomas Citharel --- js/src/components/Event/OrganizerPicker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/components/Event/OrganizerPicker.vue b/js/src/components/Event/OrganizerPicker.vue index 99e044042..eaca31a83 100644 --- a/js/src/components/Event/OrganizerPicker.vue +++ b/js/src/components/Event/OrganizerPicker.vue @@ -15,7 +15,7 @@
From 1d1574b426f165dd9acd12a70d43383d61f42e7c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 09:29:01 +0100 Subject: [PATCH 2/8] Increate number of close events and follow group events Closes #930 Signed-off-by: Thomas Citharel --- js/src/views/Home.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/views/Home.vue b/js/src/views/Home.vue index ebb45a25f..7af4b9dcd 100644 --- a/js/src/views/Home.vue +++ b/js/src/views/Home.vue @@ -283,7 +283,7 @@

- +
event_id) .includes(id) ) - .slice(0, 3); + .slice(0, 4); } } From 3fd79f89a8453cab8f8b98cb59f57d05c4e0e6dc Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 09:29:38 +0100 Subject: [PATCH 3/8] Fix accessing user profile in admin section Signed-off-by: Thomas Citharel --- js/src/views/Admin/AdminUserProfile.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/views/Admin/AdminUserProfile.vue b/js/src/views/Admin/AdminUserProfile.vue index cfb0b5759..e3da9277e 100644 --- a/js/src/views/Admin/AdminUserProfile.vue +++ b/js/src/views/Admin/AdminUserProfile.vue @@ -101,7 +101,7 @@ import { IPerson } from "../../types/actor"; // @ts-ignore const { user } = this; return { - title: user.email, + title: user?.email, }; }, }) From c4d9101302094f22a832273e5c6717674a1f36df Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 09:30:18 +0100 Subject: [PATCH 4/8] Make second parameter to Mobilizon.FollowedGroupActivity.user_followed_group_events/4 default to nil Signed-off-by: Thomas Citharel --- lib/mobilizon/followed_group_activity.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mobilizon/followed_group_activity.ex b/lib/mobilizon/followed_group_activity.ex index 7ef7e7774..e13863c59 100644 --- a/lib/mobilizon/followed_group_activity.ex +++ b/lib/mobilizon/followed_group_activity.ex @@ -14,7 +14,7 @@ defmodule Mobilizon.FollowedGroupActivity do integer() | nil, integer() | nil ) :: Page.t(Event.t()) - def user_followed_group_events(user_id, after_datetime, page \\ nil, limit \\ nil) do + def user_followed_group_events(user_id, after_datetime \\ nil, page \\ nil, limit \\ nil) do Event |> distinct([e], e.id) |> join(:left, [e], p in Participant, on: e.id == p.event_id) From 6167d8c416d01919b8f13b2b02565255cdba1d40 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 09:39:50 +0100 Subject: [PATCH 5/8] Improve MyEvents page description text Signed-off-by: Thomas Citharel --- js/src/i18n/en_US.json | 2 +- js/src/i18n/fr_FR.json | 2 +- js/src/views/Event/MyEvents.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 98b060feb..b68be9791 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -794,7 +794,7 @@ "Unable to save your participation in this browser.": "Unable to save your participation in this browser.", "return to the event's page": "return to the event's page", "View all events": "View all events", - "You will find here all the events you have created or of which you are a participant.": "You will find here all the events you have created or of which you are a participant.", + "You will find here all the events you have created or of which you are a participant, as well as events organized by groups you follow or are a member of.": "You will find here all the events you have created or of which you are a participant, as well as events organized by groups you follow or are a member of.", "Create event": "Create event", "You didn't create or join any event yet.": "You didn't create or join any event yet.", "create an event": "create an event", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index ea54e3323..e8b0fc113 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -1115,7 +1115,7 @@ "You were promoted to moderator by {profile}.": "Vous avez été promu⋅e modérateur⋅ice par {profile}.", "You will be able to add an avatar and set other options in your account settings.": "Vous pourrez ajouter un avatar et définir d'autres options dans les paramètres de votre compte.", "You will be redirected to the original instance": "Vous allez être redirigé⋅e vers l'instance d'origine", - "You will find here all the events you have created or of which you are a participant.": "Vous trouverez ici tous les événements que vous avez créé ou dont vous êtes un·e participant·e.", + "You will find here all the events you have created or of which you are a participant, as well as events organized by groups you follow or are a member of.": "Vous trouverez ici tous les événements que vous avez créé ou dont vous êtes un·e participant·e, ainsi que les événements organisés par les groupes que vous suivez ou dont vous êtes membre.", "You wish to participate to the following event": "Vous souhaitez participer à l'événement suivant", "You'll get a weekly recap every Monday for upcoming events, if you have any.": "Vous recevrez un récapitulatif hebdomadaire chaque lundi pour les événements de la semaine, si vous en avez.", "You'll need to change the URLs where there were previously entered.": "Vous devrez changer les URLs là où vous les avez entrées précédemment.", diff --git a/js/src/views/Event/MyEvents.vue b/js/src/views/Event/MyEvents.vue index 3c8dd937a..0e63f4839 100644 --- a/js/src/views/Event/MyEvents.vue +++ b/js/src/views/Event/MyEvents.vue @@ -6,7 +6,7 @@

{{ $t( - "You will find here all the events you have created or of which you are a participant." + "You will find here all the events you have created or of which you are a participant, as well as events organized by groups you follow or are a member of." ) }}

From 49ad1637f9c4666286fd5039db59c55b6297c6e9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 10:02:57 +0100 Subject: [PATCH 6/8] Set initial values for some EventMetadata elements Otherwise it fails backend validation Closes #931 Signed-off-by: Thomas Citharel --- js/src/components/Event/EventMetadataList.vue | 6 +++++- js/src/services/EventMetadata.ts | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/src/components/Event/EventMetadataList.vue b/js/src/components/Event/EventMetadataList.vue index a1ca63100..313fda303 100644 --- a/js/src/components/Event/EventMetadataList.vue +++ b/js/src/components/Event/EventMetadataList.vue @@ -16,6 +16,7 @@ > elem) + ); } localizedCategories: Record = { diff --git a/js/src/services/EventMetadata.ts b/js/src/services/EventMetadata.ts index 4008ebb92..6500173b9 100644 --- a/js/src/services/EventMetadata.ts +++ b/js/src/services/EventMetadata.ts @@ -14,7 +14,7 @@ export const eventMetaDataList: IEventMetadataDescription[] = [ description: i18n.t( "Whether the event is accessible with a wheelchair" ) as string, - value: "", + value: "no", type: EventMetadataType.STRING, keyType: EventMetadataKeyType.CHOICE, choices: { @@ -29,7 +29,7 @@ export const eventMetaDataList: IEventMetadataDescription[] = [ key: "mz:accessibility:live:subtitle", label: i18n.t("Subtitles") as string, description: i18n.t("Whether the event live video is subtitled") as string, - value: "", + value: "false", type: EventMetadataType.BOOLEAN, keyType: EventMetadataKeyType.PLAIN, choices: { @@ -47,7 +47,7 @@ export const eventMetaDataList: IEventMetadataDescription[] = [ description: i18n.t( "Whether the event is interpreted in sign language" ) as string, - value: "", + value: "false", type: EventMetadataType.BOOLEAN, keyType: EventMetadataKeyType.PLAIN, choices: { From 83783ad34b907a5e4c41a405304fe59999df5cc7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 10:03:34 +0100 Subject: [PATCH 7/8] Remove type validation in AddressAutoComplete mixin Because it can be null Signed-off-by: Thomas Citharel --- js/src/mixins/AddressAutoCompleteMixin.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/mixins/AddressAutoCompleteMixin.ts b/js/src/mixins/AddressAutoCompleteMixin.ts index 7616a3de0..b5074b1af 100644 --- a/js/src/mixins/AddressAutoCompleteMixin.ts +++ b/js/src/mixins/AddressAutoCompleteMixin.ts @@ -6,7 +6,6 @@ import { CONFIG } from "../graphql/config"; import { IConfig } from "../types/config.model"; import debounce from "lodash/debounce"; import { DebouncedFunc } from "lodash"; -import { PropType } from "vue"; @Component({ components: { @@ -18,7 +17,7 @@ import { PropType } from "vue"; }, }) export default class AddressAutoCompleteMixin extends Vue { - @Prop({ required: true, type: Object as PropType }) + @Prop({ required: true }) value!: IAddress; gettingLocationError: string | null = null; From 506a6dd4c74b116c3ab67fdf21d34d28f1233e14 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 10:08:12 +0100 Subject: [PATCH 8/8] Avoid giving an error page if the apollo futureParticipations query is undefined Closes #932 Signed-off-by: Thomas Citharel --- js/src/views/Event/MyEvents.vue | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/js/src/views/Event/MyEvents.vue b/js/src/views/Event/MyEvents.vue index 0e63f4839..bdf9285db 100644 --- a/js/src/views/Event/MyEvents.vue +++ b/js/src/views/Event/MyEvents.vue @@ -434,24 +434,28 @@ export default class MyEvents extends Vue { loadMoreFutureParticipations(): void { this.futurePage += 1; - this.$apollo.queries.futureParticipations.fetchMore({ - // New variables - variables: { - page: this.futurePage, - limit: this.limit, - }, - }); + if (this.$apollo.queries.futureParticipations) { + this.$apollo.queries.futureParticipations.fetchMore({ + // New variables + variables: { + page: this.futurePage, + limit: this.limit, + }, + }); + } } loadMorePastParticipations(): void { this.pastPage += 1; - this.$apollo.queries.pastParticipations.fetchMore({ - // New variables - variables: { - page: this.pastPage, - limit: this.limit, - }, - }); + if (this.$apollo.queries.pastParticipations) { + this.$apollo.queries.pastParticipations.fetchMore({ + // New variables + variables: { + page: this.pastPage, + limit: this.limit, + }, + }); + } } eventDeleted(eventid: string): void {