mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-30 09:57:19 +00:00
* github actions for PR and push to develop branch * test workflow * move to workflows folder * add setup node action * modify build * specify npm version * config unit test * specify host postgres * specify container to run on * add postgresql dependency * add specify ws adapter for test * add e2e test * fix linting * only log errors on tests * update eslint config * fix linting * run e2e test in silent mode * fix library app spec * dont send email on test env * fix org scope * mock env vars * remove reset modules * force colors * explicitly close db connection * add eslint rule for floating promises * update workflow * fix floating promise * fix lint * update workflow * run on all push and pulls * update lint check files * simplify workflow * increase js heap size on env * separate lint and build Co-authored-by: arpitnath <arpitnath42@gmail.com>
38 lines
965 B
JavaScript
38 lines
965 B
JavaScript
import React from 'react';
|
|
import { CodeHinter } from '../../CodeBuilder/CodeHinter';
|
|
import { changeOption } from './utils';
|
|
import { defaults } from 'lodash';
|
|
|
|
class Runjs extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
const options = defaults({ ...props.options }, { code: '//Type your JavaScript code here' });
|
|
this.state = {
|
|
options,
|
|
};
|
|
}
|
|
|
|
componentDidMount() {}
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
<CodeHinter
|
|
currentState={this.props.currentState}
|
|
initialValue={this.props.options.code}
|
|
mode="javascript"
|
|
theme={this.props.darkMode ? 'monokai' : 'base16-light'}
|
|
lineNumbers={true}
|
|
height={400}
|
|
className="query-hinter"
|
|
ignoreBraces={true}
|
|
onChange={(value) => changeOption(this, 'code', value)}
|
|
isMultiLineJs={false}
|
|
enablePreview={false}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export { Runjs };
|