Fix new lists created with quick actions not showing up in the menu
This commit is contained in:
parent
2b7e9856d8
commit
b8c7dba0ef
3 changed files with 29 additions and 21 deletions
|
@ -51,15 +51,13 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TaskService from '@/services/task'
|
import TaskService from '@/services/task'
|
||||||
import ListService from '@/services/list'
|
|
||||||
import NamespaceService from '@/services/namespace'
|
|
||||||
import TeamService from '@/services/team'
|
import TeamService from '@/services/team'
|
||||||
|
|
||||||
import TaskModel from '@/models/task'
|
import TaskModel from '@/models/task'
|
||||||
import NamespaceModel from '@/models/namespace'
|
import NamespaceModel from '@/models/namespace'
|
||||||
import TeamModel from '@/models/team'
|
import TeamModel from '@/models/team'
|
||||||
|
|
||||||
import {CURRENT_LIST, QUICK_ACTIONS_ACTIVE} from '@/store/mutation-types'
|
import {CURRENT_LIST, LOADING, LOADING_MODULE, QUICK_ACTIONS_ACTIVE} from '@/store/mutation-types'
|
||||||
import ListModel from '@/models/list'
|
import ListModel from '@/models/list'
|
||||||
|
|
||||||
const TYPE_LIST = 'list'
|
const TYPE_LIST = 'list'
|
||||||
|
@ -91,9 +89,6 @@ export default {
|
||||||
foundTeams: [],
|
foundTeams: [],
|
||||||
teamSearchTimeout: null,
|
teamSearchTimeout: null,
|
||||||
teamService: null,
|
teamService: null,
|
||||||
|
|
||||||
namespaceService: null,
|
|
||||||
listService: null,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -148,8 +143,8 @@ export default {
|
||||||
},
|
},
|
||||||
loading() {
|
loading() {
|
||||||
return this.taskService.loading ||
|
return this.taskService.loading ||
|
||||||
this.listService.loading ||
|
(this.$store.state[LOADING] && this.$store.state[LOADING_MODULE] === 'namespaces') ||
|
||||||
this.namespaceService.loading ||
|
(this.$store.state[LOADING] && this.$store.state[LOADING_MODULE] === 'lists') ||
|
||||||
this.teamService.loading
|
this.teamService.loading
|
||||||
},
|
},
|
||||||
placeholder() {
|
placeholder() {
|
||||||
|
@ -230,8 +225,6 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.taskService = new TaskService()
|
this.taskService = new TaskService()
|
||||||
this.listService = new ListService()
|
|
||||||
this.namespaceService = new NamespaceService()
|
|
||||||
this.teamService = new TeamService()
|
this.teamService = new TeamService()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -378,7 +371,7 @@ export default {
|
||||||
title: this.query,
|
title: this.query,
|
||||||
namespaceId: this.currentList.namespaceId,
|
namespaceId: this.currentList.namespaceId,
|
||||||
})
|
})
|
||||||
this.listService.create(newList)
|
this.$store.dispatch('lists/createList', newList)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
this.success({message: this.$t('list.create.createdSuccess')})
|
this.success({message: this.$t('list.create.createdSuccess')})
|
||||||
this.$router.push({name: 'list.index', params: {listId: r.id}})
|
this.$router.push({name: 'list.index', params: {listId: r.id}})
|
||||||
|
@ -390,9 +383,9 @@ export default {
|
||||||
},
|
},
|
||||||
newNamespace() {
|
newNamespace() {
|
||||||
const newNamespace = new NamespaceModel({title: this.query})
|
const newNamespace = new NamespaceModel({title: this.query})
|
||||||
this.namespaceService.create(newNamespace)
|
|
||||||
.then(r => {
|
this.$store.dispatch('namespaces/createNamespace', newNamespace)
|
||||||
this.$store.commit('namespaces/addNamespace', r)
|
.then(() => {
|
||||||
this.success({message: this.$t('namespace.create.success')})
|
this.success({message: this.$t('namespace.create.success')})
|
||||||
this.closeQuickActions()
|
this.closeQuickActions()
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import ListService from '@/services/list'
|
import ListService from '@/services/list'
|
||||||
|
import {setLoading} from '@/store/helper'
|
||||||
|
|
||||||
const FavoriteListsNamespace = -2
|
const FavoriteListsNamespace = -2
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ export default {
|
||||||
return ctx.dispatch('updateList', list)
|
return ctx.dispatch('updateList', list)
|
||||||
},
|
},
|
||||||
createList(ctx, list) {
|
createList(ctx, list) {
|
||||||
|
const cancel = setLoading(ctx, 'lists')
|
||||||
const listService = new ListService()
|
const listService = new ListService()
|
||||||
|
|
||||||
return listService.create(list)
|
return listService.create(list)
|
||||||
|
@ -41,11 +43,11 @@ export default {
|
||||||
ctx.commit('setList', r)
|
ctx.commit('setList', r)
|
||||||
return Promise.resolve(r)
|
return Promise.resolve(r)
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => Promise.reject(e))
|
||||||
return Promise.reject(e)
|
.finally(() => cancel())
|
||||||
})
|
|
||||||
},
|
},
|
||||||
updateList(ctx, list) {
|
updateList(ctx, list) {
|
||||||
|
const cancel = setLoading(ctx, 'lists')
|
||||||
const listService = new ListService()
|
const listService = new ListService()
|
||||||
|
|
||||||
return listService.update(list)
|
return listService.update(list)
|
||||||
|
@ -69,6 +71,7 @@ export default {
|
||||||
ctx.commit('setList', list)
|
ctx.commit('setList', list)
|
||||||
return Promise.reject(e)
|
return Promise.reject(e)
|
||||||
})
|
})
|
||||||
|
.finally(() => cancel())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -116,9 +116,7 @@ export default {
|
||||||
|
|
||||||
return Promise.resolve(r)
|
return Promise.resolve(r)
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => Promise.reject(e))
|
||||||
return Promise.reject(e)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
@ -136,6 +134,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteNamespace(ctx, namespace) {
|
deleteNamespace(ctx, namespace) {
|
||||||
|
const cancel = setLoading(ctx, 'namespaces')
|
||||||
const namespaceService = new NamespaceService()
|
const namespaceService = new NamespaceService()
|
||||||
|
|
||||||
return namespaceService.delete(namespace)
|
return namespaceService.delete(namespace)
|
||||||
|
@ -143,7 +142,20 @@ export default {
|
||||||
ctx.commit('removeNamespaceById', namespace.id)
|
ctx.commit('removeNamespaceById', namespace.id)
|
||||||
return Promise.resolve(r)
|
return Promise.resolve(r)
|
||||||
})
|
})
|
||||||
.catch(Promise.reject)
|
.catch(e => Promise.reject(e))
|
||||||
|
.finally(() => cancel())
|
||||||
|
},
|
||||||
|
createNamespace(ctx, namespace) {
|
||||||
|
const cancel = setLoading(ctx, 'namespaces')
|
||||||
|
const namespaceService = new NamespaceService()
|
||||||
|
|
||||||
|
return namespaceService.create(namespace)
|
||||||
|
.then(r => {
|
||||||
|
ctx.commit('addNamespace', r)
|
||||||
|
return Promise.resolve(r)
|
||||||
|
})
|
||||||
|
.catch(e => Promise.reject(e))
|
||||||
|
.finally(() => cancel())
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
Loading…
Reference in a new issue