feat: show all parent projects in project search
This commit is contained in:
@ -1,14 +1,28 @@
|
||||
import {i18n} from '@/i18n'
|
||||
import type {IProject} from '@/modelTypes/IProject'
|
||||
import {useProjectStore} from '@/stores/projects'
|
||||
|
||||
export function getProjectTitle(project: IProject) {
|
||||
if (project.id === -1) {
|
||||
return i18n.global.t('project.pseudo.favorites.title')
|
||||
}
|
||||
|
||||
|
||||
if (project.title === 'Inbox') {
|
||||
return i18n.global.t('project.inboxTitle')
|
||||
}
|
||||
|
||||
|
||||
return project.title
|
||||
}
|
||||
|
||||
export function getParentProjects(project: IProject, projectStore): IProject[] {
|
||||
let parents = []
|
||||
if (project.parentProjectId) {
|
||||
const parentProject = projectStore.getProjectById(project.parentProjectId)
|
||||
parents = getParentProjects(parentProject, projectStore)
|
||||
}
|
||||
|
||||
return [
|
||||
...parents,
|
||||
project,
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user