This commit is contained in:
Adam Gough
2025-05-30 10:47:15 -07:00
parent 222f97f097
commit c9d826e7d6
3 changed files with 36 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
'use client'
import { useEffect, useRef, useState } from 'react'
import { useState } from 'react'
import {
AlertDialog,
AlertDialogAction,

View File

@@ -319,41 +319,41 @@ export function LongInput({
<ChevronsUpDown className='h-3 w-3 text-muted-foreground/70' />
</div>
<EnvVarDropdown
visible={showEnvVars}
onSelect={(newValue) => {
if (onChange) {
onChange(newValue)
} else if (!isPreview) {
setStoreValue(newValue)
}
}}
searchTerm={searchTerm}
inputValue={value?.toString() ?? ''}
cursorPosition={cursorPosition}
onClose={() => {
setShowEnvVars(false)
setSearchTerm('')
}}
/>
<TagDropdown
visible={showTags}
onSelect={(newValue) => {
if (onChange) {
onChange(newValue)
} else if (!isPreview) {
setStoreValue(newValue)
}
}}
blockId={blockId}
activeSourceBlockId={activeSourceBlockId}
inputValue={value?.toString() ?? ''}
cursorPosition={cursorPosition}
onClose={() => {
setShowTags(false)
setActiveSourceBlockId(null)
}}
/>
<EnvVarDropdown
visible={showEnvVars}
onSelect={(newValue) => {
if (onChange) {
onChange(newValue)
} else if (!isPreview) {
setStoreValue(newValue)
}
}}
searchTerm={searchTerm}
inputValue={value?.toString() ?? ''}
cursorPosition={cursorPosition}
onClose={() => {
setShowEnvVars(false)
setSearchTerm('')
}}
/>
<TagDropdown
visible={showTags}
onSelect={(newValue) => {
if (onChange) {
onChange(newValue)
} else if (!isPreview) {
setStoreValue(newValue)
}
}}
blockId={blockId}
activeSourceBlockId={activeSourceBlockId}
inputValue={value?.toString() ?? ''}
cursorPosition={cursorPosition}
onClose={() => {
setShowTags(false)
setActiveSourceBlockId(null)
}}
/>
</div>
)
}

View File

@@ -3,7 +3,6 @@ import { Label } from '@/components/ui/label'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { getBlock } from '@/blocks/index'
import type { SubBlockConfig } from '@/blocks/types'
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
import { CheckboxList } from './components/checkbox-list'
import { Code } from './components/code'
@@ -46,7 +45,6 @@ export function SubBlock({
e.stopPropagation()
}
const isFieldRequired = () => {
const blockType = useWorkflowStore.getState().blocks[blockId]?.type
if (!blockType) return false