2020-02-18 07:57:00 +00:00
|
|
|
<template>
|
2022-07-12 08:55:28 +00:00
|
|
|
<section class="container mx-auto" v-if="todo">
|
2022-01-10 14:19:16 +00:00
|
|
|
<breadcrumbs-nav
|
|
|
|
:links="[
|
|
|
|
{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: {
|
|
|
|
preferredUsername: usernameWithDomain(todo.todoList.actor),
|
|
|
|
},
|
|
|
|
text: displayName(todo.todoList.actor),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: RouteName.TODO_LISTS,
|
|
|
|
params: {
|
|
|
|
preferredUsername: usernameWithDomain(todo.todoList.actor),
|
|
|
|
},
|
|
|
|
text: $t('Task lists'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: RouteName.TODO_LIST,
|
|
|
|
params: { id: todo.todoList.id },
|
|
|
|
text: todo.todoList.title,
|
|
|
|
},
|
|
|
|
{ name: RouteName.TODO, text: todo.title },
|
|
|
|
]"
|
|
|
|
/>
|
2020-02-18 07:57:00 +00:00
|
|
|
<full-todo :todo="todo" />
|
|
|
|
</section>
|
|
|
|
</template>
|
2022-07-12 08:55:28 +00:00
|
|
|
<script lang="ts" setup>
|
2020-02-18 07:57:00 +00:00
|
|
|
import { GET_TODO } from "@/graphql/todos";
|
|
|
|
import { ITodo } from "@/types/todos";
|
|
|
|
import FullTodo from "@/components/Todo/FullTodo.vue";
|
|
|
|
import RouteName from "../../router/name";
|
2022-01-10 14:19:16 +00:00
|
|
|
import { displayName, usernameWithDomain } from "@/types/actor";
|
2022-07-12 08:55:28 +00:00
|
|
|
import { useQuery } from "@vue/apollo-composable";
|
2023-11-21 15:04:09 +00:00
|
|
|
import { useHead } from "@unhead/vue";
|
2022-07-12 08:55:28 +00:00
|
|
|
import { computed } from "vue";
|
2020-02-18 07:57:00 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const props = defineProps<{ todoId: string }>();
|
2020-02-18 07:57:00 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const { result: todoResult } = useQuery<{ todo: ITodo }>(GET_TODO, () => ({
|
|
|
|
id: props.todoId,
|
|
|
|
}));
|
2020-02-18 07:57:00 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const todo = computed(() => todoResult.value?.todo);
|
2022-01-10 14:19:16 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
useHead({
|
|
|
|
title: computed(() => todo.value?.title),
|
|
|
|
});
|
2020-02-18 07:57:00 +00:00
|
|
|
</script>
|