feat(navigation): make dragging a project under another project work

This commit is contained in:
kolaente 2023-03-27 13:25:23 +02:00
parent fa71cec5c8
commit ab94343d07
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -72,7 +72,7 @@
<span class="list-setting-spacer" v-else></span> <span class="list-setting-spacer" v-else></span>
</section> </section>
<ProjectsNavigation <ProjectsNavigation
v-if="p.childProjects.length > 0 && !collapsedProjects[p.id]" v-if="!collapsedProjects[p.id]"
v-model="p.childProjects" v-model="p.childProjects"
/> />
</li> </li>
@ -151,7 +151,7 @@ async function saveProjectPosition(e: SortableEvent) {
projectAfter !== null ? projectAfter.position : null, projectAfter !== null ? projectAfter.position : null,
) )
if (project.parentProjectId !== parentProjectId) { if (project.parentProjectId !== parentProjectId && project.parentProjectId > 0) {
const parentProject = projectStore.getProjectById(project.parentProjectId) const parentProject = projectStore.getProjectById(project.parentProjectId)
const childProjectIndex = parentProject.childProjects.findIndex(p => p.id === project.id) const childProjectIndex = parentProject.childProjects.findIndex(p => p.id === project.id)
parentProject.childProjects.splice(childProjectIndex, 1) parentProject.childProjects.splice(childProjectIndex, 1)