Added many new usecases and and a way to show vid os within workflows
This commit is contained in:
@@ -607,7 +607,7 @@ const OrgHeader = (props) => {
|
||||
{/*isCloud ? null : */}
|
||||
<Grid item xs={12} style={{marginTop: 50,}}>
|
||||
<Typography variant="h4" style={{textAlign: "center",}}>SAML SSO (v1.1)</Typography>
|
||||
<Grid container style={{marginTop: 10, }}>
|
||||
<Grid container style={{marginTop: 20, }}>
|
||||
<Grid item xs={6} style={{}}>
|
||||
<span>
|
||||
<Typography>SSO Entrypoint (IdP)</Typography>
|
||||
@@ -682,6 +682,11 @@ const OrgHeader = (props) => {
|
||||
</span>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{isCloud ?
|
||||
<Typography variant="body2" style={{textAlign: "left",}} color="textSecondary">
|
||||
IdP URL for Shuffle: https://shuffler.io/api/v1/login_sso
|
||||
</Typography>
|
||||
: null}
|
||||
</Grid>
|
||||
{isCloud ? null : (
|
||||
<Grid item xs={6} style={{}}>
|
||||
|
||||
@@ -83,6 +83,7 @@ import {
|
||||
ExpandMore as ExpandMoreIcon,
|
||||
VpnKey as VpnKeyIcon,
|
||||
AutoFixHigh as AutoFixHighIcon,
|
||||
SquareFoot as SquareFootIcon,
|
||||
} from '@mui/icons-material';
|
||||
//} from "@material-ui/icons";
|
||||
|
||||
@@ -167,6 +168,7 @@ const ParsedAction = (props) => {
|
||||
isCloud,
|
||||
lastSaved,
|
||||
setLastSaved,
|
||||
setShowVideo,
|
||||
//expansionModalOpen,
|
||||
//setExpansionModalOpen,
|
||||
} = props;
|
||||
@@ -525,8 +527,12 @@ const ParsedAction = (props) => {
|
||||
|
||||
const valid = validateJson(foundResult)
|
||||
if (valid.valid) {
|
||||
exampledata = valid.result;
|
||||
break;
|
||||
if (valid.result.success === false) {
|
||||
//console.log("Skipping success false autocomplete")
|
||||
} else {
|
||||
exampledata = valid.result;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
exampledata = foundResult;
|
||||
}
|
||||
@@ -777,6 +783,10 @@ const ParsedAction = (props) => {
|
||||
selectedAction.parameters[count].value = event.target.value;
|
||||
|
||||
var forceUpdate = false
|
||||
if (isCloud && (selectedAction.app_name === "Shuffle Tools" || selectedAction.app_name === "email") && (selectedAction.name === "send_email_shuffle" || selectedAction.name === "send_sms_shuffle") && data.name === "apikey") {
|
||||
console.log("APIKEY - this shouldn't show up!")
|
||||
}
|
||||
|
||||
if (selectedAction.app_name === "Shuffle Tools" && selectedAction.name === "filter_list" && data.name === "input_list") {
|
||||
//console.log("FILTER LIST!: ", event, count, data)
|
||||
const parsedvalue = event.target.value
|
||||
@@ -1140,6 +1150,16 @@ const ParsedAction = (props) => {
|
||||
);
|
||||
}
|
||||
|
||||
// Added autofill to make this ALOT simpler
|
||||
if (isCloud && (selectedAction.app_name === "Shuffle Tools" || selectedAction.app_name === "email") && (selectedAction.name === "send_email_shuffle" || selectedAction.name === "send_sms_shuffle") && data.name === "apikey") {
|
||||
if (selectedActionParameters[count].length === 0) {
|
||||
selectedAction.parameters[count].value = "TMP: Will be replaced during execution if cloud"
|
||||
setSelectedAction(selectedAction)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
var staticcolor = "inherit";
|
||||
var actioncolor = "inherit";
|
||||
var varcolor = "inherit";
|
||||
@@ -1429,8 +1449,15 @@ const ParsedAction = (props) => {
|
||||
multiline={multiline}
|
||||
helperText={returnHelperText(data.name, data.value)}
|
||||
onClick={() => {
|
||||
console.log("Clicked field: ", clickedFieldId, data.name)
|
||||
if (data.name === "file_id") {
|
||||
console.log("show file video?")
|
||||
if (setShowVideo !== undefined) {
|
||||
setShowVideo("https://www.youtube.com/embed/DPYowyTbsSk")
|
||||
}
|
||||
}
|
||||
//(data.name.toLowerCase().includes("api") ||
|
||||
/*
|
||||
console.log("Clicked field: ", clickedFieldId);
|
||||
setExpansionModalOpen(false);
|
||||
if (
|
||||
setScrollConfig !== undefined &&
|
||||
@@ -1689,6 +1716,7 @@ const ParsedAction = (props) => {
|
||||
.endsWith("$")
|
||||
? values[0].autocomplete
|
||||
: "$" + values[0].autocomplete;
|
||||
|
||||
toComplete = toComplete.toLowerCase().replaceAll(" ", "_");
|
||||
console.log("AUTOCOMPLETE: ", toComplete);
|
||||
for (var key in values) {
|
||||
@@ -1951,7 +1979,30 @@ const ParsedAction = (props) => {
|
||||
baseIndent
|
||||
)
|
||||
})}
|
||||
{icon} {newname}
|
||||
{icon} {newname}
|
||||
{pathdata.type === "list" ? <SquareFootIcon style={{marginleft: 10, }} onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
console.log("INNER: ", innerdata, pathdata)
|
||||
|
||||
// Removing .list from autocomplete
|
||||
var newname = pathdata.name
|
||||
if (newname.length > 5) {
|
||||
newname = newname.slice(0, newname.length-5)
|
||||
}
|
||||
selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
|
||||
selectedAction.parameters[count].value = selectedActionParameters[count].value;
|
||||
setSelectedAction(selectedAction);
|
||||
setUpdate(Math.random());
|
||||
setShowDropdown(false);
|
||||
setMenuPosition(null);
|
||||
|
||||
// innerdata.name
|
||||
// pathdata.name
|
||||
//handleItemClick([innerdata, newpathdata])
|
||||
//console.log("CLICK LENGTH!")
|
||||
}} /> : null}
|
||||
</div>
|
||||
</Tooltip>
|
||||
</MenuItem>
|
||||
@@ -2036,6 +2087,10 @@ const ParsedAction = (props) => {
|
||||
{
|
||||
/*<div style={{width: 17, height: 17, borderRadius: 17 / 2, backgroundColor: itemColor, marginRight: 10, marginTop: 2, marginTop: "auto", marginBottom: "auto",}}/>*/
|
||||
}
|
||||
|
||||
//console.log(data.configuration)
|
||||
|
||||
const buttonTitle = `Authenticate ${selectedApp.name.replaceAll("_", " ")}`
|
||||
return (
|
||||
<div key={data.name}>
|
||||
{hideBodyButton}
|
||||
@@ -2044,7 +2099,7 @@ const ParsedAction = (props) => {
|
||||
>
|
||||
{data.configuration === true ? (
|
||||
<Tooltip
|
||||
title={`Authenticate ${selectedApp.name}`}
|
||||
title={buttonTitle}
|
||||
placement="top"
|
||||
>
|
||||
<LockOpenIcon
|
||||
|
||||
@@ -48,6 +48,11 @@ const mathFilters = [
|
||||
{"name": "Minus", "value": "minus: 1", "example": `{{ "1" | minus: 1 }}`},
|
||||
]
|
||||
|
||||
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": ``},
|
||||
]
|
||||
|
||||
const CodeEditor = (props) => {
|
||||
const { fieldCount, setFieldCount, actionlist, changeActionParameterCodeMirror, expansionModalOpen, setExpansionModalOpen, codedata, setcodedata } = props
|
||||
const [localcodedata, setlocalcodedata] = React.useState(codedata === undefined || codedata === null || codedata.length === 0 ? "" : codedata);
|
||||
@@ -67,10 +72,12 @@ const CodeEditor = (props) => {
|
||||
const [currentVariable, setCurrentVariable] = React.useState("");
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
const [anchorEl2, setAnchorEl2] = React.useState(null);
|
||||
const [anchorEl3, setAnchorEl3] = React.useState(null);
|
||||
const [mainVariables, setMainVariables] = React.useState([]);
|
||||
const [availableVariables, setAvailableVariables] = React.useState([]);
|
||||
const liquidOpen = Boolean(anchorEl);
|
||||
const mathOpen = Boolean(anchorEl2);
|
||||
const pythonOpen = Boolean(anchorEl3);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
@@ -337,13 +344,19 @@ const CodeEditor = (props) => {
|
||||
|
||||
|
||||
const handleClick = (item) => {
|
||||
if (item === undefined || item.value === undefined) {
|
||||
if (item === undefined || item.value === undefined || item.value === null) {
|
||||
return
|
||||
}
|
||||
|
||||
setlocalcodedata(localcodedata+" | "+item.value+" }}")
|
||||
if (!item.value.includes("{%")) {
|
||||
setlocalcodedata(localcodedata+" | "+item.value+" }}")
|
||||
} else {
|
||||
setlocalcodedata(localcodedata+item.value)
|
||||
}
|
||||
|
||||
setAnchorEl(null)
|
||||
setAnchorEl2(null)
|
||||
setAnchorEl3(null)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -479,6 +492,41 @@ const CodeEditor = (props) => {
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={pythonOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={pythonOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
style={{
|
||||
textTransform: "none",
|
||||
width: 100,
|
||||
}}
|
||||
onClick={(event) => {
|
||||
setAnchorEl3(event.currentTarget);
|
||||
}}
|
||||
>
|
||||
Python
|
||||
</Button>
|
||||
<Menu
|
||||
id="basic-menu"
|
||||
anchorEl={anchorEl3}
|
||||
open={pythonOpen}
|
||||
onClose={() => {
|
||||
setAnchorEl3(null);
|
||||
}}
|
||||
MenuListProps={{
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
{pythonFilters.map((item, index) => {
|
||||
return (
|
||||
<MenuItem onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
</div>
|
||||
<span style={{
|
||||
border: `2px solid ${theme.palette.inputColor}`,
|
||||
@@ -528,7 +576,7 @@ const CodeEditor = (props) => {
|
||||
styleSelectedText: true,
|
||||
theme: codeTheme,
|
||||
keyMap: 'sublime',
|
||||
mode: 'javascript',
|
||||
mode: 'python',
|
||||
lineWrapping: linewrap,
|
||||
// mode: {codelang},
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user