Commit 79cb0db3 authored by Jure's avatar Jure

Merge branch 'initial_release' into 'master'

Initial starter app

See merge request !1
parents 30d3353c ca511357
{
"parser": "babel-eslint",
"extends": [
"standard",
"plugin:react/recommended"
],
"plugins": [
"react"
],
"parserOptions": {
"ecmaVersion": 7,
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es6": true,
"browser": true
}
}
api
logs
node_modules
.env.*
_build
{
"presets": [
"env",
"react",
"stage-2"
]
}
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": ["standard", "standard-react"]
}
import React from 'react'
import ReactDOM from 'react-dom'
import { configureStore, Root } from 'pubsweet-client'
import { AppContainer } from 'react-hot-loader'
import { browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
let store = configureStore(browserHistory, {})
let history = syncHistoryWithStore(browserHistory, store)
const rootEl = document.getElementById('root')
ReactDOM.render(
<AppContainer>
<Root store={store} history={history} />
</AppContainer>,
rootEl
)
if (module.hot) {
module.hot.accept('pubsweet-client/src/components/Root', () => {
const NextRoot = require('pubsweet-client/src/components/Root').default
ReactDOM.render(
<AppContainer>
<NextRoot store={store} history={history} />
</AppContainer>,
rootEl
)
})
}
import React from 'react'
import { LinkContainer } from 'react-router-bootstrap'
import { Navbar, Nav, NavItem, NavbarBrand } from 'react-bootstrap'
import Authorize from 'pubsweet-client/src/helpers/Authorize'
import NavbarUser from 'pubsweet-component-navigation/NavbarUser'
export default class Navigation extends React.Component {
render () {
const { actions, currentUser } = this.props
let logoutButtonIfAuthenticated
if (currentUser.isAuthenticated) {
logoutButtonIfAuthenticated = <NavbarUser
user={currentUser.user}
onLogoutClick={actions.logoutUser}
/>
}
return (
<Navbar fluid>
<Navbar.Header>
<NavbarBrand>
<a href='#'><img src='/assets/pubsweet.jpg' alt='pubsweet' /></a>
</NavbarBrand>
</Navbar.Header>
<Nav>
<LinkContainer to='/manage/posts'>
<NavItem>Posts</NavItem>
</LinkContainer>
<Authorize operation='read' object='users'>
<LinkContainer to='/manage/users'>
<NavItem>Users</NavItem>
</LinkContainer>
</Authorize>
<Authorize operation='read' object='teams'>
<LinkContainer to='/manage/teams'>
<NavItem>Teams</NavItem>
</LinkContainer>
</Authorize>
</Nav>
{ logoutButtonIfAuthenticated }
</Navbar>
)
}
}
Navigation.propTypes = {
actions: React.PropTypes.object.isRequired,
currentUser: React.PropTypes.object
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="root"></div>
<script type="text/javascript" charset="utf-8" src="/assets/app.js"></script>
</body>
</html>
import React from 'react'
import { Route } from 'react-router'
import { requireAuthentication } from 'pubsweet-client/src/components/AuthenticatedComponent'
// Manage
import Manage from 'pubsweet-component-manage/Manage'
import PostsManager from 'pubsweet-component-posts-manager/PostsManager'
import UsersManager from 'pubsweet-component-users-manager/UsersManager'
import TeamsManager from 'pubsweet-component-teams-manager/TeamsManager'
// Editor
import MediumDraft from 'pubsweet-component-medium-draft/MediumDraft'
// Public
import Blog from 'pubsweet-component-blog/Blog'
import HTML from 'pubsweet-component-html/HTML'
// Authentication
import Login from 'pubsweet-component-login/Login'
import Signup from 'pubsweet-component-signup/Signup'
const AuthenticatedManage = requireAuthentication(
Manage, 'create', (state) => state.collections[0]
)
export default (
<Route>
<Route path='/' component={Blog} />
<Route path='/manage' component={AuthenticatedManage}>
<Route path='posts' component={PostsManager} />
<Route path='users' component={UsersManager} />
<Route path='teams' component={TeamsManager} />
<Route path='sciencewriter/:id' component={MediumDraft} />
</Route>
<Route path='/login' component={Login} />
<Route path='/signup' component={Signup} />
<Route path='/:id' component={HTML} />
</Route>
)
[
"pubsweet-component-blog",
"pubsweet-component-login",
"pubsweet-component-manage",
"pubsweet-component-pepper-theme",
"pubsweet-component-posts-manager",
"pubsweet-component-signup"
]
const config = require('./shared.js')
module.exports = config
const config = require('./shared.js')
module.exports = config
const path = require('path')
const blogmode = require('authsome/src/modes/blog')
const Joi = require('joi')
module.exports = {
'pubsweet-server': {
dbPath: process.env.PUBSWEET_DB || path.join(__dirname, '..', 'api', 'db'),
API_ENDPOINT: '/api',
sse: process.env.PUBSWEET_SSE
},
'pubsweet-client': {
theme: 'PepperTheme',
'login-redirect': '/manage/posts'
},
authsome: {
mode: blogmode,
teams: {
teamContributors: {
name: 'Contributors',
permissions: 'create'
},
teamCoauthors: {
name: 'Coauthors',
permissions: 'update'
}
},
'fail-redirect': '/login'
},
pubsweet: {
components: require('./components.json')
},
validations: {
fragment: {
kind: Joi.string(),
published: Joi.bool(),
published_at: Joi.string(),
source: Joi.any(),
presentation: Joi.string()
}
}
}
const config = require('./shared.js')
module.exports = config
This diff is collapsed.
This diff is collapsed.
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for app.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="index.html">All files</a> app.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/14</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import React from 'react'<span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" ></span></span>
import ReactDOM <span class="cstat-no" title="statement not covered" >from 'react-dom'<span class="cstat-no" title="statement not covered" ></span></span>
&nbsp;
import { configureStor<span class="cstat-no" title="statement not covered" >e, Root } from 'pubsweet-cl</span>ient'
&nbsp;
import { AppContainer <span class="cstat-no" title="statement not covered" >} from 'react-hot-loader'</span>
import { browserHis<span class="cstat-no" title="statement not covered" >tory } from 'react-route</span>r'
import { syncHistoryWith<span class="cstat-no" title="statement not covered" >Store } from 'react-router-red</span>ux'<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ></span></span>
&nbsp;
let store = <span class="cstat-no" title="statement not covered" >configureStore(browserHistory, {})</span>
let history = <span class="cstat-no" title="statement not covered" >syncHistoryWithStore(browserHistory, store)</span>
&nbsp;
const rootEl <span class="cstat-no" title="statement not covered" >= document.getElementById('root'</span>)
&nbsp;
<span class="cstat-no" title="statement not covered" >ReactDOM.render(</span>
&lt;AppContainer&gt;
&lt;Root store={store} history={history} /&gt;
&lt;/AppContainer&gt;,
rootEl
)
&nbsp;
<span class="cstat-no" title="statement not covered" >if (module.hot) {</span>
<span class="cstat-no" title="statement not covered" > module.hot.accept('pubsweet-client/src/components/Root', <span class="fstat-no" title="function not covered" >()</span> =&gt; {</span>
const NextRoot <span class="cstat-no" title="statement not covered" >= require('pubsweet-client/src/components/Root').defaul</span>t
&nbsp;
<span class="cstat-no" title="statement not covered" > ReactDOM.render(</span>
&lt;AppContainer&gt;
&lt;NextRoot store={store} history={history} /&gt;
&lt;/AppContainer&gt;,
rootEl
)
})
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Sep 18 2017 11:32:55 GMT+0200 (CEST)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for app/app.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">All files</a> / <a href="index.html">app</a> app.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/14</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import React from 'react'<span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" ></span></span>
import ReactDOM <span class="cstat-no" title="statement not covered" >from 'react-dom'<span class="cstat-no" title="statement not covered" ></span></span>
&nbsp;
import { configureStor<span class="cstat-no" title="statement not covered" >e, Root } from 'pubsweet-cl</span>ient'
&nbsp;
import { AppContainer <span class="cstat-no" title="statement not covered" >} from 'react-hot-loader'</span>
import { browserHis<span class="cstat-no" title="statement not covered" >tory } from 'react-route</span>r'
import { syncHistoryWith<span class="cstat-no" title="statement not covered" >Store } from 'react-router-red</span>ux'<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ></span></span>
&nbsp;
let store = <span class="cstat-no" title="statement not covered" >configureStore(browserHistory, {})</span>
let history = <span class="cstat-no" title="statement not covered" >syncHistoryWithStore(browserHistory, store)</span>
&nbsp;
const rootEl <span class="cstat-no" title="statement not covered" >= document.getElementById('root'</span>)
&nbsp;
<span class="cstat-no" title="statement not covered" >ReactDOM.render(</span>
&lt;AppContainer&gt;
&lt;Root store={store} history={history} /&gt;
&lt;/AppContainer&gt;,
rootEl
)
&nbsp;
<span class="cstat-no" title="statement not covered" >if (module.hot) {</span>
<span class="cstat-no" title="statement not covered" > module.hot.accept('pubsweet-client/src/components/Root', <span class="fstat-no" title="function not covered" >()</span> =&gt; {</span>
const NextRoot <span class="cstat-no" title="statement not covered" >= require('pubsweet-client/src/components/Root').defaul</span>t
&nbsp;
<span class="cstat-no" title="statement not covered" > ReactDOM.render(</span>
&lt;AppContainer&gt;
&lt;NextRoot store={store} history={history} /&gt;
&lt;/AppContainer&gt;,
rootEl
)
})
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Sep 18 2017 11:41:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for app</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">All files</a> app
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/14</span>
</div>
</div>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="app.js"><a href="app.js.html">app.js</a></td>
<td data-value="0" class="pic low"><div class="chart"><div class="cover-fill" style="width: 0%;"></div><div class="cover-empty" style="width:100%;"></div></div></td>
<td data-value="0" class="pct low">0%</td>
<td data-value="17" class="abs low">0/17</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="6" class="abs low">0/6</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="2" class="abs low">0/2</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="14" class="abs low">0/14</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Sep 18 2017 11:41:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;