Fixed minor bugs in app creator bodies and action names + added auto addition of headers

This commit is contained in:
frikky
2022-07-14 01:16:27 +02:00
parent 76bfff84da
commit 16e7bfcb58
11 changed files with 340 additions and 269 deletions
@@ -41,6 +41,7 @@ import { padding, textAlign } from '@mui/system';
const liquidFilters = [
{"name": "Size", "value": "size", "example": ""},
{"name": "Date", "value": `date: "%Y%M%d"`, "example": `{{ "now" | date: "%s" }}`},
{"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``},
]
const mathFilters = [
@@ -50,7 +51,7 @@ const mathFilters = [
const pythonFilters = [
{"name": "Hello World", "value": `{% python %}\nprint("hello world")\n{% endpython %}`, "example": ``},
{"name": "Handle JSON", "value": `{% python %}\nimport json\njsondata = json.loads("""$nodename""")\n{% endpython %}`, "example": ``},
{"name": "Handle JSON", "value": `{% python %}\nimport json\njsondata = json.loads(r"""$nodename""")\n{% endpython %}`, "example": ``},
]
const CodeEditor = (props) => {
@@ -348,7 +349,7 @@ const CodeEditor = (props) => {
return
}
if (!item.value.includes("{%")) {
if (!item.value.includes("{%") && !item.value.includes("{{")) {
setlocalcodedata(localcodedata+" | "+item.value+" }}")
} else {
setlocalcodedata(localcodedata+item.value)
@@ -582,7 +583,7 @@ const CodeEditor = (props) => {
}}
/>
</span>
{editorPopupOpen ?
{/*editorPopupOpen ?
<Paper
style={{
margin: 10,
@@ -617,13 +618,12 @@ const CodeEditor = (props) => {
}}
>
{data.substring(0, 25)}
{/* {Object.keys(data.example).forEach(key => key)} */}
</button>
</div>
)
})}
</Paper>
: null}
: null*/}
<div
style={{