Skip to content

Commit b1cde02

Browse files
committed
update styling + move predeploy checks earlier for first time deploys
1 parent 54ed579 commit b1cde02

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deployment.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { useCallback, useState } from 'react'
22
import { createLogger } from '@sim/logger'
3+
import { runPreDeployChecks } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-predeploy-checks'
34
import { useNotificationStore } from '@/stores/notifications'
45
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
6+
import { mergeSubblockState } from '@/stores/workflows/utils'
7+
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
58

69
const logger = createLogger('useDeployment')
710

@@ -35,6 +38,24 @@ export function useDeployment({
3538
return { success: true, shouldOpenModal: true }
3639
}
3740

41+
const { blocks, edges, loops, parallels } = useWorkflowStore.getState()
42+
const liveBlocks = mergeSubblockState(blocks, workflowId)
43+
const checkResult = runPreDeployChecks({
44+
blocks: liveBlocks,
45+
edges,
46+
loops,
47+
parallels,
48+
workflowId,
49+
})
50+
if (!checkResult.passed) {
51+
addNotification({
52+
level: 'error',
53+
message: checkResult.error || 'Pre-deploy validation failed',
54+
workflowId,
55+
})
56+
return { success: false, shouldOpenModal: false }
57+
}
58+
3859
setIsDeploying(true)
3960
try {
4061
const response = await fetch(`/api/workflows/${workflowId}/deploy`, {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/parameter.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ export function ParameterWithLabel({
9090
<Label className='flex items-baseline gap-[6px] whitespace-nowrap font-medium text-[13px] text-[var(--text-primary)]'>
9191
{title}
9292
{isRequired && visibility === 'user-only' && <span className='ml-0.5'>*</span>}
93-
{visibility !== 'user-only' && (
94-
<span className='-ml-[3px] font-normal text-[12px] text-[var(--text-tertiary)]'>
95-
(optional)
96-
</span>
97-
)}
9893
</Label>
9994
<div className='flex min-w-0 flex-1 items-center justify-end gap-[6px]'>
10095
{showWand &&

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/sub-block-renderer.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useEffect, useMemo, useRef } from 'react'
3+
import { useEffect, useRef } from 'react'
44
import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value'
55
import { SubBlock } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block'
66
import type { SubBlockConfig as BlockSubBlockConfig } from '@/blocks/types'
@@ -77,21 +77,10 @@ export function ToolSubBlockRenderer({
7777
}
7878
}, [storeValue, toolIndex, effectiveParamId, onParamChange])
7979

80-
// Determine if the parameter is optional for the user (LLM can fill it)
80+
// Suppress SubBlock's "*" required indicator when the LLM can fill the param
8181
const visibility = subBlock.paramVisibility ?? 'user-or-llm'
8282
const isOptionalForUser = visibility !== 'user-only'
8383

84-
const labelSuffix = useMemo(
85-
() =>
86-
isOptionalForUser ? (
87-
<span className='-ml-[3px] font-normal text-[12px] text-[var(--text-tertiary)]'>
88-
(optional)
89-
</span>
90-
) : null,
91-
[isOptionalForUser]
92-
)
93-
94-
// Suppress SubBlock's "*" required indicator for optional-for-user params
9584
const config = {
9685
...subBlock,
9786
id: syntheticId,
@@ -105,7 +94,6 @@ export function ToolSubBlockRenderer({
10594
isPreview={false}
10695
disabled={disabled}
10796
canonicalToggle={canonicalToggle}
108-
labelSuffix={labelSuffix}
10997
dependencyContext={toolParams}
11098
/>
11199
)

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ export const ToolInput = memo(function ToolInput({
10671067
<ShortInput
10681068
blockId={blockId}
10691069
subBlockId={uniqueSubBlockId}
1070-
placeholder={param.description}
1070+
placeholder={param.description || `Enter ${formatParameterLabel(param.id).toLowerCase()}`}
10711071
password={isPasswordParameter(param.id)}
10721072
config={{
10731073
id: uniqueSubBlockId,
@@ -1747,7 +1747,7 @@ export const ToolInput = memo(function ToolInput({
17471747
{requiresOAuth && oauthConfig && (
17481748
<div className='relative min-w-0 space-y-[6px]'>
17491749
<div className='font-medium text-[13px] text-[var(--text-primary)]'>
1750-
Account
1750+
Account <span className='ml-0.5'>*</span>
17511751
</div>
17521752
<div className='w-full min-w-0'>
17531753
<ToolCredentialSelector

0 commit comments

Comments
 (0)