From e3ff66653c448199af995e7fd22cacacbb9fd80a Mon Sep 17 00:00:00 2001 From: Viswamedha Nalabotu Date: Sun, 22 Mar 2026 17:38:01 +0000 Subject: [PATCH] Added check for training file upload --- site/src/views/OnboardingView.vue | 52 +++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/site/src/views/OnboardingView.vue b/site/src/views/OnboardingView.vue index a23ddfd..1176f48 100644 --- a/site/src/views/OnboardingView.vue +++ b/site/src/views/OnboardingView.vue @@ -2,6 +2,7 @@ import { ref, computed, onMounted, onUnmounted, watch, reactive } from 'vue' import { useRoute, useRouter } from 'vue-router' import { + Alert, Card, Typography, Button, @@ -41,6 +42,32 @@ const userStore = useUserStore() const roleId = computed(() => route.params.roleId as string) const flowDetails = ref(null) + +const trainingFileWarning = ref(null) + +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) + ? res.data + : (res.data as { results?: { status: string }[] }).results ?? [] + const ingesting = files.filter((f) => f.status === 'ingesting').length + const failed = files.filter((f) => f.status === 'failed').length + if (ingesting === 0 && failed === 0) { + trainingFileWarning.value = null + return + } + const parts: string[] = [] + if (ingesting > 0) parts.push(`${ingesting} file${ingesting > 1 ? 's are' : ' is'} still being processed`) + if (failed > 0) parts.push(`${failed} file${failed > 1 ? 's' : ''} failed to ingest`) + trainingFileWarning.value = + parts.join(' and ') + '. Generated content may not reflect all uploaded documents.' + } catch { + trainingFileWarning.value = null + } +} const session = ref(null) const currentPageIndex = ref(0) const loading = ref(false) @@ -96,7 +123,7 @@ const pageHelpByPage = computed< const currentPageHelp = computed(() => { if (!currentPage.value) return [] - return pageHelpByPage.value[currentPage.value.uuid] || [] + return [...(pageHelpByPage.value[currentPage.value.uuid] || [])].reverse() }) const currentPageBody = computed(() => { @@ -316,6 +343,7 @@ const startAgenticGeneration = async () => { isAutoGenerating.value = true generationHandled.value = false agentStore.clearLog() + await fetchTrainingFileWarning() agentStore.connect(roleId.value) const checkInterval = setInterval(() => { @@ -627,6 +655,14 @@ watch( + +
@@ -754,7 +790,7 @@ watch(
@@ -910,6 +946,18 @@ watch(
+
+ KA: +
+
+