Fixed more welcome pages to work better and set priorities

This commit is contained in:
frikky
2022-07-22 01:34:02 +02:00
parent 193f6b1f08
commit 20bde3de2a
7 changed files with 71 additions and 56 deletions
+1
View File
@@ -1389,6 +1389,7 @@ func handleLogin(resp http.ResponseWriter, request *http.Request) {
Value: Userdata.Session, Value: Userdata.Session,
Expiration: expiration.Unix(), Expiration: expiration.Unix(),
}) })
loginData = fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]}`, Userdata.Session, expiration.Unix()) loginData = fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]}`, Userdata.Session, expiration.Unix())
newData, err := json.Marshal(returnValue) newData, err := json.Marshal(returnValue)
if err == nil { if err == nil {
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

@@ -1518,7 +1518,7 @@ const Framework = (props) => {
{ {
Object.getOwnPropertyNames(discoveryData).length > 0 ? Object.getOwnPropertyNames(discoveryData).length > 0 ?
<Paper style={{width: 275, maxHeight: 400, overflow: "hidden", zIndex: 12500, padding: 25, paddingRight: 35, backgroundColor: theme.palette.surfaceColor, border: "1px solid rgba(255,255,255,0.2)", position: "absolute", top: 50, left: 50, }}> <Paper style={{width: 275, maxHeight: 400, overflow: "hidden", zIndex: 12500, padding: 25, paddingRight: 35, backgroundColor: theme.palette.surfaceColor, border: "1px solid rgba(255,255,255,0.2)", position: "absolute", top: 25, left: 50, }}>
{paperTitle.length > 0 ? {paperTitle.length > 0 ?
<span> <span>
<Typography variant="h6" style={{textAlign: "center"}}> <Typography variant="h6" style={{textAlign: "center"}}>
+2 -3
View File
@@ -54,9 +54,7 @@ const SearchField = props => {
return null return null
} }
const isCloud = const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io";
window.location.host === "localhost:3002" ||
window.location.host === "shuffler.io";
if (window.location.pathname !== oldPath) { if (window.location.pathname !== oldPath) {
setSearchOpen(false) setSearchOpen(false)
@@ -204,6 +202,7 @@ const SearchField = props => {
const appGroup = hit.action_references === undefined || hit.action_references === null ? [] : hit.action_references const appGroup = hit.action_references === undefined || hit.action_references === null ? [] : hit.action_references
const avatar = baseImage const avatar = baseImage
console.log("CLOUD: ", isCloud)
var parsedUrl = isCloud ? `/workflows/${hit.objectID}` : `https://shuffler.io/workflows/${hit.objectID}` var parsedUrl = isCloud ? `/workflows/${hit.objectID}` : `https://shuffler.io/workflows/${hit.objectID}`
parsedUrl += `?queryID=${hit.__queryID}` parsedUrl += `?queryID=${hit.__queryID}`
+45 -36
View File
@@ -110,7 +110,7 @@ const WelcomeForm = (props) => {
"user_id": userId, "user_id": userId,
} }
const url = `${globalUrl}/api/v1/updateuser` const url = `${globalUrl}/api/v1/users/updateuser`
fetch(url, { fetch(url, {
mode: "cors", mode: "cors",
method: "PUT", method: "PUT",
@@ -139,7 +139,7 @@ const WelcomeForm = (props) => {
}); });
} }
const sendOrgUpdate = (orgname, company_type, orgId) => { const sendOrgUpdate = (orgname, company_type, orgId, priority) => {
var data = { var data = {
org_id: orgId, org_id: orgId,
}; };
@@ -152,6 +152,10 @@ const WelcomeForm = (props) => {
data.company_type = company_type data.company_type = company_type
} }
if (priority.length > 0) {
data.priority = priority
}
const url = globalUrl + `/api/v1/orgs/${orgId}`; const url = globalUrl + `/api/v1/orgs/${orgId}`;
fetch(url, { fetch(url, {
mode: "cors", mode: "cors",
@@ -222,7 +226,7 @@ const WelcomeForm = (props) => {
navigate(`/welcome?tab=2`) navigate(`/welcome?tab=2`)
if (userdata.active_org !== undefined && userdata.active_org.id !== undefined && userdata.active_org.id !== null && userdata.active_org.id.length > 0) { if (userdata.active_org !== undefined && userdata.active_org.id !== undefined && userdata.active_org.id !== null && userdata.active_org.id.length > 0) {
sendOrgUpdate(orgName, orgType, userdata.active_org.id) sendOrgUpdate(orgName, orgType, userdata.active_org.id, "")
} }
if (userdata.id !== undefined && userdata.id !== null && userdata.id.length > 0) { if (userdata.id !== undefined && userdata.id !== null && userdata.id.length > 0) {
@@ -294,7 +298,7 @@ const WelcomeForm = (props) => {
} }
const newButtonStyle = { const newButtonStyle = {
padding: 25, padding: 22,
flex: 1, flex: 1,
margin: buttonMargin, margin: buttonMargin,
minWidth: buttonWidth, minWidth: buttonWidth,
@@ -306,6 +310,11 @@ const WelcomeForm = (props) => {
case 0: case 0:
return ( return (
<Grid container spacing={1} style={{width: "100%", marginTop: 20, minHeight: sizing, maxHeight: sizing, }}> <Grid container spacing={1} style={{width: "100%", marginTop: 20, minHeight: sizing, maxHeight: sizing, }}>
{/*isCloud ? null :
<Typography variant="body1" style={{marginLeft: 8, marginTop: 10, marginRight: 30, }} color="textSecondary">
This data will be used within the product and NOT be shared unless <a href="https://shuffler.io/docs/organizations#cloud_synchronization" target="_blank" rel="norefferer" style={{color: "#f86a3e", textDecoration: "none"}}>cloud synchronization</a> is configured.
</Typography>
*/}
<Typography variant="body1" style={{marginLeft: 8, marginTop: 10, marginRight: 30, }} color="textSecondary"> <Typography variant="body1" style={{marginLeft: 8, marginTop: 10, marginRight: 30, }} color="textSecondary">
We need some more information in order to understand how we best can help you find relevant Usecases in Shuffle. Giving us this info is optional, but encouraged. We need some more information in order to understand how we best can help you find relevant Usecases in Shuffle. Giving us this info is optional, but encouraged.
</Typography> </Typography>
@@ -384,8 +393,10 @@ const WelcomeForm = (props) => {
return ( return (
<div style={{minHeight: sizing, maxHeight: sizing, marginTop: 20,}}> <div style={{minHeight: sizing, maxHeight: sizing, marginTop: 20,}}>
<Typography variant="body1" style={{marginLeft: 8, marginTop: 25, marginRight: 30, marginBottom: 0, }} color="textSecondary"> <Typography variant="body1" style={{marginLeft: 8, marginTop: 25, marginRight: 30, marginBottom: 0, }} color="textSecondary">
Find the most relevant apps, then we'll help you find the most relevant workflows Find your apps, then we'll help you find relevant workflows. Can't find what you're looking for? Contact support: <a href="mailto:support@shuffler.io" style={{color: "#f86a3e", textDecoration: "none"}}>support@shuffler.io</a>
</Typography> </Typography>
{/*The app framework helps us access and authenticate the most important APIs for you. */}
{/* {/*
<Grid item xs={10}> <Grid item xs={10}>
<FormControl fullWidth={true}> <FormControl fullWidth={true}>
@@ -461,27 +472,14 @@ const WelcomeForm = (props) => {
) )
case 2: case 2:
return ( return (
<div style={{display: "flex", marginTop: 25, width: 1366, minHeight: sizing, maxHeight: sizing, }}> <div style={{display: "flex", marginTop: 25, width: 1200, minHeight: sizing, maxHeight: sizing, }}>
<Grid item xs={10} style={{width: "100%", flex: 6, }}> <Grid item xs={10} style={{width: "100%", flex: 5, }}>
<Typography variant="body1" style={{}} color="textSecondary"> <Typography variant="body1" style={{marginLeft: 8, marginTop: 0, marginRight: 30, marginBottom: 0, maxWidth: 500, }} color="textSecondary">
What processes are you interested in? This will help us suggest relevant Workflows. What usecases are you interested in? This will help us suggest relevant Workflows.
</Typography> </Typography>
<Grid item xs={5} style={{marginTop: 15, display: "flex", flexDirection: "column", width: "100%",}}> <Grid item xs={5} style={{marginTop: 15, display: "flex", flexDirection: "column", width: "100%",}}>
<Button variant={defaultSearch === "Phishing" ? "contained" : "outlined"} startIcon={<EmailIcon />} style={newButtonStyle} onClick={() => {
console.log("Plus the email comms tool")
setDefaultSearch("Phishing")
setSelectionOpen(false)
setTimeout(function(){
setSelectionOpen(true)
}, 150)
}}>
Phishing
</Button>
<Button variant={defaultSearch === "Enrichment" ? "contained" : "outlined"} startIcon={<SearchIcon />} style={newButtonStyle} onClick={() => { <Button variant={defaultSearch === "Enrichment" ? "contained" : "outlined"} startIcon={<SearchIcon />} style={newButtonStyle} onClick={() => {
console.log("Plus the Intel tool")
setDefaultSearch("Enrichment") setDefaultSearch("Enrichment")
setSelectionOpen(false) setSelectionOpen(false)
@@ -489,31 +487,47 @@ const WelcomeForm = (props) => {
setTimeout(function(){ setTimeout(function(){
setSelectionOpen(true) setSelectionOpen(true)
}, 150) }, 150)
sendOrgUpdate("", "", userdata.active_org.id, "2. Enrich")
}}> }}>
Enrichment Enrichment
</Button> </Button>
<Button variant={defaultSearch === "Detection" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => { <Button variant={defaultSearch === "Phishing" ? "contained" : "outlined"} startIcon={<EmailIcon />} style={newButtonStyle} onClick={() => {
console.log("Plus the siem tool") setDefaultSearch("Phishing")
setSelectionOpen(false)
setTimeout(function(){
setSelectionOpen(true)
}, 150)
sendOrgUpdate("", "", userdata.active_org.id, "Email management")
}}>
Phishing
</Button>
<Button disabled={true} variant={defaultSearch === "Detection" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => {
setDefaultSearch("Detection") setDefaultSearch("Detection")
setSelectionOpen(false) setSelectionOpen(false)
setTimeout(function(){ setTimeout(function(){
setSelectionOpen(true) setSelectionOpen(true)
}, 150); }, 150);
sendOrgUpdate("", "", userdata.active_org.id, "3. Detect")
}}> }}>
Detection Detection
</Button> </Button>
{/* <Button disabled={true} variant={defaultSearch === "Response" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => {
<Button variant="outlined" startIcon={<NewReleasesIcon />} style={{padding: 10, flex: 1, minWidth: buttonWidth, maxWidth: buttonWidth, }} onClick={() => {
console.log("Plus the edr tool")
setDefaultSearch("Response") setDefaultSearch("Response")
setSelectionOpen(true) setSelectionOpen(false)
setTimeout(function(){
setSelectionOpen(true)
}, 150);
sendOrgUpdate("", "", userdata.active_org.id, "4. Respond")
}}> }}>
Response Response
</Button> </Button>
*/}
</Grid> </Grid>
</Grid> </Grid>
{/* {/*
@@ -531,7 +545,7 @@ const WelcomeForm = (props) => {
/> />
</Grid> </Grid>
*/} */}
<div style={{marginTop: 15, flex: 5, }}> <div style={{marginTop: 15, flex: 6, }}>
{selectionOpen === true ? {selectionOpen === true ?
<WorkflowSearch <WorkflowSearch
ConfiguredHits={NewHits} ConfiguredHits={NewHits}
@@ -578,11 +592,6 @@ const WelcomeForm = (props) => {
/> />
: null*/} : null*/}
<div> <div>
{isCloud ? null :
<Typography>
This data will be used within the product and NOT be shared unless <a href="https://shuffler.io/docs/organizations#cloud_synchronization" target="_blank" rel="norefferer" style={{color: "#f86a3e", textDecoration: "none"}}>cloud synchronization</a> is configured.
</Typography>
}
{activeStep === steps.length ? ( {activeStep === steps.length ? (
<div paddingTop="20px"> <div paddingTop="20px">
You Will be Redirected to getting Start Page Wait for 5-sec. You Will be Redirected to getting Start Page Wait for 5-sec.
+1 -1
View File
@@ -2160,7 +2160,7 @@ const GettingStarted = (props) => {
}) })
} }
}}> }}>
<Link to="/detectionframework" style={{textDecoration: "none", color: "#f86a3e",}}>Find relevant apps</Link> and start your automation journey <Link to="/welcome?tab=2" style={{textDecoration: "none", color: "#f86a3e",}}>Find relevant apps</Link> and start your automation journey
</Typography> </Typography>
), ),
tutorial: "find_integrations", tutorial: "find_integrations",
+21 -15
View File
@@ -5,6 +5,7 @@ import {
Grid, Grid,
Container, Container,
Fade, Fade,
Typography,
} from '@mui/material'; } from '@mui/material';
import theme from '../theme'; import theme from '../theme';
import { useNavigate, Link } from "react-router-dom"; import { useNavigate, Link } from "react-router-dom";
@@ -68,21 +69,26 @@ const Welcome = (props) => {
</div> </div>
</Grid> </Grid>
{frameworkData === undefined || window.location.href.includes("tab=3") ? null : {frameworkData === undefined || window.location.href.includes("tab=3") ? null :
<Fade> <div style={{marginTop: 25}}>
<DetectionFramework <Typography variant="h6" style={{textAlign: "center", marginBottom: 25, }}>
inputUsecase={inputUsecase} App Framework
frameworkData={frameworkData} </Typography>
selectedOption={"Draw"} <Fade>
showOptions={false} <DetectionFramework
isLoaded={true} inputUsecase={inputUsecase}
isLoggedIn={true} frameworkData={frameworkData}
globalUrl={globalUrl} selectedOption={"Draw"}
size={0.8} showOptions={false}
color={theme.palette.platformColor} isLoaded={true}
discoveryWrapper={discoveryWrapper} isLoggedIn={true}
setDiscoveryWrapper={setDiscoveryWrapper} globalUrl={globalUrl}
/> size={0.8}
</Fade> color={theme.palette.platformColor}
discoveryWrapper={discoveryWrapper}
setDiscoveryWrapper={setDiscoveryWrapper}
/>
</Fade>
</div>
} }
</Grid> </Grid>
) )