2020-02-18 07:57:00 +00:00
|
|
|
<template>
|
|
|
|
<section class="section container" 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>
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
|
|
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";
|
2020-02-18 07:57:00 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
FullTodo,
|
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
todo: {
|
|
|
|
query: GET_TODO,
|
2020-08-27 09:53:24 +00:00
|
|
|
fetchPolicy: "cache-and-network",
|
2020-02-18 07:57:00 +00:00
|
|
|
variables() {
|
|
|
|
return {
|
|
|
|
id: this.$route.params.todoId,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-10-10 14:24:12 +00:00
|
|
|
metaInfo() {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
// @ts-ignore
|
|
|
|
const { todo } = this;
|
|
|
|
return {
|
|
|
|
title: todo.title,
|
|
|
|
};
|
|
|
|
},
|
2020-02-18 07:57:00 +00:00
|
|
|
})
|
|
|
|
export default class Todo extends Vue {
|
|
|
|
@Prop({ type: String, required: true }) todoId!: string;
|
|
|
|
|
|
|
|
todo!: ITodo;
|
|
|
|
|
|
|
|
RouteName = RouteName;
|
2022-01-10 14:19:16 +00:00
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
|
|
|
|
|
|
|
displayName = displayName;
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
</script>
|