2024-12-19 10:32:48 +01:00
|
|
|
<template>
|
|
|
|
|
<article
|
|
|
|
|
class="notification | bg-white rounded-lg | p-16 | flow"
|
|
|
|
|
data-type="comment"
|
2025-01-10 18:17:13 +01:00
|
|
|
@click="router.push(targetUri + '&comments=true')"
|
2024-12-19 10:32:48 +01:00
|
|
|
>
|
|
|
|
|
<header>
|
|
|
|
|
<p class="flex">
|
|
|
|
|
<strong
|
|
|
|
|
class="notification__type | font-medium text-primary"
|
|
|
|
|
data-icon="comment"
|
|
|
|
|
>Commentaire</strong
|
|
|
|
|
>
|
2025-01-09 16:11:59 +01:00
|
|
|
<span class="notification__client | text-grey-700"
|
|
|
|
|
>{{ project.title }}
|
|
|
|
|
{{ project?.status === "unlisted" ? "(archivé)" : "" }}</span
|
|
|
|
|
>
|
2024-12-19 10:32:48 +01:00
|
|
|
<time
|
|
|
|
|
datetime=""
|
|
|
|
|
class="notification__date | text-grey-700 | ml-auto"
|
|
|
|
|
>{{ formatDate(notification) }}</time
|
|
|
|
|
>
|
|
|
|
|
</p>
|
|
|
|
|
</header>
|
|
|
|
|
<p
|
|
|
|
|
v-if="notification.type"
|
|
|
|
|
class="notification__body | text-md font-medium | line-clamp"
|
|
|
|
|
>
|
|
|
|
|
{{
|
|
|
|
|
notification.author.name
|
|
|
|
|
? notification.author.name
|
|
|
|
|
: notification.author.email
|
|
|
|
|
}}
|
|
|
|
|
: {{ notification.text }}
|
|
|
|
|
</p>
|
|
|
|
|
</article>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-12-19 10:37:20 +01:00
|
|
|
import { useRouter } from "vue-router";
|
2024-12-19 10:32:48 +01:00
|
|
|
import { useNotificationsStore } from "../../stores/notifications";
|
2025-01-09 16:11:59 +01:00
|
|
|
import { useProjectsStore } from "../../stores/projects";
|
2024-12-19 10:32:48 +01:00
|
|
|
|
2024-12-19 10:37:20 +01:00
|
|
|
const router = useRouter();
|
2024-12-19 10:32:48 +01:00
|
|
|
const { notification } = defineProps({ notification: Object });
|
|
|
|
|
const { formatDate } = useNotificationsStore();
|
2025-01-09 16:11:59 +01:00
|
|
|
const { getProjectByUuid } = useProjectsStore();
|
|
|
|
|
|
|
|
|
|
const project = getProjectByUuid(notification.location.project.uuid);
|
2025-01-10 18:17:13 +01:00
|
|
|
const targetUri = notification.location.dialoguri.replace(
|
|
|
|
|
/\/projects\/([a-z0-9\-]+)/,
|
|
|
|
|
"/projects/" + notification.target.slug
|
|
|
|
|
);
|
2024-12-19 10:32:48 +01:00
|
|
|
</script>
|