mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Add more nodes for agents, loaders
This commit is contained in:
@@ -8,7 +8,6 @@ export const SET_LAYOUT = '@customization/SET_LAYOUT '
|
||||
export const SET_DARKMODE = '@customization/SET_DARKMODE'
|
||||
|
||||
// action - canvas reducer
|
||||
export const REMOVE_EDGE = '@canvas/REMOVE_EDGE'
|
||||
export const SET_DIRTY = '@canvas/SET_DIRTY'
|
||||
export const REMOVE_DIRTY = '@canvas/REMOVE_DIRTY'
|
||||
export const SET_CHATFLOW = '@canvas/SET_CHATFLOW'
|
||||
|
||||
@@ -4,7 +4,8 @@ import PropTypes from 'prop-types'
|
||||
const initialValue = {
|
||||
reactFlowInstance: null,
|
||||
setReactFlowInstance: () => {},
|
||||
deleteNode: () => {}
|
||||
deleteNode: () => {},
|
||||
deleteEdge: () => {}
|
||||
}
|
||||
|
||||
export const flowContext = createContext(initialValue)
|
||||
@@ -17,12 +18,17 @@ export const ReactFlowContext = ({ children }) => {
|
||||
reactFlowInstance.setEdges(reactFlowInstance.getEdges().filter((ns) => ns.source !== id && ns.target !== id))
|
||||
}
|
||||
|
||||
const deleteEdge = (id) => {
|
||||
reactFlowInstance.setEdges(reactFlowInstance.getEdges().filter((edge) => edge.id !== id))
|
||||
}
|
||||
|
||||
return (
|
||||
<flowContext.Provider
|
||||
value={{
|
||||
reactFlowInstance,
|
||||
setReactFlowInstance,
|
||||
deleteNode
|
||||
deleteNode,
|
||||
deleteEdge
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import * as actionTypes from '../actions'
|
||||
|
||||
export const initialState = {
|
||||
removeEdgeId: '',
|
||||
isDirty: false,
|
||||
chatflow: null
|
||||
}
|
||||
@@ -11,11 +10,6 @@ export const initialState = {
|
||||
|
||||
const canvasReducer = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case actionTypes.REMOVE_EDGE:
|
||||
return {
|
||||
...state,
|
||||
removeEdgeId: action.edgeId
|
||||
}
|
||||
case actionTypes.SET_DIRTY:
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user