Fetched upstream and made merge changes for output section
This commit is contained in:
Generated
+797
-295
File diff suppressed because it is too large
Load Diff
@@ -21,11 +21,24 @@ import 'codemirror/theme/gruvbox-dark.css';
|
|||||||
const CodeEditor = (props) => {
|
const CodeEditor = (props) => {
|
||||||
const {fieldCount, setFieldCount} = props
|
const {fieldCount, setFieldCount} = props
|
||||||
const {changeActionParameterCodeMirror} = props
|
const {changeActionParameterCodeMirror} = props
|
||||||
const {expansionModalOpen, setExpansionModalOpen} = props
|
const {expansionModalOpen, setExpansionModalOpen} = props
|
||||||
const {codedata, setcodedata} = props
|
const {codedata, setcodedata} = props
|
||||||
const [localcodedata, setlocalcodedata] = React.useState(codedata === undefined || codedata === null || codedata.length === 0 ? "" : codedata);
|
const [localcodedata, setlocalcodedata] = React.useState(codedata === undefined || codedata === null || codedata.length === 0 ? "" : codedata);
|
||||||
// const {codelang, setcodelang} = props
|
// const {codelang, setcodelang} = props
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const [expOutput, setexpOutput] = React.useState(" ");
|
||||||
|
function expectedOutput(input) {
|
||||||
|
// const obj = JSON.parse(input);
|
||||||
|
// setexpOutput(JSON.stringify(JSON.parse(input), null, 4))
|
||||||
|
var x = document.getElementById("expOutput");
|
||||||
|
x.innerHTML = JSON.stringify(input, null, 4)
|
||||||
|
// x.innerHTML = JSON.stringify(JSON.parse(input), null, 4)
|
||||||
|
// x.appendChild(document.createTextNode(JSON.stringify(JSON.parse(input), null, 4)));
|
||||||
|
// setexpOutput(JSON.stringify(input, null, 4))
|
||||||
|
|
||||||
|
// Variables + Syntax highlighting + Validation
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
@@ -54,35 +67,6 @@ const CodeEditor = (props) => {
|
|||||||
>
|
>
|
||||||
Code Editor
|
Code Editor
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
{/* / Removed due to possible confusion between cancel, done and close buttons.
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: 60,
|
|
||||||
marginLeft: 280,
|
|
||||||
position: "absolute",
|
|
||||||
top: 15,
|
|
||||||
right: 15,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Tooltip title="Close editor" placement="top">
|
|
||||||
<IconButton
|
|
||||||
style={{
|
|
||||||
color: "white",
|
|
||||||
background: "#27292d",
|
|
||||||
fontSize: 15,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
cursor: "pointer"
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
setExpansionModalOpen(false)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FullscreenExitIcon />
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
|
||||||
*/}
|
|
||||||
</div>
|
</div>
|
||||||
<span style={{
|
<span style={{
|
||||||
border: `2px solid ${theme.palette.inputColor}`,
|
border: `2px solid ${theme.palette.inputColor}`,
|
||||||
@@ -95,6 +79,7 @@ const CodeEditor = (props) => {
|
|||||||
}}
|
}}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
setlocalcodedata(value.getValue())
|
setlocalcodedata(value.getValue())
|
||||||
|
expectedOutput(value.getValue())
|
||||||
}}
|
}}
|
||||||
options={{
|
options={{
|
||||||
theme: 'gruvbox-dark',
|
theme: 'gruvbox-dark',
|
||||||
@@ -104,6 +89,37 @@ const CodeEditor = (props) => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<DialogTitle
|
||||||
|
style={{
|
||||||
|
paddingTop: 30,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
color: "white"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Output
|
||||||
|
</span>
|
||||||
|
</DialogTitle>
|
||||||
|
<p
|
||||||
|
id='expOutput'
|
||||||
|
style={{
|
||||||
|
color: "#f85a3e",
|
||||||
|
fontFamily: "monospace",
|
||||||
|
backgroundColor: "#282828",
|
||||||
|
padding: 20,
|
||||||
|
marginTop: -2,
|
||||||
|
border: `2px solid ${theme.palette.inputColor}`,
|
||||||
|
borderRadius: theme.palette.borderRadius,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* {expOutput} */}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
Reference in New Issue
Block a user