|
@@ -47,7 +47,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
|
|
if (!isValid) {
|
|
|
Toast.notify({
|
|
|
type: 'error',
|
|
|
- message: t(`appDebug.varKeyError.${errorMessageKey}`, { key: t('appDebug.variableConig.varName') }),
|
|
|
+ message: t(`appDebug.varKeyError.${errorMessageKey}`, { key: t('appDebug.variableConfig.varName') }),
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
@@ -101,7 +101,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
|
|
// }
|
|
|
|
|
|
if (!tempPayload.label) {
|
|
|
- Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.labelNameRequired') })
|
|
|
+ Toast.notify({ type: 'error', message: t('appDebug.variableConfig.errorMsg.labelNameRequired') })
|
|
|
return
|
|
|
}
|
|
|
if (isStringInput || type === InputVarType.number) {
|
|
@@ -109,7 +109,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
|
|
}
|
|
|
else {
|
|
|
if (options?.length === 0) {
|
|
|
- Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.atLeastOneOption') })
|
|
|
+ Toast.notify({ type: 'error', message: t('appDebug.variableConfig.errorMsg.atLeastOneOption') })
|
|
|
return
|
|
|
}
|
|
|
const obj: Record<string, boolean> = {}
|
|
@@ -122,7 +122,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
|
|
obj[o] = true
|
|
|
})
|
|
|
if (hasRepeatedItem) {
|
|
|
- Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.optionRepeat') })
|
|
|
+ Toast.notify({ type: 'error', message: t('appDebug.variableConfig.errorMsg.optionRepeat') })
|
|
|
return
|
|
|
}
|
|
|
onConfirm(tempPayload, moreInfo)
|
|
@@ -131,14 +131,14 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
|
|
|
|
|
return (
|
|
|
<Modal
|
|
|
- title={t(`appDebug.variableConig.${isCreate ? 'addModalTitle' : 'editModalTitle'}`)}
|
|
|
+ title={t(`appDebug.variableConfig.${isCreate ? 'addModalTitle' : 'editModalTitle'}`)}
|
|
|
isShow={isShow}
|
|
|
onClose={onClose}
|
|
|
>
|
|
|
<div className='mb-8'>
|
|
|
<div className='space-y-2'>
|
|
|
|
|
|
- <Field title={t('appDebug.variableConig.fieldType')}>
|
|
|
+ <Field title={t('appDebug.variableConfig.fieldType')}>
|
|
|
<div className='flex space-x-2'>
|
|
|
<SelectTypeItem type={InputVarType.textInput} selected={type === InputVarType.textInput} onClick={() => handlePayloadChange('type')(InputVarType.textInput)} />
|
|
|
<SelectTypeItem type={InputVarType.paragraph} selected={type === InputVarType.paragraph} onClick={() => handlePayloadChange('type')(InputVarType.paragraph)} />
|
|
@@ -147,39 +147,39 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
|
|
</div>
|
|
|
</Field>
|
|
|
|
|
|
- <Field title={t('appDebug.variableConig.varName')}>
|
|
|
+ <Field title={t('appDebug.variableConfig.varName')}>
|
|
|
<input
|
|
|
type='text'
|
|
|
className={inputClassName}
|
|
|
value={variable}
|
|
|
onChange={e => handlePayloadChange('variable')(e.target.value)}
|
|
|
onBlur={handleVarKeyBlur}
|
|
|
- placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
|
|
+ placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
|
|
/>
|
|
|
</Field>
|
|
|
- <Field title={t('appDebug.variableConig.labelName')}>
|
|
|
+ <Field title={t('appDebug.variableConfig.labelName')}>
|
|
|
<input
|
|
|
type='text'
|
|
|
className={inputClassName}
|
|
|
value={label as string}
|
|
|
onChange={e => handlePayloadChange('label')(e.target.value)}
|
|
|
- placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
|
|
+ placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
|
|
/>
|
|
|
</Field>
|
|
|
|
|
|
{isStringInput && (
|
|
|
- <Field title={t('appDebug.variableConig.maxLength')}>
|
|
|
+ <Field title={t('appDebug.variableConfig.maxLength')}>
|
|
|
<ConfigString maxLength={type === InputVarType.textInput ? TEXT_MAX_LENGTH : Infinity} modelId={modelConfig.model_id} value={max_length} onChange={handlePayloadChange('max_length')} />
|
|
|
</Field>
|
|
|
|
|
|
)}
|
|
|
{type === InputVarType.select && (
|
|
|
- <Field title={t('appDebug.variableConig.options')}>
|
|
|
+ <Field title={t('appDebug.variableConfig.options')}>
|
|
|
<ConfigSelect options={options || []} onChange={handlePayloadChange('options')} />
|
|
|
</Field>
|
|
|
)}
|
|
|
|
|
|
- <Field title={t('appDebug.variableConig.required')}>
|
|
|
+ <Field title={t('appDebug.variableConfig.required')}>
|
|
|
<Switch defaultValue={tempPayload.required} onChange={handlePayloadChange('required')} />
|
|
|
</Field>
|
|
|
</div>
|