mirror of https://github.com/langgenius/dify.git
type safe
This commit is contained in:
parent
8698d4f0e6
commit
5058339bf1
|
|
@ -30,7 +30,7 @@ const Item = ({
|
|||
if (!isValid) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t(`varKeyError.${errorMessageKey}` as any, { ns: 'appDebug', key: t('env.modal.name', { ns: 'workflow' }) }) as string,
|
||||
message: t(`varKeyError.${errorMessageKey}`, { ns: 'appDebug', key: t('env.modal.name', { ns: 'workflow' }) }),
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ const AddExtractParameter: FC<Props> = ({
|
|||
if (!isValid) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t(`varKeyError.${errorMessageKey}` as any, { ns: 'appDebug', key: errorKey }) as string,
|
||||
message: t(`varKeyError.${errorMessageKey}`, { ns: 'appDebug', key: errorKey }),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,10 +106,10 @@ const useConfig = (id: string, payload: WebhookTriggerNodeType) => {
|
|||
if (!isValid) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t(`varKeyError.${errorMessageKey}` as any, {
|
||||
message: t(`varKeyError.${errorMessageKey}`, {
|
||||
ns: 'appDebug',
|
||||
key: t('variableConfig.varName', { ns: 'appDebug' }),
|
||||
}) as string,
|
||||
}),
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { Node, ValueSelector } from '@/app/components/workflow/types'
|
||||
import type { I18nKeysByPrefix } from '@/types/i18n'
|
||||
import {
|
||||
memo,
|
||||
useMemo,
|
||||
|
|
@ -16,7 +17,7 @@ import { cn } from '@/utils/classnames'
|
|||
type NodeVariableItemProps = {
|
||||
node: Node
|
||||
variable: ValueSelector
|
||||
writeMode?: string
|
||||
writeMode?: I18nKeysByPrefix<'workflow', 'nodes.assigner.operations.'>
|
||||
showBorder?: boolean
|
||||
className?: string
|
||||
isException?: boolean
|
||||
|
|
@ -120,7 +121,7 @@ const NodeVariableItem = ({
|
|||
{VariableIcon}
|
||||
{VariableName}
|
||||
</div>
|
||||
{writeMode && <Badge className="shrink-0" text={t(`${i18nPrefix}.operations.${writeMode}` as any, { ns: 'workflow' }) as string} />}
|
||||
{writeMode && <Badge className="shrink-0" text={t(`${i18nPrefix}.operations.${writeMode}`, { ns: 'workflow' }) as string} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ const VarGroupItem: FC<Props> = ({
|
|||
if (!isValid) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t(`varKeyError.${errorMessageKey}` as any, { ns: 'appDebug', key: errorKey }) as string,
|
||||
message: t(`varKeyError.${errorMessageKey}`, { ns: 'appDebug', key: errorKey }),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ const ChatVariableModal = ({
|
|||
if (!isValid) {
|
||||
notify({
|
||||
type: 'error',
|
||||
message: t(`varKeyError.${errorMessageKey}` as any, { ns: 'appDebug', key: t('env.modal.name', { ns: 'workflow' }) }) as string,
|
||||
message: t(`varKeyError.${errorMessageKey}`, { ns: 'appDebug', key: t('env.modal.name', { ns: 'workflow' }) }),
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const VariableModal = ({
|
|||
if (!isValid) {
|
||||
notify({
|
||||
type: 'error',
|
||||
message: t(`varKeyError.${errorMessageKey}` as any, { ns: 'appDebug', key: t('env.modal.name', { ns: 'workflow' }) }) as string,
|
||||
message: t(`varKeyError.${errorMessageKey}`, { ns: 'appDebug', key: t('env.modal.name', { ns: 'workflow' }) }),
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue