appointment request notification working

This commit is contained in:
isUnknown 2025-01-27 14:46:50 +01:00
parent 54af78e32c
commit 85e3e7b2d4
4 changed files with 68 additions and 4 deletions

View file

@ -0,0 +1,59 @@
<template>
<article
@click="read()"
v-if="useUserStore.role !== 'client'"
class="notification | bg-white rounded-lg | p-16 | flow"
data-type="appointment-request"
>
<header>
<p class="flex">
<strong
class="notification__type | font-medium text-primary"
data-icon="comment"
>Demande de rendez-vous</strong
>
<span class="notification__client | text-grey-700"
>{{ notification.project.title }}
{{
notification.project.status === "draft" ? "(brouillon)" : ""
}}</span
>
<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"
v-html="
'Auteur : ' +
(notification.author.name
? notification.author.name + ' (' + notification.author.email + ')'
: notification.author.email) +
' : <br>' +
notification.text
"
></p>
</article>
</template>
<script setup>
import { useNotificationsStore } from "../../stores/notifications";
import { useUserStore } from "../../stores/user";
import { useApiStore } from "../../stores/api";
const { notification } = defineProps({ notification: Object });
const { formatDate } = useNotificationsStore();
const { user } = useUserStore();
const api = useApiStore();
async function read() {
const response = await api.readNotification(
notification.id,
notification.project.uri
);
}
</script>

View file

@ -13,7 +13,10 @@
>Demande de création de projet</strong
>
<span class="notification__client | text-grey-700"
>{{ notification.project.title }} (brouillon)</span
>{{ notification.project.title }}
{{
notification.project.status === "draft" ? "(brouillon)" : ""
}}</span
>
<time
datetime=""
@ -26,11 +29,11 @@
v-if="notification.type"
class="notification__body | text-md font-medium | line-clamp"
v-html="
'Auteur de la demande : ' +
'De la part de ' +
(notification.author.name
? notification.author.name + ' (' + notification.author.email + ')'
: notification.author.email) +
'<br>Demande : ' +
' : <br>' +
notification.text
"
></p>