= 0.9 ? "#f86a3e" : null, }} onClick={() => {
+ console.log(userdata.appe_execution_usage/userdata.app_execution_limit)
if (window.drift !== undefined) {
window.drift.api.startInteraction({ interactionId: 326905 })
+ navigate("/pricing")
} else {
console.log("Couldn't find drift in window.drift and not .drift-open-chat with querySelector: ", window.drift)
}
diff --git a/frontend/src/components/Oauth2Auth.jsx b/frontend/src/components/Oauth2Auth.jsx
index a5665c61..2b2996cc 100755
--- a/frontend/src/components/Oauth2Auth.jsx
+++ b/frontend/src/components/Oauth2Auth.jsx
@@ -1,5 +1,6 @@
import React, { useRef, useState, useEffect, useLayoutEffect } from "react";
import { useParams, useNavigate, Link } from "react-router-dom";
+import { useTheme } from "@material-ui/core/styles";
import theme from '../theme.jsx';
import { useAlert } from "react-alert";
@@ -36,8 +37,8 @@ import {
Breadcrumbs,
CircularProgress,
Switch,
- Collapse,
-} from "@mui/material";
+ Fade,
+} from "@material-ui/core";
import {
LockOpen as LockOpenIcon,
SupervisorAccount as SupervisorAccountIcon,
@@ -70,6 +71,7 @@ const registeredApps = [
"todoist",
"microsoft_sentinel",
"microsoft_365_defender",
+ "google_chat",
"google_sheets",
"google_drive",
"google_disk",
@@ -260,6 +262,16 @@ const AuthenticationOauth2 = (props) => {
admin_consent,
"consent",
)
+ } else if (selectedApp.name.toLowerCase().includes("google_chat") || selectedApp.name.toLowerCase().includes("google_hangout")) {
+ handleOauth2Request(
+ "253565968129-6pij4g6ojim4gpum0h9m9u3bc357qsq7.apps.googleusercontent.com",
+ "",
+ "https://www.googleapis.com",
+ ["https://www.googleapis.com/auth/chat.messages",],
+ admin_consent,
+ "consent",
+ )
+
} else if (selectedApp.name.toLowerCase().includes("jira_service_desk") || selectedApp.name.toLowerCase().includes("jira") || selectedApp.name.toLowerCase().includes("jira_service_management")) {
handleOauth2Request(
"AI02egeCQh1Zskm1QAJaaR6dzjR97V2F",
diff --git a/frontend/src/components/OrgHeader.jsx b/frontend/src/components/OrgHeader.jsx
index 21d1c096..9b4a344d 100644
--- a/frontend/src/components/OrgHeader.jsx
+++ b/frontend/src/components/OrgHeader.jsx
@@ -1,23 +1,17 @@
import React, { useEffect } from "react";
-import theme from '../theme.jsx';
-import { makeStyles } from "@mui/styles";
-
-import {
- Tooltip,
- Grid,
- Button,
- TextField,
- Typography,
- IconButton,
-} from "@mui/material";
+import { makeStyles } from "@material-ui/styles";
+import { useTheme } from "@material-ui/core/styles";
+import Tooltip from "@material-ui/core/Tooltip";
+import Grid from "@material-ui/core/Grid";
+import Button from "@material-ui/core/Button";
+import TextField from "@material-ui/core/TextField";
+import Typography from "@material-ui/core/Typography";
import { useAlert } from "react-alert";
-
-import {
- ExpandLess as ExpandLessIcon,
- ExpandMore as ExpandMoreIcon,
- Save as SaveIcon,
-} from "@mui/icons-material";
+import IconButton from "@material-ui/core/IconButton";
+import ExpandLessIcon from "@material-ui/icons/ExpandLess";
+import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
+import SaveIcon from "@material-ui/icons/Save";
const useStyles = makeStyles({
notchedOutline: {
@@ -39,6 +33,7 @@ const OrgHeader = (props) => {
handleEditOrg,
} = props;
+ const theme = useTheme();
const alert = useAlert();
const classes = useStyles();
@@ -101,10 +96,9 @@ const OrgHeader = (props) => {
//console.log("USER: ", userdata)
const orgSaveButton = (
-
-
);
diff --git a/frontend/src/components/Priorities.jsx b/frontend/src/components/Priorities.jsx
index 6e0a872e..f0a61a3a 100644
--- a/frontend/src/components/Priorities.jsx
+++ b/frontend/src/components/Priorities.jsx
@@ -9,13 +9,13 @@ import {
Grid,
Card,
Switch,
-} from "@mui/material";
+} from "@material-ui/core";
import Priority from "../components/Priority.jsx";
import { useAlert } from "react-alert";
const Priorities = (props) => {
- const { globalUrl, userdata, serverside, billingInfo, stripeKey, checkLogin, } = props;
+ const { globalUrl, userdata, serverside, billingInfo, stripeKey, checkLogin, setAdminTab, setCurTab, } = props;
const [showDismissed, setShowDismissed] = React.useState(false);
const [showRead, setShowRead] = React.useState(false);
@@ -60,6 +60,8 @@ const Priorities = (props) => {
globalUrl={globalUrl}
priority={priority}
checkLogin={checkLogin}
+ setAdminTab={setAdminTab}
+ setCurTab={setCurTab}
/>
)
})
diff --git a/frontend/src/components/Priority.jsx b/frontend/src/components/Priority.jsx
index 8d571d79..15f71754 100644
--- a/frontend/src/components/Priority.jsx
+++ b/frontend/src/components/Priority.jsx
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from "react";
+import ReactGA from 'react-ga4';
import theme from "../theme.jsx";
import { useNavigate, Link } from "react-router-dom";
import {
@@ -9,7 +10,7 @@ import {
Button,
Grid,
Card,
-} from "@mui/material";
+} from "@material-ui/core";
// import magic wand icon from material ui icons
import {
@@ -19,9 +20,10 @@ import {
import { useAlert } from "react-alert";
const Priority = (props) => {
- const { globalUrl, userdata, serverside, priority, checkLogin, } = props;
+ const { globalUrl, userdata, serverside, priority, checkLogin, setAdminTab, setCurTab, } = props;
+ const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io";
let navigate = useNavigate();
const changeRecommendation = (recommendation, action) => {
const data = {
@@ -101,14 +103,27 @@ const Priority = (props) => {
diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx
index 30f9a5ab..b7f42b03 100755
--- a/frontend/src/views/Admin.jsx
+++ b/frontend/src/views/Admin.jsx
@@ -1,9 +1,16 @@
import React, { useState, useEffect } from "react";
-import { useNavigate, } from "react-router-dom";
+import { makeStyles } from "@material-ui/styles";
+import { useNavigate, Link } from "react-router-dom";
+import countries from "../components/Countries.jsx";
+import CodeEditor from "../components/ShuffleCodeEditor.jsx";
+import getLocalCodeData from "../components/ShuffleCodeEditor.jsx";
import CacheView from "../components/CacheView.jsx";
import theme from "../theme.jsx";
-
+import AddIcon from "@mui/icons-material/Add";
+import ClearIcon from '@mui/icons-material/Clear';
+import StorageIcon from '@mui/icons-material/Storage';
+//import ToggleButton from '@mui/material/ToggleButton';
import {
FormControl,
InputLabel,
@@ -12,6 +19,7 @@ import {
Checkbox,
Card,
Tooltip,
+ FormControlLabel,
Typography,
Switch,
Select,
@@ -27,6 +35,7 @@ import {
ListItem,
ListItemText,
ListItemAvatar,
+ ListItemSecondaryAction,
IconButton,
Avatar,
Zoom,
@@ -35,38 +44,54 @@ import {
DialogActions,
DialogContent,
CircularProgress,
- InputAdornment,
-} from "@mui/material";
+ Box,
+ InputAdornment,
+} from "@material-ui/core";
+
+import { Autocomplete } from "@mui/material";
import {
Edit as EditIcon,
FileCopy as FileCopyIcon,
SelectAll as SelectAllIcon,
+ OpenInNew as OpenInNewIcon,
+ CloudDownload as CloudDownloadIcon,
Description as DescriptionIcon,
- Code as CodeIcon,
+ Polymer as PolymerIcon,
CheckCircle as CheckCircleIcon,
Close as CloseIcon,
Apps as AppsIcon,
+ Image as ImageIcon,
Delete as DeleteIcon,
Cached as CachedIcon,
AccessibilityNew as AccessibilityNewIcon,
Lock as LockIcon,
+ Eco as EcoIcon,
Schedule as ScheduleIcon,
+ Cloud as CloudIcon,
Business as BusinessIcon,
- Visibility as VisibilityIcon,
- VisibilityOff as VisibilityOffIcon,
- Storage as StorageIcon,
-} from "@mui/icons-material";
+ Visibility as VisibilityIcon,
+ VisibilityOff as VisibilityOffIcon,
+} from "@material-ui/icons";
import { useAlert } from "react-alert";
+import Dropzone from "../components/Dropzone.jsx";
+import HandlePaymentNew from "../views/HandlePaymentNew.jsx";
import OrgHeader from "../components/OrgHeader.jsx";
import OrgHeaderexpanded from "../components/OrgHeaderexpanded.jsx";
import Billing from "../components/Billing.jsx";
import Priorities from "../components/Priorities.jsx";
import Branding from "../components/Branding.jsx";
import Files from "../components/Files.jsx";
+import { display, style } from "@mui/system";
//import EnvironmentStats from "../components/EnvironmentStats.jsx";
+const useStyles = makeStyles({
+ notchedOutline: {
+ borderColor: "#f85a3e !important",
+ },
+});
+
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
@@ -79,10 +104,37 @@ const MenuProps = {
getContentAnchorEl: () => null,
};
+
+const FileCategoryInput = (props) => {
+ const isSet = props.isSet;
+ console.log("inside filecategoryinput");
+ console.log("isset value" , isSet);
+ if (isSet){
+ return (
+
+ )}
+ }
+
+
const Admin = (props) => {
const { globalUrl, userdata, serverside, checkLogin } = props;
var to_be_copied = "";
+ const classes = useStyles();
let navigate = useNavigate();
const [firstRequest, setFirstRequest] = React.useState(true);
@@ -98,9 +150,11 @@ const Admin = (props) => {
const [selectedOrganization, setSelectedOrganization] = React.useState({});
//console.log("Selected: ", selectedOrganization)
+ const [organizationFeatures, setOrganizationFeatures] = React.useState({});
const [loginInfo, setLoginInfo] = React.useState("");
const [curTab, setCurTab] = React.useState(0);
const [users, setUsers] = React.useState([]);
+ const [organizations, setOrganizations] = React.useState([]);
const [orgSyncResponse, setOrgSyncResponse] = React.useState("");
const [userSettings, setUserSettings] = React.useState({});
const [matchingOrganizations, setMatchingOrganizations] = React.useState([]);
@@ -116,21 +170,30 @@ const Admin = (props) => {
const [selectedAuthenticationModalOpen, setSelectedAuthenticationModalOpen] = React.useState(false);
const [authenticationFields, setAuthenticationFields] = React.useState([]);
const [showArchived, setShowArchived] = React.useState(false);
+ const [isDropzone, setIsDropzone] = React.useState(false);
const [image2FA, setImage2FA] = React.useState("");
const [value2FA, setValue2FA] = React.useState("");
const [secret2FA, setSecret2FA] = React.useState("");
const [show2faSetup, setShow2faSetup] = useState(false);
- const [billingInfo, ] = React.useState({});
const [adminTab, setAdminTab] = React.useState(2);
- const [showApiKey, setShowApiKey] = useState(false);
- const [selectedStatus, setSelectedStatus] = React.useState([]);
+ const [showApiKey, setShowApiKey] = useState(false);
+ const [billingInfo, setBillingInfo] = React.useState({});
+ const [selectedStatus, setSelectedStatus] = React.useState([]);
useEffect(() => {
- getUsers()
+ getUsers()
}, []);
+
+ useEffect(() => {
+ if (isDropzone) {
+ //redirectOpenApi();
+ setIsDropzone(false);
+ }
+ }, [isDropzone]);
+
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io";
const get2faCode = (userId) => {
@@ -162,7 +225,39 @@ const Admin = (props) => {
});
};
-
+ const getApps = () => {
+ fetch(globalUrl + "/api/v1/apps", {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ },
+ credentials: "include",
+ })
+ .then((response) => {
+ if (response.status !== 200) {
+ console.log("Status not 200 for apps :O!");
+ }
+
+ return response.json();
+ })
+ .then((responseJson) => {
+ console.log("apps: ", responseJson);
+ //setApps(responseJson)
+ //setFilteredApps(responseJson)
+ //if (responseJson.length > 0) {
+ // setSelectedApp(responseJson[0])
+ // if (responseJson[0].actions !== null && responseJson[0].actions.length > 0) {
+ // setSelectedAction(responseJson[0].actions[0])
+ // } else {
+ // setSelectedAction({})
+ // }
+ //}
+ })
+ .catch((error) => {
+ alert.error(error.toString());
+ });
+ };
const categories = [
{
@@ -191,19 +286,22 @@ const Admin = (props) => {
]
*/
- const alert = useAlert();
+ const alert = useAlert();
const handleStatusChange = (event) => {
const { value } = event.target;
+ console.log("value: ", value)
setSelectedStatus(value);
- handleEditOrg(
+
+
+ handleEditOrg(
"",
"",
selectedOrganization.id,
"",
{},
{},
- value,
+ value.length === 0 ? ["none"] : value,
)
}
@@ -235,67 +333,66 @@ const Admin = (props) => {
if (org.security_framework !== undefined && org.security_framework !== null) {
if (org.security_framework.cases.name !== undefined && org.security_framework.cases.name !== null && org.security_framework.cases.name !== "") {
- your_apps += org.security_framework.cases.name.replace("_", " ", -1) + ", "
+ your_apps += org.security_framework.cases.name.replace("_", " ", -1).replace(" API", "", -1) + ", "
if (subject_add < 2) {
if (subject_add === 1) {
- subject += " & "
+ subject += " and "
}
subject_add += 1
- subject += org.security_framework.cases.name.replace("_", " ", -1)
+ subject += org.security_framework.cases.name.replace("_", " ", -1).replace(" API", "", -1)
}
}
if (org.security_framework.siem.name !== undefined && org.security_framework.siem.name !== null && org.security_framework.siem.name !== "") {
- your_apps += org.security_framework.siem.name.replace("_", " ", -1) + ", "
-
+ your_apps += org.security_framework.siem.name.replace("_", " ", -1).replace(" API", "", -1) + ", "
if (subject_add < 2) {
if (subject_add === 1) {
- subject += " & "
+ subject += " and "
}
subject_add += 1
- subject += org.security_framework.siem.name.replace("_", " ", -1)
+ subject += org.security_framework.siem.name.replace("_", " ", -1).replace(" API", "", -1)
}
}
if (org.security_framework.communication.name !== undefined && org.security_framework.communication.name !== null && org.security_framework.communication.name !== "") {
- your_apps += org.security_framework.communication.name.replace("_", " ", -1) + ", "
+ your_apps += org.security_framework.communication.name.replace("_", " ", -1).replace(" API", "", -1) + ", "
if (subject_add < 2) {
if (subject_add === 1) {
- subject += " & "
+ subject += " and "
}
subject_add += 1
- subject += org.security_framework.communication.name.replace("_", " ", -1)
+ subject += org.security_framework.communication.name.replace("_", " ", -1).replace(" API", "", -1)
}
}
if (org.security_framework.edr.name !== undefined && org.security_framework.edr.name !== null && org.security_framework.edr.name !== "") {
- your_apps += org.security_framework.edr.name.replace("_", " ", -1) + ", "
+ your_apps += org.security_framework.edr.name.replace("_", " ", -1).replace(" API", "", -1) + ", "
if (subject_add < 2) {
if (subject_add === 1) {
- subject += " & "
+ subject += " and "
}
subject_add += 1
- subject += org.security_framework.edr.name.replace("_", " ", -1)
+ subject += org.security_framework.edr.name.replace("_", " ", -1).replace(" API", "", -1)
}
}
if (org.security_framework.intel.name !== undefined && org.security_framework.intel.name !== null && org.security_framework.intel.name !== "") {
- your_apps += org.security_framework.intel.name.replace("_", " ", -1) + ", "
+ your_apps += org.security_framework.intel.name.replace("_", " ", -1).replace(" API", "", -1) + ", "
if (subject_add < 2) {
if (subject_add === 1) {
- subject += " & "
+ subject += " and "
}
subject_add += 1
- subject += org.security_framework.intel.name.replace("_", " ", -1)
+ subject += org.security_framework.intel.name.replace("_", " ", -1).replace(" API", "", -1)
}
}
@@ -363,7 +460,7 @@ ${usecases}
Let me know if you're interested, or set up a call here: https://drift.me/${username}`
- return `mailto:${admins}?bcc=frikky@shuffler.io&subject=${subject}&body=${body}`
+ return `mailto:${admins}?bcc=frikky@shuffler.io,binu@shuffler.io&subject=${subject}&body=${body}`
}
const deleteAuthentication = (data) => {
@@ -578,6 +675,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
} else if (!responseJson.success) {
alert.error("Failed to handle sync.");
} else {
+ getOrgs();
if (disableSync) {
alert.success("Successfully disabled sync!");
setOrgSyncResponse("Successfully disabled syncronization");
@@ -900,22 +998,26 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
leads.push("internal")
}
+ if (responseJson.lead_info.sub_org) {
+ leads.push("sub_org")
+ }
+
setSelectedStatus(leads)
}
setSelectedOrganization(responseJson)
- //var lists = {
- // active: {
- // triggers: [],
- // features: [],
- // sync: [],
- // },
- // inactive: {
- // triggers: [],
- // features: [],
- // sync: [],
- // },
- //};
+ var lists = {
+ active: {
+ triggers: [],
+ features: [],
+ sync: [],
+ },
+ inactive: {
+ triggers: [],
+ features: [],
+ sync: [],
+ },
+ };
// FIXME: Set up features
//Object.keys(responseJson.sync_features).map(function(key, index) {
@@ -924,7 +1026,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
//setOrgName(responseJson.name)
//setOrgDescription(responseJson.description)
- //setOrganizationFeatures(lists);
+ setOrganizationFeatures(lists);
}
})
.catch((error) => {
@@ -1017,7 +1119,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
alert.info("Setting default env to " + environment.name);
var newEnv = [];
for (var key in environments) {
- if (environments[key].id === environment.id) {
+ if (environments[key].id == environment.id) {
if (environments[key].archived) {
alert.error("Can't set archived to default");
return;
@@ -1025,7 +1127,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
environments[key].default = true;
} else if (
- environments[key].default === true &&
+ environments[key].default == true &&
environments[key].id !== environment.id
) {
environments[key].default = false;
@@ -1065,6 +1167,33 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
});
};
+ const flushQueue = (name) => {
+ // Just use this one?
+ const url = globalUrl + "/api/v1/flush_queue";
+ fetch(url, {
+ method: "DELETE",
+ credentials: "include",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ })
+ .then((response) =>
+ response.json().then((responseJson) => {
+ if (responseJson["success"] === false) {
+ alert.error(responseJson.reason);
+ getEnvironments();
+ } else {
+ setLoginInfo("");
+ setModalOpen(false);
+ getEnvironments();
+ }
+ })
+ )
+ .catch((error) => {
+ console.log("Error when deleting: ", error);
+ });
+ };
+
const rerunCloudWorkflows = (environment) => {
alert.info("Starting execution reruns. This can run in the background.")
fetch(
@@ -1154,7 +1283,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
//alert.info("Modifying environment " + environment.Name)
var newEnv = [];
for (var key in environments) {
- if (environments[key].id === id) {
+ if (environments[key].id == id) {
if (environments[key].default) {
alert.error("Can't modify the default environment");
return;
@@ -1233,6 +1362,9 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
});
};
+ var localData = "";
+
+
const getSchedules = () => {
fetch(globalUrl + "/api/v1/workflows/schedules", {
method: "GET",
@@ -1314,6 +1446,34 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
});
};
+ const getOrgs = () => {
+ // API no longer in use, as it's in handleInfo request
+ return;
+
+ fetch(globalUrl + "/api/v1/orgs", {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ },
+ credentials: "include",
+ })
+ .then((response) => {
+ if (response.status !== 200) {
+ console.log("Status not 200 for apps :O!");
+ return;
+ }
+
+ return response.json();
+ })
+ .then((responseJson) => {
+ setOrganizations(responseJson);
+ })
+ .catch((error) => {
+ alert.error(error.toString());
+ });
+ };
+
const getUsers = () => {
fetch(globalUrl + "/api/v1/getusers", {
method: "GET",
@@ -1406,8 +1566,8 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
document.title = "Shuffle - admin - environments";
getEnvironments();
} else if (newValue === 7) {
- //getOrgs();
document.title = "Shuffle - admin - orgs";
+ getOrgs();
} else {
document.title = "Shuffle - admin";
}
@@ -1423,6 +1583,8 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
if (firstRequest) {
setFirstRequest(false);
document.title = "Shuffle - admin";
+
+ getEnvironments();
if (!isCloud) {
getUsers();
} else {
@@ -1909,6 +2071,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
maxHeight: 200,
maxWidth: 200,
minWidth: 200,
+ maxWidth: 200,
}}
/>
) : (
@@ -2036,7 +2199,7 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user
primary: "Workflows",
secondary: "",
active: true,
- icon:
,
+ icon:
,
},
{
primary: "Apps",
@@ -2188,25 +2351,40 @@ Let me know if you're interested, or set up a call here: https://drift.me/${user