@ -29,6 +29,7 @@ const VariableModal = ({
const [ type , setType ] = React . useState < 'string' | 'number' | 'secret' > ( 'string' )
const [ type , setType ] = React . useState < 'string' | 'number' | 'secret' > ( 'string' )
const [ name , setName ] = React . useState ( '' )
const [ name , setName ] = React . useState ( '' )
const [ value , setValue ] = React . useState < any > ( )
const [ value , setValue ] = React . useState < any > ( )
const [ des , setDes ] = React . useState < string > ( '' )
const checkVariableName = ( value : string ) = > {
const checkVariableName = ( value : string ) = > {
const { isValid , errorMessageKey } = checkKeys ( [ value ] , false )
const { isValid , errorMessageKey } = checkKeys ( [ value ] , false )
@ -60,6 +61,7 @@ const VariableModal = ({
value_type : type ,
value_type : type ,
name ,
name ,
value : type === 'number' ? Number ( value ) : value ,
value : type === 'number' ? Number ( value ) : value ,
description : des ,
} )
} )
onClose ( )
onClose ( )
}
}
@ -69,6 +71,7 @@ const VariableModal = ({
setType ( env . value_type )
setType ( env . value_type )
setName ( env . name )
setName ( env . name )
setValue ( env . value_type === 'secret' ? envSecrets [ env . id ] : env . value )
setValue ( env . value_type === 'secret' ? envSecrets [ env . id ] : env . value )
setDes ( env . description )
}
}
} , [ env , envSecrets ] )
} , [ env , envSecrets ] )
@ -153,6 +156,18 @@ const VariableModal = ({
}
}
< / div >
< / div >
< / div >
< / div >
{ /* description */ }
< div className = '' >
< div className = 'system-sm-semibold mb-1 flex h-6 items-center text-text-secondary' > { t ( 'workflow.env.modal.description' ) } < / div >
< div className = 'flex' >
< textarea
className = 'system-sm-regular placeholder:system-sm-regular block h-20 w-full resize-none appearance-none rounded-lg border border-transparent bg-components-input-bg-normal p-2 text-components-input-text-filled caret-primary-600 outline-none placeholder:text-components-input-text-placeholder hover:border-components-input-border-hover hover:bg-components-input-bg-hover focus:border-components-input-border-active focus:bg-components-input-bg-active focus:shadow-xs'
value = { des }
placeholder = { t ( 'workflow.env.modal.descriptionPlaceholder' ) || '' }
onChange = { e = > setDes ( e . target . value ) }
/ >
< / div >
< / div >
< / div >
< / div >
< div className = 'flex flex-row-reverse rounded-b-2xl p-4 pt-2' >
< div className = 'flex flex-row-reverse rounded-b-2xl p-4 pt-2' >
< div className = 'flex gap-2' >
< div className = 'flex gap-2' >