fix: list loading
This commit is contained in:
parent
29a9335844
commit
5937f01cc5
7 changed files with 12 additions and 12 deletions
|
@ -29,7 +29,7 @@ describe('Lists', () => {
|
|||
.contains('New list')
|
||||
.click()
|
||||
cy.url()
|
||||
.should('contain', '/namespaces/1/list')
|
||||
.should('contain', '/lists/new/1')
|
||||
cy.get('.card-header-title')
|
||||
.contains('Create a new list')
|
||||
cy.get('input.input')
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
{{ $t('menu.share') }}
|
||||
</dropdown-item>
|
||||
<dropdown-item
|
||||
:to="{ name: 'list.create', params: { id: namespace.id } }"
|
||||
:to="{ name: 'list.create', params: { namespaceId: namespace.id } }"
|
||||
icon="plus"
|
||||
>
|
||||
{{ $t('menu.newList') }}
|
||||
|
|
|
@ -251,7 +251,7 @@ const router = createRouter({
|
|||
component: ShowTasksInRangeComponent,
|
||||
},
|
||||
{
|
||||
path: '/lists/:id/new',
|
||||
path: '/lists/new/:namespaceId/',
|
||||
name: 'list.create',
|
||||
component: NewListComponent,
|
||||
meta: {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<template v-if="defaultNamespaceId > 0">
|
||||
<p class="mt-4">{{ $t('home.list.newText') }}</p>
|
||||
<x-button
|
||||
:to="{ name: 'list.create', params: { id: defaultNamespaceId } }"
|
||||
:to="{ name: 'list.create', params: { namespaceId: defaultNamespaceId } }"
|
||||
:shadow="false"
|
||||
class="ml-2"
|
||||
>
|
||||
|
|
|
@ -87,8 +87,8 @@ watchEffect(() => loadList(listId.value))
|
|||
|
||||
useTitle(() => currentList.value.id ? getListTitle(currentList.value) : '')
|
||||
|
||||
async function loadList(listId) {
|
||||
const listData = {id: listId}
|
||||
async function loadList(listIdToLoad) {
|
||||
const listData = {id: listIdToLoad}
|
||||
saveListToHistory(listData)
|
||||
|
||||
// This invalidates the loaded list at the kanban board which lets it reload its content when
|
||||
|
@ -107,9 +107,9 @@ async function loadList(listId) {
|
|||
// the currently loaded list has the right set.
|
||||
if (
|
||||
(
|
||||
listId.value === loadedListId.value ||
|
||||
typeof listId.value === 'undefined' ||
|
||||
listId.value === currentList.value.id
|
||||
listIdToLoad === loadedListId.value ||
|
||||
typeof listIdToLoad === 'undefined' ||
|
||||
listIdToLoad === currentList.value.id
|
||||
)
|
||||
&& typeof currentList.value !== 'undefined' && currentList.value.maxRight !== null
|
||||
) {
|
||||
|
|
|
@ -61,7 +61,7 @@ export default {
|
|||
}
|
||||
this.showError = false
|
||||
|
||||
this.list.namespaceId = parseInt(this.$route.params.id)
|
||||
this.list.namespaceId = parseInt(this.$route.params.namespaceId)
|
||||
const list = await this.$store.dispatch('lists/createList', this.list)
|
||||
this.$message.success({message: this.$t('list.create.createdSuccess') })
|
||||
this.$router.push({
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<div :key="`n${n.id}`" class="namespace" v-for="n in namespaces">
|
||||
<x-button
|
||||
:to="{name: 'list.create', params: {id: n.id}}"
|
||||
:to="{name: 'list.create', params: {namespaceId: n.id}}"
|
||||
class="is-pulled-right"
|
||||
variant="secondary"
|
||||
v-if="n.id > 0 && n.lists.length > 0"
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
<p class="has-text-centered has-text-grey mt-4 is-italic" v-if="n.lists.length === 0">
|
||||
{{ $t('namespace.noLists') }}
|
||||
<router-link :to="{name: 'list.create', params: {id: n.id}}">
|
||||
<router-link :to="{name: 'list.create', params: {namespaceId: n.id}}">
|
||||
{{ $t('namespace.createList') }}
|
||||
</router-link>
|
||||
</p>
|
||||
|
|
Loading…
Reference in a new issue