fix: don't show child projects when the project is only a favorite

This commit is contained in:
kolaente 2023-04-03 11:18:10 +02:00
parent b567146d69
commit 0a17df87e9
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 7 additions and 4 deletions

View File

@ -22,6 +22,7 @@
<ProjectsNavigationItem <ProjectsNavigationItem
:project="project" :project="project"
:is-loading="projectUpdating[project.id]" :is-loading="projectUpdating[project.id]"
:can-collapse="canCollapse"
/> />
</template> </template>
</draggable> </draggable>
@ -42,6 +43,7 @@ import {useProjectStore} from '@/stores/projects'
const props = defineProps<{ const props = defineProps<{
modelValue?: IProject[], modelValue?: IProject[],
canEditOrder: boolean, canEditOrder: boolean,
canCollapse?: boolean,
}>() }>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])

View File

@ -6,7 +6,7 @@
> >
<section> <section>
<BaseButton <BaseButton
v-if="childProjects?.length > 0" v-if="canCollapse && childProjects?.length > 0"
@click="childProjectsOpen = !childProjectsOpen" @click="childProjectsOpen = !childProjectsOpen"
class="collapse-project-button" class="collapse-project-button"
> >
@ -46,7 +46,7 @@
<span class="list-setting-spacer" v-else></span> <span class="list-setting-spacer" v-else></span>
</section> </section>
<ProjectsNavigation <ProjectsNavigation
v-if="childProjectsOpen" v-if="childProjectsOpen && canCollapse"
v-model="childProjects" v-model="childProjects"
:can-edit-order="true" :can-edit-order="true"
/> />
@ -69,6 +69,7 @@ import ProjectsNavigation from '@/components/home/ProjectsNavigation.vue'
const props = defineProps<{ const props = defineProps<{
project: IProject, project: IProject,
isLoading?: boolean, isLoading?: boolean,
canCollapse?: boolean,
}>() }>()
const projectStore = useProjectStore() const projectStore = useProjectStore()

View File

@ -51,11 +51,11 @@
<Loading variant="small" v-if="projectsLoading"/> <Loading variant="small" v-if="projectsLoading"/>
<template v-else> <template v-else>
<nav class="menu" v-if="favoriteProjects"> <nav class="menu" v-if="favoriteProjects">
<ProjectsNavigation :model-value="favoriteProjects" :can-edit-order="false"/> <ProjectsNavigation :model-value="favoriteProjects" :can-edit-order="false" :can-collapse="false"/>
</nav> </nav>
<nav class="menu"> <nav class="menu">
<ProjectsNavigation :model-value="projects" :can-edit-order="true"/> <ProjectsNavigation :model-value="projects" :can-edit-order="true" :can-collapse="true"/>
</nav> </nav>
</template> </template>