Fix dashboard view

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-10-31 13:01:37 +01:00
parent 470a3e594b
commit ecb862f634
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 16 additions and 55 deletions

View file

@ -8,11 +8,18 @@ export const DASHBOARD = gql`
id id
uuid uuid
title title
beginsOn
picture { picture {
id id
alt alt
url url
} }
attributedTo {
...ActorFragment
}
organizerActor {
...ActorFragment
}
} }
lastGroupCreated { lastGroupCreated {
...ActorFragment ...ActorFragment

View file

@ -64,61 +64,14 @@
}" }"
/> />
</div> </div>
<div class="tile"> <div class="flex flex-wrap gap-4">
<div <div>
class="tile is-parent is-vertical is-6" <h2>{{ t('Last published event')}}</h2>
v-if="dashboard?.lastPublicEventPublished" <event-card v-if="dashboard?.lastPublicEventPublished" :event="dashboard?.lastPublicEventPublished" />
>
<article class="tile is-child box">
<router-link
:to="{
name: RouteName.EVENT,
params: { uuid: dashboard?.lastPublicEventPublished.uuid },
}"
>
<p>{{ t("Last published event") }}</p>
<p>
{{ dashboard?.lastPublicEventPublished.title }}
</p>
<figure
class="image is-4by3"
v-if="dashboard?.lastPublicEventPublished.picture"
>
<img :src="dashboard?.lastPublicEventPublished.picture.url" />
</figure>
</router-link>
</article>
</div> </div>
<div <div>
class="tile is-parent is-vertical" <h2>{{ t('Last group created')}}</h2>
v-if="dashboard?.lastGroupCreated" <group-card v-if="dashboard?.lastGroupCreated" :group="dashboard?.lastGroupCreated" />
>
<article class="tile is-child box">
<router-link
:to="{
name: RouteName.GROUP,
params: {
preferredUsername: usernameWithDomain(
dashboard?.lastGroupCreated
),
},
}"
>
<p>{{ t("Last group created") }}</p>
<p>
{{
dashboard?.lastGroupCreated.name ||
dashboard?.lastGroupCreated.preferredUsername
}}
</p>
<figure
class="image is-4by3"
v-if="dashboard?.lastGroupCreated.avatar"
>
<img :src="dashboard?.lastGroupCreated.avatar.url" />
</figure>
</router-link>
</article>
</div> </div>
</div> </div>
</section> </section>
@ -127,7 +80,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { DASHBOARD } from "@/graphql/admin"; import { DASHBOARD } from "@/graphql/admin";
import { IDashboard } from "@/types/admin.model"; import { IDashboard } from "@/types/admin.model";
import { usernameWithDomain } from "@/types/actor";
import RouteName from "@/router/name"; import RouteName from "@/router/name";
import { useQuery } from "@vue/apollo-composable"; import { useQuery } from "@vue/apollo-composable";
import { computed } from "vue"; import { computed } from "vue";
@ -136,6 +88,8 @@ import { useHead } from "@vueuse/head";
import NumberDashboardTile from "@/components/Dashboard/NumberDashboardTile.vue"; import NumberDashboardTile from "@/components/Dashboard/NumberDashboardTile.vue";
import LinkedNumberDashboardTile from "@/components/Dashboard/LinkedNumberDashboardTile.vue"; import LinkedNumberDashboardTile from "@/components/Dashboard/LinkedNumberDashboardTile.vue";
import { InstanceFilterFollowStatus } from "@/types/enums"; import { InstanceFilterFollowStatus } from "@/types/enums";
import GroupCard from "@/components/Group/GroupCard.vue";
import EventCard from "@/components/Event/EventCard.vue";
const { result: dashboardResult } = useQuery<{ dashboard: IDashboard }>( const { result: dashboardResult } = useQuery<{ dashboard: IDashboard }>(
DASHBOARD DASHBOARD