From 927f406fa744d3d3c692678b08fadfb1a7e12634 Mon Sep 17 00:00:00 2001 From: Viswamedha Nalabotu Date: Wed, 11 Mar 2026 14:10:38 +0000 Subject: [PATCH] Removed delete flow button for non managers --- site/src/views/OnboardingView.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/site/src/views/OnboardingView.vue b/site/src/views/OnboardingView.vue index 124db8a..df6f0d2 100644 --- a/site/src/views/OnboardingView.vue +++ b/site/src/views/OnboardingView.vue @@ -20,6 +20,7 @@ import { import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons-vue' import { apiClient, API, isAxiosError } from '../router/api' import { useOnboardingAgentStore } from '../stores/onboardingAgentStore' +import { useUserStore } from '../stores/userStore' import type { OnboardingFlow, OnboardingPage, @@ -34,6 +35,7 @@ const marked = new Marked() const route = useRoute() const router = useRouter() const agentStore = useOnboardingAgentStore() +const userStore = useUserStore() const roleId = computed(() => route.params.roleId as string) const flowDetails = ref(null) @@ -73,6 +75,7 @@ const currentPage = computed( const hasNext = computed(() => currentPageIndex.value < pages.value.length - 1) const hasPrev = computed(() => currentPageIndex.value > 0) const isError = computed(() => agentStore.executionStatus === 'failed') +const canDeleteFlow = computed(() => Boolean(userStore.isGeneralManager)) const completedModules = computed(() => { const state = (session.value as unknown as { state?: Record } | null)?.state @@ -240,6 +243,10 @@ const retryGeneration = async () => { const resetCurrentFlow = async () => { if (!flowDetails.value || deletingFlow.value) return + if (!canDeleteFlow.value) { + message.error('Only managers can delete onboarding flows.') + return + } deletingFlow.value = true try { @@ -641,7 +648,7 @@ watch( You have already completed this onboarding flow. You can return to your - organization page, or delete this flow to regenerate a new one. + organization page and wait for your manager to review your onboarding results.
@@ -649,12 +656,15 @@ watch( Return to Organization - +
@@ -694,12 +704,15 @@ watch( {{ flowDetails.title }} - +