Fix navigating back to list view after deleting a task

This commit is contained in:
kolaente 2020-04-30 12:49:42 +02:00
parent 120d5a8c19
commit b043369245
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
6 changed files with 8 additions and 20 deletions

View file

@ -141,7 +141,7 @@
<div class="more-container" :key="n.id + 'child'"> <div class="more-container" :key="n.id + 'child'">
<ul class="menu-list can-be-hidden" > <ul class="menu-list can-be-hidden" >
<li v-for="l in n.lists" :key="l.id"> <li v-for="l in n.lists" :key="l.id">
<router-link :to="{ name: 'showList', params: { listId: l.id} }"> <router-link :to="{ name: 'list.index', params: { listId: l.id} }">
<span class="name"> <span class="name">
<span class="color-bubble" v-if="l.hexColor !== ''" :style="{ backgroundColor: l.hexColor }"></span> <span class="color-bubble" v-if="l.hexColor !== ''" :style="{ backgroundColor: l.hexColor }"></span>
{{l.title}} {{l.title}}

View file

@ -70,7 +70,7 @@
.then(response => { .then(response => {
this.$parent.loadNamespaces() this.$parent.loadNamespaces()
this.success({message: 'The list was successfully created.'}, this) this.success({message: 'The list was successfully created.'}, this)
router.push({name: 'showList', params: {listId: response.id}}) router.push({name: 'list.index', params: {listId: response.id}})
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View file

@ -28,7 +28,7 @@
auth.linkShareAuth(this.$route.params.share) auth.linkShareAuth(this.$route.params.share)
.then((r) => { .then((r) => {
this.loading = false this.loading = false
router.push({name: 'showList', params: {listId: r.listId}}) router.push({name: 'list.index', params: {listId: r.listId}})
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View file

@ -12,7 +12,7 @@
<!-- Commented out because it is a) not working and b) not working --> <!-- Commented out because it is a) not working and b) not working -->
<!-- <h6 class="subtitle">--> <!-- <h6 class="subtitle">-->
<!-- {{ namespace.name }} >--> <!-- {{ namespace.name }} >-->
<!-- <router-link :to="{ name: 'showList', params: { id: list.id } }">--> <!-- <router-link :to="{ name: 'list.index', params: { id: list.id } }">-->
<!-- {{ list.title }}--> <!-- {{ list.title }}-->
<!-- </router-link>--> <!-- </router-link>-->
<!-- </h6>--> <!-- </h6>-->
@ -306,7 +306,6 @@
import TaskService from '../../services/task' import TaskService from '../../services/task'
import TaskModel from '../../models/task' import TaskModel from '../../models/task'
import relationKinds from '../../models/relationKinds' import relationKinds from '../../models/relationKinds'
import ListModel from '../../models/list'
import NamespaceModel from '../../models/namespace' import NamespaceModel from '../../models/namespace'
import priorites from '../../models/priorities' import priorites from '../../models/priorities'
@ -323,7 +322,7 @@
import Reminders from './reusable/reminders' import Reminders from './reusable/reminders'
import Comments from './reusable/comments' import Comments from './reusable/comments'
import router from '../../router' import router from '../../router'
import ListSearch from "./reusable/listSearch"; import ListSearch from './reusable/listSearch'
export default { export default {
name: 'TaskDetailView', name: 'TaskDetailView',
@ -347,7 +346,6 @@
task: TaskModel, task: TaskModel,
relationKinds: relationKinds, relationKinds: relationKinds,
list: ListModel,
namespace: NamespaceModel, namespace: NamespaceModel,
showDeleteModal: false, showDeleteModal: false,
taskTitle: '', taskTitle: '',
@ -484,7 +482,7 @@
this.taskService.delete(this.task) this.taskService.delete(this.task)
.then(() => { .then(() => {
this.success({message: 'The task been deleted successfully.'}, this) this.success({message: 'The task been deleted successfully.'}, this)
router.push({name: 'showList', params: {listId: this.list.id}}) router.back()
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View file

@ -5,7 +5,7 @@
<a @click="close()" class="close"> <a @click="close()" class="close">
<icon icon="times"/> <icon icon="times"/>
</a> </a>
<task-detail-view :parent-list="list" :parent-namespace="namespace"/> <task-detail-view/>
</div> </div>
</div> </div>
</div> </div>
@ -17,12 +17,6 @@
export default { export default {
name: 'TaskDetailViewModal', name: 'TaskDetailViewModal',
data() {
return {
list: null,
namespace: null,
}
},
components: { components: {
TaskDetailView, TaskDetailView,
}, },
@ -33,7 +27,3 @@
}, },
} }
</script> </script>
<style scoped>
</style>

View file

@ -92,7 +92,7 @@ export default new Router({
}, },
{ {
path: '/lists/:listId', path: '/lists/:listId',
name: 'showList', name: 'list.index',
component: ShowListComponent, component: ShowListComponent,
children: [ children: [
{ {