Fixed some stuff. More is broken.

This commit is contained in:
Frikky
2023-07-14 01:43:22 +02:00
parent e625bf2c2d
commit dd9ae8fb68
6 changed files with 70 additions and 232 deletions
+1
View File
@@ -68,6 +68,7 @@
"react-router-dom": "^6.14.1", "react-router-dom": "^6.14.1",
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",
"reaviz": "^14.9.4", "reaviz": "^14.9.4",
"remark-gfm": "^3.0.1",
"search-insights": "^2.2.1", "search-insights": "^2.2.1",
"shellwords": "^0.1.1", "shellwords": "^0.1.1",
"simplebar": "^4.2.3", "simplebar": "^4.2.3",
@@ -506,13 +506,6 @@ const ConfigureWorkflow = (props) => {
borderRadius: 5, borderRadius: 5,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
minHeight: 50,
marginLeft: 5,
maxWidth: "95%",
fontSize: "1em",
},
endAdornment: <InputAdornment position="end"></InputAdornment>, endAdornment: <InputAdornment position="end"></InputAdornment>,
}} }}
fullWidth fullWidth
+46 -59
View File
@@ -1159,6 +1159,8 @@ const ParsedAction = (props) => {
const iconInfo = GetIconInfo({ name: data.app_name }); const iconInfo = GetIconInfo({ name: data.app_name });
const useIcon = iconInfo.originalIcon; const useIcon = iconInfo.originalIcon;
console.log("Actionname 1: ", newActionname)
newActionname = ( newActionname = (
newActionname.charAt(0).toUpperCase() + newActionname.charAt(0).toUpperCase() +
newActionname.substring(1) newActionname.substring(1)
@@ -1362,7 +1364,7 @@ const ParsedAction = (props) => {
} }
var disabled = false; var disabled = false;
var rows = "5"; var rows = "3";
var openApiHelperText = "This is an OpenAPI specific field"; var openApiHelperText = "This is an OpenAPI specific field";
/* /*
if ( if (
@@ -1554,8 +1556,8 @@ const ParsedAction = (props) => {
} }
if (tmpitem === "from_shuffle") { if (tmpitem === "from_shuffle") {
tmpitem = "from" tmpitem = "from"
} }
tmpitem = ( tmpitem = (
tmpitem.charAt(0).toUpperCase() + tmpitem.substring(1) tmpitem.charAt(0).toUpperCase() + tmpitem.substring(1)
@@ -1585,14 +1587,7 @@ const ParsedAction = (props) => {
fontSize: "1em", fontSize: "1em",
}} }}
InputProps={{ InputProps={{
style: { disableUnderline: true,
color: "white",
minHeight: 50,
marginLeft: 5,
maxWidth: "95%",
fontSize: "1em",
},
disableUnderline: true,
endAdornment: hideExtraTypes ? null : ( endAdornment: hideExtraTypes ? null : (
<InputAdornment position="end"> <InputAdornment position="end">
<ButtonGroup orientation={multiline ? "vertical" : "horizontal"}> <ButtonGroup orientation={multiline ? "vertical" : "horizontal"}>
@@ -1940,13 +1935,6 @@ const ParsedAction = (props) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
minHeight: 50,
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
endAdornment: hideExtraTypes ? null : ( endAdornment: hideExtraTypes ? null : (
<InputAdornment position="end"> <InputAdornment position="end">
<Tooltip title="Autocomplete text" placement="top"> <Tooltip title="Autocomplete text" placement="top">
@@ -1969,7 +1957,7 @@ const ParsedAction = (props) => {
helperText={returnHelperText(data.name, data.value)} helperText={returnHelperText(data.name, data.value)}
fullWidth fullWidth
multiline={multiline} multiline={multiline}
rows="5" rows={"3"}
color="primary" color="primary"
defaultValue={data.value} defaultValue={data.value}
type={"text"} type={"text"}
@@ -3166,14 +3154,6 @@ const ParsedAction = (props) => {
<span> <span>
<Typography style={{color: "rgba(255,255,255,0.7)"}}>Delay</Typography> <Typography style={{color: "rgba(255,255,255,0.7)"}}>Delay</Typography>
<TextField <TextField
style={{
backgroundColor: theme.palette.inputColor,
borderRadius: theme.palette.borderRadius,
color: "white",
width: 50,
height: 50,
fontSize: "1em",
}}
InputProps={{ InputProps={{
style: theme.palette.innerTextfieldStyle, style: theme.palette.innerTextfieldStyle,
disableUnderline: true, disableUnderline: true,
@@ -3499,18 +3479,20 @@ const ParsedAction = (props) => {
color: "white", color: "white",
}, },
}} }}
filterOptions={(options, { inputValue }) => { filterOptions={(options, { inputValue }) => {
//console.log("Option contains?: ", inputValue, options) //console.log("Option contains?: ", inputValue, options)
const lowercaseValue = inputValue.toLowerCase() const lowercaseValue = inputValue.toLowerCase()
options = options.filter(x => x.name.replaceAll("_", " ").toLowerCase().includes(lowercaseValue) || x.description.toLowerCase().includes(lowercaseValue)) options = options.filter(x => x.name.replaceAll("_", " ").toLowerCase().includes(lowercaseValue) || x.description.toLowerCase().includes(lowercaseValue))
return options return options
}} }}
getOptionLabel={(option) => { getOptionLabel={(option) => {
if (option === undefined || option === null || option.name === undefined || option.name === null ) { if (option === undefined || option === null || option.name === undefined || option.name === null ) {
return null; return null;
} }
console.log("OPTION: ", option)
const newname = ( const newname = (
option.name.charAt(0).toUpperCase() + option.name.substring(1) option.name.charAt(0).toUpperCase() + option.name.substring(1)
).replaceAll("_", " "); ).replaceAll("_", " ");
@@ -3533,45 +3515,50 @@ const ParsedAction = (props) => {
}); });
} }
}} }}
renderOption={(data) => { renderOption={(props, data, state) => {
var newActionname = data.name; var newActionname = data.name;
if (data.label !== undefined && data.label !== null && data.label.length > 0) { if (data.label !== undefined && data.label !== null && data.label.length > 0) {
newActionname = data.label; newActionname = data.label;
} }
var newActiondescription = data.description; var newActiondescription = data.description;
//console.log("DESC: ", newActiondescription) //console.log("DESC: ", newActiondescription)
if (data.description === undefined || data.description === null) { if (data.description === undefined || data.description === null) {
newActiondescription = "Description: No description defined for this action" newActiondescription = "Description: No description defined for this action"
} else { } else {
newActiondescription = "Description: "+newActiondescription newActiondescription = "Description: "+newActiondescription
} }
const iconInfo = GetIconInfo({ name: data.name }); const iconInfo = GetIconInfo({ name: data.name });
const useIcon = iconInfo.originalIcon; const useIcon = iconInfo.originalIcon;
newActionname = ( if (newActionname === undefined || newActionname === null) {
newActionname.charAt(0).toUpperCase() + newActionname = "No name"
newActionname.substring(1) data.name = "No name"
).replaceAll("_", " "); data.label = "No name"
}
var method = "" console.log("Name: ", newActionname)
var extraDescription = ""
if (data.name.includes("get_")) { newActionname = (newActionname.charAt(0).toUpperCase() + newActionname.substring(1)).replaceAll("_", " ");
method = "GET"
} else if (data.name.includes("post_")) { var method = ""
method = "POST" var extraDescription = ""
} else if (data.name.includes("put_")) { if (data.name.includes("get_")) {
method = "PUT" method = "GET"
} else if (data.name.includes("patch_")) { } else if (data.name.includes("post_")) {
method = "PATCH" method = "POST"
} else if (data.name.includes("delete_")) { } else if (data.name.includes("put_")) {
method = "DELETE" method = "PUT"
} else if (data.name.includes("options_")) { } else if (data.name.includes("patch_")) {
method = "OPTIONS" method = "PATCH"
} else if (data.name.includes("connect_")) { } else if (data.name.includes("delete_")) {
method = "CONNECT" method = "DELETE"
} } else if (data.name.includes("options_")) {
method = "OPTIONS"
} else if (data.name.includes("connect_")) {
method = "CONNECT"
}
// FIXME: Should it require a base URL? // FIXME: Should it require a base URL?
if (method.length > 0 && data.description !== undefined && data.description !== null && data.description.includes("http")) { if (method.length > 0 && data.description !== undefined && data.description !== null && data.description.includes("http")) {
+10 -10
View File
@@ -1,8 +1,8 @@
import React from "react"; import React from "react";
import { createTheme, adaptV4Theme } from "@mui/material/styles"; import { createTheme, adaptV4Theme } from "@mui/material/styles";
//const theme = createTheme(adaptV4Theme({ //const theme = createTheme({
const theme = createTheme({ const theme = createTheme(adaptV4Theme({
palette: { palette: {
main: "#F86743", main: "#F86743",
primary: { primary: {
@@ -34,12 +34,12 @@ const theme = createTheme({
borderRadius: 5, borderRadius: 5,
}, },
innerTextfieldStyle: { innerTextfieldStyle: {
color: "white", //color: "white",
minHeight: 50, //minHeight: 50,
marginLeft: "5px", //marginLeft: "5px",
maxWidth: "95%", //maxWidth: "95%",
fontSize: "1em", //fontSize: "1em",
borderRadius: 5, //borderRadius: 5,
}, },
tooltip: { tooltip: {
backgroundColor: "white", backgroundColor: "white",
@@ -80,7 +80,7 @@ const theme = createTheme({
font-family: 'roboto'; font-family: 'roboto';
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
font-weight: 400; font-weight: 300;
src: local('roboto'), local('roboto'), format('truetype'); src: local('roboto'), local('roboto'), format('truetype');
unicodeRange: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF; unicodeRange: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF;
} }
@@ -88,6 +88,6 @@ const theme = createTheme({
}, },
}, },
}, },
}); }));
export default theme; export default theme;
-149
View File
@@ -7080,12 +7080,6 @@ const AngularWorkflow = (defaultprops) => {
<div style={appViewStyle}> <div style={appViewStyle}>
<div style={{ flex: "1" }}> <div style={{ flex: "1" }}>
<TextField <TextField
style={{
backgroundColor: inputColor,
borderRadius: theme.palette.borderRadius,
marginTop: 5,
marginRight: 10,
}}
InputProps={{ InputProps={{
style: { style: {
color: "white", color: "white",
@@ -7789,15 +7783,6 @@ const AngularWorkflow = (defaultprops) => {
backgroundColor: inputColor, backgroundColor: inputColor,
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{
style: {
color: "white",
minHeight: 50,
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
}}
fullWidth fullWidth
multiline={multiline} multiline={multiline}
color="primary" color="primary"
@@ -9146,15 +9131,6 @@ const AngularWorkflow = (defaultprops) => {
backgroundColor: inputColor, backgroundColor: inputColor,
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}}
fullWidth fullWidth
color="primary" color="primary"
placeholder={selectedTrigger.label} placeholder={selectedTrigger.label}
@@ -9169,13 +9145,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
required required
disabled disabled
@@ -9906,15 +9875,6 @@ const AngularWorkflow = (defaultprops) => {
backgroundColor: inputColor, backgroundColor: inputColor,
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}}
fullWidth fullWidth
color="primary" color="primary"
placeholder={selectedTrigger.label} placeholder={selectedTrigger.label}
@@ -9931,14 +9891,6 @@ const AngularWorkflow = (defaultprops) => {
<span> <span>
<Typography>Delay</Typography> <Typography>Delay</Typography>
<TextField <TextField
style={{
backgroundColor: theme.palette.inputColor,
borderRadius: theme.palette.borderRadius,
color: "white",
width: 50,
height: 50,
fontSize: "1em",
}}
InputProps={{ InputProps={{
style: theme.palette.innerTextfieldStyle, style: theme.palette.innerTextfieldStyle,
}} }}
@@ -10259,12 +10211,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
endAdornment: ( endAdornment: (
<InputAdornment position="end"> <InputAdornment position="end">
<Tooltip title="Autocomplete text" placement="top"> <Tooltip title="Autocomplete text" placement="top">
@@ -10411,12 +10357,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
}} }}
multiline multiline
rows="4" rows="4"
@@ -10438,13 +10378,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -10492,13 +10425,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -10518,13 +10444,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -10544,13 +10463,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -10655,13 +10567,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -11008,12 +10913,6 @@ const AngularWorkflow = (defaultprops) => {
id="webhook_uri_header" id="webhook_uri_header"
onClick={() => { }} onClick={() => { }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
}} }}
fullWidth fullWidth
multiline multiline
@@ -11065,12 +10964,6 @@ const AngularWorkflow = (defaultprops) => {
id="webhook_uri_header" id="webhook_uri_header"
onClick={() => { }} onClick={() => { }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
}} }}
fullWidth fullWidth
multiline multiline
@@ -11474,13 +11367,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -11548,13 +11434,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
marginTop: "3px",
fontSize: "1em",
},
}} }}
fullWidth fullWidth
rows="4" rows="4"
@@ -11762,13 +11641,6 @@ const AngularWorkflow = (defaultprops) => {
marginTop: 10, marginTop: 10,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -11851,13 +11723,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: 50,
fontSize: "1em",
},
}} }}
fullWidth fullWidth
color="primary" color="primary"
@@ -11955,13 +11820,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
height: 50,
marginLeft: "5px",
maxWidth: "95%",
fontSize: "1em",
},
}} }}
fullWidth fullWidth
disabled={ disabled={
@@ -12010,13 +11868,6 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius, borderRadius: theme.palette.borderRadius,
}} }}
InputProps={{ InputProps={{
style: {
color: "white",
marginLeft: "5px",
maxWidth: "95%",
marginTop: "3px",
fontSize: "1em",
},
}} }}
disabled={ disabled={
workflow.triggers[selectedTriggerIndex].status === "running" workflow.triggers[selectedTriggerIndex].status === "running"
+13 -7
View File
@@ -5,6 +5,7 @@ import { BrowserView, MobileView } from "react-device-detect";
import { useParams, useNavigate, Link } from "react-router-dom"; import { useParams, useNavigate, Link } from "react-router-dom";
import { isMobile } from "react-device-detect"; import { isMobile } from "react-device-detect";
import theme from '../theme.jsx'; import theme from '../theme.jsx';
import remarkGfm from 'remark-gfm'
import { import {
Grid, Grid,
@@ -364,6 +365,7 @@ const Docs = (defaultprops) => {
}; };
function OuterLink(props) { function OuterLink(props) {
console.log("Link: ", props.href)
if (props.href.includes("http") || props.href.includes("mailto")) { if (props.href.includes("http") || props.href.includes("mailto")) {
return ( return (
<a <a
@@ -385,7 +387,7 @@ const Docs = (defaultprops) => {
} }
function Img(props) { function Img(props) {
return <img style={{ borderRadius: theme.palette.borderRadius, maxWidth: "100%", marginTop: 15, marginBottom: 15, }} alt={props.alt} src={props.src} />; return <img style={{ borderRadius: theme.palette.borderRadius, width: 750, maxWidth: "100%", marginTop: 15, marginBottom: 15, }} alt={props.alt} src={props.src} />;
} }
function CodeHandler(props) { function CodeHandler(props) {
@@ -789,17 +791,21 @@ const Docs = (defaultprops) => {
: :
<div id="markdown_wrapper_outer" style={markdownStyle}> <div id="markdown_wrapper_outer" style={markdownStyle}>
<ReactMarkdown <ReactMarkdown
id="markdown_wrapper" components={{
escapeHtml={false}
source={data}
style={{maxWidth: "100%", minWidth: "100%", }}
renderers={{
link: OuterLink, link: OuterLink,
image: Img, image: Img,
code: CodeHandler, code: CodeHandler,
heading: Heading, heading: Heading,
}} }}
/> id="markdown_wrapper"
escapeHtml={false}
style={{
maxWidth: "100%", minWidth: "100%",
}}
remarkPlugins={[remarkGfm]}
>
{data}
</ReactMarkdown>
</div> </div>
} }
</div> </div>