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