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 6 additions and 6 deletions
Showing only changes of commit 39f699a61a - Show all commits

View File

@ -11,8 +11,8 @@
@search="findProjects"
>
<template #searchResult="{option}">
<span class="has-text-grey" v-if="projectStore.getParentProjects(option).length > 1">
{{ projectStore.getParentProjects(option).filter(p => p.id !== option.id).map(p => getProjectTitle(p)).join(' &gt; ') }} &gt;
<span class="has-text-grey" v-if="projectStore.getAncestors(option).length > 1">
{{ projectStore.getAncestors(option).filter(p => p.id !== option.id).map(p => getProjectTitle(p)).join(' &gt; ') }} &gt;
</span>
{{ getProjectTitle(option) }}
</template>

View File

@ -158,14 +158,14 @@ export const useProjectStore = defineStore('project', () => {
}

Unsure: we might want to return the return value of setProjects here instead. Because maybe the projects will be modfied while being set. So it will be better to return from that method OR filter and return the projects with the id from the store object.

Unsure: we might want to return the return value of setProjects here instead. Because maybe the projects will be modfied while being set. So it will be better to return from that method OR filter and return the projects with the id from the store object.

But setProjects does not return anything? Neither does setProject.

These methods don't modify anything. I think it's fine to leave it like it is.

But `setProjects` does not return anything? Neither does `setProject`. These methods don't modify anything. I think it's fine to leave it like it is.
}
function getParentProjects(project: IProject): IProject[] {
function getAncestors(project: IProject): IProject[] {
if (!project?.parentProjectId) {
return [project]
}

When I read this first I thought that this implies that one project could have several parents. If I got it correct that's wrong. So how about getAncestors instead?

When I read this first I thought that this implies that one project could have several parents. If I got it correct that's wrong. So how about `getAncestors` instead?

I like that. Changed it.

I like that. Changed it.
const parentProject = projects.value[project.parentProjectId]
return [
...getParentProjects(parentProject),
...getAncestors(parentProject),
project,
]
}
@ -190,7 +190,7 @@ export const useProjectStore = defineStore('project', () => {
createProject,
updateProject,
deleteProject,
getParentProjects,
getAncestors,
}
})

View File

@ -14,7 +14,7 @@
ref="heading"
/>
<h6 class="subtitle" v-if="project?.id">
<template v-for="p in projectStore.getParentProjects(project)">

Shouldn't we still show the parent here?

Shouldn't we still show the parent here?

I've changed it now so that is shows this:

Screenshot_20230328_174428.png

(each project is clickable individually)

For a hierarchy like this:

Screenshot_20230328_174646.png

I've changed it now so that is shows this: ![Screenshot_20230328_174428.png](/attachments/35babb55-b48a-49bf-a595-3fcc28da12dc) (each project is clickable individually) For a hierarchy like this: ![Screenshot_20230328_174646.png](/attachments/070d677e-d199-45ee-af6b-c0a6b3196681)

Can't see these images either

Can't see these images either

Again 404?

Again 404?

This starts to feel like a gitea bug...

This starts to feel like a gitea bug...
<template v-for="p in projectStore.getAncestors(project)">

This won't update dynamically. Should we change the getParentProjects to a computed parentProjects that automatically updates instead?

This won't update dynamically. Should we change the `getParentProjects` to a computed `parentProjects` that automatically updates instead?

I tried to change it but it fails with getAncestors is not a function. Any idea?

I tried to change it but it fails with `getAncestors is not a function`. Any idea?

Actually this does update dynamically when the project changes. I've had a task open, moved the project to another parent project and it updated instantly.

Actually this does update dynamically when the project changes. I've had a task open, moved the project to another parent project and it updated instantly.
<router-link :to="{ name: 'project.index', params: { projectId: p.id } }">
{{ getProjectTitle(p) }}
</router-link>