diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 276ecded..6f78e4b1 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "shuffler",
- "version": "0.3.0",
+ "version": "0.6.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -3733,9 +3733,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
- "version": "14.0.13",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz",
- "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA=="
+ "version": "14.0.24",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.24.tgz",
+ "integrity": "sha512-btt/oNOiDWcSuI721MdL8VQGnjsKjlTMdrKyTcLCKeQp/n4AAMFJ961wMbp+09y8WuGPClDEv07RIItdXKIXAA=="
},
"@types/object-assign": {
"version": "4.0.30",
@@ -3748,9 +3748,9 @@
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"@types/prop-types": {
- "version": "15.7.1",
- "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.1.tgz",
- "integrity": "sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg=="
+ "version": "15.7.3",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
+ "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
},
"@types/q": {
"version": "1.5.4",
@@ -3758,9 +3758,9 @@
"integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug=="
},
"@types/react": {
- "version": "16.8.20",
- "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.20.tgz",
- "integrity": "sha512-ZLmI+ubSJpfUIlQuULDDrdyuFQORBuGOvNnMue8HeA0GVrAJbWtZQhcBvnBPNRBI/GrfSfrKPFhthzC2SLEtLQ==",
+ "version": "16.9.43",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.43.tgz",
+ "integrity": "sha512-PxshAFcnJqIWYpJbLPriClH53Z2WlJcVZE+NP2etUtWQs2s7yIMj3/LDKZT/5CHJ/F62iyjVCDu2H3jHEXIxSg==",
"requires": {
"@types/prop-types": "*",
"csstype": "^2.2.0"
@@ -11944,9 +11944,9 @@
}
},
"lodash": {
- "version": "4.17.15",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
+ "version": "4.17.19",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
+ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
},
"lodash._reinterpolate": {
"version": "3.0.0",
diff --git a/frontend/src/App.js b/frontend/src/App.js
deleted file mode 100644
index 42cd96ed..00000000
--- a/frontend/src/App.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import React, {useState, useEffect} from 'react';
-
-import {Route} from 'react-router';
-import {BrowserRouter} from 'react-router-dom';
-import { CookiesProvider } from 'react-cookie';
-import { useCookies } from 'react-cookie';
-
-import EditSchedule from "./EditSchedule";
-import Schedules from "./Schedules";
-import Webhooks from "./Webhooks";
-import Workflows from "./Workflows";
-import EditWebhook from "./EditWebhook";
-import AngularWorkflow from "./AngularWorkflow";
-import ForgotPassword from "./ForgotPassword";
-import ForgotPasswordLink from "./ForgotPasswordLink";
-
-import Header from './Header';
-import Apps from './Apps';
-import AppCreator from './AppCreator';
-import Contact from './Contact';
-import Oauth2 from './Oauth2';
-import About from "./About";
-import Post from "./Post";
-import Dashboard from "./Dashboard";
-import AdminSetup from "./AdminSetup";
-import Admin from "./Admin";
-import Docs from "./Docs";
-import RegisterLink from "./RegisterLink";
-import LandingPage from "./Landingpage";
-import LandingPageNew from "./LandingpageNew";
-import LoginPage from "./LoginPage";
-import SettingsPage from "./SettingsPage";
-
-//import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
-import { createMuiTheme, ThemeProvider as MuiThemeProvider } from '@material-ui/core/styles';
-
-import AlertTemplate from "react-alert-template-basic";
-import { positions, Provider } from "react-alert";
-
-// Production - backend proxy forwarding in nginx
-var globalUrl = window.location.origin
-
-// CORS used for testing purposes. Should only happen with specific port and http
-if (window.location.protocol == "http:" && window.location.port === "3000") {
- globalUrl = "http://localhost:5001"
-}
-
-const surfaceColor = "#27292D"
-const inputColor = "#383B40"
-
-const theme = createMuiTheme({
- palette: {
- primary: {
- main: "#f85a3e"
- },
- secondary: {
- main: '#e8eaf6',
- },
- },
- typography: {
- useNextVariants: true
- },
- overrides: {
- MuiMenu: {
- list: {
- backgroundColor: inputColor,
- },
- },
- },
-});
-
-
-// FIXME - set client side cookies
-const App = (message, props) => {
- const [userdata, setUserData] = useState({});
- //const [homePage, ] = useState(true);
- const [cookies, setCookie, removeCookie] = useCookies([]);
- const [isLoggedIn, setIsLoggedIn] = useState(false);
- const [dataset, setDataset] = useState(false);
- const [isLoaded, setIsLoaded] = useState(false);
-
- useEffect(() => {
- if (dataset === false) {
- checkLogin()
- setDataset(true)
- }})
-
- if (isLoaded && !isLoggedIn && (!window.location.pathname.startsWith("/login") && (!window.location.pathname.startsWith("/docs") && (!window.location.pathname.startsWith("/adminsetup"))))) {
- window.location = "/login"
- }
-
- const checkLogin = () => {
- var baseurl = globalUrl
- fetch(baseurl+"/api/v1/users/getinfo", {
- credentials: "include",
- headers: {
- 'Content-Type': 'application/json',
- },
- })
- .then(response => response.json())
- .then(responseJson => {
- if (responseJson.success === true) {
- console.log(responseJson)
- setUserData(responseJson)
- setIsLoggedIn(true)
-
- // Updating cookie every request
- for (var key in responseJson["cookies"]) {
- setCookie(responseJson["cookies"][key].key, responseJson["cookies"][key].value, {path: "/"})
- }
- }
- setIsLoaded(true)
- })
- .catch(error => {
- setIsLoaded(true)
- });
- }
-
- // Dumb for content load (per now), but good for making the site not suddenly reload parts (ajax thingies)
-
- const options = {
- timeout: 5000,
- position: positions.BOTTOM_CENTER
- };
-
- const includedData = window.location.pathname === "/home" || window.location.pathname === "/features" ?
-
- } />
-
:
-
-
-
} />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- {window.location.pathname = "/docs/about"}} />
- {window.location.pathname = "/login"}} />
-
-
- //
- // backgroundColor: "#213243",
- // This is a mess hahahah
- return (
-
-
-
-
- {includedData}
-
-
-
-
- );
-};
-
-export default App;
-
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
new file mode 100644
index 00000000..f5214bab
--- /dev/null
+++ b/frontend/src/App.jsx
@@ -0,0 +1,161 @@
+import React, { useState, useEffect } from 'react';
+
+import { Route } from 'react-router';
+import { BrowserRouter } from 'react-router-dom';
+import { CookiesProvider } from 'react-cookie';
+import { useCookies } from 'react-cookie';
+
+import EditSchedule from "./views/EditSchedule";
+import Schedules from "./views/Schedules";
+import Webhooks from "./views/Webhooks";
+import Workflows from "./views/Workflows";
+import EditWebhook from "./views/EditWebhook";
+import AngularWorkflow from "./views/AngularWorkflow";
+
+import Header from './components/Header';
+import Apps from './views/Apps';
+import AppCreator from './views/AppCreator';
+import Contact from './views/Contact';
+import Oauth2 from './views/Oauth2';
+import Dashboard from "./views/Dashboard";
+import AdminSetup from "./views/AdminSetup";
+import Admin from "./views/Admin";
+import Docs from "./views/Docs";
+import LandingPageNew from "./views/LandingpageNew";
+import LoginPage from "./views/LoginPage";
+import SettingsPage from "./views/SettingsPage";
+
+import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
+
+import AlertTemplate from "react-alert-template-basic";
+import { positions, Provider } from "react-alert";
+
+// Production - backend proxy forwarding in nginx
+var globalUrl = window.location.origin
+
+// CORS used for testing purposes. Should only happen with specific port and http
+if (window.location.protocol == "http:" && window.location.port === "3000") {
+ globalUrl = "http://localhost:5001"
+}
+
+const theme = createMuiTheme({
+ palette: {
+ primary: {
+ main: "#f85a3e"
+ },
+ secondary: {
+ main: '#e8eaf6',
+ },
+ surfaceColor: "#27292d",
+ inputColor: "#383B40"
+ },
+ typography: {
+ useNextVariants: true
+ },
+ overrides: {
+ MuiMenu: {
+ list: {
+ backgroundColor: "#383B40",
+ },
+ },
+ },
+});
+
+
+// FIXME - set client side cookies
+const App = (message, props) => {
+ const [userdata, setUserData] = useState({});
+ //const [homePage, ] = useState(true);
+ const [cookies, setCookie, removeCookie] = useCookies([]);
+ const [isLoggedIn, setIsLoggedIn] = useState(false);
+ const [dataset, setDataset] = useState(false);
+ const [isLoaded, setIsLoaded] = useState(false);
+
+ useEffect(() => {
+ if (dataset === false) {
+ checkLogin()
+ setDataset(true)
+ }
+ })
+
+ if (isLoaded && !isLoggedIn && (!window.location.pathname.startsWith("/login") && (!window.location.pathname.startsWith("/docs") && (!window.location.pathname.startsWith("/adminsetup"))))) {
+ window.location = "/login"
+ }
+
+ const checkLogin = () => {
+ var baseurl = globalUrl
+ fetch(baseurl + "/api/v1/users/getinfo", {
+ credentials: "include",
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ })
+ .then(response => response.json())
+ .then(responseJson => {
+ if (responseJson.success === true) {
+ setUserData(responseJson)
+ setIsLoggedIn(true)
+
+ // Updating cookie every request
+ for (var key in responseJson["cookies"]) {
+ setCookie(responseJson["cookies"][key].key, responseJson["cookies"][key].value, { path: "/" })
+ }
+ }
+ setIsLoaded(true)
+ })
+ .catch(error => {
+ setIsLoaded(true)
+ });
+ }
+
+ // Dumb for content load (per now), but good for making the site not suddenly reload parts (ajax thingies)
+
+ const options = {
+ timeout: 5000,
+ position: positions.BOTTOM_CENTER
+ };
+
+ const includedData = window.location.pathname === "/home" || window.location.pathname === "/features" ?
+
+ } />
+
:
+
+
+
} />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ { window.location.pathname = "/docs/about" }} />
+ { window.location.pathname = "/login" }} />
+
+
+ //
+ // backgroundColor: "#213243",
+ // This is a mess hahahah
+ return (
+
+
+
+
+ {includedData}
+
+
+
+
+ );
+};
+
+export default App;
diff --git a/frontend/src/Flows.js b/frontend/src/Flows.js
deleted file mode 100644
index aa1a35a3..00000000
--- a/frontend/src/Flows.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-
-const Flows = () => {
- return (
-
-
Flows
-
-
- Built to suit any organization
-
-
-
- WAT
-
-
-
-
-
-
-
-
- )
-}
-
-export default Flows;
diff --git a/frontend/src/Hookpost.js b/frontend/src/Hookpost.js
deleted file mode 100644
index 566a26d4..00000000
--- a/frontend/src/Hookpost.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-
-const Hooks = () => {
- return (
-
-
Hooks
-
-
- Built to suit any organization
-
-
-
- WAT
-
-
-
-
-
-
-
-
- )
-}
-
-export default Hooks;
diff --git a/frontend/src/Schedulespost.js b/frontend/src/Schedulespost.js
deleted file mode 100644
index 102144e7..00000000
--- a/frontend/src/Schedulespost.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-
-const Schedules = () => {
- return (
-
-
Schedules
-
-
- Built to suit any organization
-
-
-
- WAT
-
-
-
-
-
-
-
-
- )
-}
-
-export default Schedules;
diff --git a/frontend/src/appdata.js b/frontend/src/__test__/appdata.js
similarity index 100%
rename from frontend/src/appdata.js
rename to frontend/src/__test__/appdata.js
diff --git a/frontend/src/environmentdata.js b/frontend/src/__test__/environmentdata.js
similarity index 100%
rename from frontend/src/environmentdata.js
rename to frontend/src/__test__/environmentdata.js
diff --git a/frontend/src/scheduledata.js b/frontend/src/__test__/scheduledata.js
similarity index 100%
rename from frontend/src/scheduledata.js
rename to frontend/src/__test__/scheduledata.js
diff --git a/frontend/src/webhookdata.js b/frontend/src/__test__/webhookdata.js
similarity index 100%
rename from frontend/src/webhookdata.js
rename to frontend/src/__test__/webhookdata.js
diff --git a/frontend/src/workflowdata.js b/frontend/src/__test__/workflowdata.js
similarity index 100%
rename from frontend/src/workflowdata.js
rename to frontend/src/__test__/workflowdata.js
diff --git a/frontend/src/AlertPopup.js b/frontend/src/components/AlertPopup.js
similarity index 100%
rename from frontend/src/AlertPopup.js
rename to frontend/src/components/AlertPopup.js
diff --git a/frontend/src/AlertTemplate.js b/frontend/src/components/AlertTemplate.js
similarity index 100%
rename from frontend/src/AlertTemplate.js
rename to frontend/src/components/AlertTemplate.js
diff --git a/frontend/src/FooterNew.js b/frontend/src/components/FooterNew.js
similarity index 100%
rename from frontend/src/FooterNew.js
rename to frontend/src/components/FooterNew.js
diff --git a/frontend/src/Header.js b/frontend/src/components/Header.js
similarity index 99%
rename from frontend/src/Header.js
rename to frontend/src/components/Header.js
index 7a880bd5..54dfafc2 100644
--- a/frontend/src/Header.js
+++ b/frontend/src/components/Header.js
@@ -194,7 +194,7 @@ const Header = props => {
- {userdata.orgs.length <= 1 ? null :
+ {userdata === undefined || userdata.orgs.length <= 1 ? null :
+ label={
Exit on Error
}
control={
{
workflow.configuration.exit_on_error = !workflow.configuration.exit_on_error
@@ -4791,7 +4790,7 @@ const AngularWorkflow = (props) => {
/>
Start from top
+ label={Start from top
}
control={
{
workflow.configuration.start_from_top = !workflow.configuration.start_from_top
@@ -5119,7 +5118,7 @@ const AngularWorkflow = (props) => {
Executing Workflow
Show failed / skipped actions
+ label={Show failed / skipped actions
}
control={
{setShowSkippedActions(!showSkippedActions)}} />
}
diff --git a/frontend/src/AppCreator.js b/frontend/src/views/AppCreator.jsx
similarity index 100%
rename from frontend/src/AppCreator.js
rename to frontend/src/views/AppCreator.jsx
diff --git a/frontend/src/Apps.js b/frontend/src/views/Apps.jsx
similarity index 99%
rename from frontend/src/Apps.js
rename to frontend/src/views/Apps.jsx
index e482765d..35bef2d4 100644
--- a/frontend/src/Apps.js
+++ b/frontend/src/views/Apps.jsx
@@ -654,7 +654,7 @@ const Apps = (props) => {
{isLoading ? : null}
Search OpenAPI
+ label={Search OpenAPI
}
control={ {
handleSearchChange("")
setSearchBackend(!searchBackend)}
diff --git a/frontend/src/Contact.js b/frontend/src/views/Contact.jsx
similarity index 54%
rename from frontend/src/Contact.js
rename to frontend/src/views/Contact.jsx
index 97cf84e6..5a34382c 100644
--- a/frontend/src/Contact.js
+++ b/frontend/src/views/Contact.jsx
@@ -1,11 +1,13 @@
-import React, {useState} from 'react';
-import {BrowserView, MobileView} from "react-device-detect";
+import React, { useState } from 'react';
+import { BrowserView, MobileView } from "react-device-detect";
import Paper from '@material-ui/core/Paper';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
+import { useTheme } from '@material-ui/core/styles';
+
const bodyDivStyle = {
margin: "auto",
textAlign: "center",
@@ -13,11 +15,11 @@ const bodyDivStyle = {
}
-
-
// Should be different if logged in :|
const Contact = (props) => {
- const { globalUrl, isLoaded, surfaceColor, inputColor } = props;
+ const { globalUrl, isLoaded } = props;
+
+ const theme = useTheme();
const boxStyle = {
flex: "1",
@@ -27,24 +29,24 @@ const Contact = (props) => {
paddingRight: "30px",
paddingBottom: "30px",
paddingTop: "30px",
- backgroundColor: surfaceColor,
- display: "flex",
+ backgroundColor: theme.palette.surfaceColor,
+ display: "flex",
flexDirection: "column"
}
-
+
const bodyTextStyle = {
- color: "#ffffff",
+ color: "#ffffff",
}
- const [firstname, setFirstname] = useState("");
- const [lastname, setLastname] = useState("");
- const [title, setTitle] = useState("");
- const [companyname, setCompanyname] = useState("");
- const [email, setEmail] = useState("");
- const [phone, setPhone] = useState("");
- const [message, setMessage] = useState("");
+ const [firstname, setFirstname] = useState("");
+ const [lastname, setLastname] = useState("");
+ const [title, setTitle] = useState("");
+ const [companyname, setCompanyname] = useState("");
+ const [email, setEmail] = useState("");
+ const [phone, setPhone] = useState("");
+ const [message, setMessage] = useState("");
- const [formMessage, setFormMessage] = useState("");
+ const [formMessage, setFormMessage] = useState("");
const submitContact = () => {
const data = {
@@ -58,43 +60,43 @@ const Contact = (props) => {
}
console.log(data)
- fetch(globalUrl+"/api/v1/contact", {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify(data),
- })
- .then(response => response.json())
- .then(response => {
- if (response.success === true) {
- setFormMessage(response.message)
- } else {
- setFormMessage("Something went wrong. Please contact frikky@shuffler.io.")
- }
- console.log(response)
- })
- .catch(error => {
- console.log(error)
- });
+ fetch(globalUrl + "/api/v1/contact", {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(data),
+ })
+ .then(response => response.json())
+ .then(response => {
+ if (response.success === true) {
+ setFormMessage(response.message)
+ } else {
+ setFormMessage("Something went wrong. Please contact frikky@shuffler.io.")
+ }
+ console.log(response)
+ })
+ .catch(error => {
+ console.log(error)
+ });
}
// Random names for type & autoComplete. Didn't research :^)
- const landingpageDataBrowser =
+ const landingpageDataBrowser =
-
Contact us
+ Contact us
Lets talk!
-
+
Contact Details
-
+
{
fullWidth={true}
placeholder="First Name"
type="firstname"
- id="standard-required"
+ id="standard-required"
autoComplete="firstname"
margin="normal"
variant="outlined"
- onChange={e => setFirstname(e.target.value)}
+ onChange={e => setFirstname(e.target.value)}
/>
{
fullWidth={true}
placeholder="Last Name"
type="lastname"
- id="standard"
+ id="standard"
autoComplete="lastname"
margin="normal"
variant="outlined"
- onChange={e => setLastname(e.target.value)}
+ onChange={e => setLastname(e.target.value)}
/>
-
+
{
fullWidth={true}
placeholder="Job Title"
type="jobtitle"
- id="standard-required"
+ id="standard-required"
autoComplete="jobtitle"
margin="normal"
variant="outlined"
- onChange={e => setTitle(e.target.value)}
+ onChange={e => setTitle(e.target.value)}
/>
{
fullWidth={true}
type="companyname"
placeholder="Company Name"
- id="standard-required"
+ id="standard-required"
autoComplete="companyname"
margin="normal"
variant="outlined"
- onChange={e => setCompanyname(e.target.value)}
+ onChange={e => setCompanyname(e.target.value)}
/>
-
+
{
fullWidth={true}
placeholder="Email"
type="email"
- id="standard-required"
+ id="standard-required"
autoComplete="email"
margin="normal"
variant="outlined"
- onChange={e => setEmail(e.target.value)}
+ onChange={e => setEmail(e.target.value)}
/>
{
fullWidth={true}
type="phone"
placeholder="Phone number"
- id="standard-required"
+ id="standard-required"
autoComplete="phone"
margin="normal"
variant="outlined"
- onChange={e => setPhone(e.target.value)}
+ onChange={e => setPhone(e.target.value)}
/>
-
+
Message
-
+
setMessage(e.target.value)}
+ onChange={e => setMessage(e.target.value)}
/>
{formMessage}
- const landingpageDataMobile =
-
-
-
Contact us
+ const landingpageDataMobile =
+
+
+
Contact us
Lets talk!
-
+
Contact Details
-
+
{
fullWidth={true}
placeholder="Name"
type="firstname"
- id="standard-required"
+ id="standard-required"
autoComplete="firstname"
margin="normal"
variant="outlined"
- onChange={e => setFirstname(e.target.value)}
+ onChange={e => setFirstname(e.target.value)}
/>
-
+
{
fullWidth={true}
placeholder="Email"
type="email"
- id="standard-required"
+ id="standard-required"
autoComplete="email"
margin="normal"
variant="outlined"
- onChange={e => setEmail(e.target.value)}
+ onChange={e => setEmail(e.target.value)}
/>
-
+
Message
-
+
{
id="filled-multiline-static"
margin="normal"
variant="outlined"
- onChange={e => setMessage(e.target.value)}
+ onChange={e => setMessage(e.target.value)}
/>
{formMessage}
@@ -321,7 +323,7 @@ const Contact = (props) => {
- const loadedCheck = isLoaded ?
+ const loadedCheck = isLoaded ?
{landingpageDataBrowser}
@@ -334,7 +336,7 @@ const Contact = (props) => {
- return(
+ return (
{loadedCheck}
diff --git a/frontend/src/Dashboard.js b/frontend/src/views/Dashboard.jsx
similarity index 99%
rename from frontend/src/Dashboard.js
rename to frontend/src/views/Dashboard.jsx
index f450e99e..3ffb560e 100644
--- a/frontend/src/Dashboard.js
+++ b/frontend/src/views/Dashboard.jsx
@@ -35,7 +35,7 @@ import {
chartExample2,
chartExample3,
chartExample4
-} from "./charts.js";
+} from "../charts.js";
// This is the start of a dashboard that can be used.
// What data do we fill in here? Idk
diff --git a/frontend/src/Docs.js b/frontend/src/views/Docs.jsx
similarity index 100%
rename from frontend/src/Docs.js
rename to frontend/src/views/Docs.jsx
diff --git a/frontend/src/EditSchedule.js b/frontend/src/views/EditSchedule.jsx
similarity index 99%
rename from frontend/src/EditSchedule.js
rename to frontend/src/views/EditSchedule.jsx
index 0c588172..c47453e8 100644
--- a/frontend/src/EditSchedule.js
+++ b/frontend/src/views/EditSchedule.jsx
@@ -34,9 +34,6 @@ import DeleteIcon from '@material-ui/icons/Delete';
import Downshift from 'downshift';
import deburr from 'lodash/deburr';
-//import appdata from './appdata';
-
-
const EditSchedule = (props) => {
const { globalUrl } = props;
diff --git a/frontend/src/EditWebhook.js b/frontend/src/views/EditWebhook.jsx
similarity index 98%
rename from frontend/src/EditWebhook.js
rename to frontend/src/views/EditWebhook.jsx
index 6653cb5a..ba42a58b 100644
--- a/frontend/src/EditWebhook.js
+++ b/frontend/src/views/EditWebhook.jsx
@@ -6,8 +6,8 @@ import Divider from '@material-ui/core/Divider';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
-import WebhookImage from './assets/img/webhook.png';
-import KafkaImage from './assets/img/kafka.png';
+import WebhookImage from '../assets/img/webhook.png';
+import KafkaImage from '../assets/img/kafka.png';
import EditWorkflow from "./EditWorkflow";
diff --git a/frontend/src/EditWorkflow.js b/frontend/src/views/EditWorkflow.jsx
similarity index 100%
rename from frontend/src/EditWorkflow.js
rename to frontend/src/views/EditWorkflow.jsx
diff --git a/frontend/src/ForgotPassword.js b/frontend/src/views/ForgotPassword.jsx
similarity index 100%
rename from frontend/src/ForgotPassword.js
rename to frontend/src/views/ForgotPassword.jsx
diff --git a/frontend/src/ForgotPasswordLink.js b/frontend/src/views/ForgotPasswordLink.jsx
similarity index 100%
rename from frontend/src/ForgotPasswordLink.js
rename to frontend/src/views/ForgotPasswordLink.jsx
diff --git a/frontend/src/Landingpage.js b/frontend/src/views/Landingpage.jsx
similarity index 100%
rename from frontend/src/Landingpage.js
rename to frontend/src/views/Landingpage.jsx
diff --git a/frontend/src/LandingpageLoggedin.js b/frontend/src/views/LandingpageLoggedin.jsx
similarity index 100%
rename from frontend/src/LandingpageLoggedin.js
rename to frontend/src/views/LandingpageLoggedin.jsx
diff --git a/frontend/src/LandingpageNew.js b/frontend/src/views/LandingpageNew.jsx
similarity index 100%
rename from frontend/src/LandingpageNew.js
rename to frontend/src/views/LandingpageNew.jsx
diff --git a/frontend/src/LoginPage.js b/frontend/src/views/LoginPage.jsx
similarity index 55%
rename from frontend/src/LoginPage.js
rename to frontend/src/views/LoginPage.jsx
index 49e22f55..6ed887f3 100644
--- a/frontend/src/LoginPage.js
+++ b/frontend/src/views/LoginPage.jsx
@@ -1,13 +1,15 @@
/* eslint-disable react/no-multi-comp */
-import React, {useState} from 'react';
+import React, { useState } from 'react';
import { makeStyles } from '@material-ui/styles';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import Paper from '@material-ui/core/Paper';
+import { useTheme } from '@material-ui/core/styles';
+
const hrefStyle = {
- color: "white",
+ color: "white",
textDecoration: "none"
}
@@ -17,16 +19,6 @@ const bodyDivStyle = {
width: "500px",
}
-const surfaceColor = "#27292D"
-const inputColor = "#383B40"
-
-const boxStyle = {
- paddingLeft: "30px",
- paddingRight: "30px",
- paddingBottom: "30px",
- paddingTop: "30px",
- backgroundColor: surfaceColor,
-}
const useStyles = makeStyles({
notchedOutline: {
@@ -35,12 +27,14 @@ const useStyles = makeStyles({
});
const LoginDialog = props => {
- const { globalUrl, isLoaded, isLoggedIn, setIsLoggedIn, setCookie, register } = props;
+ const theme = useTheme();
+
+ const { globalUrl, isLoaded, isLoggedIn, setIsLoggedIn, setCookie, register } = props;
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [firstRequest, setFirstRequest] = useState(true);
- // Used to swap from login to register. True = login, false = register
+ // Used to swap from login to register. True = login, false = register
const classes = useStyles();
// Error messages etc
@@ -51,32 +45,32 @@ const LoginDialog = props => {
}
if (isLoggedIn === true) {
- window.location.pathname = "/workflows"
+ window.location.pathname = "/workflows"
}
const checkAdmin = () => {
- const url = globalUrl+'/api/v1/checkusers';
+ const url = globalUrl + '/api/v1/checkusers';
fetch(url, {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json',
- },
+ method: 'GET',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
})
- .then(response =>
- response.json().then(responseJson => {
- if (responseJson["success"] === false) {
- setLoginInfo(responseJson["reason"])
- } else {
- if (responseJson.reason === "stay") {
- window.location.pathname = "/adminsetup"
+ .then(response =>
+ response.json().then(responseJson => {
+ if (responseJson["success"] === false) {
+ setLoginInfo(responseJson["reason"])
+ } else {
+ if (responseJson.reason === "stay") {
+ window.location.pathname = "/adminsetup"
+ }
}
- }
- }),
- )
- .catch(error => {
- setLoginInfo("Error in userdata: ", error)
- })
+ }),
+ )
+ .catch(error => {
+ setLoginInfo("Error in userdata: ", error)
+ })
}
if (firstRequest) {
@@ -89,41 +83,41 @@ const LoginDialog = props => {
// FIXME - add some check here ROFL
// Just use this one?
- var data = {"username": username, "password": password}
+ var data = { "username": username, "password": password }
var baseurl = globalUrl
if (register) {
- var url = baseurl+'/api/v1/users/login';
+ var url = baseurl + '/api/v1/users/login';
fetch(url, {
mode: 'cors',
- method: 'POST',
- body: JSON.stringify(data),
- credentials: 'include',
- crossDomain: true,
- withCredentials: true,
- headers: {
- 'Content-Type': 'application/json; charset=utf-8',
- },
+ method: 'POST',
+ body: JSON.stringify(data),
+ credentials: 'include',
+ crossDomain: true,
+ withCredentials: true,
+ headers: {
+ 'Content-Type': 'application/json; charset=utf-8',
+ },
})
- .then(response =>
- response.json().then(responseJson => {
- if (responseJson["success"] === false) {
- setLoginInfo(responseJson["reason"])
- } else {
- setLoginInfo("Successful login, rerouting")
- for (var key in responseJson["cookies"]) {
- setCookie(responseJson["cookies"][key].key, responseJson["cookies"][key].value, {path: "/"})
- }
+ .then(response =>
+ response.json().then(responseJson => {
+ if (responseJson["success"] === false) {
+ setLoginInfo(responseJson["reason"])
+ } else {
+ setLoginInfo("Successful login, rerouting")
+ for (var key in responseJson["cookies"]) {
+ setCookie(responseJson["cookies"][key].key, responseJson["cookies"][key].value, { path: "/" })
+ }
- setIsLoggedIn(true)
- window.location.pathname = "/workflows"
- }
- }),
- )
- .catch(error => {
- setLoginInfo("Error in userdata: " + error)
- });
+ setIsLoggedIn(true)
+ window.location.pathname = "/workflows"
+ }
+ }),
+ )
+ .catch(error => {
+ setLoginInfo("Error in userdata: " + error)
+ });
} else {
- url = baseurl+'/api/v1/users/register';
+ url = baseurl + '/api/v1/users/register';
fetch(url, {
method: 'POST',
body: JSON.stringify(data),
@@ -131,27 +125,27 @@ const LoginDialog = props => {
'Content-Type': 'application/json',
},
})
- .then(response =>
- response.json().then(responseJson => {
- if (responseJson["success"] === false) {
- setLoginInfo(responseJson["reason"])
- } else {
- setLoginInfo("Successful register :)")
- }
- }),
- )
- .catch(error => {
- setLoginInfo("Error in userdata: ", error)
- });
+ .then(response =>
+ response.json().then(responseJson => {
+ if (responseJson["success"] === false) {
+ setLoginInfo(responseJson["reason"])
+ } else {
+ setLoginInfo("Successful register :)")
+ }
+ }),
+ )
+ .catch(error => {
+ setLoginInfo("Error in userdata: ", error)
+ });
}
}
const onChangeUser = (e) => {
- setUsername(e.target.value)
+ setUsername(e.target.value)
}
const onChangePass = (e) => {
- setPassword(e.target.value)
+ setPassword(e.target.value)
}
//const onClickRegister = () => {
@@ -167,25 +161,32 @@ const LoginDialog = props => {
//var loginChange = register ? (Want to register? Click here.
) : (Go back to login? Click here.
);
var formtitle = register ? Login
: Register
- // {formtitle}
-
- const basedata =
+ // {formtitle}
+
+ console.log("THEME: ", theme.palette.surfaceColor)
+ const basedata =