Fixed app creation, RE: json issue

This commit is contained in:
frikky
2020-06-16 17:50:28 +02:00
parent 8ea19ea530
commit d087a53bd6
6 changed files with 49 additions and 18 deletions
+28 -3
View File
@@ -31,6 +31,7 @@ const Admin = (props) => {
const [users, setUsers] = React.useState([]);
const [environments, setEnvironments] = React.useState([]);
const [schedules, setSchedules] = React.useState([])
const [selectedUser, setSelectedUser] = React.useState({})
const alert = useAlert()
@@ -286,6 +287,22 @@ const Admin = (props) => {
modalUser[field] = value
}
const editUserModal =
<Dialog modal
open={modalOpen}
onClose={() => {setModalOpen(false)}}
PaperProps={{
style: {
backgroundColor: surfaceColor,
color: "white",
minWidth: "800px",
minHeight: "320px",
},
}}
>
<DialogTitle><span style={{color: "white"}}>Add user</span></DialogTitle>
</Dialog>
const modalView =
<Dialog modal
open={modalOpen}
@@ -452,17 +469,24 @@ const Admin = (props) => {
<ListItemText
primary={data.active ? "True" : "False"}
style={{minWidth: 180, maxWidth: 180}}
onClick={() => console.log("Should set user to active")}
/>
<ListItemText>
<ListItemText style={{display: "flex"}}>
<Button
style={{}}
variant="contained"
variant="outlined"
color="primary"
onClick={() => deleteUser(data)}
>
{data.active ? "Deactivate" : "Activate"}
</Button>
<Button
style={{}}
variant="outlined"
color="primary"
onClick={() => deleteUser(data)}
>
Edit
</Button>
</ListItemText>
</ListItem>
)
@@ -581,6 +605,7 @@ const Admin = (props) => {
return (
<div>
{modalView}
{editUserModal}
{data}
</div>
)
+2 -2
View File
@@ -639,7 +639,7 @@ const AppCreator = (props) => {
}
}
if (item.body.length > 0) {
if (item.body !== undefined && item.body.length > 0) {
const required = false
newitem = {
"in": "body",
@@ -1525,7 +1525,7 @@ const AppCreator = (props) => {
// <img src={file} id="logo" style={{width: "100%", height: "100%"}} />
const imageData = file.length > 0 ? file : fileBase64
const imageInfo = <img src={imageData} alt="Click to upload an image" id="logo" style={{maxWidth: 174, maxHeight: 174,}} />
const imageInfo = <img src={imageData} alt="Click to upload an image (174x174)" id="logo" style={{maxWidth: 174, maxHeight: 174,}} />
// Random names for type & autoComplete. Didn't research :^)
const landingpageDataBrowser =
+1 -1
View File
@@ -183,7 +183,7 @@ const Settings = (props) => {
<div style={{display: "flex", marginTop: "80px"}}>
<Paper style={boxStyle}>
<h2>APIKEY</h2>
<Link to="/docs/api#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is the API key used for?</Link>
<Link to="/docs/API#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is the API key used for?</Link>
<TextField
style={{backgroundColor: inputColor, flex: "1"}}
InputProps={{