diff --git a/jams-react-client/src/components/ServerParameters/ServerParameters.js b/jams-react-client/src/components/ServerParameters/ServerParameters.js index 784fdb8886312acbbdc2997fe9992af3bffc4402..fdb7ff6c9cd15e08b2775e68ed2ecea0af2aefb5 100644 --- a/jams-react-client/src/components/ServerParameters/ServerParameters.js +++ b/jams-react-client/src/components/ServerParameters/ServerParameters.js @@ -95,7 +95,7 @@ export default function ServerParameters(props) { auth.authenticated = true auth.admin = true auth.checkDirectoryType(() => { - history.push('/admin'); + history.push('/admin/users'); }) } diff --git a/jams-react-client/src/components/Sidebar/Sidebar.js b/jams-react-client/src/components/Sidebar/Sidebar.js index 284f292edc5c1322142b8c4042d8cb54ec2b5b67..e886d2cda6f17977bc128d8b251f44a684609363 100755 --- a/jams-react-client/src/components/Sidebar/Sidebar.js +++ b/jams-react-client/src/components/Sidebar/Sidebar.js @@ -31,6 +31,11 @@ export default function Sidebar(props) { const handleCloseProfile = () => { auth.logout(() => { history.push("/") }) }; + + const handleListItemClick = (e, layout, path) => { + e.preventDefault(); + history.push(layout+path.substring(0, 2)) + }; // verifies if routeName is the one active (in browser input) function activeRoute(routeName) { @@ -62,7 +67,7 @@ export default function Sidebar(props) { activeClassName="active" key={key} > - <ListItem button className={classes.itemLink + listItemClasses}> + <ListItem button className={classes.itemLink + listItemClasses} onClick={e => handleListItemClick(e, prop.layout, prop.path)}> {typeof prop.icon === "string" ? ( <Icon className={classNames(classes.itemIcon, whiteFontClasses, { @@ -179,12 +184,12 @@ export default function Sidebar(props) { } Sidebar.propTypes = { - rtlActive: PropTypes.bool, - handleDrawerToggle: PropTypes.func, - bgColor: PropTypes.oneOf(["purple", "blue", "green", "orange", "red"]), - logo: PropTypes.string, - image: PropTypes.string, - logoText: PropTypes.string, - routes: PropTypes.arrayOf(PropTypes.object), - open: PropTypes.bool + rtlActive: PropTypes.bool, + handleDrawerToggle: PropTypes.func, + bgColor: PropTypes.oneOf(["purple", "blue", "green", "orange", "red"]), + logo: PropTypes.string, + image: PropTypes.string, + logoText: PropTypes.string, + routes: PropTypes.arrayOf(PropTypes.object), + open: PropTypes.bool }; diff --git a/jams-react-client/src/layouts/Admin.js b/jams-react-client/src/layouts/Admin.js index f1f29631188f98d73a3fbe75ac1e6fbc6a44e35d..29864f97efd82bf29346e0666b2c756e39b11a7d 100644 --- a/jams-react-client/src/layouts/Admin.js +++ b/jams-react-client/src/layouts/Admin.js @@ -34,7 +34,10 @@ const switchRoutes = ( } return null; })} - <Redirect from="/admin" to="/admin/users" /> + <Redirect from="/admin/u" to="/admin/users" /> + <Redirect from="/admin/g" to="/admin/groups" /> + <Redirect from="/admin/b" to="/admin/blueprints" /> + </Switch> ); diff --git a/jams-react-client/src/layouts/SignIn.js b/jams-react-client/src/layouts/SignIn.js index 74af2aafca83c7cf584c7ccb0d34dd8b398d8541..d2b00a4412e297eccb52eb680b5104ead386c7b4 100644 --- a/jams-react-client/src/layouts/SignIn.js +++ b/jams-react-client/src/layouts/SignIn.js @@ -77,7 +77,7 @@ export default function SignIn(props) { React.useEffect(() => { if(auth.isAuthenticated() && auth.isInstalled()) { - history.push('/admin'); + history.push('/admin/users'); } }) @@ -91,7 +91,7 @@ export default function SignIn(props) { auth.checkLastKnowStep(() => { auth.checkDirectoryType(() => { if(auth.isInstalled){ - history.push('/admin'); + history.push('/admin/users'); } else{ history.push('/'); diff --git a/jams-react-client/src/views/Blueprints/Blueprints.js b/jams-react-client/src/views/Blueprints/Blueprints.js index 199115554f5a03c39eba22cd4d84e00a3244139e..3b141f851f28e0fb4f85c7ca936817e7000b35f6 100644 --- a/jams-react-client/src/views/Blueprints/Blueprints.js +++ b/jams-react-client/src/views/Blueprints/Blueprints.js @@ -131,11 +131,6 @@ export default function Blueprints() { setSelectedBlueprint(true) setSelectedBlueprintName(blueprintNameRedirect) } - function redirectToBlueprints(e) { - e.preventDefault() - setSelectedBlueprint(false); - history.push('/admin/blueprints') - } const handleCheckBlueprintNameExists = (searchBlueprintNameValue) => { axios(configApiCall(api_path_blueprints+"?name="+searchBlueprintNameValue, 'GET', null, null)).then((response)=>{ @@ -185,16 +180,6 @@ export default function Blueprints() { <h4>You are not allowed to access this section. Please contact your administrator to get administrator privileges.</h4> </div> ) - } else if(selectedBlueprint && auth.hasAdminScope()){ - return ( - <div> - <Button variant="contained" color="info" href="#contained-buttons" onClick={redirectToBlueprints} style={{color: "white"}}> - <KeyboardReturnIcon /> return to blueprints - </Button> - <h3>{selectedBlueprintName}</h3> - <Blueprint blueprintName={selectedBlueprintName}/> - </div> - ) } else { return ( diff --git a/jams-react-client/src/views/Groups/Groups.js b/jams-react-client/src/views/Groups/Groups.js index 6c2abb482cfcd0eebe15746a25f8346133f9f58a..eb7d071f91e3f1bdc1eefd94daaa571ffeaf7491 100644 --- a/jams-react-client/src/views/Groups/Groups.js +++ b/jams-react-client/src/views/Groups/Groups.js @@ -160,12 +160,6 @@ export default function Groups() { setSelectedGroupName(name) } - const redirectToGroupList = (e) => { - e.preventDefault() - setSelectedGroup(false); - history.push('/admin/groups') - } - const handleCheckGroupNameExists = (searchGroupNameValue) => { axios(configApiCall(api_path_get_list_group+"?groupName="+searchGroupNameValue, 'GET', null, null)).then((response)=>{ if(response.data === "[]"){ @@ -220,12 +214,9 @@ export default function Groups() { if(selectedGroup && auth.hasAdminScope()){ return( <div> - <Button variant="contained" color="info" href="#contained-buttons" onClick={redirectToGroupList}> - <KeyboardReturnIcon /> - </Button> <EditGroup - groupName={selectedGroupName} - initCheckGroupNameExists={initCheckGroupNameExists} + groupName={selectedGroupName} + initCheckGroupNameExists={initCheckGroupNameExists} groupNameExits={groupNameExits} blueprintsOptionsItems={blueprintsOptionsItems} selectedBlueprint={selectedBlueprint} diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js index 8fcdcac9f73fb11bd8b174d6c0f63cb4281489c5..e0110f43ebc48b19096bdfddf6f93525a617cf21 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js @@ -183,7 +183,7 @@ export default function EditCreateUserProfile(props) { } const handleCancel = () => { - history.push('/admin'); + history.push('/admin/users'); } const handleCancelUpdate = () => { @@ -291,7 +291,7 @@ export default function EditCreateUserProfile(props) { const handleClosePassword = () => { setOpenPassword(false); - history.push('/admin'); + history.push('/admin/users'); } /** diff --git a/jams-react-client/src/views/Users/Users.js b/jams-react-client/src/views/Users/Users.js index 9ee6b08353d6bb6e51ad5ecd8b0428fcde793f91..894c3787d44177759e6807746d76852fa5c91d8c 100644 --- a/jams-react-client/src/views/Users/Users.js +++ b/jams-react-client/src/views/Users/Users.js @@ -115,11 +115,6 @@ export default function Users() { setSelectedProfile(true); setSelectedUsername(username) } - const redirectToUsers = (e) => { - e.preventDefault() - setSelectedProfile(false); - history.push('/admin') - } const searchUsers = (value) => { axios(configApiCall(api_path_get_user_directory_search, 'GET', {"queryString": value ? value : "*"}, null)).then((response)=>{ @@ -151,9 +146,6 @@ export default function Users() { } else if(selectedProfile && auth.hasAdminScope()){ return ( <div> - <Button variant="contained" color="info" href="#contained-buttons" onClick={redirectToUsers}> - <KeyboardReturnIcon /> - </Button> <UserProfile username={selectedUsername}/> </div> )