Cleaned the code
This commit is contained in:
@@ -13,10 +13,6 @@ import {Popper, TextField, TextareaAutosize, Drawer, Button, Paper, Grid, Tabs,
|
|||||||
import {GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons';
|
import {GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons';
|
||||||
import Autocomplete from '@material-ui/lab/Autocomplete';
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
||||||
|
|
||||||
import CodeMirror from '@uiw/react-codemirror';
|
|
||||||
import 'codemirror/keymap/sublime';
|
|
||||||
import 'codemirror/theme/gruvbox-dark.css';
|
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
notchedOutline: {
|
notchedOutline: {
|
||||||
borderColor: "#f85a3e !important"
|
borderColor: "#f85a3e !important"
|
||||||
@@ -492,10 +488,6 @@ const ParsedAction = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const changeActionParameterCodeMirror = (event, count, data) => {
|
const changeActionParameterCodeMirror = (event, count, data) => {
|
||||||
// console.log(event)
|
|
||||||
// if (data.name.startsWith("${") && data.name.endsWith("}")) {
|
|
||||||
// console.log(data)
|
|
||||||
// console.log(count)
|
|
||||||
if (data.startsWith("${") && data.endsWith("}")) {
|
if (data.startsWith("${") && data.endsWith("}")) {
|
||||||
// PARAM FIX - Gonna use the ID field, even though it's a hack
|
// PARAM FIX - Gonna use the ID field, even though it's a hack
|
||||||
const paramcheck = selectedAction.parameters.find(param => param.name === "body")
|
const paramcheck = selectedAction.parameters.find(param => param.name === "body")
|
||||||
@@ -843,18 +835,15 @@ const ParsedAction = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const clickedFieldId = "rightside_field_"+count
|
const clickedFieldId = "rightside_field_"+count
|
||||||
//<TextareaAutosize
|
|
||||||
// <CodeMirror
|
|
||||||
|
|
||||||
const shufflecode = <ShuffleCodeEditor
|
const shufflecode = <ShuffleCodeEditor
|
||||||
fieldCount = {fieldCount}
|
fieldCount = {fieldCount}
|
||||||
setFieldCount = {setFieldCount}
|
setFieldCount = {setFieldCount}
|
||||||
// editorData = {data.value.valueOf()}
|
|
||||||
changeActionParameterCodeMirror = {changeActionParameterCodeMirror}
|
changeActionParameterCodeMirror = {changeActionParameterCodeMirror}
|
||||||
codedata={codedata}
|
codedata={codedata}
|
||||||
setcodedata={setcodedata}
|
setcodedata={setcodedata}
|
||||||
setExpansionModalOpen={setExpansionModalOpen}
|
|
||||||
expansionModalOpen={expansionModalOpen}
|
expansionModalOpen={expansionModalOpen}
|
||||||
|
setExpansionModalOpen={setExpansionModalOpen}
|
||||||
// codelang={codelang}
|
// codelang={codelang}
|
||||||
// setcodelang={setcodelang}
|
// setcodelang={setcodelang}
|
||||||
/>
|
/>
|
||||||
@@ -888,16 +877,15 @@ const ParsedAction = (props) => {
|
|||||||
id={clickedFieldId}
|
id={clickedFieldId}
|
||||||
rows={rows}
|
rows={rows}
|
||||||
color="primary"
|
color="primary"
|
||||||
// value={codedata}
|
|
||||||
defaultValue={data.value}
|
defaultValue={data.value}
|
||||||
// height={multiline ? 50 : 150}
|
// height={multiline ? 50 : 150}
|
||||||
|
|
||||||
type={placeholder.includes("***") || (data.configuration && (data.name.toLowerCase().includes("api") || data.name.toLowerCase().includes("key") || data.name.toLowerCase().includes("pass"))) ? "password" : "text"}
|
type={placeholder.includes("***") || (data.configuration && (data.name.toLowerCase().includes("api") || data.name.toLowerCase().includes("key") || data.name.toLowerCase().includes("pass"))) ? "password" : "text"}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
|
|
||||||
onChange={(event) => {
|
// onChange={(event) => {
|
||||||
// changeActionParameter(event, count, data)
|
// changeActionParameter(event, count, data)
|
||||||
}}
|
// }}
|
||||||
|
|
||||||
helperText={selectedApp.generated && selectedApp.activated && data.name === "body" ?
|
helperText={selectedApp.generated && selectedApp.activated && data.name === "body" ?
|
||||||
<span style={{color:"white", marginBottom: 5, marginleft: 5,}}>
|
<span style={{color:"white", marginBottom: 5, marginleft: 5,}}>
|
||||||
@@ -1432,16 +1420,6 @@ const ParsedAction = (props) => {
|
|||||||
const baselabel = selectedAction.label
|
const baselabel = selectedAction.label
|
||||||
return (
|
return (
|
||||||
<div style={appApiViewStyle} id="parsed_action_view">
|
<div style={appApiViewStyle} id="parsed_action_view">
|
||||||
{/* {<ShuffleCodeEditor
|
|
||||||
count = {count}
|
|
||||||
changeActionParameter = {changeActionParameter}
|
|
||||||
codedata={codedata}
|
|
||||||
setcodedata={setcodedata}
|
|
||||||
setExpansionModalOpen={setExpansionModalOpen}
|
|
||||||
expansionModalOpen={expansionModalOpen}
|
|
||||||
// codelang={codelang}
|
|
||||||
// setcodelang={setcodelang}
|
|
||||||
/>} */}
|
|
||||||
{hideExtraTypes === true ? null :
|
{hideExtraTypes === true ? null :
|
||||||
<span>
|
<span>
|
||||||
<div style={{display: "flex", minHeight: 40, marginBottom: 30}}>
|
<div style={{display: "flex", minHeight: 40, marginBottom: 30}}>
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import 'codemirror/theme/gruvbox-dark.css';
|
|||||||
|
|
||||||
const Textfield = (props) => {
|
const Textfield = (props) => {
|
||||||
const {fieldCount, setFieldCount} = props
|
const {fieldCount, setFieldCount} = props
|
||||||
// const {editorData} = props
|
|
||||||
const {changeActionParameterCodeMirror} = props
|
const {changeActionParameterCodeMirror} = props
|
||||||
const {expansionModalOpen, setExpansionModalOpen} = props
|
const {expansionModalOpen, setExpansionModalOpen} = props
|
||||||
const {codedata, setcodedata} = props
|
const {codedata, setcodedata} = props
|
||||||
@@ -94,7 +93,6 @@ const Textfield = (props) => {
|
|||||||
value = {localcodedata}
|
value = {localcodedata}
|
||||||
height="200px"
|
height="200px"
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
// setcodedata(value.getValue())
|
|
||||||
setlocalcodedata(value.getValue())
|
setlocalcodedata(value.getValue())
|
||||||
}}
|
}}
|
||||||
options={{
|
options={{
|
||||||
@@ -107,7 +105,6 @@ const Textfield = (props) => {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
// justifyContent: 'left',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React, {useRef, useState, useEffect, useLayoutEffect} from 'react';
|
import React, {useRef, useState, useEffect, useLayoutEffect} from 'react';
|
||||||
import { useInterval } from 'react-powerhooks';
|
import { useInterval } from 'react-powerhooks';
|
||||||
import { useTheme } from '@material-ui/core/styles';
|
import { useTheme } from '@material-ui/core/styles';
|
||||||
import ShuffleCodeEditor from "../components/ShuffleCodeEditor.jsx";
|
|
||||||
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
@@ -170,9 +169,6 @@ const AngularWorkflow = (props) => {
|
|||||||
selected: "",
|
selected: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
const [codedata, setcodedata] = React.useState("print('Hello')");
|
|
||||||
const [expansionModalOpen, setExpansionModalOpen] = React.useState(false);
|
|
||||||
|
|
||||||
const [history, setHistory] = React.useState([])
|
const [history, setHistory] = React.useState([])
|
||||||
const [historyIndex, setHistoryIndex] = React.useState(history.length)
|
const [historyIndex, setHistoryIndex] = React.useState(history.length)
|
||||||
|
|
||||||
@@ -7832,12 +7828,6 @@ const AngularWorkflow = (props) => {
|
|||||||
globalUrl={globalUrl}
|
globalUrl={globalUrl}
|
||||||
setSelectedActionEnvironment={setSelectedActionEnvironment}
|
setSelectedActionEnvironment={setSelectedActionEnvironment}
|
||||||
requiresAuthentication={requiresAuthentication}
|
requiresAuthentication={requiresAuthentication}
|
||||||
|
|
||||||
// onClick={() => {
|
|
||||||
// // console.log("Clicked field: ", clickedFieldId)
|
|
||||||
// setExpansionModalOpen(true)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -9449,20 +9439,6 @@ const AngularWorkflow = (props) => {
|
|||||||
</ScrollElement>
|
</ScrollElement>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
// const baselabel = selectedAction.label
|
|
||||||
// return (
|
|
||||||
// <div style={appApiViewStyle} id="parsed_action_view">
|
|
||||||
// {<ShuffleCodeEditor
|
|
||||||
// codedata={codedata}
|
|
||||||
// setcodedata={setcodedata}
|
|
||||||
// setExpansionModalOpen={setExpansionModalOpen}
|
|
||||||
// expansionModalOpen={expansionModalOpen}
|
|
||||||
// // codelang={codelang}
|
|
||||||
// // setcodelang={setcodelang}
|
|
||||||
// />}
|
|
||||||
// </div>
|
|
||||||
// )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AngularWorkflow
|
export default AngularWorkflow
|
||||||
|
|||||||
Reference in New Issue
Block a user