Loads of frontend fixes
This commit is contained in:
@@ -615,7 +615,7 @@ const { globalUrl, setNotifications, notifications, isLoggedIn, removeCookie, ho
|
||||
</List>
|
||||
</div>
|
||||
<div style={{flex: 1, marginTop: 10,}}>
|
||||
<SearchField serverside={serverside} userdata={userdata} />
|
||||
<SearchField globalUrl={globalUrl} serverside={serverside} userdata={userdata} />
|
||||
</div>
|
||||
<div style={{flex: 1, display: "flex", flexDirection: "row-reverse"}}>
|
||||
<List style={{display: 'flex', flexDirection: 'row-reverse'}} component="nav">
|
||||
|
||||
@@ -741,7 +741,7 @@ const Header = (props) => {
|
||||
>
|
||||
<div style={{maxWidth: 70, minWidth: 70, }}/>
|
||||
<span style={{marginTop: 8, marginRight: 15, }}>
|
||||
<SearchField isHeader={true} isLoggedIn={isLoggedIn} isLoaded={isLoaded} serverside={serverside} userdata={userdata} small={true} rounded={true} />
|
||||
<SearchField globalUrl={globalUrl} isHeader={true} isLoggedIn={isLoggedIn} isLoaded={isLoaded} serverside={serverside} userdata={userdata} small={true} rounded={true} />
|
||||
</span>
|
||||
<Link to="/register" style={hrefStyle}>
|
||||
<Button
|
||||
@@ -912,7 +912,7 @@ const Header = (props) => {
|
||||
</List>
|
||||
</div>
|
||||
<div style={{ flex: 1, marginTop: 10, }}>
|
||||
<SearchField isHeader={true} isLoggedIn={isLoggedIn} isLoaded={isLoaded} serverside={serverside} userdata={userdata} hidemargins={true}/>
|
||||
<SearchField globalUrl={globalUrl} isHeader={true} isLoggedIn={isLoggedIn} isLoaded={isLoaded} serverside={serverside} userdata={userdata} hidemargins={true}/>
|
||||
</div>
|
||||
<div style={{ flex: isLoggedIn ? null : 1, display: "flex", flexDirection: "row-reverse" }}>
|
||||
<List
|
||||
|
||||
@@ -374,7 +374,7 @@ const AuthenticationOauth2 = (props) => {
|
||||
},
|
||||
"fields": parsedFields,
|
||||
"type": "oauth2-app",
|
||||
"reference_workflow": workflowId,
|
||||
//"reference_workflow": workflowId,
|
||||
}
|
||||
|
||||
if (setNewAppAuth !== undefined) {
|
||||
|
||||
@@ -1644,13 +1644,11 @@ const ParsedAction = (props) => {
|
||||
multiline={data.name.startsWith("${") && data.name.endsWith("}") ? true : multiline}
|
||||
helperText={returnHelperText(data.name, data.value)}
|
||||
onClick={() => {
|
||||
console.log("Clicked field: ", clickedFieldId, data.name)
|
||||
/*
|
||||
setExpansionModalOpen(false);
|
||||
*/
|
||||
|
||||
if (setScrollConfig !== undefined && scrollConfig !== null && scrollConfig !== undefined && scrollConfig.selected !== clickedFieldId) {
|
||||
console.log("IN SCROLL CONFIG!")
|
||||
|
||||
scrollConfig.selected = clickedFieldId
|
||||
setScrollConfig(scrollConfig)
|
||||
@@ -3737,6 +3735,11 @@ const ParsedAction = (props) => {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Check if it starts with "Get List" and method is "Get"
|
||||
if (params.inputProps.value.startsWith("Get List")) {
|
||||
console.log("Get List")
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef } from 'react';
|
||||
|
||||
import theme from '../theme.jsx';
|
||||
import { useNavigate, Link, useParams } from "react-router-dom";
|
||||
import { toast } from "react-toastify"
|
||||
|
||||
import {
|
||||
Chip,
|
||||
@@ -41,7 +42,7 @@ const chipStyle = {
|
||||
|
||||
const searchClient = algoliasearch("JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240")
|
||||
const SearchData = props => {
|
||||
const { serverside, userdata, setModalOpen, modalOpen } = props
|
||||
const { serverside, globalUrl, userdata, setModalOpen, modalOpen } = props
|
||||
let navigate = useNavigate();
|
||||
const borderRadius = 3
|
||||
const node = useRef()
|
||||
@@ -326,6 +327,57 @@ const SearchData = props => {
|
||||
)
|
||||
}
|
||||
|
||||
const activateApp = (name, appid, type) => {
|
||||
if (globalUrl === undefined || globalUrl === null) {
|
||||
console.log(`Global URL not set`)
|
||||
return
|
||||
}
|
||||
|
||||
if (name === undefined || name === null) {
|
||||
name = ""
|
||||
}
|
||||
|
||||
name = name.replaceAll("_", " ")
|
||||
|
||||
if (userdata === undefined || userdata === null || userdata.id === undefined) {
|
||||
toast(`You need to be logged in to activate the ${name} app. Redirecting`)
|
||||
|
||||
setTimeout(() => {
|
||||
navigate(`/register?message=You need to be logged in to use the ${name} app.`)
|
||||
}, 500)
|
||||
return
|
||||
}
|
||||
|
||||
const url = `${globalUrl}/api/v1/apps/${appid}/${type}`
|
||||
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
credentials: "include",
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status !== 200) {
|
||||
toast(`Failed to ${type} the app for your organization. Please try again or contact support@shuffler.io`)
|
||||
}
|
||||
|
||||
return response.json()
|
||||
})
|
||||
.then((responseJson) => {
|
||||
if (responseJson.success === false) {
|
||||
toast(`Failed to ${type} the app for your organization. Please try again or contact support@shuffler.io for more info`)
|
||||
} else {
|
||||
toast(`App successfully ${type}d. Please refresh the page to use it.`)
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
//toast(error.toString())
|
||||
console.log("Activate app error: ", error.toString())
|
||||
});
|
||||
}
|
||||
|
||||
const AppHits = ({ hits }) => {
|
||||
const [mouseHoverIndex, setMouseHoverIndex] = useState(0)
|
||||
|
||||
@@ -431,7 +483,6 @@ const SearchData = props => {
|
||||
return (
|
||||
<Link key={hit.objectID} to={parsedUrl} style={{ textDecoration: "none", color: "white", }} onClick={(event) => {
|
||||
setSearchOpen(true)
|
||||
|
||||
setModalOpen(false)
|
||||
aa('init', {
|
||||
appId: searchClient.appId,
|
||||
@@ -474,6 +525,29 @@ const SearchData = props => {
|
||||
</IconButton>
|
||||
</ListItemSecondaryAction>
|
||||
*/}
|
||||
<Button
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
console.log("OBJECT CHANGE: ", hit.objectID)
|
||||
|
||||
// This does nothing rofl
|
||||
if (userdata.active_apps === undefined || userdata.active_apps === null) {
|
||||
activateApp(hit.name, hit.objectID, "activate")
|
||||
} else {
|
||||
if (userdata.active_apps.includes(hit.objectID)) {
|
||||
activateApp(hit.name, hit.objectID, "deactivate")
|
||||
} else {
|
||||
activateApp(hit.name, hit.objectID, "activate")
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
{userdata.active_apps !== undefined && userdata.active_apps !== null && userdata.active_apps.includes(hit.objectID) ? "Deactivate" : "Activate"}
|
||||
</Button>
|
||||
</ListItem>
|
||||
</Link>
|
||||
)
|
||||
|
||||
@@ -98,7 +98,7 @@ const SearchField = props => {
|
||||
</div>
|
||||
: null}
|
||||
<DialogContent style={{}}>
|
||||
<SearchBox setModalOpen={setModalOpen} modalOpen={modalOpen} serverside={serverside} userdata={userdata} />
|
||||
<SearchBox globalUrl={globalUrl} setModalOpen={setModalOpen} modalOpen={modalOpen} serverside={serverside} userdata={userdata} />
|
||||
</DialogContent>
|
||||
<Divider style={{overflow: "hidden"}}/>
|
||||
<span style={{display:"flex", width:"100%", height:30}}>
|
||||
|
||||
@@ -236,8 +236,6 @@ const CodeEditor = (props) => {
|
||||
|
||||
//var newitem = JSON.parse(base);
|
||||
var newitem = validateJson(base).result
|
||||
|
||||
|
||||
to_be_copied = "$" + base_node_name.toLowerCase().replaceAll(" ", "_");
|
||||
for (let copykey in copy.namespace) {
|
||||
if (copy.namespace[copykey].includes("Results for")) {
|
||||
@@ -825,7 +823,7 @@ const CodeEditor = (props) => {
|
||||
console.log("ERR IN INPUT: ", e)
|
||||
}
|
||||
|
||||
console.log("Got output for: ", fullpath, new_input, actionlist[k].example, typeof new_input)
|
||||
//console.log("Got output for: ", fullpath, new_input, actionlist[k].example, typeof new_input)
|
||||
|
||||
if (typeof new_input === "object") {
|
||||
new_input = JSON.stringify(new_input)
|
||||
@@ -1078,114 +1076,122 @@ const CodeEditor = (props) => {
|
||||
*/}
|
||||
{ isFileEditor ? null :
|
||||
<div style={{display: "flex", maxHeight: 40, }}>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={liquidOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={liquidOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
style={{
|
||||
textTransform: "none",
|
||||
width: 100,
|
||||
}}
|
||||
onClick={(event) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
}}
|
||||
>
|
||||
Filters
|
||||
</Button>
|
||||
<Menu
|
||||
id="basic-menu"
|
||||
anchorEl={anchorEl}
|
||||
open={liquidOpen}
|
||||
onClose={() => {
|
||||
setAnchorEl(null);
|
||||
}}
|
||||
MenuListProps={{
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
{liquidFilters.map((item, index) => {
|
||||
return (
|
||||
<MenuItem key={index} onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={mathOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={mathOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
style={{
|
||||
textTransform: "none",
|
||||
width: 100,
|
||||
}}
|
||||
onClick={(event) => {
|
||||
setAnchorEl2(event.currentTarget);
|
||||
}}
|
||||
>
|
||||
Math
|
||||
</Button>
|
||||
<Menu
|
||||
id="basic-menu"
|
||||
anchorEl={anchorEl2}
|
||||
open={mathOpen}
|
||||
onClose={() => {
|
||||
setAnchorEl2(null);
|
||||
}}
|
||||
MenuListProps={{
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
{mathFilters.map((item, index) => {
|
||||
return (
|
||||
<MenuItem key={index} onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={pythonOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={pythonOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
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 key={index} onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
{selectedAction.name === "execute_python" ?
|
||||
<Typography variant="body1" style={{marginTop: 5, }}>
|
||||
Run Python Code
|
||||
</Typography>
|
||||
:
|
||||
<div style={{display: "flex", }}>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={liquidOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={liquidOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
style={{
|
||||
textTransform: "none",
|
||||
width: 100,
|
||||
}}
|
||||
onClick={(event) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
}}
|
||||
>
|
||||
Filters
|
||||
</Button>
|
||||
<Menu
|
||||
id="basic-menu"
|
||||
anchorEl={anchorEl}
|
||||
open={liquidOpen}
|
||||
onClose={() => {
|
||||
setAnchorEl(null);
|
||||
}}
|
||||
MenuListProps={{
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
{liquidFilters.map((item, index) => {
|
||||
return (
|
||||
<MenuItem key={index} onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={mathOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={mathOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
style={{
|
||||
textTransform: "none",
|
||||
width: 100,
|
||||
}}
|
||||
onClick={(event) => {
|
||||
setAnchorEl2(event.currentTarget);
|
||||
}}
|
||||
>
|
||||
Math
|
||||
</Button>
|
||||
<Menu
|
||||
id="basic-menu"
|
||||
anchorEl={anchorEl2}
|
||||
open={mathOpen}
|
||||
onClose={() => {
|
||||
setAnchorEl2(null);
|
||||
}}
|
||||
MenuListProps={{
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
{mathFilters.map((item, index) => {
|
||||
return (
|
||||
<MenuItem key={index} onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
aria-controls={pythonOpen ? 'basic-menu' : undefined}
|
||||
aria-expanded={pythonOpen ? 'true' : undefined}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
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 key={index} onClick={() => {
|
||||
handleClick(item)
|
||||
}}>{item.name}</MenuItem>
|
||||
)
|
||||
})}
|
||||
</Menu>
|
||||
</div>
|
||||
}
|
||||
<Button
|
||||
id="basic-button"
|
||||
aria-haspopup="true"
|
||||
@@ -1589,7 +1595,6 @@ const CodeEditor = (props) => {
|
||||
maxHeight: 35,
|
||||
minWidth: 70,
|
||||
}}
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
executeSingleAction(expOutput)
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user