fix: list loading

This commit is contained in:
Dominik Pschenitschni 2021-11-17 18:04:53 +01:00
parent 29a9335844
commit 5937f01cc5
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
7 changed files with 12 additions and 12 deletions

View file

@ -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')

View file

@ -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') }}

View file

@ -251,7 +251,7 @@ const router = createRouter({
component: ShowTasksInRangeComponent,
},
{
path: '/lists/:id/new',
path: '/lists/new/:namespaceId/',
name: 'list.create',
component: NewListComponent,
meta: {

View file

@ -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"
>

View file

@ -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
) {

View file

@ -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({

View file

@ -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>