From c13bf821ac5e2bf4f5c11600d20fc116ae7b6e1f Mon Sep 17 00:00:00 2001 From: Giannis Kopanas <jkopanas@gmail.com> Date: Wed, 6 Jun 2018 22:15:59 +0300 Subject: [PATCH] add new menu to xpub --- app/components/App.js | 9 ++++++++- app/routes.js | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/components/App.js b/app/components/App.js index aada5befd9..12241478a0 100644 --- a/app/components/App.js +++ b/app/components/App.js @@ -2,6 +2,7 @@ import React from 'react' import styled from 'styled-components' import { compose } from 'recompose' import { connect } from 'react-redux' +import Authorize from 'pubsweet-client/src/helpers/Authorize' import { withRouter, matchPath } from 'react-router-dom' // import PropTypes from 'prop-types' @@ -36,7 +37,7 @@ const App = ({ }) => { const { pathname } = history.location const showLinks = pathname.match(/submit|manuscript/g) - let links + let links = [] if (showLinks) { const params = getParams(pathname) @@ -62,6 +63,12 @@ const App = ({ : null } + links.push( + <Authorize object={{}} operation="can view teams menu"> + <Action to="/teams">Team Manager</Action> + </Authorize>, + ) + return ( <Root disableLinks={disableLinks}> <AppBar diff --git a/app/routes.js b/app/routes.js index 9bc1f22f92..0412889acf 100644 --- a/app/routes.js +++ b/app/routes.js @@ -17,6 +17,7 @@ import SubmitPage from 'pubsweet-component-xpub-submit/src/components/SubmitPage import ManuscriptPage from 'pubsweet-component-xpub-manuscript/src/components/ManuscriptPage' import ReviewersPage from 'pubsweet-component-xpub-review/src/components/ReviewersPage' import ReviewPage from 'pubsweet-component-xpub-review/src/components/ReviewPage' +import TeamPage from 'pubsweet-component-xpub-teams-manager/src/components/TeamsManagerPage' import DecisionPage from 'pubsweet-component-xpub-review/src/components/DecisionPage' import UsersManager from 'pubsweet-component-users-manager/src/UsersManagerContainer' @@ -46,6 +47,7 @@ const Routes = () => ( exact path="/projects/:project/versions/:version/submit" /> + <PrivateRoute component={TeamPage} exact path="/teams" /> <PrivateRoute component={ManuscriptPage} exact -- GitLab