Skip to content

Commit 654cb2b

Browse files
v0.5.85: deployment improvements
2 parents 6c66521 + c749229 commit 654cb2b

File tree

4 files changed

+46
-51
lines changed

4 files changed

+46
-51
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/api/api.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ interface ApiDeployProps {
2828
deploymentInfo: WorkflowDeploymentInfo | null
2929
isLoading: boolean
3030
needsRedeployment: boolean
31-
apiDeployError: string | null
3231
getInputFormatExample: (includeStreaming?: boolean) => string
3332
selectedStreamingOutputs: string[]
3433
onSelectedStreamingOutputsChange: (outputs: string[]) => void
@@ -63,7 +62,6 @@ export function ApiDeploy({
6362
deploymentInfo,
6463
isLoading,
6564
needsRedeployment,
66-
apiDeployError,
6765
getInputFormatExample,
6866
selectedStreamingOutputs,
6967
onSelectedStreamingOutputsChange,
@@ -419,12 +417,6 @@ console.log(limits);`
419417
if (isLoading || !info) {
420418
return (
421419
<div className='space-y-[16px]'>
422-
{apiDeployError && (
423-
<div className='rounded-[4px] border border-destructive/30 bg-destructive/10 p-3 text-destructive text-sm'>
424-
<div className='font-semibold'>API Deployment Error</div>
425-
<div>{apiDeployError}</div>
426-
</div>
427-
)}
428420
<div>
429421
<Skeleton className='mb-[6.5px] h-[16px] w-[62px]' />
430422
<Skeleton className='h-[28px] w-[260px] rounded-[4px]' />
@@ -443,13 +435,6 @@ console.log(limits);`
443435

444436
return (
445437
<div className='space-y-[16px]'>
446-
{apiDeployError && (
447-
<div className='rounded-[4px] border border-destructive/30 bg-destructive/10 p-3 text-destructive text-sm'>
448-
<div className='font-semibold'>API Deployment Error</div>
449-
<div>{apiDeployError}</div>
450-
</div>
451-
)}
452-
453438
<div>
454439
<div className='mb-[6.5px] flex items-center justify-between'>
455440
<Label className='block pl-[2px] font-medium text-[13px] text-[var(--text-primary)]'>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/terminal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ export const Terminal = memo(function Terminal() {
11511151
<aside
11521152
ref={terminalRef}
11531153
className={clsx(
1154-
'terminal-container fixed right-[var(--panel-width)] bottom-0 left-[var(--sidebar-width)] z-10 overflow-hidden bg-[var(--surface-1)]',
1154+
'terminal-container fixed right-[var(--panel-width)] bottom-0 left-[var(--sidebar-width)] z-10 overflow-hidden border-[var(--border)] border-t bg-[var(--surface-1)]',
11551155
isToggling && 'transition-[height] duration-100 ease-out'
11561156
)}
11571157
onTransitionEnd={handleTransitionEnd}
@@ -1160,7 +1160,7 @@ export const Terminal = memo(function Terminal() {
11601160
tabIndex={-1}
11611161
aria-label='Terminal'
11621162
>
1163-
<div className='relative flex h-full border-[var(--border)] border-t'>
1163+
<div className='relative flex h-full'>
11641164
{/* Left Section - Logs */}
11651165
<div
11661166
className={clsx('flex flex-col', !selectedEntry && 'flex-1')}

apps/sim/lib/webhooks/deploy.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ function isFieldRequired(
111111
}
112112

113113
function resolveTriggerId(block: BlockState): string | undefined {
114+
const blockConfig = getBlock(block.type)
115+
116+
if (blockConfig?.category === 'triggers' && isTriggerValid(block.type)) {
117+
return block.type
118+
}
119+
120+
if (!block.triggerMode) {
121+
return undefined
122+
}
123+
114124
const selectedTriggerId = getSubBlockValue(block, 'selectedTriggerId')
115125
if (typeof selectedTriggerId === 'string' && isTriggerValid(selectedTriggerId)) {
116126
return selectedTriggerId
@@ -121,12 +131,7 @@ function resolveTriggerId(block: BlockState): string | undefined {
121131
return storedTriggerId
122132
}
123133

124-
const blockConfig = getBlock(block.type)
125-
if (blockConfig?.category === 'triggers' && isTriggerValid(block.type)) {
126-
return block.type
127-
}
128-
129-
if (block.triggerMode && blockConfig?.triggers?.enabled) {
134+
if (blockConfig?.triggers?.enabled) {
130135
const configuredTriggerId =
131136
typeof selectedTriggerId === 'string' ? selectedTriggerId : undefined
132137
if (configuredTriggerId && isTriggerValid(configuredTriggerId)) {

0 commit comments

Comments
 (0)