#105: Fixed app updates and cloud init
This commit is contained in:
@@ -398,7 +398,7 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet
|
|||||||
verifyAddin,
|
verifyAddin,
|
||||||
)
|
)
|
||||||
|
|
||||||
log.Printf("%s", data)
|
//log.Printf("%s", data)
|
||||||
return functionname, data
|
return functionname, data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-2
@@ -662,7 +662,7 @@ func handleApiAuthentication(resp http.ResponseWriter, request *http.Request) (U
|
|||||||
if len(Userdata.Username) > 0 {
|
if len(Userdata.Username) > 0 {
|
||||||
return Userdata, nil
|
return Userdata, nil
|
||||||
} else {
|
} else {
|
||||||
return Userdata, errors.New("User is invalid")
|
return Userdata, errors.New(fmt.Sprintf("User is invalid - no username found: %#v", Userdata))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1605,8 +1605,11 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is a long check to see if an inactive admin can access the site
|
// This is a long check to see if an inactive admin can access the site
|
||||||
|
parsedAdmin := "false"
|
||||||
if !userInfo.Active {
|
if !userInfo.Active {
|
||||||
if userInfo.Role == "admin" {
|
if userInfo.Role == "admin" {
|
||||||
|
parsedAdmin = "true"
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
q := datastore.NewQuery("Users")
|
q := datastore.NewQuery("Users")
|
||||||
var users []User
|
var users []User
|
||||||
@@ -1672,7 +1675,14 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
|
|||||||
Expires: expiration,
|
Expires: expiration,
|
||||||
})
|
})
|
||||||
|
|
||||||
returnData := fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]}`, userInfo.Session, expiration.Unix())
|
returnData := fmt.Sprintf(`
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"admin": %s,
|
||||||
|
"orgs": [{"name": "Shuffle", "id": "123", "role": "admin"}],
|
||||||
|
"selected_org": {"name": "Shuffle", "id": "123", "role": "admin"},
|
||||||
|
"cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]
|
||||||
|
}`, parsedAdmin, userInfo.Session, expiration.Unix())
|
||||||
|
|
||||||
resp.WriteHeader(200)
|
resp.WriteHeader(200)
|
||||||
resp.Write([]byte(returnData))
|
resp.Write([]byte(returnData))
|
||||||
|
|||||||
+135
-16
@@ -2,6 +2,8 @@ import React, { useEffect} from 'react';
|
|||||||
|
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
import Paper from '@material-ui/core/Paper';
|
import Paper from '@material-ui/core/Paper';
|
||||||
|
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
||||||
|
import Switch from '@material-ui/core/Switch';
|
||||||
import Select from '@material-ui/core/Select';
|
import Select from '@material-ui/core/Select';
|
||||||
import MenuItem from '@material-ui/core/MenuItem';
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
import List from '@material-ui/core/List';
|
import List from '@material-ui/core/List';
|
||||||
@@ -21,7 +23,13 @@ import DialogTitle from '@material-ui/core/DialogTitle';
|
|||||||
import DialogActions from '@material-ui/core/DialogActions';
|
import DialogActions from '@material-ui/core/DialogActions';
|
||||||
import DialogContent from '@material-ui/core/DialogContent';
|
import DialogContent from '@material-ui/core/DialogContent';
|
||||||
|
|
||||||
|
import AccessibilityNewIcon from '@material-ui/icons/AccessibilityNew';
|
||||||
import CachedIcon from '@material-ui/icons/Cached';
|
import CachedIcon from '@material-ui/icons/Cached';
|
||||||
|
import LockIcon from '@material-ui/icons/Lock';
|
||||||
|
import BusinessIcon from '@material-ui/icons/Business';
|
||||||
|
import EcoIcon from '@material-ui/icons/Eco';
|
||||||
|
import ScheduleIcon from '@material-ui/icons/Schedule';
|
||||||
|
import CloudIcon from '@material-ui/icons/Cloud';
|
||||||
|
|
||||||
const surfaceColor = "#27292D"
|
const surfaceColor = "#27292D"
|
||||||
const inputColor = "#383B40"
|
const inputColor = "#383B40"
|
||||||
@@ -459,7 +467,7 @@ const Admin = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const editAuthenticationModal =
|
const editAuthenticationModal =
|
||||||
<Dialog modal
|
<Dialog
|
||||||
open={selectedAuthenticationModalOpen}
|
open={selectedAuthenticationModalOpen}
|
||||||
onClose={() => {setSelectedAuthenticationModalOpen(false)}}
|
onClose={() => {setSelectedAuthenticationModalOpen(false)}}
|
||||||
PaperProps={{
|
PaperProps={{
|
||||||
@@ -523,7 +531,7 @@ const Admin = (props) => {
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
const editUserModal =
|
const editUserModal =
|
||||||
<Dialog modal
|
<Dialog
|
||||||
open={selectedUserModalOpen}
|
open={selectedUserModalOpen}
|
||||||
onClose={() => {setSelectedUserModalOpen(false)}}
|
onClose={() => {setSelectedUserModalOpen(false)}}
|
||||||
PaperProps={{
|
PaperProps={{
|
||||||
@@ -587,7 +595,7 @@ const Admin = (props) => {
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
const modalView =
|
const modalView =
|
||||||
<Dialog modal
|
<Dialog
|
||||||
open={modalOpen}
|
open={modalOpen}
|
||||||
onClose={() => {setModalOpen(false)}}
|
onClose={() => {setModalOpen(false)}}
|
||||||
PaperProps={{
|
PaperProps={{
|
||||||
@@ -600,7 +608,7 @@ const Admin = (props) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DialogTitle><span style={{color: "white"}}>
|
<DialogTitle><span style={{color: "white"}}>
|
||||||
{curTab === 0 ? "Add user" : "Add environment"}
|
{curTab === 0 ? "Add user" : curTab === 2 ? "Add environment" : "Add organization"}
|
||||||
</span></DialogTitle>
|
</span></DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
{curTab === 0 ?
|
{curTab === 0 ?
|
||||||
@@ -671,7 +679,30 @@ const Admin = (props) => {
|
|||||||
onChange={(event) => changeModalData("environment", event.target.value)}
|
onChange={(event) => changeModalData("environment", event.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
: null }
|
:
|
||||||
|
<div>
|
||||||
|
Org Name
|
||||||
|
<TextField
|
||||||
|
color="primary"
|
||||||
|
style={{backgroundColor: inputColor}}
|
||||||
|
autoFocus
|
||||||
|
InputProps={{
|
||||||
|
style:{
|
||||||
|
height: "50px",
|
||||||
|
color: "white",
|
||||||
|
fontSize: "1em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
required
|
||||||
|
fullWidth={true}
|
||||||
|
placeholder="datacenter froglantern"
|
||||||
|
id="environment_name"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
onChange={(event) => changeModalData("organization", event.target.value)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
{loginInfo}
|
{loginInfo}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
@@ -731,7 +762,7 @@ const Admin = (props) => {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
{users === undefined ? null : users.map(data => {
|
{users === undefined ? null : users.map(data => {
|
||||||
return (
|
return (
|
||||||
<ListItem>
|
<ListItem key={data.id}>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={data.username}
|
primary={data.username}
|
||||||
style={{minWidth: 200, maxWidth: 200}}
|
style={{minWidth: 200, maxWidth: 200}}
|
||||||
@@ -743,10 +774,6 @@ const Admin = (props) => {
|
|||||||
<ListItemText
|
<ListItemText
|
||||||
primary=
|
primary=
|
||||||
<Select
|
<Select
|
||||||
PaperProps={{
|
|
||||||
style: {
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
SelectDisplayProps={{
|
SelectDisplayProps={{
|
||||||
style: {
|
style: {
|
||||||
marginLeft: 10,
|
marginLeft: 10,
|
||||||
@@ -977,7 +1004,7 @@ const Admin = (props) => {
|
|||||||
style={{minWidth: 200, maxWidth: 200, overflow: "hidden"}}
|
style={{minWidth: 200, maxWidth: 200, overflow: "hidden"}}
|
||||||
/>
|
/>
|
||||||
<ListItemText>
|
<ListItemText>
|
||||||
<Button type="outlined" style={{borderRadius: "0px"}} onClick={() => deleteEnvironment(environment.Name)} color="primary">Delete</Button>
|
<Button variant="outlined" style={{borderRadius: "0px"}} onClick={() => deleteEnvironment(environment.Name)} color="primary">Delete</Button>
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
)
|
)
|
||||||
@@ -986,6 +1013,94 @@ const Admin = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
: null
|
: null
|
||||||
|
|
||||||
|
const organizationsTab = curTab === 5 ?
|
||||||
|
<div>
|
||||||
|
<div style={{marginTop: 20, marginBottom: 20,}}>
|
||||||
|
<h2 style={{display: "inline",}}>Organizations</h2>
|
||||||
|
<span style={{marginLeft: 25}}>Global admin: control organizations</span>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
style={{}}
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
onClick={() => setModalOpen(true)}
|
||||||
|
>
|
||||||
|
Add organization
|
||||||
|
</Button>
|
||||||
|
<Divider style={{marginTop: 20, marginBottom: 20, backgroundColor: inputColor}}/>
|
||||||
|
<List>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemText
|
||||||
|
primary="Name"
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary="Orborus running (TBD)"
|
||||||
|
style={{minWidth: 200, maxWidth: 200}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary="Actions"
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemText
|
||||||
|
primary="Enabled"
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary="false"
|
||||||
|
style={{minWidth: 200, maxWidth: 200}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary=<Switch checked={false} onChange={() => {console.log("INVERT")}} />
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
</List>
|
||||||
|
</div>
|
||||||
|
: null
|
||||||
|
|
||||||
|
const hybridTab = curTab === 4 ?
|
||||||
|
<div>
|
||||||
|
<div style={{marginTop: 20, marginBottom: 20,}}>
|
||||||
|
<h2 style={{display: "inline",}}>Hybrid</h2>
|
||||||
|
<span style={{marginLeft: 25}}></span>
|
||||||
|
</div>
|
||||||
|
<Divider style={{marginTop: 20, marginBottom: 20, backgroundColor: inputColor}}/>
|
||||||
|
<List>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemText
|
||||||
|
primary="Name"
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary="Orborus running (TBD)"
|
||||||
|
style={{minWidth: 200, maxWidth: 200}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary="Actions"
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemText
|
||||||
|
primary="Enabled"
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary="false"
|
||||||
|
style={{minWidth: 200, maxWidth: 200}}
|
||||||
|
/>
|
||||||
|
<ListItemText
|
||||||
|
primary=<Switch checked={false} onChange={() => {console.log("INVERT")}} />
|
||||||
|
style={{minWidth: 150, maxWidth: 150}}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
</List>
|
||||||
|
</div>
|
||||||
|
: null
|
||||||
|
|
||||||
// primary={environment.Registered ? "true" : "false"}
|
// primary={environment.Registered ? "true" : "false"}
|
||||||
|
|
||||||
const setConfig = (event, newValue) => {
|
const setConfig = (event, newValue) => {
|
||||||
@@ -1001,20 +1116,22 @@ const Admin = (props) => {
|
|||||||
setCurTab(newValue)
|
setCurTab(newValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iconStyle = {marginRight: 10}
|
||||||
const data =
|
const data =
|
||||||
<div style={{minWidth: 1366, margin: "auto"}}>
|
<div style={{minWidth: 1366, margin: "auto"}}>
|
||||||
<Paper style={paperStyle}>
|
<Paper style={paperStyle}>
|
||||||
<Tabs
|
<Tabs
|
||||||
value={curTab}
|
value={curTab}
|
||||||
indicatorColor="primary"
|
indicatorColor="primary"
|
||||||
textColor="white"
|
|
||||||
onChange={setConfig}
|
onChange={setConfig}
|
||||||
aria-label="disabled tabs example"
|
aria-label="disabled tabs example"
|
||||||
>
|
>
|
||||||
<Tab label="Users" />
|
<Tab label=<span><AccessibilityNewIcon style={iconStyle} />Users</span> />
|
||||||
<Tab label="App Authentication"/>
|
<Tab label=<span><LockIcon style={iconStyle} />App Authentication</span>/>
|
||||||
<Tab label="Environments"/>
|
<Tab label=<span><EcoIcon style={iconStyle} />Environments</span>/>
|
||||||
<Tab label="Schedules"/>
|
<Tab label=<span><ScheduleIcon style={iconStyle} />Schedules</span> />
|
||||||
|
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><CloudIcon style={iconStyle} /> Hybrid</span>/> : null}
|
||||||
|
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><BusinessIcon style={iconStyle} /> Organizations</span>/> : null}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<Divider style={{marginTop: 0, marginBottom: 10, backgroundColor: "rgb(91, 96, 100)"}} />
|
<Divider style={{marginTop: 0, marginBottom: 10, backgroundColor: "rgb(91, 96, 100)"}} />
|
||||||
<div style={{padding: 15}}>
|
<div style={{padding: 15}}>
|
||||||
@@ -1022,6 +1139,8 @@ const Admin = (props) => {
|
|||||||
{usersView}
|
{usersView}
|
||||||
{environmentView}
|
{environmentView}
|
||||||
{schedulesView}
|
{schedulesView}
|
||||||
|
{hybridTab}
|
||||||
|
{organizationsTab}
|
||||||
</div>
|
</div>
|
||||||
</Paper>
|
</Paper>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -950,6 +950,10 @@ const AngularWorkflow = (props) => {
|
|||||||
if (curaction.selectedAuthentication === null || curaction.selectedAuthentication === undefined || curaction.selectedAuthentication.length === "") {
|
if (curaction.selectedAuthentication === null || curaction.selectedAuthentication === undefined || curaction.selectedAuthentication.length === "") {
|
||||||
curaction.selectedAuthentication = {}
|
curaction.selectedAuthentication = {}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
curaction.authentication = []
|
||||||
|
curaction.authentication_id = ""
|
||||||
|
curaction.selectedAuthentication = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
setSelectedApp(curapp)
|
setSelectedApp(curapp)
|
||||||
@@ -2998,7 +3002,7 @@ const AngularWorkflow = (props) => {
|
|||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
minHeight: "100%",
|
minHeight: "100%",
|
||||||
zIndex: 1000,
|
zIndex: 1000,
|
||||||
resize: "horizontal",
|
resize: "vertical",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -31,8 +31,8 @@ import LandingPageNew from "./LandingpageNew";
|
|||||||
import LoginPage from "./LoginPage";
|
import LoginPage from "./LoginPage";
|
||||||
import SettingsPage from "./SettingsPage";
|
import SettingsPage from "./SettingsPage";
|
||||||
|
|
||||||
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
|
//import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
|
||||||
import { createMuiTheme } from '@material-ui/core/styles';
|
import { createMuiTheme, ThemeProvider as MuiThemeProvider } from '@material-ui/core/styles';
|
||||||
|
|
||||||
import AlertTemplate from "react-alert-template-basic";
|
import AlertTemplate from "react-alert-template-basic";
|
||||||
import { positions, Provider } from "react-alert";
|
import { positions, Provider } from "react-alert";
|
||||||
@@ -100,6 +100,7 @@ const App = (message, props) => {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(responseJson => {
|
.then(responseJson => {
|
||||||
if (responseJson.success === true) {
|
if (responseJson.success === true) {
|
||||||
|
console.log(responseJson)
|
||||||
setUserData(responseJson)
|
setUserData(responseJson)
|
||||||
setIsLoggedIn(true)
|
setIsLoggedIn(true)
|
||||||
|
|
||||||
@@ -127,7 +128,7 @@ const App = (message, props) => {
|
|||||||
<Route exact path="/home" render={props => <LandingPageNew isLoaded={isLoaded} {...props} /> } />
|
<Route exact path="/home" render={props => <LandingPageNew isLoaded={isLoaded} {...props} /> } />
|
||||||
</div> :
|
</div> :
|
||||||
<div style={{backgroundColor: "#1F2023", color: "rgba(255, 255, 255, 0.65)", minHeight: "100vh"}}>
|
<div style={{backgroundColor: "#1F2023", color: "rgba(255, 255, 255, 0.65)", minHeight: "100vh"}}>
|
||||||
<Header removeCookie={removeCookie} isLoaded={isLoaded} globalUrl={globalUrl} setIsLoggedIn={setIsLoggedIn} isLoggedIn={isLoggedIn} surfaceColor={surfaceColor} inputColor={inputColor}{...props} />
|
<Header removeCookie={removeCookie} surfaceColor={surfaceColor} inputColor={inputColor} userdata={userdata} isLoaded={isLoaded} globalUrl={globalUrl} setIsLoggedIn={setIsLoggedIn} isLoggedIn={isLoggedIn} surfaceColor={surfaceColor} inputColor={inputColor}{...props} />
|
||||||
<Route exact path="/oauth2" render={props => <Oauth2 isLoaded={isLoaded} globalUrl={globalUrl} surfaceColor={surfaceColor} inputColor={inputColor}{...props} /> } />
|
<Route exact path="/oauth2" render={props => <Oauth2 isLoaded={isLoaded} globalUrl={globalUrl} surfaceColor={surfaceColor} inputColor={inputColor}{...props} /> } />
|
||||||
<Route exact path="/contact" render={props => <Contact isLoaded={isLoaded} globalUrl={globalUrl} surfaceColor={surfaceColor} inputColor={inputColor} {...props} /> } />
|
<Route exact path="/contact" render={props => <Contact isLoaded={isLoaded} globalUrl={globalUrl} surfaceColor={surfaceColor} inputColor={inputColor} {...props} /> } />
|
||||||
<Route exact path="/login" render={props => <LoginPage isLoggedIn={isLoggedIn} setIsLoggedIn={setIsLoggedIn} register={true} isLoaded={isLoaded} globalUrl={globalUrl} setCookie={setCookie} cookies={cookies} surfaceColor={surfaceColor} inputColor={inputColor} {...props} /> } />
|
<Route exact path="/login" render={props => <LoginPage isLoggedIn={isLoggedIn} setIsLoggedIn={setIsLoggedIn} register={true} isLoaded={isLoaded} globalUrl={globalUrl} setCookie={setCookie} cookies={cookies} surfaceColor={surfaceColor} inputColor={inputColor} {...props} /> } />
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ const Apps = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper square style={paperAppStyle} onClick={() => {
|
<Paper square key={data.id} style={paperAppStyle} onClick={() => {
|
||||||
if (selectedApp.id !== data.id) {
|
if (selectedApp.id !== data.id) {
|
||||||
setSelectedApp(data)
|
setSelectedApp(data)
|
||||||
console.log(data)
|
console.log(data)
|
||||||
@@ -515,7 +515,7 @@ const Apps = (props) => {
|
|||||||
newActionname = newActionname.replace("_", " ")
|
newActionname = newActionname.replace("_", " ")
|
||||||
newActionname = newActionname.charAt(0).toUpperCase()+newActionname.substring(1)
|
newActionname = newActionname.charAt(0).toUpperCase()+newActionname.substring(1)
|
||||||
return (
|
return (
|
||||||
<MenuItem style={{backgroundColor: inputColor, color: "white"}} value={data}>
|
<MenuItem key={data.name} style={{backgroundColor: inputColor, color: "white"}} value={data}>
|
||||||
{newActionname}
|
{newActionname}
|
||||||
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
@@ -540,7 +540,7 @@ const Apps = (props) => {
|
|||||||
|
|
||||||
const circleSize = 10
|
const circleSize = 10
|
||||||
return (
|
return (
|
||||||
<MenuItem style={{backgroundColor: inputColor, color: "white"}} value={data}>
|
<MenuItem key={data.name} style={{backgroundColor: inputColor, color: "white"}} value={data}>
|
||||||
<div style={{width: circleSize, height: circleSize, borderRadius: circleSize / 2, backgroundColor: itemColor, marginRight: "10px"}}/>
|
<div style={{width: circleSize, height: circleSize, borderRadius: circleSize / 2, backgroundColor: itemColor, marginRight: "10px"}}/>
|
||||||
{data.name}
|
{data.name}
|
||||||
|
|
||||||
|
|||||||
+32
-5
@@ -6,6 +6,8 @@ import {Link} from 'react-router-dom';
|
|||||||
import List from '@material-ui/core/List';
|
import List from '@material-ui/core/List';
|
||||||
import ListItem from '@material-ui/core/ListItem';
|
import ListItem from '@material-ui/core/ListItem';
|
||||||
|
|
||||||
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
|
import Select from '@material-ui/core/Select';
|
||||||
import Button from '@material-ui/core/Button';
|
import Button from '@material-ui/core/Button';
|
||||||
import HomeIcon from '@material-ui/icons/Home';
|
import HomeIcon from '@material-ui/icons/Home';
|
||||||
import PolymerIcon from '@material-ui/icons/Polymer';
|
import PolymerIcon from '@material-ui/icons/Polymer';
|
||||||
@@ -17,7 +19,7 @@ const hoverColor = "#f85a3e"
|
|||||||
const hoverOutColor = "#e8eaf6"
|
const hoverOutColor = "#e8eaf6"
|
||||||
|
|
||||||
const Header = props => {
|
const Header = props => {
|
||||||
const { globalUrl, isLoggedIn, removeCookie, homePage, isLoaded } = props;
|
const { surfaceColor, inputColor, globalUrl, isLoggedIn, removeCookie, homePage, isLoaded, userdata} = props;
|
||||||
|
|
||||||
const [HomeHoverColor, setHomeHoverColor] = useState(hoverOutColor);
|
const [HomeHoverColor, setHomeHoverColor] = useState(hoverOutColor);
|
||||||
const [SoarHoverColor, setSoarHoverColor] = useState(hoverOutColor);
|
const [SoarHoverColor, setSoarHoverColor] = useState(hoverOutColor);
|
||||||
@@ -100,7 +102,7 @@ const Header = props => {
|
|||||||
|
|
||||||
|
|
||||||
// Handle top bar or something
|
// Handle top bar or something
|
||||||
const loginTextBrowser = !isLoggedIn ?
|
const loginTextBrowser = !isLoggedIn ?
|
||||||
<div style={{display: "flex"}}>
|
<div style={{display: "flex"}}>
|
||||||
<List style={{display: "flex", flexDirect: "row"}} component="nav">
|
<List style={{display: "flex", flexDirect: "row"}} component="nav">
|
||||||
<ListItem style={{textAlign: "center", marginLeft: "0px"}}>
|
<ListItem style={{textAlign: "center", marginLeft: "0px"}}>
|
||||||
@@ -192,6 +194,31 @@ const Header = props => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
{userdata.orgs.length <= 1 ? null :
|
||||||
|
<ListItem>
|
||||||
|
<Select
|
||||||
|
SelectDisplayProps={{
|
||||||
|
style: {
|
||||||
|
marginLeft: 10,
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
value={userdata.selected_org}
|
||||||
|
fullWidth
|
||||||
|
style={{backgroundColor: surfaceColor, color: "white", height: "50px"}}
|
||||||
|
onChange={(e) => {
|
||||||
|
console.log("SET ORG TO ", e.target.value)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{userdata.orgs.map(data => {
|
||||||
|
return (
|
||||||
|
<MenuItem key={data.id} style={{backgroundColor: inputColor, color: "white"}} value={data}>
|
||||||
|
{data.name}
|
||||||
|
</MenuItem>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</Select>
|
||||||
|
</ListItem>
|
||||||
|
}
|
||||||
</List>
|
</List>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -272,10 +299,10 @@ const Header = props => {
|
|||||||
const loadedCheck = isLoaded ?
|
const loadedCheck = isLoaded ?
|
||||||
<div>
|
<div>
|
||||||
<BrowserView>
|
<BrowserView>
|
||||||
{loginTextBrowser}
|
{loginTextBrowser}
|
||||||
</BrowserView>
|
</BrowserView>
|
||||||
<MobileView>
|
<MobileView>
|
||||||
{loginTextMobile}
|
{loginTextMobile}
|
||||||
</MobileView>
|
</MobileView>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
@@ -288,6 +315,6 @@ const Header = props => {
|
|||||||
{loadedCheck}
|
{loadedCheck}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
export default Header;
|
export default Header;
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ const Workflows = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper square style={resultPaperAppStyle} onClick={() => {}}>
|
<Paper key={data.id} square style={resultPaperAppStyle} onClick={() => {}}>
|
||||||
<div style={{marginLeft: "10px", marginTop: "5px", marginBottom: "5px", marginRight: "5px", width: boxWidth, backgroundColor: boxColor}}>
|
<div style={{marginLeft: "10px", marginTop: "5px", marginBottom: "5px", marginRight: "5px", width: boxWidth, backgroundColor: boxColor}}>
|
||||||
</div>
|
</div>
|
||||||
<Grid container style={{margin: "10px 10px 10px 10px", flex: "1"}}>
|
<Grid container style={{margin: "10px 10px 10px 10px", flex: "1"}}>
|
||||||
|
|||||||
Reference in New Issue
Block a user