Compare commits
3 Commits
4b202b6f3a
...
e2c71bf636
Author | SHA1 | Date | |
---|---|---|---|
e2c71bf636 | |||
d7fb1a1e14 | |||
7e218e03b2 |
|
@ -128,4 +128,24 @@ describe('Home Page Task Overview', () => {
|
|||
.last()
|
||||
.should('contain.text', newTaskTitle)
|
||||
})
|
||||
|
||||
it('Should show the cta buttons for new list when there are no tasks', () => {
|
||||
TaskFactory.truncate()
|
||||
|
||||
cy.visit('/')
|
||||
|
||||
cy.get('.home.app-content .content')
|
||||
.should('contain.text', 'You can create a new list for your new tasks:')
|
||||
.should('contain.text', 'Or import your lists and tasks from other services into Vikunja:')
|
||||
})
|
||||
|
||||
it('Should not show the cta buttons for new list when there are tasks', () => {
|
||||
seedTasks()
|
||||
|
||||
cy.visit('/')
|
||||
|
||||
cy.get('.home.app-content .content')
|
||||
.should('not.contain.text', 'You can create a new list for your new tasks:')
|
||||
.should('not.contain.text', 'Or import your lists and tasks from other services into Vikunja:')
|
||||
})
|
||||
})
|
||||
|
|
|
@ -546,5 +546,35 @@ describe('Task', () => {
|
|||
cy.get('.bucket .task .footer .icon svg.fa-paperclip')
|
||||
.should('exist')
|
||||
})
|
||||
|
||||
it('Can check items off a checklist', () => {
|
||||
const tasks = TaskFactory.create(1, {
|
||||
id: 1,
|
||||
description: `
|
||||
This is a checklist:
|
||||
|
||||
* [ ] one item
|
||||
* [ ] another item
|
||||
* [ ] third item
|
||||
* [ ] fourth item
|
||||
* [x] and this one is already done
|
||||
`,
|
||||
})
|
||||
cy.visit(`/tasks/${tasks[0].id}`)
|
||||
|
||||
cy.get('.task-view .checklist-summary')
|
||||
.should('contain.text', '1 of 5 tasks')
|
||||
cy.get('.editor .content ul > li input[type=checkbox]')
|
||||
.eq(2)
|
||||
.click()
|
||||
|
||||
cy.get('.editor .content ul > li input[type=checkbox]')
|
||||
.eq(2)
|
||||
.should('be.checked')
|
||||
cy.get('.editor .content input[type=checkbox]')
|
||||
.should('have.length', 5)
|
||||
cy.get('.task-view .checklist-summary')
|
||||
.should('contain.text', '2 of 5 tasks')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
"vite-plugin-pwa": "0.13.1",
|
||||
"vite-svg-loader": "3.6.0",
|
||||
"vitest": "0.24.3",
|
||||
"vue-tsc": "1.0.8",
|
||||
"vue-tsc": "1.0.9",
|
||||
"wait-on": "6.0.1",
|
||||
"workbox-cli": "6.5.4"
|
||||
},
|
||||
|
|
|
@ -80,7 +80,7 @@ specifiers:
|
|||
vue-flatpickr-component: 10.0.0
|
||||
vue-i18n: 9.2.2
|
||||
vue-router: 4.1.5
|
||||
vue-tsc: 1.0.8
|
||||
vue-tsc: 1.0.9
|
||||
wait-on: 6.0.1
|
||||
workbox-cli: 6.5.4
|
||||
workbox-precaching: 6.5.4
|
||||
|
@ -170,7 +170,7 @@ devDependencies:
|
|||
vite-plugin-pwa: 0.13.1_2txo4viysstjrz5b6oxcrxybay
|
||||
vite-svg-loader: 3.6.0
|
||||
vitest: 0.24.3_voxzrpq56bzpuevukk5apxlhw4
|
||||
vue-tsc: 1.0.8_typescript@4.8.4
|
||||
vue-tsc: 1.0.9_typescript@4.8.4
|
||||
wait-on: 6.0.1
|
||||
workbox-cli: 6.5.4_acorn@8.8.0
|
||||
|
||||
|
@ -3328,31 +3328,31 @@ packages:
|
|||
vue: 3.2.41
|
||||
dev: true
|
||||
|
||||
/@volar/language-core/1.0.8:
|
||||
resolution: {integrity: sha512-uxYSOqBk8ZFSzGjUIPOBEFPOg8F3CE6cLO5meK95DODGIlUlPytGiy9sy8QZ9w7RpUH4XMOX3MH/G48SLgP07A==}
|
||||
/@volar/language-core/1.0.9:
|
||||
resolution: {integrity: sha512-5Fty3slLet6svXiJw2YxhYeo6c7wFdtILrql5bZymYLM+HbiZtJbryW1YnUEKAP7MO9Mbeh+TNH4Z0HFxHgIqw==}
|
||||
dependencies:
|
||||
'@volar/source-map': 1.0.8
|
||||
'@volar/source-map': 1.0.9
|
||||
'@vue/reactivity': 3.2.41
|
||||
muggle-string: 0.1.0
|
||||
dev: true
|
||||
|
||||
/@volar/source-map/1.0.8:
|
||||
resolution: {integrity: sha512-uKMe+alyfl1Abs5SviKejFoe7x9g6jDPVpVt63Tet4qn1Ziy7tFsvtCpM2Y1Ko5qw2nLIeloLslPqm9/gmbBLQ==}
|
||||
/@volar/source-map/1.0.9:
|
||||
resolution: {integrity: sha512-fazB/vy5ZEJ3yKx4fabJyGNI3CBkdLkfEIRVu6+1P3VixK0Mn+eqyUIkLBrzGYaeFM3GybhCLCvsVdNz0Fu/CQ==}
|
||||
dependencies:
|
||||
muggle-string: 0.1.0
|
||||
dev: true
|
||||
|
||||
/@volar/typescript/1.0.8:
|
||||
resolution: {integrity: sha512-2oY1Apvzcs/5tAn7p1tRlDxNgal5ezaK0h9cutcWALeimsaQBAEE2NAirCrLMHl8DneuDce0tzJqHaQeHw9RmQ==}
|
||||
/@volar/typescript/1.0.9:
|
||||
resolution: {integrity: sha512-dVziu+ShQUWuMukM6bvK2v2O446/gG6l1XkTh2vfkccw1IzjfbiP1TWQoNo1ipTfZOtu5YJGYAx+o5HNrGXWfQ==}
|
||||
dependencies:
|
||||
'@volar/language-core': 1.0.8
|
||||
'@volar/language-core': 1.0.9
|
||||
dev: true
|
||||
|
||||
/@volar/vue-language-core/1.0.8:
|
||||
resolution: {integrity: sha512-cXb7oTybxcm1vpz003agdYQHyxij7UAaSub60d7W1aMWpqb2iaCbVaq9izgQFlrpC4/JnVs+cJPb/Q6fAUVxBg==}
|
||||
/@volar/vue-language-core/1.0.9:
|
||||
resolution: {integrity: sha512-tofNoR8ShPFenHT1YVMuvoXtXWwoQE+fiXVqSmW0dSKZqEDjWQ3YeXSd0a6aqyKaIbvR7kWWGp34WbpQlwf9Ww==}
|
||||
dependencies:
|
||||
'@volar/language-core': 1.0.8
|
||||
'@volar/source-map': 1.0.8
|
||||
'@volar/language-core': 1.0.9
|
||||
'@volar/source-map': 1.0.9
|
||||
'@vue/compiler-dom': 3.2.41
|
||||
'@vue/compiler-sfc': 3.2.41
|
||||
'@vue/reactivity': 3.2.41
|
||||
|
@ -3361,11 +3361,11 @@ packages:
|
|||
vue-template-compiler: 2.7.10
|
||||
dev: true
|
||||
|
||||
/@volar/vue-typescript/1.0.8:
|
||||
resolution: {integrity: sha512-6jBvA7iwBkRqS2VQx2gLJgfLcF3hcODyJ6Lmiw2tN8D/LVfFCovvzJgPvIQb9Y4i+rha1Y0cpsYOUt9XW2Z7ZA==}
|
||||
/@volar/vue-typescript/1.0.9:
|
||||
resolution: {integrity: sha512-ZLe4y9YNbviACa7uAMCilzxA76gbbSlKfjspXBzk6fCobd8QCIig+VyDYcjANIlm2HhgSCX8jYTzhCKlegh4mw==}
|
||||
dependencies:
|
||||
'@volar/typescript': 1.0.8
|
||||
'@volar/vue-language-core': 1.0.8
|
||||
'@volar/typescript': 1.0.9
|
||||
'@volar/vue-language-core': 1.0.9
|
||||
dev: true
|
||||
|
||||
/@vue/compiler-core/3.2.37:
|
||||
|
@ -12758,14 +12758,14 @@ packages:
|
|||
he: 1.2.0
|
||||
dev: true
|
||||
|
||||
/vue-tsc/1.0.8_typescript@4.8.4:
|
||||
resolution: {integrity: sha512-+0sJ+QVH7SHLt8mV/uIw4xlHDk1mWigZkMFugfZTv8rlHpM3S2tCVZ0BWEGclT/0rKdO8j+St+mljpvhWPN/eQ==}
|
||||
/vue-tsc/1.0.9_typescript@4.8.4:
|
||||
resolution: {integrity: sha512-vRmHD1K6DmBymNhoHjQy/aYKTRQNLGOu2/ESasChG9Vy113K6CdP0NlhR0bzgFJfv2eFB9Ez/9L5kIciUajBxQ==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
dependencies:
|
||||
'@volar/vue-language-core': 1.0.8
|
||||
'@volar/vue-typescript': 1.0.8
|
||||
'@volar/vue-language-core': 1.0.9
|
||||
'@volar/vue-typescript': 1.0.9
|
||||
typescript: 4.8.4
|
||||
dev: true
|
||||
|
||||
|
|
|
@ -285,9 +285,9 @@ function handleCheckboxClick(e: Event) {
|
|||
console.debug('no index found')
|
||||
return
|
||||
}
|
||||
console.debug(index, text.value.slice(index, 9))
|
||||
|
||||
const listPrefix = text.value.slice(index, 1)
|
||||
const listPrefix = text.value.substring(index, index + 1)
|
||||
|
||||
console.debug({index, listPrefix, checked, text: text.value})
|
||||
|
||||
text.value = replaceAt(text.value, index, `${listPrefix} ${checked ? '[x]' : '[ ]'} `)
|
||||
bubble()
|
||||
|
|
|
@ -28,6 +28,7 @@ import {useLabelStore} from '@/stores/labels'
|
|||
import {useListStore} from '@/stores/lists'
|
||||
import {useAttachmentStore} from '@/stores/attachments'
|
||||
import {useKanbanStore} from '@/stores/kanban'
|
||||
import {useBaseStore} from '@/stores/base'
|
||||
|
||||
// IDEA: maybe use a small fuzzy search here to prevent errors
|
||||
function findPropertyByValue(object, key, value) {
|
||||
|
@ -105,6 +106,7 @@ export const useTaskStore = defineStore('task', {
|
|||
const cancel = setModuleLoading(this)
|
||||
try {
|
||||
this.tasks = await taskService.getAll({}, params)
|
||||
useBaseStore().setHasTasks(this.tasks.length > 0)
|
||||
return this.tasks
|
||||
} finally {
|
||||
cancel()
|
||||
|
|
Reference in New Issue
Block a user