fix(menu): separate favorite and saved filter projects from other projects

Resolves vikunja/frontend#3710
Resolves https://github.com/go-vikunja/frontend/issues/119
This commit is contained in:
kolaente 2023-08-24 11:27:20 +02:00
parent fc72a82a2a
commit 1ad03877fb
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 13 additions and 1 deletions

View File

@ -60,6 +60,14 @@
:can-collapse="false"
/>
</nav>
<nav class="menu" v-if="savedFilterProjects">
<ProjectsNavigation
:model-value="savedFilterProjects"
:can-edit-order="false"
:can-collapse="false"
/>
</nav>
<nav class="menu">
<ProjectsNavigation
@ -91,6 +99,7 @@ const projectStore = useProjectStore()
const projects = computed(() => projectStore.notArchivedRootProjects)
const favoriteProjects = computed(() => projectStore.favoriteProjects)
const savedFilterProjects = computed(() => projectStore.savedFilterProjects)
</script>
<style lang="scss" scoped>

View File

@ -36,9 +36,11 @@ export const useProjectStore = defineStore('project', () => {
const projectsArray = computed(() => Object.values(projects.value)
.sort((a, b) => a.position - b.position))
const notArchivedRootProjects = computed(() => projectsArray.value
.filter(p => p.parentProjectId === 0 && !p.isArchived))
.filter(p => p.parentProjectId === 0 && !p.isArchived && p.id > 0))
const favoriteProjects = computed(() => projectsArray.value
.filter(p => !p.isArchived && p.isFavorite))
const savedFilterProjects = computed(() => projectsArray.value
.filter(p => !p.isArchived && p.id < -1))
const hasProjects = computed(() => projectsArray.value.length > 0)
const getChildProjects = computed(() => {
@ -198,6 +200,7 @@ export const useProjectStore = defineStore('project', () => {
notArchivedRootProjects: readonly(notArchivedRootProjects),
favoriteProjects: readonly(favoriteProjects),
hasProjects: readonly(hasProjects),
savedFilterProjects: readonly(savedFilterProjects),
getChildProjects,
findProjectByExactname,