dify/web/app/components/workflow/nodes/start-placeholder/default.ts
Stephen Zhou b9fde89781
refactor(web): migrate i18n to selector optimize mode (#38657)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-10 09:35:31 +00:00

31 lines
809 B
TypeScript

import type { TFunction } from 'i18next'
import type { NodeDefault } from '../../types'
import type { StartPlaceholderNodeType } from './types'
import { BlockEnum } from '@/app/components/workflow/types'
import { genNodeMetaData } from '@/app/components/workflow/utils'
const metaData = genNodeMetaData({
sort: 0.05,
type: BlockEnum.StartPlaceholder,
isRequired: false,
isSingleton: true,
isTypeFixed: true,
helpLinkUri: 'start',
})
const nodeDefault: NodeDefault<StartPlaceholderNodeType> = {
metaData,
defaultValue: {
title: 'Workflow start',
desc: '',
},
checkValid(_payload, t: TFunction<'workflow'>) {
return {
isValid: false,
errorMessage: t($ => $['nodes.startPlaceholder.validationRequired'], { ns: 'workflow' }),
}
},
}
export default nodeDefault