comment notification : dynamize target uri
This commit is contained in:
parent
246d21f85a
commit
375bed1d01
3 changed files with 11 additions and 5 deletions
|
|
@ -10,7 +10,8 @@ function getProjectData($project) {
|
||||||
"logo" => $project->client()->toPage() ? $project->client()->toPage()->logo()->toFile()->url() : "",
|
"logo" => $project->client()->toPage() ? $project->client()->toPage()->logo()->toFile()->url() : "",
|
||||||
"steps" => $project->getSteps(),
|
"steps" => $project->getSteps(),
|
||||||
"notifications" => Yaml::decode($project->notifications()->value),
|
"notifications" => Yaml::decode($project->notifications()->value),
|
||||||
"uuid" => (string) $project->uuid()
|
"uuid" => (string) $project->uuid(),
|
||||||
|
"slug" => (string) $project->slug(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<article
|
<article
|
||||||
class="notification | bg-white rounded-lg | p-16 | flow"
|
class="notification | bg-white rounded-lg | p-16 | flow"
|
||||||
data-type="comment"
|
data-type="comment"
|
||||||
@click="router.push(notification.location.dialoguri + '&comments=true')"
|
@click="router.push(targetUri + '&comments=true')"
|
||||||
>
|
>
|
||||||
<header>
|
<header>
|
||||||
<p class="flex">
|
<p class="flex">
|
||||||
|
|
@ -47,4 +47,8 @@ const { formatDate } = useNotificationsStore();
|
||||||
const { getProjectByUuid } = useProjectsStore();
|
const { getProjectByUuid } = useProjectsStore();
|
||||||
|
|
||||||
const project = getProjectByUuid(notification.location.project.uuid);
|
const project = getProjectByUuid(notification.location.project.uuid);
|
||||||
|
const targetUri = notification.location.dialoguri.replace(
|
||||||
|
/\/projects\/([a-z0-9\-]+)/,
|
||||||
|
"/projects/" + notification.target.slug
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,10 @@ export const useUserStore = defineStore("user", () => {
|
||||||
const projectNotifications = project.notifications.map(
|
const projectNotifications = project.notifications.map(
|
||||||
(notification) => ({
|
(notification) => ({
|
||||||
...notification,
|
...notification,
|
||||||
project: {
|
target: {
|
||||||
id: project.id,
|
uuid: project.uuid,
|
||||||
name: project.title,
|
title: project.title,
|
||||||
|
slug: project.slug,
|
||||||
},
|
},
|
||||||
isRead:
|
isRead:
|
||||||
notification.author.uuid === user.value.uuid ||
|
notification.author.uuid === user.value.uuid ||
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue