fix: code-based extension (#2490)
This commit is contained in:
@@ -147,6 +147,7 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
|
||||
) => {
|
||||
setShowExternalDataToolModal({
|
||||
payload: {
|
||||
type,
|
||||
variable: key,
|
||||
label: name,
|
||||
config,
|
||||
@@ -245,7 +246,7 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar
|
||||
|
||||
const handleConfig = ({ key, type, index, name, config, icon, icon_background }: ExternalDataToolParams) => {
|
||||
setCurrKey(key)
|
||||
if (type === 'api') {
|
||||
if (type !== 'string' && type !== 'paragraph' && type !== 'select') {
|
||||
handleOpenExternalDataToolModal({ key, type, index, name, config, icon, icon_background }, promptVariables)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ const Debug: FC<IDebug> = ({
|
||||
}
|
||||
let hasEmptyInput = ''
|
||||
const requiredVars = modelConfig.configs.prompt_variables.filter(({ key, name, required, type }) => {
|
||||
if (type === 'api')
|
||||
if (type !== 'string' && type !== 'paragraph' && type !== 'select')
|
||||
return false
|
||||
const res = (!key || !key.trim()) || (!name || !name.trim()) || (required || required === undefined || required === null)
|
||||
return res
|
||||
|
||||
@@ -65,7 +65,7 @@ const FormGeneration: FC<FormGenerationProps> = ({
|
||||
}
|
||||
})}
|
||||
onSelect={item => handleFormChange(form.variable, item.value as string)}
|
||||
popupClassName='w-[576px]'
|
||||
popupClassName='w-[576px] !z-[102]'
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export const useCheckPromptVariables = () => {
|
||||
} = promptVariablesConfig
|
||||
let hasEmptyInput = ''
|
||||
const requiredVars = promptVariables.filter(({ key, name, required, type }) => {
|
||||
if (type === 'api')
|
||||
if (type !== 'string' && type !== 'paragraph' && type !== 'select')
|
||||
return false
|
||||
const res = (!key || !key.trim()) || (!name || !name.trim()) || (required || required === undefined || required === null)
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user