@@ -94,8 +94,8 @@ export function DeployModal({
9494 const workflowWorkspaceId = workflowMetadata ?. workspaceId ?? null
9595 const [ activeTab , setActiveTab ] = useState < TabView > ( 'general' )
9696 const [ chatSubmitting , setChatSubmitting ] = useState ( false )
97- const [ apiDeployError , setApiDeployError ] = useState < string | null > ( null )
98- const [ apiDeployWarnings , setApiDeployWarnings ] = useState < string [ ] > ( [ ] )
97+ const [ deployError , setDeployError ] = useState < string | null > ( null )
98+ const [ deployWarnings , setDeployWarnings ] = useState < string [ ] > ( [ ] )
9999 const [ isChatFormValid , setIsChatFormValid ] = useState ( false )
100100 const [ selectedStreamingOutputs , setSelectedStreamingOutputs ] = useState < string [ ] > ( [ ] )
101101
@@ -225,8 +225,8 @@ export function DeployModal({
225225 useEffect ( ( ) => {
226226 if ( open && workflowId ) {
227227 setActiveTab ( 'general' )
228- setApiDeployError ( null )
229- setApiDeployWarnings ( [ ] )
228+ setDeployError ( null )
229+ setDeployWarnings ( [ ] )
230230 }
231231 } , [ open , workflowId ] )
232232
@@ -281,32 +281,32 @@ export function DeployModal({
281281 const onDeploy = useCallback ( async ( ) => {
282282 if ( ! workflowId ) return
283283
284- setApiDeployError ( null )
285- setApiDeployWarnings ( [ ] )
284+ setDeployError ( null )
285+ setDeployWarnings ( [ ] )
286286
287287 try {
288288 const result = await deployMutation . mutateAsync ( { workflowId, deployChatEnabled : false } )
289289 if ( result . warnings && result . warnings . length > 0 ) {
290- setApiDeployWarnings ( result . warnings )
290+ setDeployWarnings ( result . warnings )
291291 }
292292 await refetchDeployedState ( )
293293 } catch ( error : unknown ) {
294294 logger . error ( 'Error deploying workflow:' , { error } )
295295 const errorMessage = error instanceof Error ? error . message : 'Failed to deploy workflow'
296- setApiDeployError ( errorMessage )
296+ setDeployError ( errorMessage )
297297 }
298298 } , [ workflowId , deployMutation , refetchDeployedState ] )
299299
300300 const handlePromoteToLive = useCallback (
301301 async ( version : number ) => {
302302 if ( ! workflowId ) return
303303
304- setApiDeployWarnings ( [ ] )
304+ setDeployWarnings ( [ ] )
305305
306306 try {
307307 const result = await activateVersionMutation . mutateAsync ( { workflowId, version } )
308308 if ( result . warnings && result . warnings . length > 0 ) {
309- setApiDeployWarnings ( result . warnings )
309+ setDeployWarnings ( result . warnings )
310310 }
311311 await refetchDeployedState ( )
312312 } catch ( error ) {
@@ -332,26 +332,26 @@ export function DeployModal({
332332 const handleRedeploy = useCallback ( async ( ) => {
333333 if ( ! workflowId ) return
334334
335- setApiDeployError ( null )
336- setApiDeployWarnings ( [ ] )
335+ setDeployError ( null )
336+ setDeployWarnings ( [ ] )
337337
338338 try {
339339 const result = await deployMutation . mutateAsync ( { workflowId, deployChatEnabled : false } )
340340 if ( result . warnings && result . warnings . length > 0 ) {
341- setApiDeployWarnings ( result . warnings )
341+ setDeployWarnings ( result . warnings )
342342 }
343343 await refetchDeployedState ( )
344344 } catch ( error : unknown ) {
345345 logger . error ( 'Error redeploying workflow:' , { error } )
346346 const errorMessage = error instanceof Error ? error . message : 'Failed to redeploy workflow'
347- setApiDeployError ( errorMessage )
347+ setDeployError ( errorMessage )
348348 }
349349 } , [ workflowId , deployMutation , refetchDeployedState ] )
350350
351351 const handleCloseModal = useCallback ( ( ) => {
352352 setChatSubmitting ( false )
353- setApiDeployError ( null )
354- setApiDeployWarnings ( [ ] )
353+ setDeployError ( null )
354+ setDeployWarnings ( [ ] )
355355 onOpenChange ( false )
356356 } , [ onOpenChange ] )
357357
@@ -483,17 +483,23 @@ export function DeployModal({
483483 </ ModalTabsList >
484484
485485 < ModalBody className = 'min-h-0 flex-1' >
486- { apiDeployError && (
487- < div className = 'mb-3 rounded-[4px] border border-destructive/30 bg-destructive/10 p-3 text-destructive text-sm' >
488- < div className = 'font-semibold' > Deployment Error</ div >
489- < div > { apiDeployError } </ div >
490- </ div >
491- ) }
492- { apiDeployWarnings . length > 0 && (
493- < div className = 'mb-3 rounded-[4px] border border-amber-500/30 bg-amber-500/10 p-3 text-amber-700 text-sm dark:text-amber-400' >
494- < div className = 'font-semibold' > Deployment Warning</ div >
495- { apiDeployWarnings . map ( ( warning , index ) => (
496- < div key = { index } > { warning } </ div >
486+ { ( deployError || deployWarnings . length > 0 ) && (
487+ < div className = 'mb-3 flex flex-col gap-2' >
488+ { deployError && (
489+ < Badge variant = 'red' size = 'lg' dot className = 'max-w-full truncate' >
490+ { deployError }
491+ </ Badge >
492+ ) }
493+ { deployWarnings . map ( ( warning , index ) => (
494+ < Badge
495+ key = { index }
496+ variant = 'amber'
497+ size = 'lg'
498+ dot
499+ className = 'max-w-full truncate'
500+ >
501+ { warning }
502+ </ Badge >
497503 ) ) }
498504 </ div >
499505 ) }
@@ -515,7 +521,6 @@ export function DeployModal({
515521 deploymentInfo = { deploymentInfo }
516522 isLoading = { isLoadingDeploymentInfo }
517523 needsRedeployment = { needsRedeployment }
518- apiDeployError = { apiDeployError }
519524 getInputFormatExample = { getInputFormatExample }
520525 selectedStreamingOutputs = { selectedStreamingOutputs }
521526 onSelectedStreamingOutputsChange = { setSelectedStreamingOutputs }
0 commit comments