feat: Add default value support for all workflow start node variable types (#24129)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
51cc2bf429
commit
ffe1685b54
6 changed files with 100 additions and 36 deletions
|
|
@ -210,7 +210,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
|||
|
||||
return {
|
||||
...item.paragraph,
|
||||
default: value || item.default,
|
||||
default: value || item.default || item.paragraph.default,
|
||||
type: 'paragraph',
|
||||
}
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
|||
const convertedNumber = Number(initInputs[item.number.variable]) ?? undefined
|
||||
return {
|
||||
...item.number,
|
||||
default: convertedNumber || item.default,
|
||||
default: convertedNumber || item.default || item.number.default,
|
||||
type: 'number',
|
||||
}
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
|||
|
||||
return {
|
||||
...item['text-input'],
|
||||
default: value || item.default,
|
||||
default: value || item.default || item['text-input'].default,
|
||||
type: 'text-input',
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ export const useEmbeddedChatbot = () => {
|
|||
|
||||
return {
|
||||
...item.paragraph,
|
||||
default: value || item.default,
|
||||
default: value || item.default || item.paragraph.default,
|
||||
type: 'paragraph',
|
||||
}
|
||||
}
|
||||
|
|
@ -191,7 +191,7 @@ export const useEmbeddedChatbot = () => {
|
|||
const convertedNumber = Number(initInputs[item.number.variable]) ?? undefined
|
||||
return {
|
||||
...item.number,
|
||||
default: convertedNumber || item.default,
|
||||
default: convertedNumber || item.default || item.number.default,
|
||||
type: 'number',
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ export const useEmbeddedChatbot = () => {
|
|||
|
||||
return {
|
||||
...item['text-input'],
|
||||
default: value || item.default,
|
||||
default: value || item.default || item['text-input'].default,
|
||||
type: 'text-input',
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue