Fixed auto redirect for welcome pages

This commit is contained in:
frikky
2022-07-25 03:16:43 +02:00
parent d3e02de38f
commit 14c41faa78
6 changed files with 36 additions and 16 deletions
+6 -2
View File
@@ -1050,7 +1050,11 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
}
}
tutorialsFinished := []string{}
tutorialsFinished := userInfo.PersonalInfo.Tutorials
if len(org.SecurityFramework.SIEM.Name) > 0 || len(org.SecurityFramework.Network.Name) > 0 || len(org.SecurityFramework.EDR.Name) > 0 || len(org.SecurityFramework.Cases.Name) > 0 || len(org.SecurityFramework.IAM.Name) > 0 || len(org.SecurityFramework.Assets.Name) > 0 || len(org.SecurityFramework.Intel.Name) > 0 || len(org.SecurityFramework.Communication.Name) > 0 {
tutorialsFinished = append(tutorialsFinished, "find_integrations")
}
returnValue := shuffle.HandleInfo{
Success: true,
Username: userInfo.Username,
@@ -1066,8 +1070,8 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
},
},
EthInfo: userInfo.EthInfo,
Tutorials: tutorialsFinished,
ChatDisabled: chatDisabled,
Tutorials: tutorialsFinished,
Priorities: orgPriorities,
}
+13 -9
View File
@@ -1533,6 +1533,7 @@ const ParsedAction = (props) => {
multiline = data.name.startsWith("${") && data.name.endsWith("}") ? true : multiline
console.log("Next to datafield")
var datafield = (
<TextField
disabled={disabled}
@@ -1669,8 +1670,9 @@ const ParsedAction = (props) => {
);
// Finds headers from a string to be used for autocompletion
console.log("Before header update")
const findHeaders = (inputdata) => {
const splitdata = inputdata.split("\n")
var splitdata = inputdata.split("\n")
var foundnewline = false
var allValues = []
@@ -1681,7 +1683,7 @@ const ParsedAction = (props) => {
continue
}
const splitvalue = ""
var splitvalue = ""
if (line.includes(":")) {
splitvalue = ":"
}
@@ -1698,7 +1700,7 @@ const ParsedAction = (props) => {
continue
}
const splitKeys = line.split(splitvalue)
var splitKeys = line.split(splitvalue)
if (splitKeys.length > 1) {
allValues.push({
key: splitKeys[0].trim(),
@@ -1760,7 +1762,7 @@ const ParsedAction = (props) => {
var newarr = []
for (var key in valsplit) {
const line = valsplit[key]
var line = valsplit[key]
if (key == index) {
if (oldkey === "") {
@@ -1778,7 +1780,7 @@ const ParsedAction = (props) => {
}
}
const newval = newarr.join("\n")
var newval = newarr.join("\n")
console.log("Fixed: ", newval)
selectedActionParameters[count].value = newval
@@ -1796,7 +1798,7 @@ const ParsedAction = (props) => {
// Find the right line to replace!
//const newval = selectedActionParameters[count].value.replace(oldval, e.target.value, 1)
const tmpsplit = selectedActionParameters[count].value.split("\n")
var tmpsplit = selectedActionParameters[count].value.split("\n")
var valsplit = []
var add_empty = false
for (var key in tmpsplit) {
@@ -1815,7 +1817,7 @@ const ParsedAction = (props) => {
var newarr = []
for (var key in valsplit) {
const line = valsplit[key]
var line = valsplit[key]
if (key == index) {
if (oldval === "") {
@@ -1833,7 +1835,7 @@ const ParsedAction = (props) => {
}
}
const newval = newarr.join("\n")
var newval = newarr.join("\n")
console.log("Fixed: ", newval)
selectedActionParameters[count].value = newval
@@ -1860,6 +1862,8 @@ const ParsedAction = (props) => {
</div>
}
console.log("After header update")
//console.log("FIELD VALUE: ", data.value)
//const regexp = new RegExp("\W+\.", "g")
//let match
@@ -3521,7 +3525,7 @@ const ParsedAction = (props) => {
}
console.log("NO BASEURL TOO!! Why missing last one in certain scenarios (sevco)?", extraUrl, urlsplit, descSplit[line])
//console.log("NO BASEURL TOO!! Why missing last one in certain scenarios (sevco)?", extraUrl, urlsplit, descSplit[line])
break
}
}
+2 -1
View File
@@ -83,7 +83,7 @@ const SearchField = props => {
*/
return (
<form id="search_form" noValidate type="searchbox" action="" role="search" style={{margin: isCloud ? 10 : 0, }} onClick={() => {
<form id="search_form" noValidate type="searchbox" action="" role="search" style={{margin: 0, }} onClick={() => {
}}>
<TextField
fullWidth
@@ -93,6 +93,7 @@ const SearchField = props => {
color: "white",
fontSize: "1em",
height: 50,
margin: 0,
},
startAdornment: (
<InputAdornment position="start">
+1 -1
View File
@@ -316,7 +316,7 @@ const WelcomeForm = (props) => {
</Typography>
*/}
<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.
</Typography>
<Grid item xs={11} style={{marginTop: 16, padding: 0,}}>
<TextField
+2
View File
@@ -2748,6 +2748,8 @@ const AngularWorkflow = (defaultprops) => {
left: 0,
selected: "",
});
console.log("DOne in the node update")
})
}
+12 -3
View File
@@ -184,13 +184,22 @@ const LoginDialog = (props) => {
);
}
setIsLoggedIn(true);
if (!responseJson.tutorials.includes("welcome")) {
if (responseJson.tutorials === undefined || responseJson.tutorials === null || !responseJson.tutorials.includes("welcome")) {
console.log("RUN Welcome!!")
window.location.pathname = "/welcome"
return
}
window.location.href = "/workflows"
const tmpView = new URLSearchParams(window.location.search).get("view")
if (tmpView !== undefined && tmpView !== null) {
//const newUrl = `/${tmpView}${decodeURIComponent(window.location.search)}`
const newUrl = `/${tmpView}`
window.location.pathname = newUrl
} else {
window.location.pathname = "/workflows"
}
setIsLoggedIn(true);
}
})
)