clean console log and added toObject() log
This commit is contained in:
parent
cc1bbefc84
commit
fc23bda7b3
5 changed files with 4 additions and 7 deletions
|
|
@ -28,14 +28,12 @@ export default function Chat({ reactFlowInstance }) {
|
|||
ref.current.scrollIntoView({behavior: 'smooth'});
|
||||
}, [chatHistory])
|
||||
function validateNodes(){
|
||||
console.log(reactFlowInstance.getNodes());
|
||||
if(reactFlowInstance.getNodes().some((n) => (n.data.node && Object.keys(n.data.node.template).some((t: any) => ((n.data.node.template[t].required && n.data.node.template[t].value === "") && (n.data.node.template[t].required && !reactFlowInstance.getEdges().some((e) => (e.sourceHandle.split('|')[1] === t && e.sourceHandle.split('|')[2] === n.id)))))))){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function validateChatNodes(){
|
||||
console.log(reactFlowInstance.getNodes());
|
||||
if(!reactFlowInstance.getNodes().some((n)=> (n.type === 'chatOutputNode')) || !reactFlowInstance.getNodes().some((n)=> (n.type === 'chatInputNode'))){
|
||||
return false;
|
||||
}
|
||||
|
|
@ -103,6 +101,7 @@ export default function Chat({ reactFlowInstance }) {
|
|||
<div className="absolute inset-y-0 right-0 flex items-center pr-3">
|
||||
<button
|
||||
onClick={() => {
|
||||
console.log(reactFlowInstance.toObject())
|
||||
if(chatValue !== ""){
|
||||
if(validateNodes()){
|
||||
if(validateChatNodes()){
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ export default function InputListComponent({ value, onChange, disabled}) {
|
|||
: <button onClick={() => {setInputList((old) => {
|
||||
let newInputList = _.cloneDeep(old);
|
||||
newInputList.splice(idx, 1);
|
||||
console.log(newInputList);
|
||||
return newInputList;
|
||||
});
|
||||
onChange(inputList);}}>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const ConnectionLineComponent = ({
|
|||
fromNode={},
|
||||
connectionLineStyle = {} // provide a default value for connectionLineStyle
|
||||
}) => {
|
||||
console.log(fromNode)
|
||||
// console.log(fromNode)
|
||||
return (
|
||||
<g>
|
||||
<path
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ export default function ExtraSidebar() {
|
|||
acc[c] = curr;
|
||||
data[curr][c].base_classes?.forEach((b) => {acc[b] = curr;})
|
||||
});
|
||||
console.log(acc);
|
||||
// console.log(acc);
|
||||
return acc;
|
||||
}, {str: 'advanced', bool: 'advanced', chatOutput: 'chat', chatInput: 'chat'});
|
||||
|
||||
useEffect(() => {
|
||||
getAll().then((d) => {
|
||||
setData(d.data);
|
||||
console.log(d.data);
|
||||
// console.log(d.data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
|
|
@ -310,7 +310,6 @@ export function toFirstUpperCase(str: string) {
|
|||
}
|
||||
|
||||
export function snakeToNormalCase(str: string) {
|
||||
console.log(str);
|
||||
return str
|
||||
.split("_")
|
||||
.map((word, index) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue