Merge branch 'fixes' into 'main'

Fix ecto dev warning

See merge request framasoft/mobilizon!1330
This commit is contained in:
Thomas Citharel 2022-11-07 08:39:39 +00:00
commit d36db8e18f
4 changed files with 31 additions and 19 deletions

View file

@ -213,9 +213,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ParticipantRole } from "@/types/enums"; import { ParticipantRole } from "@/types/enums";
import RouteName from "@/router/name"; import RouteName from "@/router/name";
import { IParticipant } from "../../types/participant.model"; import type { IParticipant } from "../../types/participant.model";
import { LOGGED_USER_DRAFTS } from "../../graphql/actor"; import { LOGGED_USER_DRAFTS } from "../../graphql/actor";
import { IEvent } from "../../types/event.model"; import type { IEvent } from "../../types/event.model";
import MultiEventMinimalistCard from "../../components/Event/MultiEventMinimalistCard.vue"; import MultiEventMinimalistCard from "../../components/Event/MultiEventMinimalistCard.vue";
import EventMinimalistCard from "../../components/Event/EventMinimalistCard.vue"; import EventMinimalistCard from "../../components/Event/EventMinimalistCard.vue";
import { import {
@ -366,7 +366,7 @@ const monthlyFutureEvents = computed((): Map<string, Eventable[]> => {
eventable = [...eventable, ...futureParticipations.value]; eventable = [...eventable, ...futureParticipations.value];
} }
if (showMyGroups.value) { if (showMyGroups.value) {
eventable = [...eventable, ...groupEvents.value]; eventable = [...eventable, ...groupEvents.value.map(({ event }) => event)];
} }
return monthlyEvents(eventable); return monthlyEvents(eventable);
}); });

View file

