From a6fe130307f746fc60023e335e1d3c68099914d8 Mon Sep 17 00:00:00 2001 From: Viswamedha Nalabotu Date: Sun, 22 Mar 2026 18:04:29 +0000 Subject: [PATCH] Added warning for ingestion progress on onboarding --- site/src/views/OnboardingView.vue | 44 ++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/site/src/views/OnboardingView.vue b/site/src/views/OnboardingView.vue index 1176f48..d5dcca1 100644 --- a/site/src/views/OnboardingView.vue +++ b/site/src/views/OnboardingView.vue @@ -44,17 +44,24 @@ const roleId = computed(() => route.params.roleId as string) const flowDetails = ref(null) const trainingFileWarning = ref(null) +const hasIngestingFiles = ref(false) +const generationBlocked = ref(false) +const isManager = computed(() => Boolean(userStore.isGeneralManager)) const fetchTrainingFileWarning = async () => { try { const res = await apiClient.get<{ status: string }[]>(API.knowledge.trainingFiles.list(), { params: { role_uuid: roleId.value }, }) - const files: { status: string }[] = Array.isArray(res.data) + const allFiles: { status: string; scope?: string }[] = Array.isArray(res.data) ? res.data - : (res.data as { results?: { status: string }[] }).results ?? [] + : (res.data as { results?: { status: string; scope?: string }[] }).results ?? [] + // Only consider role-scoped files — org-wide files apply to all roles + // and their ingestion state shouldn't block a specific role's onboarding + const files = allFiles.filter((f) => f.scope === 'role') const ingesting = files.filter((f) => f.status === 'ingesting').length const failed = files.filter((f) => f.status === 'failed').length + hasIngestingFiles.value = ingesting > 0 if (ingesting === 0 && failed === 0) { trainingFileWarning.value = null return @@ -66,6 +73,7 @@ const fetchTrainingFileWarning = async () => { parts.join(' and ') + '. Generated content may not reflect all uploaded documents.' } catch { trainingFileWarning.value = null + hasIngestingFiles.value = false } } const session = ref(null) @@ -329,7 +337,12 @@ const initOnboarding = async () => { await loadFlow(matchingFlow.uuid) } else { if (!generationHandled.value) { - await startAgenticGeneration() + await fetchTrainingFileWarning() + if (hasIngestingFiles.value) { + generationBlocked.value = true + } else { + await startAgenticGeneration() + } } } } catch { @@ -340,10 +353,10 @@ const initOnboarding = async () => { } const startAgenticGeneration = async () => { + generationBlocked.value = false isAutoGenerating.value = true generationHandled.value = false agentStore.clearLog() - await fetchTrainingFileWarning() agentStore.connect(roleId.value) const checkInterval = setInterval(() => { @@ -647,6 +660,29 @@ watch(