WIP: feat: route modals everywhere #2735

Closed
dpschen wants to merge 15 commits from dpschen/frontend:feature/route-modals-everywhere into main
2 changed files with 8 additions and 13 deletions
Showing only changes of commit 440e90230a - Show all commits

View File

@ -13,7 +13,11 @@
/> />
<router-link <router-link
:to="taskDetailRoute" :to="{
name: 'task.detail',
params: {id: task.id},
state: { backdropRoutePath: $route.fullPath },
}"
:class="{ 'done': task.done}" :class="{ 'done': task.done}"
class="tasktext" class="tasktext"
> >
@ -221,14 +225,6 @@ const currentList = computed(() => {
} : baseStore.currentList } : baseStore.currentList
}) })
const taskDetailRoute = computed(() => ({
name: 'task.detail',
params: {id: task.value.id},
// TODO: re-enable opening task detail in modal
// state: { backdropRoutePath: router.currentRoute.value.fullPath },
}))
async function markAsDone(checked: boolean) { async function markAsDone(checked: boolean) {
const updateFunc = async () => { const updateFunc = async () => {
const newTask = await taskStore.update(task.value) const newTask = await taskStore.update(task.value)

View File

@ -181,7 +181,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {toRef, computed, type Ref} from 'vue' import {toRef, computed, type Ref} from 'vue'
import {useRoute} from 'vue-router'
import {useStorage} from '@vueuse/core' import {useStorage} from '@vueuse/core'
import ListWrapper from '@/components/list/ListWrapper.vue' import ListWrapper from '@/components/list/ListWrapper.vue'
@ -274,15 +274,14 @@ function sort(property: keyof SortBy) {
sortByParam.value = sortBy.value sortByParam.value = sortBy.value
} }
// TODO: re-enable opening task detail in modal const route = useRoute()
// const router = useRouter()
const taskDetailRoutes = computed(() => Object.fromEntries( const taskDetailRoutes = computed(() => Object.fromEntries(
tasks.value.map(({id}) => ([ tasks.value.map(({id}) => ([
id, id,
{ {
name: 'task.detail', name: 'task.detail',
params: {id}, params: {id},
// state: { backdropRoutePath: router.currentRoute.value.fullPath }, state: { backdropRoutePath: route.fullPath },
}, },
])), ])),
)) ))