feat(code/run-javascript): run async code and introduce monaco editor

This commit is contained in:
Ali BARIN
2024-07-29 15:19:05 +00:00
parent c99b9dbe0a
commit 49d4071928
7 changed files with 164 additions and 351 deletions

View File

@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
import useDynamicFields from 'hooks/useDynamicFields';
import useDynamicData from 'hooks/useDynamicData';
import PowerInput from 'components/PowerInput';
import CodeEditor from 'components/CodeEditor';
import TextField from 'components/TextField';
import ControlledAutocomplete from 'components/ControlledAutocomplete';
import ControlledCustomAutocomplete from 'components/ControlledCustomAutocomplete';
@@ -126,6 +127,26 @@ function InputCreator(props) {
);
}
if (type === 'code') {
return (
<React.Fragment>
<CodeEditor
key={computedName}
defaultValue={value}
required={required}
readOnly={readOnly || disabled}
name={computedName}
data-test={`${computedName}-text`}
label={label}
fullWidth
helperText={description}
shouldUnregister={shouldUnregister}
disabled={disabled}
/>
</React.Fragment>
);
}
if (type === 'string') {
if (schema.variables) {
return (