Fixed more org related functionality

This commit is contained in:
frikky
2020-10-31 09:11:00 +01:00
parent fdba86f9c3
commit a6a5bc9d30
10 changed files with 405 additions and 247 deletions
+2 -2
View File
@@ -1136,9 +1136,9 @@ const Admin = (props) => {
}}
>
Edit user
</Button>
</Button>
</ListItemText>
</ListItem>
</ListItem>
)
})}
</List>
File diff suppressed because one or more lines are too long
-4
View File
@@ -160,10 +160,6 @@ const LoginDialog = props => {
//var loginChange = register ? (<div><p onClick={setLoginCheck(false)}>Want to register? Click here.</p></div>) : (<div><p onClick={setLoginCheck(true)}>Go back to login? Click here.</p></div>);
var formtitle = register ? <div>Login</div> : <div>Register</div>
// <DialogTitle>{formtitle}</DialogTitle>
console.log("THEME: ", theme.palette.surfaceColor)
const basedata =
<div style={bodyDivStyle}>
<Paper style={{
+34 -6
View File
@@ -33,7 +33,6 @@ import {Link} from 'react-router-dom';
import { useAlert } from "react-alert";
import ChipInput from 'material-ui-chip-input'
import Dialog from '@material-ui/core/Dialog';
import DialogTitle from '@material-ui/core/DialogTitle';
import DialogActions from '@material-ui/core/DialogActions';
@@ -44,7 +43,7 @@ const inputColor = "#383B40"
const surfaceColor = "#27292D"
const Workflows = (props) => {
const { globalUrl, isLoggedIn, isLoaded, } = props;
const { globalUrl, isLoggedIn, isLoaded, removeCookie, cookies} = props;
document.title = "Shuffle - Workflows"
const alert = useAlert()
@@ -83,6 +82,31 @@ const Workflows = (props) => {
}
})
// DEBUG HERE
const handleClickLogout = () => {
//console.log("Cookies: ", cookies)
//console.log("SHOULD LOG OUT")
//console.log(isLoggedIn)
// Don't really care about the logout
//fetch(globalUrl+"/api/v1/logout", {
// credentials: "include",
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// },
//})
//.then(() => {
// // Log out anyway
// removeCookie("session_token", {path: "/"})
// //window.location = "/login"
//})
//.catch(error => {
// console.log(error)
// removeCookie("session_token", {path: "/"})
//});
}
const deleteModal = deleteModalOpen ?
<Dialog
open={deleteModalOpen}
@@ -124,13 +148,13 @@ const Workflows = (props) => {
const getAvailableWorkflows = () => {
fetch(globalUrl+"/api/v1/workflows", {
method: 'GET',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
credentials: "include",
})
credentials: "include",
})
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for workflows :O!")
@@ -149,7 +173,7 @@ const Workflows = (props) => {
if (isLoggedIn) {
alert.error("An error occurred while loading workflows")
} else {
window.location = "/login"
handleClickLogout()
}
return
@@ -586,6 +610,10 @@ const Workflows = (props) => {
return null
}
if (data.workflow.actions === null || data.workflow.actions === undefined) {
return null
}
var actions = data.workflow.actions.length
if (data.results !== null) {
var results = data.results.length