feat(web): Workflow
This commit is contained in:
@@ -75,7 +75,7 @@ export const useWorkflowGraph = ({
|
|||||||
|
|
||||||
if (nodes.length) {
|
if (nodes.length) {
|
||||||
const nodeList = nodes.map(node => {
|
const nodeList = nodes.map(node => {
|
||||||
const { id, type, name, position, config } = node
|
const { id, type, name, position, config = {} } = node
|
||||||
let nodeLibraryConfig = [...nodeLibrary]
|
let nodeLibraryConfig = [...nodeLibrary]
|
||||||
.flatMap(category => category.nodes)
|
.flatMap(category => category.nodes)
|
||||||
.find(n => n.type === type)
|
.find(n => n.type === type)
|
||||||
@@ -84,7 +84,7 @@ export const useWorkflowGraph = ({
|
|||||||
if (nodeLibraryConfig?.config) {
|
if (nodeLibraryConfig?.config) {
|
||||||
Object.keys(nodeLibraryConfig.config).forEach(key => {
|
Object.keys(nodeLibraryConfig.config).forEach(key => {
|
||||||
if (nodeLibraryConfig.config && nodeLibraryConfig.config[key]) {
|
if (nodeLibraryConfig.config && nodeLibraryConfig.config[key]) {
|
||||||
nodeLibraryConfig.config[key].defaultValue = config[key]
|
nodeLibraryConfig.config[key].defaultValue = config[key] || {}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user