File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import {
2626} from '@/components/emcn'
2727import { VariableIcon } from '@/components/icons'
2828import { generateWorkflowJson } from '@/lib/workflows/operations/import-export'
29+ import { validateWorkflowState } from '@/lib/workflows/sanitization/validation'
2930import { useRegisterGlobalCommands } from '@/app/workspace/[workspaceId]/providers/global-commands-provider'
3031import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
3132import { createCommands } from '@/app/workspace/[workspaceId]/utils/commands-utils'
@@ -356,7 +357,14 @@ export const Panel = memo(function Panel() {
356357 // Compute run button state
357358 const canRun = userPermissions . canRead // Running only requires read permissions
358359 const isLoadingPermissions = userPermissions . isLoading
359- const hasValidationErrors = false // TODO: Add validation logic if needed
360+ const hasValidationErrors = useWorkflowStore ( ( state ) => {
361+ if ( Object . keys ( state . blocks ) . length === 0 ) return false
362+ const result = validateWorkflowState ( {
363+ blocks : state . blocks ,
364+ edges : state . edges ,
365+ } )
366+ return ! result . valid
367+ } )
360368 const isWorkflowBlocked = isExecuting || hasValidationErrors
361369 const isButtonDisabled = ! isExecuting && ( isWorkflowBlocked || ( ! canRun && ! isLoadingPermissions ) )
362370
You can’t perform that action at this time.
0 commit comments