KI-AGENT: Projekte in der Plantafel nach Zeitraum filtern

This commit is contained in:
2026-09-07 19:47:02 +02:00
parent 914b322805
commit 5c481b105f

View File

@@ -990,16 +990,23 @@ async function loadPlanningBoard() {
absenceForm.userId = profileOptions.value[0]?.value || ""
}
const planningEvents = buildEvents({
rawEvents: rawEvents || [],
projectsById
})
const visibleProjectResourceIds = new Set(
planningEvents.flatMap((event) =>
(event.resourceIds || []).filter((resourceId) => resourceId.startsWith("PRJ-"))
)
)
resources.value = buildResources({
profiles: profiles.value,
inventoryitems: inventoryitems.value,
projects: projects.value
projects: projects.value.filter((project) => visibleProjectResourceIds.has(`PRJ-${project.id}`))
})
events.value = buildEvents({
rawEvents: rawEvents || [],
projectsById
}).concat(buildAbsenceEvents(absenceSpansByUserId))
events.value = planningEvents.concat(buildAbsenceEvents(absenceSpansByUserId))
} catch (error) {
console.error("loadPlanningBoard failed", error)
toast.add({