Merge branch '2.0.0' into main

This commit is contained in:
Frikky
2024-05-31 09:40:24 +02:00
committed by GitHub
15 changed files with 750 additions and 333 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ const CacheView = (props) => {
const deleteCache = (orgId, key) => {
toast("Attempting to delete Cache");
//toast("Attempting to delete Cache");
// method: "DELETE",
const method = "POST"
@@ -477,7 +477,7 @@ const ConfigureWorkflow = (props) => {
setConfigureWorkflowModalOpen(false)
}
setRequiredTriggers(requiredTriggers)
//setRequiredTriggers(requiredTriggers)
setRequiredVariables(requiredVariables)
setRequiredActions(newactions)
}
+53 -24
View File
@@ -62,8 +62,7 @@ const Header = (props) => {
userdata,
isMobile,
serverside,
curpath,
billingInfo
billingInfo,
} = props;
const [HomeHoverColor, setHomeHoverColor] = useState(hoverOutColor);
@@ -114,6 +113,10 @@ const Header = (props) => {
window.location.host === "shuffler.io" ||
window.location.host === "localhost:5002";
const curpath = (typeof window !== "undefined" && window.location && typeof window.location.pathname === "string")
? window.location.pathname
: "";
const clearNotifications = () => {
// Don't really care about the logout
@@ -784,7 +787,7 @@ const Header = (props) => {
</Link>
</ListItem>
</List>
<List style={{ flex: 1.5, display: "flex", flexDirect: "row", marginTop: 10, itemAlign: "center", }} component="nav">
<List style={{ flex: 1.5, display: "flex", flexDirect: "row", marginTop: 10, itemAlign: "center", padding: 0 }} component="nav">
<ListItem style={{ textAlign: "center", marginLeft: "0px" }}>
<Link to="/usecases" style={hrefStyle}>
<Button
@@ -849,9 +852,27 @@ const Header = (props) => {
</Button>
</Link>
</ListItem>
<ListItem
style={{
textAlign: "center",
marginLeft: 0,
paddingRight: 0,
}}
>
<Link rel="noopener noreferrer" to="/training" style={hrefStyle}>
<Button
variant="text"
color="secondary"
style={menuText}
onClick={() => { }}
>
Training
</Button>
</Link>
</ListItem>
</List>
<List
style={{ flex: 2, display: "flex", alignItems: "flex-start", }}
style={{ flex: 2, display: "flex", alignItems: "flex-start", padding: 0, }}
component="nav"
>
<div style={{ maxWidth: 70, minWidth: 70, }} />
@@ -1514,14 +1535,15 @@ const Header = (props) => {
*/
const topbarHeight = showTopbar ? 40 : 0
const topbar = !showTopbar ? null :
curpath === "/" || curpath.includes("/docs/") || curpath === "/pricing" || curpath === "/contact" || curpath === "/search" ?
const topbar = !isCloud || !showTopbar ? null :
curpath === "/" || curpath.includes("/docs") || curpath === "/pricing" || curpath === "/contact" || curpath === "/search" || curpath === "/usecases" || curpath === "/training" ?
<span style={{ zIndex: 50001, }}>
<div style={{ position: "relative", height: topbarHeight, backgroundImage: "linear-gradient(to right, #f86a3e, #f34079)", overflow: "hidden", }}>
<Typography variant="body1" style={{ paddingTop: 7, margin: "auto", textAlign: "center", color: "white", }}>
Shuffle 1.4 is out! Read more about&nbsp;
<u>
<a href="https://github.com/Shuffle/Shuffle" style={{ color: "inherit", }} onClick={() => {
{/* Shuffle 1.4.0 is out! Read more about&nbsp; */}
Shuffle now offers&nbsp;
{/* <u>
<a href="https://github.com/Shuffle/Shuffle/releases/tag/v1.4.0" target="_blank" style={{ color: "inherit", }} onClick={() => {
ReactGA.event({
category: "landingpage",
action: "click_header_features",
@@ -1557,16 +1579,16 @@ const Header = (props) => {
Pricing
</span>
</u>
&nbsp;and&nbsp;
&nbsp;and&nbsp; */}
<u>
<span onClick={() => {
ReactGA.event({
category: "landingpage",
action: "click_header_creators",
action: "click_header_training",
label: "",
})
navigate("/creators")
navigate("/training")
//if (window.drift !== undefined) {
// window.drift.api.startInteraction({ interactionId: 341911 })
@@ -1574,7 +1596,7 @@ const Header = (props) => {
// console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
//}
}} style={{ cursor: "pointer", textDecoration: "none", color: "rgba(255,255,255,0.8)" }}>
Earning as a Creator
Public Training!
</span>
</u>
</Typography>
@@ -1586,8 +1608,8 @@ const Header = (props) => {
:
null
return !isMobile ?
<div style={{ marginTop: 0, }}>
return !isMobile ? (
<div style={{ marginTop: 0 }}>
<AppBar
color="transparent"
elevation={0}
@@ -1599,17 +1621,24 @@ const Header = (props) => {
backgroundColor: theme.palette.backgroundColor,
}}
>
{topbar}
<div style={{ position: "sticky", top: 0, }}>
{loginTextBrowser}
</div>
{modalView}
</AppBar>
</div>
:
<div
style={{
position: "sticky",
top: 0,
minHeight: 68,
maxHeight: 68,
backgroundColor: theme.palette.backgroundColor,
}}
>
{loginTextBrowser}
</div>
{modalView}
</AppBar>
</div>
) : (
<MobileView>{loginTextMobile}</MobileView>
);
};
export default Header;
+36 -19
View File
@@ -18,6 +18,7 @@ import {
ButtonBase,
Tooltip,
Select,
Autocomplete,
MenuItem,
Divider,
Dialog,
@@ -296,7 +297,17 @@ const AuthenticationOauth2 = (props) => {
}
const handleOauth2Request = (client_id, client_secret, oauth_url, scopes, admin_consent, prompt) => {
const handleOauth2Request = (client_id, client_secret, oauth_url, scopes, admin_consent, prompt, skipScopeReplace) => {
console.log("SKIP SCOPE: ", skipScopeReplace)
if (skipScopeReplace === false || skipScopeReplace === undefined) {
console.log("Selected scopes: ", selectedScopes)
if (selectedScopes !== undefined && selectedScopes !== null && selectedScopes.length > 0) {
toast("Using your scopes instead of the default ones")
scopes = selectedScopes
}
}
if ((authenticationType.redirect_uri === undefined || authenticationType.redirect_uri === null || authenticationType.redirect_uri.length === 0) && (authenticationType.token_uri !== undefined && authenticationType.token_uri !== null && authenticationType.token_uri.length > 0)) {
console.log("No redirect URI found, and token URI found. Assuming client credentials flow and saving directly in the database")
@@ -336,6 +347,7 @@ const AuthenticationOauth2 = (props) => {
"value": tokenUri,
}]
if (authenticationType.grant_type !== undefined && authenticationType.grant_type !== null && authenticationType.grant_type.length > 0) {
if (authenticationType.grant_type === "client_credentials") {
parsedFields.push({
@@ -502,6 +514,8 @@ const AuthenticationOauth2 = (props) => {
getAppAuthentication(true, true, true);
}
toast("Authentication successful!")
// This is more a guess than anything
// Should be handled in getAppAuthentication()
// in the parent component to make it accurate,
@@ -635,9 +649,7 @@ const AuthenticationOauth2 = (props) => {
};
const handleScopeChange = (event) => {
const {
target: { value },
} = event;
const {target: { value }} = event;
console.log("VALUE: ", value);
@@ -972,13 +984,13 @@ const AuthenticationOauth2 = (props) => {
}
{allscopes === undefined || allscopes === null || allscopes.length === 0 ? null : "Scopes (access rights)"}
{allscopes === undefined || allscopes === null || allscopes.length === 0 ? null : (
<div style={{width: "100%", marginTop: 10, display: "flex"}}>
<span>
<Select
<Autocomplete
multiple
underline={false}
value={selectedScopes}
label="Scopes"
style={{
backgroundColor: theme.palette.inputColor,
@@ -987,23 +999,28 @@ const AuthenticationOauth2 = (props) => {
minWidth: 300,
maxWidth: 300,
}}
onChange={(e) => {
handleScopeChange(e)
onChange={(e, value) => {
//handleScopeChange(e)
setSelectedScopes(typeof value === "string" ? value.split(",") : value);
}}
fullWidth
input={<Input id="select-multiple-native" />}
renderValue={(selected) => selected.join(", ")}
MenuProps={MenuProps}
>
{allscopes.map((data, index) => {
options={allscopes}
getOptionLabel={(option) => option}
renderInput={(params) => {
return (
<MenuItem key={index} value={data}>
<Checkbox checked={selectedScopes.indexOf(data) > -1} />
<ListItemText primary={data} />
</MenuItem>
);
})}
</Select>
<div>
{/*<Checkbox checked={selectedScopes.indexOf(data) > -1} />*/}
<TextField
{...params}
label="Search Scopes"
variant="outlined"
/>
</div>
)
}}
/>
</span>
{((authenticationType.redirect_uri === undefined || authenticationType.redirect_uri === null || authenticationType.redirect_uri.length === 0) && (authenticationType.token_uri !== undefined && authenticationType.token_uri !== null && authenticationType.token_uri.length > 0)) ? null :
@@ -1039,7 +1056,7 @@ const AuthenticationOauth2 = (props) => {
"autoClose": 1500,
})
handleOauth2Request(clientId, clientSecret, oauthUrl, selectedScopes);
handleOauth2Request(clientId, clientSecret, oauthUrl, selectedScopes, undefined, true);
}}
color="primary"
>
+1 -1
View File
@@ -621,7 +621,7 @@ const ParsedAction = (props) => {
var helperText = ""
var looperText = ""
//const found = input_data.match(/[$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,}/g)
var found = input_data.match(/[\\]{0,1}[$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,}/g)
var found = input_data.match(/[\\]{0,1}[$]{1}([a-zA-Z0-9_@-]+\.?){1}([a-zA-Z0-9#_@-]+\.?){0,}/g)
if (found !== null && found !== undefined) {
var new_occurences = []
+1 -1
View File
@@ -821,7 +821,7 @@ const RuntimeDebugger = (props) => {
}}
onChange={(e)=>{handleQueryChange(e)}}
color="primary"
placeholder="Search Workflow Name, Status, Execution Argument, Results.."
placeholder="Filter by Workflow Name, Status, Execution Argument, Results.."
id="shuffle_search_field"
/>
</div>
+27 -39
View File
@@ -580,12 +580,12 @@ const CodeEditor = (props) => {
// var session = localcodedata.getSession();
//var code_lines = localcodedata.split('\n')
var code_lines = value.split('\n')
var newMarkers = []
var code_lines = value.split('\n')
for (var i = 0; i < code_lines.length; i++) {
var current_code_line = code_lines[i];
var variable_occurence = current_code_line.match(/[\\]{0,1}[$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,}/g);
var current_code_line = code_lines[i]
var variable_occurence = current_code_line.match(/[\\]{0,1}[$]{1}([a-zA-Z0-9_@-]+\.?){1}([a-zA-Z0-9#_@-]+\.?){0,}/g);
if (!variable_occurence) {
continue;
@@ -623,15 +623,26 @@ const CodeEditor = (props) => {
var startCh = dollar_occurence[occ]
var endCh = dollar_occurence[occ] + dollar_occurence_len[occ]
newMarkers.push({
startRow: i,
startCol: startCh,
endRow: i,
endCol: endCh,
className: correctVariable ? "good-marker" : "bad-marker",
type: "text",
})
try {
newMarkers.push({
startRow: i,
startCol: startCh,
endRow: i+1,
endCol: endCh+1,
className: correctVariable ? "good-marker" : "bad-marker",
type: "text",
})
} catch (e) {
console.log("Error in color highlighting: ", e);
newMarkers.push({
startRow: i,
startCol: startCh,
endRow: i,
endCol: endCh,
className: correctVariable ? "good-marker" : "bad-marker",
type: "text",
})
}
setMarkers(newMarkers)
}
@@ -643,7 +654,7 @@ const CodeEditor = (props) => {
}
setMarkers(newMarkers)
};
}
const replaceVariables = (swapVariable) => {
// var updatedCode = localcodedata.slice(0,index) + "$" + str + localcodedata.slice(index+currentVariable.length+1,)
@@ -686,7 +697,7 @@ const CodeEditor = (props) => {
const expectedOutput = (input) => {
//const found = input.match(/[$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,}/g)
const found = input.match(/[$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,}/g)
const found = input.match(/[$]{1}([a-zA-Z0-9_@-]+\.?){1}([a-zA-Z0-9#_@-]+\.?){0,}/g)
// Whelp this is inefficient af. Single loop pls
// When the found array is empty.
@@ -1448,34 +1459,11 @@ const CodeEditor = (props) => {
</div>
}
<IconButton
style={{
marginLeft: isMobile ? "80%" : 30,
height: 50,
width: 50,
}}
onClick={() => {
}}
>
<Tooltip
color="primary"
title={"Test Liquid in the playground"}
placement="top"
>
<a
href="https://pwwang.github.io/liquidpy/playground/"
rel="norefferer"
target="_blank"
>
<ExtensionIcon style={{color: "rgba(255,255,255,0.7)"}}/>
</a>
</Tooltip>
</IconButton>
<IconButton
style={{
height: 50,
width: 50,
marginLeft: 100,
}}
disabled={isAiLoading}
onClick={() => {
@@ -1536,7 +1524,7 @@ const CodeEditor = (props) => {
setCurrentLine(cursorPosition.row)
findIndex(cursorPosition.row, cursorPosition.column)
highlight_variables(localcodedata)
//highlight_variables(localcodedata)
//console.log("VALUE CURSOR: ", value)
}}
onChange={(value, editor) => {