chore: export not archived root projects
This commit is contained in:
parent
0be83db40f
commit
b5d9afd0f7
|
@ -19,8 +19,7 @@ await projectStore.loadProjects()
|
||||||
|
|
||||||
const projects = computed({
|
const projects = computed({
|
||||||
get() {
|
get() {
|
||||||
return projectStore.projectsArray
|
return projectStore.notArchivedRootProjects
|
||||||
.filter(p => p.parentProjectId === 0 && !p.isArchived)
|
|
||||||
.sort((a, b) => a.position - b.position)
|
.sort((a, b) => a.position - b.position)
|
||||||
},
|
},
|
||||||
set() { }, // Vue will complain about the component not being writable - but we never need to write here. The setter is only here to silence the warning.
|
set() { }, // Vue will complain about the component not being writable - but we never need to write here. The setter is only here to silence the warning.
|
||||||
|
|
|
@ -29,6 +29,8 @@ export const useProjectStore = defineStore('project', () => {
|
||||||
// The projects are stored as an object which has the project ids as keys.
|
// The projects are stored as an object which has the project ids as keys.
|
||||||
const projects = ref<ProjectState>({})
|
const projects = ref<ProjectState>({})
|
||||||
const projectsArray = computed(() => Object.values(projects.value))
|
const projectsArray = computed(() => Object.values(projects.value))
|
||||||
|
const notArchivedRootProjects = computed(() => projectsArray.value
|
||||||
|
.filter(p => p.parentProjectId === 0 && !p.isArchived))
|
||||||
const hasProjects = computed(() => projects.value ? true : false)
|
const hasProjects = computed(() => projects.value ? true : false)
|
||||||
|
|
||||||
const getProjectById = computed(() => {
|
const getProjectById = computed(() => {
|
||||||
|
@ -200,6 +202,7 @@ export const useProjectStore = defineStore('project', () => {
|
||||||
isLoading: readonly(isLoading),
|
isLoading: readonly(isLoading),
|
||||||
projects: readonly(projects),
|
projects: readonly(projects),
|
||||||
projectsArray: readonly(projectsArray),
|
projectsArray: readonly(projectsArray),
|
||||||
|
notArchivedRootProjects: readonly(notArchivedRootProjects),
|
||||||
hasProjects: readonly(hasProjects),
|
hasProjects: readonly(hasProjects),
|
||||||
|
|
||||||
getProjectById,
|
getProjectById,
|
||||||
|
@ -235,7 +238,7 @@ export function useProject(projectId: MaybeRef<IProject['id']>) {
|
||||||
)
|
)
|
||||||
|
|
||||||
const projectStore = useProjectStore()
|
const projectStore = useProjectStore()
|
||||||
|
|
||||||
const parentProject = ref<IProject | null>(null)
|
const parentProject = ref<IProject | null>(null)
|
||||||
watch(
|
watch(
|
||||||
() => project.parentProjectId,
|
() => project.parentProjectId,
|
||||||
|
|
Reference in New Issue
Block a user