diff --git a/backend/go-app/main.go b/backend/go-app/main.go
index 50f87d66..718ac5a8 100644
--- a/backend/go-app/main.go
+++ b/backend/go-app/main.go
@@ -1270,6 +1270,10 @@ func checkAdminLogin(resp http.ResponseWriter, request *http.Request) {
redirectUrl = url.QueryEscape(fmt.Sprintf("%s/api/v1/login_openid", os.Getenv("BASE_URL")))
}
+ if len(os.Getenv("SSO_REDIRECT_URL")) > 0 {
+ redirectUrl = url.QueryEscape(fmt.Sprintf("%s/api/v1/login_openid", os.Getenv("SSO_REDIRECT_URL")))
+ }
+
state := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("org=%s&challenge=%s&redirect=%s", org.Id, codeChallenge, redirectUrl)))
// has to happen after initial value is stored
diff --git a/frontend/package.json b/frontend/package.json
index ff3cdef7..d6d5577c 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -9,7 +9,6 @@
"@emotion/react": "^11.7.0",
"@emotion/styled": "^11.6.0",
"@material-ui/core": "^4.5.2",
- "@material-ui/data-grid": "^4.0.0-alpha.22",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.58",
"@material-ui/styles": "^4.5.2",
@@ -17,6 +16,7 @@
"@metamask/detect-provider": "^1.2.0",
"@mui/icons-material": "^5.2.1",
"@mui/material": "^5.2.3",
+ "@mui/x-data-grid": "^5.15.0",
"@uiw/react-codemirror": "^3.2.1",
"@use-it/interval": "^1.0.0",
"algoliasearch": "^4.13.1",
diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx
index 4a746939..a386bb9a 100644
--- a/frontend/src/components/ParsedAction.jsx
+++ b/frontend/src/components/ParsedAction.jsx
@@ -3211,7 +3211,6 @@ const ParsedAction = (props) => {
setSelectedAction(selectedAction);
setUpdate(Math.random());
} else {
- //console.log("CHOSE AN AUTHENTICATION OPTION: ", e.target.value)
selectedAction.selectedAuthentication = e.target.value;
selectedAction.authentication_id = e.target.value.id;
setSelectedAction(selectedAction);
diff --git a/frontend/src/components/WelcomeForm.jsx b/frontend/src/components/WelcomeForm.jsx
index 3009a083..58a1e8e9 100644
--- a/frontend/src/components/WelcomeForm.jsx
+++ b/frontend/src/components/WelcomeForm.jsx
@@ -4,9 +4,12 @@ import Step from "@material-ui/core/Step";
import StepLabel from "@material-ui/core/StepLabel";
import Button from "@material-ui/core/Button";
import Checkbox from '@mui/material/Checkbox';
+
import SearchIcon from '@mui/icons-material/Search';
import EmailIcon from '@mui/icons-material/Email';
import NewReleasesIcon from '@mui/icons-material/NewReleases';
+import ExtensionIcon from '@mui/icons-material/Extension';
+
import theme from '../theme';
import {
FormGroup,
@@ -422,7 +425,9 @@ const WelcomeForm = (props) => {
- } onClick={(event) => { onNodeSelect("INTEL") }} >
+ } onClick={(event) => { onNodeSelect("INTEL") }} >
+
+
Intel
} onClick={(event) => { onNodeSelect("EMAIL") }} >
diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx
index d825a5b9..67aebd13 100644
--- a/frontend/src/views/AngularWorkflow.jsx
+++ b/frontend/src/views/AngularWorkflow.jsx
@@ -2561,7 +2561,7 @@ const AngularWorkflow = (defaultprops) => {
//var curaction = JSON.parse(JSON.stringify(data))
// FIXME: Trust it to just work?
//event.target.data()
- var curaction = workflow.actions.find((a) => a.id === data.id);
+ var curaction = workflow.actions.find((a) => a.id === data.id)
if (!curaction || curaction === undefined) {
console.log("NOT FOUND DATA: ", event.target.data())
if (data.id !== undefined && data.app_name !== undefined) {
@@ -2584,14 +2584,22 @@ const AngularWorkflow = (defaultprops) => {
newapps = filteredApps
}
- const curapp = newapps.find(
- (a) =>
- a.name === curaction.app_name &&
- (a.app_version === curaction.app_version ||
- (a.loop_versions !== null &&
- a.loop_versions.includes(curaction.app_version)))
- );
+ // Check ID first, then names etc
+ // That way it always selects the right IF it exists
+ var curapp = newapps.find((a) =>
+ a.id === curaction.app_id
+ )
+ if (curapp === undefined || curapp === null) {
+ console.log("Couldn't find ID - checking with name & version")
+
+ curapp = newapps.find((a) =>
+ a.name === curaction.app_name &&
+ (a.app_version === curaction.app_version ||
+ (a.loop_versions !== null &&
+ a.loop_versions.includes(curaction.app_version)))
+ )
+ }
if (curaction.template === true) {
//newapps.
@@ -2619,7 +2627,7 @@ const AngularWorkflow = (defaultprops) => {
}
if (!curapp || curapp === undefined) {
- console.log("APPS: ", newapps)
+ console.log("APPS - couldn't find it: ", newapps)
//alert.error(`App ${curaction.app_name}:${curaction.app_version} not found. Is it activated?`);
const tmpapp = {
@@ -2640,22 +2648,18 @@ const AngularWorkflow = (defaultprops) => {
}
setAuthenticationType(
- curapp.authentication.type === "oauth2" &&
- curapp.authentication.redirect_uri !== undefined &&
- curapp.authentication.redirect_uri !== null
- ? {
- type: "oauth2",
- redirect_uri: curapp.authentication.redirect_uri,
- refresh_uri: curapp.authentication.refresh_uri,
- token_uri: curapp.authentication.token_uri,
- scope: curapp.authentication.scope,
- client_id: curapp.authentication.client_id,
- client_secret: curapp.authentication.client_secret,
- }
- : {
- type: "",
- }
- );
+ curapp.authentication.type === "oauth2" && curapp.authentication.redirect_uri !== undefined && curapp.authentication.redirect_uri !== null ? {
+ type: "oauth2",
+ redirect_uri: curapp.authentication.redirect_uri,
+ refresh_uri: curapp.authentication.refresh_uri,
+ token_uri: curapp.authentication.token_uri,
+ scope: curapp.authentication.scope,
+ client_id: curapp.authentication.client_id,
+ client_secret: curapp.authentication.client_secret,
+ } : {
+ type: "",
+ }
+ )
const requiresAuth = curapp.authentication.required; //&& ((curapp.authentication.parameters !== undefined && curapp.authentication.parameters !== null) || (curapp.authentication.type === "oauth2" && curapp.authentication.redirect_uri !== undefined && curapp.authentication.redirect_uri !== null))
setRequiresAuthentication(requiresAuth);
@@ -2672,15 +2676,15 @@ const AngularWorkflow = (defaultprops) => {
findAuthId = curaction.authentication_id;
}
- var tmpAuth = JSON.parse(JSON.stringify(newAppAuth));
+ const tmpAuth = JSON.parse(JSON.stringify(newAppAuth));
+ //var tmpAuth = newAppAuth
for (var key in tmpAuth) {
var item = tmpAuth[key];
const newfields = {};
for (var filterkey in item.fields) {
- newfields[item.fields[filterkey].key] =
- item.fields[filterkey].value;
+ newfields[item.fields[filterkey].key] = item.fields[filterkey].value;
}
item.fields = newfields;
@@ -5544,23 +5548,29 @@ const AngularWorkflow = (defaultprops) => {
findAuthId = newAppData.authentication_id;
}
- console.log("Found auth: ", findAuthId)
- var tmpAuth = JSON.parse(JSON.stringify(appAuthentication));
+ const tmpAuth = JSON.parse(JSON.stringify(appAuthentication));
for (var key in tmpAuth) {
var item = tmpAuth[key];
const newfields = {};
for (var filterkey in item.fields) {
- newfields[item.fields[filterkey].key] =
- item.fields[filterkey].value;
+ newfields[item.fields[filterkey].key] = item.fields[filterkey].value;
}
item.fields = newfields;
- if (item.app.name === app.name) {
+ if (item.app.id === app.id || item.app.name === app.name) {
authenticationOptions.push(item);
- if (item.id === findAuthId) {
- newAppData.selectedAuthentication = item;
- }
+
+ if (item.id === findAuthId) {
+ newAppData.selectedAuthentication = item
+ newAppData.authentication_id = item.id
+
+ } else if (findAuthId === "") {
+ // Will always be set to the last one if one isn't found.
+ // Last = timestamp too
+ newAppData.selectedAuthentication = item
+ newAppData.authentication_id = item.id
+ }
}
}
@@ -5571,7 +5581,8 @@ const AngularWorkflow = (defaultprops) => {
) {
for (var key in authenticationOptions) {
const option = authenticationOptions[key];
- if (option.active) {
+
+ if (option.active && newAppData.authentication_id === "") {
newAppData.selectedAuthentication = option;
newAppData.authentication_id = option.id;
break;