Port Event Triggers node to react. Fixes #6578

This commit is contained in:
Nikhil Mohite
2021-07-07 18:17:16 +05:30
committed by Akshay Joshi
parent d1e823bf39
commit 793dbc6e7f
9 changed files with 338 additions and 10 deletions

View File

@@ -10,7 +10,7 @@
import React, { useCallback } from 'react';
import _ from 'lodash';
import { FormInputText, FormInputSelect, FormInputSwitch, FormInputCheckbox, InputSQL, FormInputColor, FormInputFileSelect, FormInputToggle, InputSwitch } from '../components/FormComponents';
import { FormInputText, FormInputSelect, FormInputSwitch, FormInputCheckbox, FormInputColor, FormInputFileSelect, FormInputToggle, InputSwitch, FormInputSQL } from '../components/FormComponents';
import { InputSelect, InputText } from '../components/FormComponents';
import Privilege from '../components/Privilege';
import { evalFunc } from 'sources/utils';
@@ -28,6 +28,10 @@ function MappedFormControlBase({type, value, id, onChange, className, visible, i
onChange && onChange(value);
});
const onSqlChange = useCallback((e, cm) => {
onChange && onChange(cm.getValue());
});
const onIntChange = useCallback((e) => {
let value = e;
if(e && e.target) {
@@ -73,7 +77,7 @@ function MappedFormControlBase({type, value, id, onChange, className, visible, i
case 'file':
return <FormInputFileSelect name={name} value={value} onChange={onTextChange} className={className} {...props} />;
case 'sql':
return <InputSQL name={name} value={value} onChange={onTextChange} className={className} {...props}/>;
return <FormInputSQL name={name} value={value} onChange={onSqlChange} className={className} {...props}/>;
default:
return <></>;
}