@ -35,12 +35,12 @@
v-if="currentActor?.id && (welcomeBack || newRegisteredUser)" v-if="currentActor?.id && (welcomeBack || newRegisteredUser)"
> >
<o-notification variant="info" v-if="welcomeBack">{{ <o-notification variant="info" v-if="welcomeBack">{{
$t("Welcome back {username}!", { t("Welcome back {username}!", {
username: displayName(currentActor), username: displayName(currentActor),
}) })
}}</o-notification> }}</o-notification>
<o-notification variant="info" v-if="newRegisteredUser">{{ <o-notification variant="info" v-if="newRegisteredUser">{{
$t("Welcome to Mobilizon, {username}!", { t("Welcome to Mobilizon, {username}!", {
username: displayName(currentActor), username: displayName(currentActor),
}) })
}}</o-notification> }}</o-notification>
@ -48,7 +48,7 @@
<!-- Your upcoming events --> <!-- Your upcoming events -->
<section v-if="canShowMyUpcomingEvents" class="container mx-auto"> <section v-if="canShowMyUpcomingEvents" class="container mx-auto">
<h2 class="dark:text-white font-bold"> <h2 class="dark:text-white font-bold">
{{ $t("Your upcoming events") }} {{ t("Your upcoming events") }}
</h2> </h2>
<div <div
v-for="row of goingToEvents" v-for="row of goingToEvents"
@ -57,7 +57,7 @@
> >
<p class="date-component-container" v-if="isInLessThanSevenDays(row[0])"> <p class="date-component-container" v-if="isInLessThanSevenDays(row[0])">
<span v-if="isToday(row[0])">{{ <span v-if="isToday(row[0])">{{
$t( t(
"You have one event today.", "You have one event today.",
{ {
count: row[1].size, count: row[1].size,
@ -66,7 +66,7 @@
) )
}}</span> }}</span>
<span v-else-if="isTomorrow(row[0])">{{ <span v-else-if="isTomorrow(row[0])">{{
$t( t(
"You have one event tomorrow.", "You have one event tomorrow.",
{ {
count: row[1].size, count: row[1].size,
@ -76,7 +76,7 @@
}}</span> }}</span>
<span v-else-if="isInLessThanSevenDays(row[0])"> <span v-else-if="isInLessThanSevenDays(row[0])">
{{ {{
$t( t(
"You have one event in {days} days.", "You have one event in {days} days.",
{ {
count: row[1].size, count: row[1].size,
@ -101,16 +101,21 @@
<router-link <router-link
:to="{ name: RouteName.MY_EVENTS }" :to="{ name: RouteName.MY_EVENTS }"
class="hover:text-slate-800 hover:dark:text-slate-400" class="hover:text-slate-800 hover:dark:text-slate-400"
>{{ $t("View everything") }} >></router-link >{{ t("View everything") }} >></router-link
> >
</span> </span>
</section> </section>
<!-- Events from your followed groups --> <!-- Events from your followed groups -->
<section class="followActivity" v-if="canShowFollowedGroupEvents"> <section
<h2 class="title"> class="relative pt-10 px-2 container mx-auto px-2"
{{ $t("Upcoming events from your groups") }} v-if="canShowFollowedGroupEvents"
>
<h2
class="text-xl font-bold tracking-tight text-gray-900 dark:text-gray-100 mt-0"
>
{{ t("Upcoming events from your groups") }}
</h2> </h2>
<p>{{ $t("That you follow or of which you are a member") }}</p> <p>{{ t("That you follow or of which you are a member") }}</p>
<multi-card :events="filteredFollowedGroupsEvents" /> <multi-card :events="filteredFollowedGroupsEvents" />
<span <span
class="block mt-2 text-right underline text-slate-700 dark:text-slate-300" class="block mt-2 text-right underline text-slate-700 dark:text-slate-300"
@ -126,7 +131,7 @@
showMyGroups: 'true', showMyGroups: 'true',
}, },
}" }"
>{{ $t("View everything") }} >></router-link >{{ t("View everything") }} >></router-link
> >
</span> </span>
</section> </section>
@ -218,6 +223,9 @@ import { geoHashToCoords } from "@/utils/location";
import { useServerProvidedLocation } from "@/composition/apollo/config"; import { useServerProvidedLocation } from "@/composition/apollo/config";
import { ABOUT } from "@/graphql/config"; import { ABOUT } from "@/graphql/config";
import { IConfig } from "@/types/config.model"; import { IConfig } from "@/types/config.model";
import { useI18n } from "vue-i18n";
const { t } = useI18n({ useScope: "global" });
const EventParticipationCard = defineAsyncComponent( const EventParticipationCard = defineAsyncComponent(
() => import("@/components/Event/EventParticipationCard.vue") () => import("@/components/Event/EventParticipationCard.vue")

View file

@ -77,9 +77,7 @@ defmodule Mobilizon do
ErrorReporting.configure() ErrorReporting.configure()
if @env == :dev do setup_ecto_dev_logger(@env)
Ecto.DevLogger.install(Storage.Repo)
end
# Only attach the telemetry logger when we aren't in an IEx shell # Only attach the telemetry logger when we aren't in an IEx shell
unless Code.ensure_loaded?(IEx) && IEx.started?() do unless Code.ensure_loaded?(IEx) && IEx.started?() do
@ -156,4 +154,10 @@ defmodule Mobilizon do
restart: :temporary restart: :temporary
} }
end end
defp setup_ecto_dev_logger(:dev) do
Ecto.DevLogger.install(Storage.Repo)
end
defp setup_ecto_dev_logger(_), do: nil
end end

View file

@ -223,7 +223,7 @@ defmodule Mobilizon.Mixfile do
{:sobelow, "~> 0.8", only: [:dev, :test]}, {:sobelow, "~> 0.8", only: [:dev, :test]},
{:doctor, "~> 0.20.0", only: :dev}, {:doctor, "~> 0.20.0", only: :dev},
{:haversine, "~> 0.1.0"}, {:haversine, "~> 0.1.0"},
{:ecto_dev_logger, "~> 0.7", only: :dev} {:ecto_dev_logger, "~> 0.7"}
] ++ oauth_deps() ] ++ oauth_deps()
end end