feature/projects-all-the-way-down #3323

Merged
konrad merged 123 commits from feature/projects-all-the-way-down into main 2023-05-30 10:09:40 +00:00
3 changed files with 7 additions and 5 deletions
Showing only changes of commit fd7d90b017 - Show all commits

View File

@ -100,14 +100,14 @@ describe('Task', () => {
.should('contain', 'Success')
})
it.only('Can add a task to favorites', () => {
it('Can add a task to favorites', () => {
TaskFactory.create(1)
cy.visit('/projects/1/list')
cy.get('.tasks .task .favorite')
.first()
.click()
cy.get('.menu.namespaces-lists')
cy.get('.menu-container')
.should('contain', 'Favorites')
})

View File

@ -257,6 +257,7 @@ function undoDone(checked: boolean) {
async function toggleFavorite() {
task.value.isFavorite = !task.value.isFavorite
task.value = await taskService.update(task.value)
await projectStore.loadProjects() // reloading the projects list so that the Favorites project shows up or is hidden when there are (or are not) favorite tasks
emit('task-updated', task.value)
}

View File

@ -146,10 +146,11 @@ export const useProjectStore = defineStore('project', () => {
const projectService = new ProjectService()
try {
const projects = await projectService.getAll({}, {is_archived: true}) as IProject[]
setProjects(projects)
const loadedProjects = await projectService.getAll({}, {is_archived: true}) as IProject[]
projects.value = {}
setProjects(loadedProjects)
return projects
return loadedProjects
} finally {
cancel()
}