New assets, fixed list box scrolling, header text, etc..

This commit is contained in:
John Lyon-Smith
2018-03-05 15:18:08 -08:00
parent eaf26343b8
commit 535fffaf41
33 changed files with 354 additions and 231 deletions

View File

@@ -5,7 +5,6 @@ import { api } from 'src/API'
export class ProtectedRoute extends React.Component {
static propTypes = {
roles: PropTypes.array,
location: PropTypes.shape({
pathname: PropTypes.string,
search: PropTypes.string,
@@ -41,17 +40,11 @@ export class ProtectedRoute extends React.Component {
// The API might be in the middle of fetching the user information
// Return something and wait for login evint to fire to re-render
return <div />
}
let roles = this.props.roles
if (roles && roles.includes(user.role)) {
} else if (user.administrator) {
return <Route {...this.props} />
} else {
return <Redirect to='/' />
}
} else {
return <Redirect to={`/login?redirect=${this.props.location.pathname}${this.props.location.search}`} />
}
return <Redirect to={`/login?redirect=${this.props.location.pathname}${this.props.location.search}`} />
}
}