Minor fixes everywhere

This commit is contained in:
Frikky
2025-04-01 22:33:25 +02:00
parent fdb321a147
commit ff6b970aef
15 changed files with 791 additions and 456 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/h2non/filetype v1.1.3
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.8.19
github.com/shuffle/shuffle-shared v0.8.32
golang.org/x/crypto v0.36.0
google.golang.org/api v0.176.1
google.golang.org/grpc v1.68.1
+2 -2
View File
@@ -333,8 +333,8 @@ github.com/sendgrid/sendgrid-go v3.14.0+incompatible h1:KDSasSTktAqMJCYClHVE94Fc
github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/shuffle/shuffle-shared v0.8.19 h1:HXqU62sPhVzv9MeJnA5ZpPYwwbitVz1EtMMABbY3t74=
github.com/shuffle/shuffle-shared v0.8.19/go.mod h1:NruHSAscDsW595wpK2r7MeHPGspUEKRNvBpcN1iGbHI=
github.com/shuffle/shuffle-shared v0.8.31 h1:APO/BkBxiP9Hn/Fa7SsESRD6ws9E5dBfIzS57pd3MvA=
github.com/shuffle/shuffle-shared v0.8.31/go.mod h1:NruHSAscDsW595wpK2r7MeHPGspUEKRNvBpcN1iGbHI=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+5
View File
@@ -3041,6 +3041,11 @@ func executeSingleAction(resp http.ResponseWriter, request *http.Request) {
return
}
shouldRerun := false
rerun, rerunOk := query["rerun"]
if rerunOk && len(rerun) > 0 && rerun[0] == "true" {
shouldRerun = true
}
if shouldRerun {
log.Printf("[DEBUG] Returning single action execution ID for rerun: %s", workflowExecution.ExecutionId)
+3
View File
@@ -33,6 +33,9 @@ const AdminNavBar = (props) => {
const navigate = useNavigate();
//const leadinfo = selectedOrganization.lead_info === undefined || selectedOrganization.lead_info === null || selectedOrganization.lead_info === "" ? "" : JSON.stringify(selectedOrganization.lead_info)
//const isPartner = leadinfo.includes("partner")
useEffect(() => {
const queryParams = new URLSearchParams(location.search);
const tabName = queryParams.get('tab');
+1 -1
View File
@@ -61,7 +61,7 @@ const menuData = {
description:
"Connect and run actions seamlessly between different platforms.",
icon: "/images/logos/singul.svg",
path: "https://singul.io/",
path: "https://singul-docs.gitbook.io/singul/getting-started",
gaData: {
category: "navbar",
action: "products_click",
+2 -2
View File
@@ -120,7 +120,7 @@ const OrganizationTab = (props) => {
isLoaded={isLoaded}
/>
);
case 'branding(beta)':
case 'branding':
return <Branding
isCloud={isCloud}
userdata={userdata}
@@ -140,7 +140,7 @@ const OrganizationTab = (props) => {
return (
<div style={{ height: "100%", width: "100%", color: '#FFFFFF', backgroundColor: '#212121', borderTopRightRadius: '8px', borderBottomRightRadius: 8, borderLeft: "1px solid #494949", boxSizing: 'border-box' }}>
<div style={{ display: 'flex', justifyContent: 'space-around', width: "100%", borderBottom: '1px solid #494949' ,boxSizing: 'border-box' }}>
{['Org Configuration', "sso", "Notifications", 'Billing & Stats', 'Branding (Beta)'].map((tabName, index) => (
{['Org Configuration', "sso", "Notifications", 'Billing & Stats', 'Branding'].map((tabName, index) => (
<Tooltip
key={index}
title={
+12 -3
View File
@@ -818,9 +818,18 @@ const ParsedAction = (props) => {
if (foundResult) {
const valid = validateJson(foundResult.result);
if (valid.valid) {
if (valid.result.success !== false) {
exampleData = valid.result
break
// Check if array, and if first item is object + success
if (Array.isArray(valid.result) && valid.result.length > 0 && typeof valid.result[0] === "object") {
if (valid.result[0].success !== false) {
exampleData = valid.result[0]
break
}
} else {
if (valid.result.success !== false) {
exampleData = valid.result
break
}
}
} else {
secondaryExample = foundResult.result
+51 -5
View File
@@ -902,6 +902,8 @@ const CodeEditor = (props) => {
// Whelp this is inefficient af. Single loop pls
// When the found array is empty.
if (found !== null && found !== undefined) {
//console.log("FOUND: ", found)
try {
for (var i = 0; i < found.length; i++) {
try {
@@ -936,28 +938,72 @@ const CodeEditor = (props) => {
}
}
}
// Find the location to ensure replacements happen correctly
var foundlocation = -1
for (var j = 0; j < input.length; j++) {
const foundStringSize = fixedVariable.length
const foundslice = input.slice(j, j + foundStringSize)
//console.log("FOUNDSLICE: ", foundslice)
if (fixedVariable !== foundslice) {
continue
}
// Check if it matches EXACTLY or not, as there may be more AFTER the found[i]
const nextchar = input.slice(j + foundStringSize, j + foundStringSize + 1)
if (nextchar === ".") {
continue
}
foundlocation = j
break
}
// FIXME: There is something wrong here with:
// $variable.#
// vs
// $variable.#.subvalue
// if you put both of those lines in the same editor, then it will replace both (somehow). Make sure $variable.#.subvalue exists while testing.
console.log("FOUNDLOC: ", fixedVariable, foundlocation)
for (var j = 0; j < actionlist.length; j++) {
if (fixedVariable.slice(1,).toLowerCase() !== actionlist[j].autocomplete.toLowerCase()) {
continue
}
// Look for the location of found[i] in the input, as to make sure to skip parts of the input in the replace. Find ALL spots for it
valuefound = true
var newvalue = ""
try {
if (typeof actionlist[j].example === "object") {
input = input.replace(found[i], JSON.stringify(actionlist[j].example), -1);
if (typeof actionlist[j].example === "object") {
newvalue = JSON.stringify(actionlist[j].example)
} else if (actionlist[j].example.trim().startsWith("{") || actionlist[j].example.trim().startsWith("[")) {
input = input.replace(found[i], JSON.stringify(actionlist[j].example), -1);
newvalue = JSON.stringify(actionlist[j].example)
} else {
const newExample = fixStringInput(actionlist[j].example)
input = input.replace(found[i], newExample, -1)
newvalue = newExample
}
} catch (e) {
input = input.replace(found[i], actionlist[j].example, -1)
newvalue = actionlist[j].example
}
try {
console.log("REPLACE: ", foundlocation, fixedVariable, newvalue)
if (newvalue !== "") {
if (foundlocation === -1) {
input = input.replace(fixedVariable, newvalue, 1)
} else {
// Ensures we don't just randomly replace the first value we find
const replacedSlice = input.slice(foundlocation, input.length).replace(fixedVariable, newvalue, 1)
input = input.slice(0, foundlocation) + replacedSlice
}
}
} catch (e) {
console.log("Replace error: ", e)
}
}
if (!valuefound) {
+485 -395
View File
@@ -30,6 +30,8 @@ import {
Apps as AppsIcon,
Business as BusinessIcon,
Flag,
ArrowDropDown as ArrowDropDownIcon,
} from "@mui/icons-material";
import { toast } from 'react-toastify';
@@ -58,6 +60,8 @@ const TenantsTab = memo((props) => {
const [parentOrgRegionName, setParentOrgRegionName] = React.useState("UK");
const [loadOrgs, setLoadOrgs] = React.useState(true);
const [, forceUpdate] = React.useState();
const [suborglistOpen, setSuborglistOpen] = React.useState(false);
const [allTenantsOpen, setAllTenantsOpen] = React.useState(false);
const itemColor = "black";
useEffect(() => {
@@ -482,8 +486,8 @@ const TenantsTab = memo((props) => {
const createSubOrg = (currentOrgId, name) => {
const data = { name: name, org_id: currentOrgId };
console.log(data);
const url = globalUrl + `/api/v1/orgs/${currentOrgId}/create_sub_org`;
setSuborglistOpen(true)
fetch(url, {
mode: "cors",
@@ -791,7 +795,7 @@ const TenantsTab = memo((props) => {
Create, manage and change to sub-organizations (tenants)! {" "}
{isCloud
? "You can only make a sub organization if you are a customer of shuffle or running a POC of the platform. Please contact support@shuffler.io to try it out."
: ''}
: ''}&nbsp;
<a
href="/docs/organizations"
target="_blank"
@@ -1150,168 +1154,212 @@ const TenantsTab = memo((props) => {
overflowX: "auto",
paddingBottom: 0,
}}>
<ListItem
style={{
width: "100%",
display: "table-row",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
verticalAlign: "middle",
}}>
<ListItemText
primary="Logo"
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
paddingLeft: 20,
display: "table-cell",
padding: "0px 8px 8px 8px",
textAlign: "center",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}} />
<ListItemText
primary="Name"
style={{
minWidth: 100,
maxWidth: 300,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
textAlign: "center",
}} />
{isCloud && (
<ListItemText
primary="Region"
style={{
minWidth: 100,
maxWidth: 100,
display: "table-cell",
borderBottom: "1px solid #494949",
padding: "0px 8px 8px 8px",
}}
/>
)}
<ListItemText
primary="id"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
<ListItemText
primary="Action"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
</ListItem>
{subOrgs.map((data, index) => {
let regiontag = "UK";
let regionCode = "gb";
{!suborglistOpen ?
<ListItem
style={{
width: "100%",
display: "table-row",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
verticalAlign: "middle",
itemAlign: "center",
if (data.region_url?.length > 0) {
const regionsplit = data.region_url.split(".");
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
const namesplit = regionsplit[0].split("/");
regiontag = namesplit[namesplit.length - 1];
if (regiontag === "california") {
regiontag = "US";
regionCode = "us";
} else if (regiontag === "frankfurt") {
regiontag = "EU-2";
regionCode = "eu";
} else if (regiontag === "ca") {
regiontag = "CA";
regionCode = "ca";
}}
>
<ListItemText
primary={
<Button
fullWidth
variant="secondary"
style={{
textTransform: 'none',
}}
onClick={() => setSuborglistOpen(true)}
>
Show Sub-Organizations <ArrowDropDownIcon />
</Button>
}
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
paddingLeft: 20,
display: "table-cell",
padding: "0px 8px 8px 8px",
textAlign: "center",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
</ListItem>
:
<span>
<ListItem
style={{
width: "100%",
display: "table-row",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
verticalAlign: "middle",
}}>
<ListItemText
primary="Logo"
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
paddingLeft: 20,
display: "table-cell",
padding: "0px 8px 8px 8px",
textAlign: "center",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}} />
<ListItemText
primary="Name"
style={{
minWidth: 100,
maxWidth: 300,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
textAlign: "center",
}} />
{isCloud && (
<ListItemText
primary="Region"
style={{
minWidth: 100,
maxWidth: 100,
display: "table-cell",
borderBottom: "1px solid #494949",
padding: "0px 8px 8px 8px",
}}
/>
)}
<ListItemText
primary="id"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
<ListItemText
primary="Action"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
</ListItem>
{subOrgs.map((data, index) => {
let regiontag = "UK";
let regionCode = "gb";
if (data.region_url?.length > 0) {
const regionsplit = data.region_url.split(".");
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
const namesplit = regionsplit[0].split("/");
regiontag = namesplit[namesplit.length - 1];
if (regiontag === "california") {
regiontag = "US";
regionCode = "us";
} else if (regiontag === "frankfurt") {
regiontag = "EU-2";
regionCode = "eu";
} else if (regiontag === "ca") {
regiontag = "CA";
regionCode = "ca";
}
}
}
}
return (
<ListItem key={index} style={{ backgroundColor: index % 2 === 0 ? '#1A1A1A' : '#212121', width: "100%", borderBottomLeftRadius: 8, display:'table-row', borderBottomRightRadius: 8 }}>
<ListItemText primary={<img alt={data?.name} src={data.image || theme.palette.defaultImage} style={imageStyle} />} style={{ width: 100,
minWidth: 100,
maxWidth: 100,
display: "table-cell",
padding: "8px 8px 8px 20px",
textAlign: "center", }} />
<ListItemText primary={data.name} style={{ minWidth: 100,
maxWidth: 300,
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
display: "table-cell",
padding: 8,
verticalAlign: "middle",
textAlign: "center", }} />
return (
<ListItem key={index} style={{ backgroundColor: index % 2 === 0 ? '#1A1A1A' : '#212121', width: "100%", borderBottomLeftRadius: 8, display:'table-row', borderBottomRightRadius: 8 }}>
<ListItemText primary={<img alt={data?.name} src={data.image || theme.palette.defaultImage} style={imageStyle} />} style={{ width: 100,
minWidth: 100,
maxWidth: 100,
display: "table-cell",
padding: "8px 8px 8px 20px",
textAlign: "center", }} />
<ListItemText primary={data.name} style={{ minWidth: 100,
maxWidth: 300,
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
display: "table-cell",
padding: 8,
verticalAlign: "middle",
textAlign: "center", }} />
{isCloud && (
<ListItemText
primary={
<div style={{ display: "flex", alignItems: "center" }}>
<img
alt={regiontag}
src={`https://flagcdn.com/w20/${regionCode}.png`}
style={{ width: "30px", height: "20px", marginRight: "5px" }}
/>
<ListItemText primary={regiontag?.toUpperCase()} />
</div>
}
style={{ display: "table-cell", padding: 8, verticalAlign: "middle" }}
/>
)}
<ListItemText primary={data.id} style={{ minWidth: 300,
maxWidth: 300,
display: "table-cell",
padding: 8,
verticalAlign: "middle", }} />
{isCloud && (
<ListItemText
primary={
<div style={{ display: "flex", alignItems: "center" }}>
<img
alt={regiontag}
src={`https://flagcdn.com/w20/${regionCode}.png`}
style={{ width: "30px", height: "20px", marginRight: "5px" }}
/>
<ListItemText primary={regiontag?.toUpperCase()} />
</div>
}
style={{ display: "table-cell", padding: 8, verticalAlign: "middle" }}
/>
)}
<ListItemText primary={data.id} style={{ minWidth: 300,
maxWidth: 300,
display: "table-cell",
padding: 8,
verticalAlign: "middle", }} />
<ListItemText
primary={
<Tooltip title={data.id === userdata?.active_org?.id ? "You are already in this organization." : ""} disableInteractive>
<Button
color="primary"
variant='outlined'
disabled={data.id === userdata?.active_org?.id}
onClick={() => {
handleClickChangeOrg(data.id);
}}
sx={{
boxShadow:"none", textTransform:"capitalize",
fontSize:16,
'&.Mui-disabled': {
backgroundColor: 'rgba(200, 200, 200, 0.5)',
color: '#A9A9A9',
},
}}
>
Change Active Org
</Button>
</Tooltip>
}
style={{ display: "table-cell", verticalAlign: "middle" }}
/>
</ListItem>
)})}
</span>}
<ListItemText
primary={
<Tooltip title={data.id === userdata?.active_org?.id ? "You are already in this organization." : ""} disableInteractive>
<Button
color="primary"
variant='outlined'
disabled={data.id === userdata?.active_org?.id}
onClick={() => {
handleClickChangeOrg(data.id);
}}
sx={{
boxShadow:"none", textTransform:"capitalize",
fontSize:16,
'&.Mui-disabled': {
backgroundColor: 'rgba(200, 200, 200, 0.5)',
color: '#A9A9A9',
},
}}
>
Change Active Org
</Button>
</Tooltip>
}
style={{ display: "table-cell", verticalAlign: "middle" }}
/>
</ListItem>
)})}
</List>
</div>
</div>
@@ -1366,247 +1414,289 @@ const TenantsTab = memo((props) => {
paddingBottom: 0,
}}
>
<ListItem
style={{
width: "100%",
display: "table-row",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
verticalAlign: "middle",
}}
>
<ListItemText
primary="Logo"
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
paddingLeft: 20,
display: "table-cell",
padding: "0px 8px 8px 8px",
textAlign: "center",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
<ListItemText
primary="Name"
style={{
minWidth: 100,
maxWidth: 300,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
textAlign: "center",
}}
/>
{isCloud && (
<ListItemText
primary="Region"
style={{
minWidth: 100,
maxWidth: 100,
display: "table-cell",
borderBottom: "1px solid #494949",
padding: "0px 8px 8px 8px",
}}
/>
)}
<ListItemText
primary="id"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
<ListItemText
primary="Action"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
</ListItem>
{!allTenantsOpen ?
<ListItem
style={{
width: "100%",
display: "table-row",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
verticalAlign: "middle",
itemAlign: "center",
{userdata?.orgs?.length <= 0 ? (
[...Array(6)].map((_, rowIndex) => (
<ListItem
key={rowIndex}
style={{
display: "table-row",
backgroundColor: "#212121",
}}
>
{Array(7)
.fill()
.map((_, colIndex) => (
<ListItemText
key={colIndex}
style={{
display: "table-cell",
padding: "8px",
}}
>
<Skeleton
variant="text"
animation="wave"
sx={{
backgroundColor: "#1a1a1a",
height: "20px",
borderRadius: "4px",
}}
/>
</ListItemText>
))}
</ListItem>
))
) : (
userdata?.orgs?.length > 0 &&
userdata.orgs.map((data, index) => {
let regiontag = "UK";
let regionCode = "gb";
if (data.region_url?.length > 0) {
const regionsplit = data.region_url.split(".");
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
const namesplit = regionsplit[0].split("/");
regiontag = namesplit[namesplit.length - 1];
if (regiontag === "california") {
regiontag = "US";
regionCode = "us";
} else if (regiontag === "frankfurt") {
regiontag = "EU-2";
regionCode = "eu";
} else if (regiontag === "ca") {
regiontag = "CA";
regionCode = "ca";
}}
>
<ListItemText
primary={
<Button
fullWidth
variant="secondary"
style={{
textTransform: 'none',
}}
onClick={() => setAllTenantsOpen(true)}
>
Show ALL your tenants <ArrowDropDownIcon />
</Button>
}
}
}
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
paddingLeft: 20,
display: "table-cell",
padding: "0px 8px 8px 8px",
textAlign: "center",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
</ListItem>
:
<span>
<ListItem
style={{
width: "100%",
display: "table-row",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
verticalAlign: "middle",
}}
>
<ListItemText
primary="Logo"
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
paddingLeft: 20,
display: "table-cell",
padding: "0px 8px 8px 8px",
textAlign: "center",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
<ListItemText
primary="Name"
style={{
minWidth: 100,
maxWidth: 300,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
textAlign: "center",
}}
/>
{isCloud && (
<ListItemText
primary="Region"
style={{
minWidth: 100,
maxWidth: 100,
display: "table-cell",
borderBottom: "1px solid #494949",
padding: "0px 8px 8px 8px",
}}
/>
)}
<ListItemText
primary="id"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
<ListItemText
primary="Action"
style={{
minWidth: 400,
maxWidth: 400,
display: "table-cell",
padding: "0px 8px 8px 8px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
borderBottom: "1px solid #494949",
verticalAlign: "middle",
}}
/>
</ListItem>
return (
<ListItem
key={index}
style={{
display: "table-row",
verticalAlign: "middle",
padding: 8,
backgroundColor: index % 2 === 0 ? "#1A1A1A" : "#212121",
borderBottomLeftRadius:
userdata?.orgs?.length - 1 === index ? 8 : 0,
borderBottomRightRadius:
userdata?.orgs?.length - 1 === index ? 8 : 0,
}}
>
<ListItemText
primary={
<img
alt={data.name}
src={data.image || theme.palette.defaultImage}
style={imageStyle}
/>
}
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
display: "table-cell",
padding: "8px 8px 8px 20px",
textAlign: "center",
}}
/>
<ListItemText
primary={data?.name}
style={{
minWidth: 100,
maxWidth: 300,
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
display: "table-cell",
padding: 8,
verticalAlign: "middle",
textAlign: "center",
}}
></ListItemText>
{isCloud ? (
<ListItemText
primary={
<div style={{ display: "flex", alignItems: "center" }}>
<img
alt={regiontag}
src={`https://flagcdn.com/w20/${regionCode}.png`}
style={{
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
/>
{userdata?.orgs?.length <= 0 ? (
[...Array(6)].map((_, rowIndex) => (
<ListItem
key={rowIndex}
style={{
display: "table-row",
backgroundColor: "#212121",
}}
>
{Array(7)
.fill()
.map((_, colIndex) => (
<ListItemText
key={colIndex}
style={{
display: "table-cell",
padding: "8px",
}}
>
<Skeleton
variant="text"
animation="wave"
sx={{
backgroundColor: "#1a1a1a",
height: "20px",
borderRadius: "4px",
}}
/>
</ListItemText>
))}
</ListItem>
))
) : (
userdata?.orgs?.length > 0 &&
userdata.orgs.map((data, index) => {
let regiontag = "UK";
let regionCode = "gb";
<ListItemText primary={regiontag} />
</div>
}
style={{
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
></ListItemText>
) : null}
<ListItemText
primary={data.id}
style={{
minWidth: 300,
maxWidth: 300,
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
/>
<ListItemText
primary={
<Button
variant="outlined"
style={{
whiteSpace: "nowrap",
textTransform: "none",
fontSize: 16,
}}
disabled={data?.id === userdata?.active_org?.id}
onClick={() => {
handleClickChangeOrg(data?.id);
}}
>
Change Active Org
</Button>
}
style={{
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
></ListItemText>
</ListItem>
);
})
)}
if (data.region_url?.length > 0) {
const regionsplit = data.region_url.split(".");
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
const namesplit = regionsplit[0].split("/");
regiontag = namesplit[namesplit.length - 1];
if (regiontag === "california") {
regiontag = "US";
regionCode = "us";
} else if (regiontag === "frankfurt") {
regiontag = "EU-2";
regionCode = "eu";
} else if (regiontag === "ca") {
regiontag = "CA";
regionCode = "ca";
}
}
}
return (
<ListItem
key={index}
style={{
display: "table-row",
verticalAlign: "middle",
padding: 8,
backgroundColor: index % 2 === 0 ? "#1A1A1A" : "#212121",
borderBottomLeftRadius:
userdata?.orgs?.length - 1 === index ? 8 : 0,
borderBottomRightRadius:
userdata?.orgs?.length - 1 === index ? 8 : 0,
}}
>
<ListItemText
primary={
<img
alt={data.name}
src={data.image || theme.palette.defaultImage}
style={imageStyle}
/>
}
style={{
width: 100,
minWidth: 100,
maxWidth: 100,
display: "table-cell",
padding: "8px 8px 8px 20px",
textAlign: "center",
}}
/>
<ListItemText
primary={data?.name}
style={{
minWidth: 100,
maxWidth: 300,
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
display: "table-cell",
padding: 8,
verticalAlign: "middle",
textAlign: "center",
}}
></ListItemText>
{isCloud ? (
<ListItemText
primary={
<div style={{ display: "flex", alignItems: "center" }}>
<img
alt={regiontag}
src={`https://flagcdn.com/w20/${regionCode}.png`}
style={{
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
/>
<ListItemText primary={regiontag} />
</div>
}
style={{
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
></ListItemText>
) : null}
<ListItemText
primary={data.id}
style={{
minWidth: 300,
maxWidth: 300,
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
/>
<ListItemText
primary={
<Button
variant="outlined"
style={{
whiteSpace: "nowrap",
textTransform: "none",
fontSize: 16,
}}
disabled={data?.id === userdata?.active_org?.id}
onClick={() => {
handleClickChangeOrg(data?.id);
}}
>
Change Active Org
</Button>
}
style={{
display: "table-cell",
padding: 8,
verticalAlign: "middle",
}}
></ListItemText>
</ListItem>
);
})
)}
</span>}
</List>
</div>
</div>
+14 -11
View File
@@ -4316,9 +4316,15 @@ const AngularWorkflow = (defaultprops) => {
var sessionToken = new URLSearchParams(cursearch).get("session_token");
if (execFound === null && sessionToken === null) {
toast.error(`You don't have access to this workflow or loading failed. Redirecting to workflows in a few seconds. If you recently deleted this workflow, speak with support@shuffler.io to recover it from a revision.`, {
autoClose: 10000,
})
if (isCloud) {
toast.error(`You don't have access to this workflow or loading failed. Redirecting to workflows in a few seconds. If you recently deleted this workflow, speak with support@shuffler.io to recover it from a revision.`, {
autoClose: 10000,
})
} else {
toast.error(`You don't have access to this workflow or loading failed. Redirecting to workflows in a few seconds. Contact support@shuffler.io if this is unexpected.`, {
autoClose: 10000,
})
}
setTimeout(() => {
window.location.pathname = "/workflows";
@@ -7659,7 +7665,6 @@ const AngularWorkflow = (defaultprops) => {
};
const handlePaste = (event) => {
console.log("PASTE EVENT: ", event)
if (event.path !== undefined && event.path !== null && event.path.length > 0) {
if (event.path[0].localName !== "body") {
console.log("Skipping paste because body is not targeted")
@@ -7667,15 +7672,13 @@ const AngularWorkflow = (defaultprops) => {
}
}
console.log("Paste target: ", event?.target)
/*
if (event.target !== undefined && event.target !== null) {
if (event.target.localName !== "body") {
console.log("Skipping paste because body is not targeted (2). Target: ", event?.target?.localName)
return;
}
// If it's an input area, skip paste
if (event.target.localName === "input" || event.target.localName === "textarea") {
console.log("Skipping paste because body is not targeted (1). Target: ", event?.target?.localName)
return;
}
}
*/
// Does this stop things?
//event.preventDefault()
+7 -4
View File
@@ -1114,6 +1114,7 @@ const Docs = (defaultprops) => {
marginTop: 25,
}
const showPartnerLogo = userdata?.org_status?.includes("integration_partner") && userdata?.active_org?.image !== undefined && userdata?.active_org?.image !== null && userdata?.active_org?.image.length > 0
const mainpageInfo =
<div style={{
color: "rgba(255, 255, 255, 0.65)",
@@ -1129,10 +1130,12 @@ const Docs = (defaultprops) => {
<Typography variant="h4" style={{ textAlign: "center", marginTop: 20 }}>
Documentation
</Typography>
<div style={{ display: "flex", marginTop: 25, }}>
<CustomButton title="Talk to Support" icon=<img src="/images/Shuffle_logo_new.png" style={{ height: 35, width: 35, border: "", borderRadius: theme.palette?.borderRadius, }} /> />
<CustomButton title="Ask the community" icon=<img src="/images/social/discord.png" style={{ height: 35, width: 35, border: "", borderRadius: theme.palette?.borderRadius, }} /> link="https://discord.gg/B2CBzUm" />
</div>
{showPartnerLogo === true ? null :
<div style={{ display: "flex", marginTop: 25, }}>
<CustomButton title="Talk to Support" icon=<img src="/images/Shuffle_logo_new.png" style={{ height: 35, width: 35, border: "", borderRadius: theme.palette?.borderRadius, }} /> />
<CustomButton title="Ask the community" icon=<img src="/images/social/discord.png" style={{ height: 35, width: 35, border: "", borderRadius: theme.palette?.borderRadius, }} /> link="https://discord.gg/B2CBzUm" />
</div>
}
<div style={{ textAlign: "left" }}>
<Typography variant="h6" style={headerStyle} >Tutorial</Typography>
+163 -13
View File
@@ -34,6 +34,7 @@ import {
DialogTitle,
DialogContent,
MenuItem,
Autocomplete,
} from '@mui/material';
import {
@@ -45,6 +46,7 @@ import {
LockOpen as LockOpenIcon,
OpenInNew as OpenInNewIcon,
Edit as EditIcon,
Polyline as PolylineIcon,
} from '@mui/icons-material';
const hrefStyle = {
@@ -75,6 +77,7 @@ const RunWorkflow = (defaultprops) => {
const [sharingOpen, setSharingOpen] = React.useState(false)
const [realtimeMarkdown, setRealtimeMarkdown] = React.useState("")
const [forms, setForms] = React.useState([])
const [workflows, setWorkflows] = React.useState([])
const [boxWidth, setBoxWidth] = React.useState(500)
const [inputQuestions, setInputQuestions] = React.useState([])
@@ -181,6 +184,37 @@ const RunWorkflow = (defaultprops) => {
return true
}
const getWorkflows = () => {
const url = `${globalUrl}/api/v1/workflows`
fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
})
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for org forms");
}
return response.json()
})
.then((responseJson) => {
if (responseJson.success === false) {
toast.error("Failed saving workflow. Please try again.")
} else {
if (responseJson?.length > 0) {
setWorkflows(responseJson)
}
}
})
.catch((error) => {
//toast.error("Load form error: " + error)
})
}
const loadForms = (orgId) => {
const url = `${globalUrl}/api/v1/orgs/${orgId}/forms`
fetch(url, {
@@ -878,6 +912,7 @@ const RunWorkflow = (defaultprops) => {
// Just use this one?
var url = execution_id !== undefined && authorization !== undefined ? `${globalUrl}/api/v1/orgs/${orgId}?reference_execution=${execution_id}&authorization=${authorization}` : `${globalUrl}/api/v1/orgs/${orgId}`;
getWorkflows()
loadForms(orgId)
fetch(url, {
@@ -1152,10 +1187,100 @@ const RunWorkflow = (defaultprops) => {
No Forms Found
</Typography>
<Typography variant="body1" color="textSecondary">
<b>Every</b> Workflow is a form, and can be accessed by going to /forms/{`{workflow_id}`}. You can control the form by editing the workflow details in the "Forms" section.
</Typography>
<b>ALL</b> Workflows are forms, and can be accessed by going to /forms/{`{workflow_id}`}. You can control the form by editing the workflow details in the "Forms" section.
</Typography>
</div>
}
{workflows === undefined || workflows === null || workflows.length === 0 ? null :
<Autocomplete
disabled={workflows === undefined || workflows === null || workflows.length === 0}
id="form-workflow-search"
autoHighlight
value={""}
ListboxProps={{
style: {
backgroundColor: theme.palette.inputColor,
color: "white",
},
}}
sx={{
'& .MuiOutlinedInput-root': {
height: 40, // Adjust the input height
},
'& .MuiAutocomplete-input': {
padding: '8px', // Adjust the text padding
},
}}
getOptionSelected={(option, value) => option.id === value.id}
getOptionLabel={(option) => {
if (
option === undefined ||
option === null ||
option.name === undefined ||
option.name === null
) {
return "No Workflow Selected";
}
const newname = (
option.name.charAt(0).toUpperCase() + option.name.substring(1)
).replaceAll("_", " ");
return newname;
}}
options={workflows}
fullWidth
style={{
backgroundColor: theme.palette.inputColor,
borderRadius: theme.palette?.borderRadius,
marginTop: 75,
}}
renderOption={(props, data, state) => {
if (data.id === workflow.id) {
data = workflow;
}
//key={index}
return (
<Tooltip arrow placement="left" title={
<span style={{}}>
{data.image !== undefined && data.image !== null && data.image.length > 0 ?
<img src={data.image} alt={data.name} style={{ backgroundColor: theme.palette.surfaceColor, maxHeight: 200, minHeigth: 200, maxWidth: 285, borderRadius: theme.palette?.borderRadius, }} />
: null}
<Typography>
Choose Subflow '{data.name}'
</Typography>
</span>
}>
<MenuItem
style={{
backgroundColor: theme.palette.inputColor,
}}
onClick={() => {
window.location.href = `/forms/${data.id}`
}}
value={data}
>
<PolylineIcon style={{ marginRight: 8 }} />
{data.name}
</MenuItem>
</Tooltip>
)
}}
renderInput={(params) => {
return (
<div style={{ display: "flex", }}>
<TextField
style={theme.palette.textFieldStyle}
{...params}
label="Find your form"
variant="outlined"
/>
</div>
)
}}
/>
}
</div>
)
}
@@ -1405,7 +1530,10 @@ const RunWorkflow = (defaultprops) => {
variant="contained"
disabled={!handleValidateForm(executionArgument) || disabledButtons}
color="primary"
style={{flex: 1,}}
style={{
flex: 1,
textTransform: "none",
}}
onClick={() => {
setButtonClicked("FINISHED")
setExecutionData({
@@ -1418,14 +1546,25 @@ const RunWorkflow = (defaultprops) => {
<Typography variant="body1" style={{marginLeft: 3, marginRight: 3, marginTop: 3, }}>
&nbsp;or&nbsp;
</Typography>
<Button fullWidth id="abort_execution" variant="contained" disabled={!handleValidateForm(executionArgument) || disabledButtons} color="primary" style={{ flex: 1, }} onClick={() => {
setButtonClicked("ABORTED")
setExecutionData({
status: "ABORTED",
})
<Button
fullWidth
id="abort_execution"
variant="outlined"
disabled={!handleValidateForm(executionArgument) || disabledButtons}
color="primary"
style={{
flex: 1,
textTransform: "none",
}} onClick={() => {
setButtonClicked("ABORTED")
setExecutionData({
status: "ABORTED",
})
onSubmit(null, execution_id, authorization, false)
}}>Stop</Button>
onSubmit(null, execution_id, authorization, false)
}}>
Stop
</Button>
</div>
</span>
:
@@ -1436,6 +1575,9 @@ const RunWorkflow = (defaultprops) => {
color="primary"
fullWidth
disabled={!handleValidateForm(executionArgument) || executionLoading}
style={{
textTransform: "none",
}}
>
{executionLoading ?
<CircularProgress color="secondary" style={{color: "white",}} />
@@ -1621,7 +1763,10 @@ const RunWorkflow = (defaultprops) => {
disabled={workflow.id === undefined || workflow.id === null}
variant={"outlined"}
color={"secondary"}
style={{marginRight: 10, }}
style={{
marginRight: 10,
textTransform: "none",
}}
onClick={() => {
window.open(`/workflows/${workflow.id}`, "_blank")
}}
@@ -1634,7 +1779,10 @@ const RunWorkflow = (defaultprops) => {
disabled={workflow.id === undefined || workflow.id === null}
variant={workflow.sharing === "form" ? "outlined" : "contained"}
color={"secondary"}
style={{marginRight: 10, }}
style={{
marginRight: 10,
textTransform: "none",
}}
onClick={() => {
setSharingOpen(true)
}}
@@ -1656,7 +1804,9 @@ const RunWorkflow = (defaultprops) => {
disabled={workflow.id === undefined || workflow.id === null}
variant={"contained"}
color={"primary"}
style={{}}
style={{
textTransform: "none",
}}
onClick={() => {
setEditWorkflowModalOpen(true)
}}
+42 -16
View File
@@ -812,9 +812,10 @@ const Workflows2 = (props) => {
}
const isCloud =
window.location.host === "localhost:3002" ||
window.location.host === "shuffler.io";
//const isCloud =
// window.location.host === "localhost:3002" ||
// window.location.host === "shuffler.io";
const isCloud = false
const findWorkflow = (filters) => {
console.log("Using filters: ", filters)
@@ -2474,16 +2475,18 @@ const Workflows2 = (props) => {
style={{ display: "flex", flexDirection: "column", width: "100%", fontFamily: theme?.typography?.fontFamily }}
>
<Grid item style={{ display: "flex", maxHeight: 34 }}>
<Tooltip title={`Org "${orgName}". Click to edit image.`} placement="bottom">
<div
styl={{ cursor: "pointer" }}
onClick={() => {
navigate("/admin")
}}
>
{image}
</div>
</Tooltip>
{currTab === 2 ? null :
<Tooltip title={`Org "${orgName}". Click to edit image.`} placement="bottom">
<div
styl={{ cursor: "pointer" }}
onClick={() => {
navigate("/admin")
}}
>
{image}
</div>
</Tooltip>
}
<Tooltip arrow
onMouseEnter={() => {
/*
@@ -2562,9 +2565,19 @@ const Workflows2 = (props) => {
>
<Link
to={
type === "public" ? parsedUrl : data.workflow_as_code ? `/workflows/${data.id}/code` : `/workflows/${data.id}`
currTab === 2 ? `https://shuffler.io${parsedUrl}` : type === "public" ? parsedUrl : data.workflow_as_code ? `/workflows/${data.id}/code` : `/workflows/${data.id}`
}
style={{ textDecoration: "none", color: "inherit", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth: "90%", display: "block" }} >
style={{
textDecoration: "none",
color: "inherit",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: "90%",
display: "block"
}}
target={currTab === 2 ? "_blank" : "_self"}
>
{parsedName}
</Link>
</Typography>
@@ -4261,7 +4274,7 @@ const Workflows2 = (props) => {
TabIndicatorProps={{ style: { display: 'none' } }}
>
<Tab
label="Organization Workflows"
label="Org Workflows"
style={{
...tabStyle,
...(currTab === 0 ? tabActive : {})
@@ -4282,6 +4295,19 @@ const Workflows2 = (props) => {
...(currTab === 2 ? tabActive : {})
}}
/>
<Tab
label="Org Forms"
onClick={() => {
navigate("/forms")
}}
style={{
...tabStyle,
marginRight: 0,
marginLeft: 25,
...(currTab === 3 ? tabActive : {})
}}
/>
</Tabs>
</div>
+1 -1
View File
@@ -8,7 +8,7 @@ require (
github.com/docker/docker v27.5.0+incompatible
github.com/gorilla/mux v1.8.1
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.8.19
github.com/shuffle/shuffle-shared v0.8.31
k8s.io/api v0.30.2
k8s.io/apimachinery v0.30.2
k8s.io/client-go v0.30.2
+2 -2
View File
@@ -294,8 +294,8 @@ github.com/sendgrid/sendgrid-go v3.14.0+incompatible h1:KDSasSTktAqMJCYClHVE94Fc
github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/shuffle/shuffle-shared v0.8.19 h1:HXqU62sPhVzv9MeJnA5ZpPYwwbitVz1EtMMABbY3t74=
github.com/shuffle/shuffle-shared v0.8.19/go.mod h1:NruHSAscDsW595wpK2r7MeHPGspUEKRNvBpcN1iGbHI=
github.com/shuffle/shuffle-shared v0.8.31 h1:APO/BkBxiP9Hn/Fa7SsESRD6ws9E5dBfIzS57pd3MvA=
github.com/shuffle/shuffle-shared v0.8.31/go.mod h1:NruHSAscDsW595wpK2r7MeHPGspUEKRNvBpcN1iGbHI=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=