diff --git a/jams-react-client/build_deploy_jams_client.sh b/jams-react-client/build_deploy_jams_client.sh index fcd2b78046f4902b823266f0002a88340ca3e2fb..de41b240d804a063972be11dff7c909c38316f97 100755 --- a/jams-react-client/build_deploy_jams_client.sh +++ b/jams-react-client/build_deploy_jams_client.sh @@ -19,7 +19,7 @@ sed -i 's/material-dashboard-react\///g' $WEBAPP"index.html" #rm config.json cd .. -#mvn clean package -DskipTests +mvn clean package -DskipTests mvn package -DskipTests cd $JAMS diff --git a/jams-react-client/src/auth.js b/jams-react-client/src/auth.js index c77574c550318926e3280fe0fae62cabd7d5aae5..827ea05b14a3cd5368bac33ba1274ab6ce1faa05 100644 --- a/jams-react-client/src/auth.js +++ b/jams-react-client/src/auth.js @@ -6,6 +6,7 @@ import { api_path_post_auth_login, api_path_get_server_status, api_path_get_install_lastKnownStep, + api_path_get_directories, } from "globalUrls"; class Auth { @@ -55,6 +56,28 @@ class Auth { return this.authenticated; } + isLocalDirectory() { + return this.localDirectory + } + + checkDirectoryType(cb){ + axios(configApiCall(api_path_get_directories, "GET", null, null)).then((response) => { + console.log(response) + if (response.data.length == 1) { + this.localDirectory = true + } + else if (response.data.length == 2){ + this.localDirectory = false + }else{ + console.log("Error getting on checkDirectoryType: Size of directory types is " + response.data.length) + } + cb() + }).catch((error) => { + console.log("Error getting on checkDirectoryType: " + error) + cb() + }); + } + checkAdminAccountStatus(cb) { axios(configApiCall(api_path_post_install_admin, "GET", null, null)).then((response) => { if (response['headers']['showlogin'] == "true") { diff --git a/jams-react-client/src/layouts/SignIn.js b/jams-react-client/src/layouts/SignIn.js index 2eb818404ca8cadfc1572905dc62fb2796937e94..93a165583f7960d243b548fc7cfc25d45edde835 100644 --- a/jams-react-client/src/layouts/SignIn.js +++ b/jams-react-client/src/layouts/SignIn.js @@ -71,14 +71,15 @@ export default function SignIn(props) { } auth.login(jsonData, () => { if(auth.authenticated && auth.access_token != ""){ - auth.checkLastKnowStep(()=>{ - if(auth.isInstalled){ - history.push('/admin'); - } - else{ - history.push('/'); - } - + auth.checkLastKnowStep(() => { + auth.checkDirectoryType(() => { + if(auth.isInstalled){ + history.push('/admin'); + } + else{ + history.push('/'); + } + }) }) }else{ setError(true) diff --git a/jams-react-client/src/views/Users/Users.js b/jams-react-client/src/views/Users/Users.js index 4c9cc6cd36ccb5da4f938fee8d7cccbbb7590186..2c836c43de01c237d6acff2c658d61f1dee53e1a 100644 --- a/jams-react-client/src/views/Users/Users.js +++ b/jams-react-client/src/views/Users/Users.js @@ -151,11 +151,13 @@ export default function Users() { </DialogActions> </Dialog> <GridContainer> + {auth.isLocalDirectory() && <GridItem xs={12} sm={12} md={12}> <Button variant="contained" color="primary" href="#contained-buttons"> <AddCircleOutlineIcon /> Create user </Button> </GridItem> + } { users.map(user => <GridItem xs={12} sm={12} md={2} key={user.username}>