Skip to content

Commit 82fa4e8

Browse files
fix(input-format): allow value field to be cleared (#1658)
* fix(input-format): allow value field to be cleared * don't let value field be detected as deployment change * fix zep icon in docs * exclude collapsed state
1 parent 4cd790b commit 82fa4e8

File tree

3 files changed

+40
-15
lines changed
  • apps
    • docs/content/docs/en/tools
    • sim
      • app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/starter
      • lib/workflows

3 files changed

+40
-15
lines changed

apps/docs/content/docs/en/tools/zep.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
77

88
<BlockInfoCard
99
type="zep"
10-
color="#4F46E5"
10+
color="#E8E8E8"
1111
icon={true}
1212
iconSvg={`<svg className="block-icon"
1313
14+
xmlns='http://www.w3.org/2000/svg'
15+
viewBox='0 0 233 196'
1416
1517
16-
viewBox='0 0 24 24'
17-
fill='none'
18-
xmlns='http://www.w3.org/2000/svg'
1918
>
2019
<path
21-
d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'
22-
fill='currentColor'
20+
d='m231.34,108.7l-1.48-1.55h-10.26l3.59-75.86-14.8-.45-2.77,49.31c-59.6-3.24-119.33-3.24-178.92-.02l-1.73-64.96-14.8.45,2.5,91.53H2.16l-1.41,1.47c-1.55,16.23-.66,32.68,2.26,48.89h10.83l.18,1.27c.67,19.34,16.1,34.68,35.9,34.68s44.86-.92,66.12-.92,46.56.92,65.95.92,35.19-15.29,35.9-34.61l.16-1.34h11.02c2.91-16.19,3.81-32.61,2.26-48.81Zm-158.23,58.01c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Zm86.51,0c-17.27,0-30.25-13.78-30.25-29.78s12.99-29.78,30.25-29.78,29.62,13.94,29.62,29.94-12.35,29.62-29.62,29.62Z'
21+
fill='#FF1493'
22+
/>
23+
<polygon
24+
points='111.77 22.4 93.39 49.97 93.52 50.48 185.88 38.51 190.95 27.68 114.32 36.55 117.7 31.48 117.7 31.47 138.38 .49 138.25 0 47.67 11.6 42.85 22.27 118.34 12.61 111.77 22.4'
25+
fill='#FF1493'
2326
/>
2427
<path
25-
d='M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z'
26-
fill='currentColor'
28+
d='m72.97,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
29+
fill='#FF1493'
2730
/>
28-
<circle cx='12' cy='12' r='2' fill='currentColor' />
2931
<path
30-
d='M8 8h8M8 16h8'
31-
stroke='currentColor'
32-
strokeWidth='1.5'
33-
strokeLinecap='round'
32+
d='m159.48,121.47c-8.67,0-15.73,6.93-15.73,15.46s7.06,15.46,15.73,15.46,15.37-6.75,15.37-15.37-6.75-15.55-15.37-15.55Z'
33+
fill='#FF1493'
3434
/>
3535
</svg>`}
3636
/>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/starter/input-format.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ export function FieldFormat({
135135
if (!inputEl) return
136136

137137
const current = localValues[field.id] ?? inputEl.value ?? ''
138-
const trimmed = current.trim()
139-
if (!trimmed) return
140138
updateField(field.id, 'value', current)
141139
}
142140

apps/sim/lib/workflows/utils.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,23 @@ function sanitizeToolsForComparison(tools: any[] | undefined): any[] {
206206
})
207207
}
208208

209+
/**
210+
* Sanitize inputFormat array by removing test-only value fields
211+
* @param inputFormat - The inputFormat array to sanitize
212+
* @returns A sanitized inputFormat array without test values
213+
*/
214+
function sanitizeInputFormatForComparison(inputFormat: any[] | undefined): any[] {
215+
if (!Array.isArray(inputFormat)) {
216+
return []
217+
}
218+
219+
return inputFormat.map((field) => {
220+
// Remove test-only field: value (used only for manual testing)
221+
const { value, collapsed, ...cleanField } = field
222+
return cleanField
223+
})
224+
}
225+
209226
/**
210227
* Normalize a value for consistent comparison by sorting object keys
211228
* @param value - The value to normalize
@@ -363,6 +380,16 @@ export function hasWorkflowChanged(
363380
deployedValue = sanitizeToolsForComparison(deployedValue)
364381
}
365382

383+
// Special handling for 'inputFormat' subBlock - sanitize test-only value fields
384+
if (
385+
subBlockId === 'inputFormat' &&
386+
Array.isArray(currentValue) &&
387+
Array.isArray(deployedValue)
388+
) {
389+
currentValue = sanitizeInputFormatForComparison(currentValue)
390+
deployedValue = sanitizeInputFormatForComparison(deployedValue)
391+
}
392+
366393
// For string values, compare directly to catch even small text changes
367394
if (typeof currentValue === 'string' && typeof deployedValue === 'string') {
368395
if (currentValue !== deployedValue) {

0 commit comments

Comments
 (0)