read notification working
This commit is contained in:
parent
0b472988a2
commit
2071d9bd6d
4 changed files with 57 additions and 48 deletions
|
|
@ -2,7 +2,6 @@
|
|||
<article
|
||||
class="notification | bg-white rounded-lg | p-16 | flow"
|
||||
data-type="comment"
|
||||
@click="router.push(href)"
|
||||
>
|
||||
<header>
|
||||
<p class="flex">
|
||||
|
|
@ -39,31 +38,8 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from "vue-router";
|
||||
import { useNotificationsStore } from "../../stores/notifications";
|
||||
|
||||
const router = useRouter();
|
||||
const { notification } = defineProps({ notification: Object });
|
||||
const { formatDate } = useNotificationsStore();
|
||||
|
||||
const href = getTargetPath();
|
||||
|
||||
// Functions
|
||||
function getTargetPath() {
|
||||
const uri = notification.location.page.uri;
|
||||
|
||||
const isDocumentBrief =
|
||||
notification.location.page.template === "client-brief" &&
|
||||
notification.location?.file.type === "document";
|
||||
|
||||
if (isDocumentBrief) {
|
||||
return notification.project.uri + "?dialog=client-brief&comments=true";
|
||||
}
|
||||
|
||||
if (notification.location.page.template === "track") {
|
||||
return notification.project.uri + "?dialog=virtual-sample&comments=true";
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue