Commit cc17ae4b authored by Alexandros Georgantas's avatar Alexandros Georgantas

Initial commit

parents
set -e
use node
**/_build
**/node_modules
**/coverage
packages/ui/styleguide
{
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true
},
"extends": ["pubsweet"],
"rules": {
"prefer-destructuring": ["error", {
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": false,
"object": false
}
}, {
"enforceForRenamedProperties": false
}],
"global-require": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/no-static-element-interactions": 0,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/no-named-as-default": 0,
"import/no-named-as-default-member": 0,
"import/prefer-default-export": 0,
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-param-reassign": 0,
"no-shadow": 0,
"no-underscore-dangle": 0,
"react/forbid-prop-types": 0,
"react/no-unused-prop-types": 0,
"react/no-unused-state": 0,
"react/prop-types": 0,
"react/require-default-props": 0,
"sort-keys": 0
}
}
.env.*
coverage/
lerna-debug.log
node_modules/
npm-debug.log
packages/editoria-app/_build/*
packages/editoria-app/api/db/*
packages/editoria-app/config/local*
packages/editoria-app/logs/*
packages/editoria-app/pubsweet.log
packages/editoria-app/tmp/
packages/editoria-app/uploads/*
yarn-error.log
{
"singleQuote": true,
"semi": false,
"printWidth": 80,
"trailingComma": "all"
}
# Editoria
## 1.3.0
#### Wax
* Search / find and replace
* Notes pane is hidden if there are no notes in the document
* Note callouts work with track changes
* Track changes previous / next navigation
* Copy / cut and paste works with track changes
* Indicator for how many items exist in a collapsed comment discussion
* Performance improvements
* Find and Replace a single match and undo throws an Error
* Undo / Redo Notes on certain Occasions throws an Error
* Opening an Empty Chapter Save is Enabled and modal is triggered if you try to go back without any change in the Editor
* if Track Changes is on, user cannot remove an image
* Remove additions on cut operation in track changes if done from the same user
* With track Changes on if you accept a deleted note and undo throws an error
* With track Changes on if you delete a whole paragraph and undo throws an error
* Navigate Through Notes with left and right arrow
* Toggle on /off Native Spell Checker
* Full screen mode
* Track Spaces
* Image Captions
* Change note icon in the toolbar
* Add keyboard shortcuts for accept & reject track changes
* Small Caps
#### Maintenance
* Switch to using yarn instead of npm by default
* React 16
* Upgrade to latest pubsweet client
* Clean up component prop types and refs
* Switch to Postgres
* Docker container for the DB provided via yarn start:services
## 1.2.0
* Upgrade to latest Pubsweet server, client, and components
* Introduce password reset
#### Book Builder
* Preview exported book in Vivliostyle Viewer
* Chapters keep track of their own numbering (independently from parts) in the Body
* Renaming of fragments has been removed in favour of using the title tag in Wax
* Drag and drop fixes
#### Wax Editor
* Can now style multiple blocks/paragraphs at once, including lists
* Keyboard shortcuts
* Turn track changes on/off => ctrl/cmd+y
* Hide / show tracked changes => ctrl/cmd+shift+y
* Comments => ctrl/cmd+m
* Save => ctrl/cmd+s
* New Title style (which will also rename the fragment in the book builder)
* New Subtitle style
* New Bibliography Entry style
* Revamped track changes UI: Tools are now in the toolbar instead of inline, and line height in the document has been reduced
* Surface doesn't lose focus any more unless the user clicks outside of Wax
* Paragraph indentation
## 1.1.4
#### Wax Editor
* Fix for unsaved changes warning
## 1.1.3
* New design for the book builder, the dashboard and the theme
#### Dashboard
* Renamed 'remove' button to 'delete' for consistency with the book builder
* Double clicking on a book will take you to the book builder for that book, instead of opening the renaming interface
* The position of 'Edit' and 'Rename' actions have been swapped ('Edit' now comes first)
* Books now appear in alphabetical order
#### Book Builder
* Fixed issue with fragments disappearing when uploading multiple files
* Renamed 'Front Matter' and 'Back Matter' to 'Frontmatter' and 'Backmatter'
#### Wax Editor
* Introduce layouts
* Accept configuration options (`layout` and `lockWhenEditing`)
* It is now broken down into separate modules for better separation of concerns
* Pubsweet integration
* React integration
* Core
* Diacritics work within notes
### Editoria 1.0, July 2017
Editoria was started as a collaboration between UCP and Coko, initial funding came from the Mellon Foundation.
Those involved in conceptualising, designing, and building Editoria (including the Wax Editor) from 0 to 1.0 include:
* Erich van Rijn
* Catherine Mitchell
* Kate Warne
* Cindy Fulton
* Lisa Schiff
* Justin Gonder
* Juliana Froggatt
* Adam Hyde
* Kristen Ratan
* Yannis Barlas
* Christos Kokosias
* Julien Taquet
* Alex Theg
* Alexandros Georgantas
* Giannis Kopanas
MIT License
Copyright (c) 2017 The Regents of the University of California
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
This diff is collapsed.
{
"lerna": "2.4.0",
"packages": [
"packages/*"
],
"version": "independent"
}
{
"author": "Collaborative Knowledge Foundation",
"description": "Monorepo grouping all the different parts of the UCP project",
"devDependencies": {
"babel-eslint": "^8.0.3",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.13.1",
"eslint-config-pubsweet": "^0.0.6",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.4.2",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"lerna": "^2.5.1",
"lint-staged": "^6.0.0",
"prettier": "^1.8.2",
"stylelint": "^8.2.0",
"stylelint-config-prettier": "^2.0.0",
"stylelint-config-pubsweet": "^0.0.3"
},
"license": "MIT",
"name": "ucp-monorepo",
"private": true,
"repository": {
"type": "git",
"url": "git@gitlab.coko.foundation:editoria/ucp.git"
},
"scripts": {
"bootstrap": "lerna bootstrap",
"clean": "lerna clean",
"publish": "lerna publish",
"updated": "lerna updated",
"test": "lerna run test"
},
"version": "0.0.0",
"dependencies": {
"babel-preset-stage-0": "^6.24.1"
},
"workspaces": [
"packages/*"
]
}
{
"presets": [
"env",
"react",
"stage-2"
]
}
\ No newline at end of file
node_modules
\ No newline at end of file
**/_build
**/node_modules
**/coverage
{
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true
},
"extends": ["pubsweet"],
"rules": {
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"sort-keys": 0
},
"overrides": [
{
"files": ["test/**/*.test.js"],
"globals": {
"fixture": true,
"text": true
}
}
]
}
# Created by https://www.gitignore.io/api/osx,node
### OSX ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Node ###
# Logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# IDEs
.idea
# pubsweet-specific
myapp
testapp
api/db/*
/data
!api/db/.gitkeep
.vscode
.wallaby.js
logs
.env.*
_build
coverage/
yarn-error.log
package-lock.json
config/local*.*
config/*.env
### Editoria 1.0, July 2017
Editoria was started as a collaboration between UCP and Coko, initial funding came from the Mellon Foundation.
Those involved in conceptualising, designing, and building Editoria (including the Wax Editor) from 0 to 1.0 include:
* Erich van Rijn
* Catherine Mitchell
* Kate Warne
* Cindy Fulton
* Lisa Schiff
* Justin Gonder
* Juliana Froggatt
* Adam Hyde
* Kristen Ratan
* Yannis Barlas
* Christos Kokosias
* Julien Taquet
* Alex Theg
* Alexandros Georgantas
* Giannis Kopanas
MIT License
Copyright (c) 2017 University of California Press
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
const logger = require('@pubsweet/logger')
const startServer = require('pubsweet-server')
startServer().catch(err => {
logger.error('FATAL ERROR, SHUTTING DOWN:', err)
process.exit(1)
})
import 'regenerator-runtime/runtime'
import React from 'react'
import ReactDOM from 'react-dom'
import { configureStore, Root } from 'pubsweet-client'
import theme from './theme'
import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory'
import routes from './routes'
const history = createHistory()
const store = configureStore(history, {})
const rootEl = document.getElementById('root')
ReactDOM.render(
<AppContainer>
<Root history={history} routes={routes} store={store} theme={theme} />
</AppContainer>,
rootEl,
)
if (module.hot) {
module.hot.accept('pubsweet-client/src/components/Root', () => {
// eslint-disable-next-line global-require
const NextRoot = require('pubsweet-client/src/components/Root').default
ReactDOM.render(
<AppContainer>
<NextRoot history={history} routes={routes} store={store} />
</AppContainer>,
rootEl,
)
})
}
import React from 'react'
import PropTypes from 'prop-types'
import { withRouter } from 'react-router-dom'
import { LinkContainer } from 'react-router-bootstrap'
import { Navbar, Nav, NavItem, NavbarBrand } from 'react-bootstrap'
import { connect } from 'react-redux'
import Authorize from 'pubsweet-client/src/helpers/Authorize'
import NavbarUser from 'pubsweet-component-navigation/NavbarUser'
import actions from 'pubsweet-client/src/actions'
// TODO -- break into smaller components
class Navigation extends React.Component {
constructor(props) {
super(props)
this.collectionId = ''
this.inEditor = null
this.inPaged = null
}
componentDidMount() {
this.shouldAddBookLink()
}
componentWillUpdate() {
this.shouldAddBookLink()
}
shouldAddBookLink() {
const { history } = this.props
const { location } = history
const { pathname } = location
this.collectionId = ''
this.inEditor = null
this.inPaged = null
this.inEditor = pathname.match(/fragments/g)
this.inPaged = pathname.match(/pagedPreviewer\/paged/g)
if (this.inEditor || this.inPaged) {
const pathnameSplited = pathname.split('/')
this.collectionId = pathnameSplited[2]
}
}
render() {
const { logoutUser, currentUser } = this.props
let logoutButtonIfAuthenticated
if (currentUser.user === null) return null
if (currentUser.isAuthenticated) {
logoutButtonIfAuthenticated = (
<NavbarUser
user={currentUser.user}
onLogoutClick={() => logoutUser('/login')}
/>
)
}
let BackToBooks
if (this.inEditor || this.inPaged) {
BackToBooks = (
<LinkContainer to={`/books/${this.collectionId}/book-builder`}>
<NavItem>Back to book</NavItem>
</LinkContainer>
)
}
// TODO -- fix object properties underneath
return (
<Navbar fluid>
<Navbar.Header>
<NavbarBrand>
<a href="/">Editoria</a>
</NavbarBrand>
</Navbar.Header>
<Nav>
<LinkContainer to="/books">
<NavItem>Books</NavItem>
</LinkContainer>
<Authorize operation="can view nav links" object="users">
<LinkContainer to="/users">
<NavItem>Users</NavItem>
</LinkContainer>
</Authorize>
{BackToBooks}
</Nav>
{logoutButtonIfAuthenticated}
</Navbar>
)
}
}
Navigation.propTypes = {
currentUser: PropTypes.any,
history: PropTypes.any.isRequired,
logoutUser: PropTypes.func.isRequired,
}
export default withRouter(
connect(
state => ({
currentUser: state.currentUser,
}),
{
logoutUser: actions.logoutUser,
},
)(Navigation),
)
.root {
font-style: italic;
}
\ No newline at end of file
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Route, Redirect, withRouter } from 'react-router-dom'
import { actions } from 'pubsweet-client'
class PrivateRoute extends React.Component {
constructor(props) {
super(props)
this.state = {
complete: false,
}
}
componentDidMount() {
const onComplete = () => {
this.setState({
complete: true,
})
}
this.props.getCurrentUser().then(onComplete, onComplete)
}
render() {
const {
currentUser,
getCurrentUser,
component: Component,
...rest
} = this.props
return (
<Route
render={props => {
// complete, authenticated
if (currentUser.isAuthenticated) {
return <Component {...props} />
}
// complete, not authenticated
if (this.state.complete) {
return (
<Redirect
to={{
pathname: '/login',
state: { from: props.location },
}}
/>
)
}
// incomplete, loading
if (currentUser.isFetching) {
return <div>loading…</div>
}
// incomplete, not yet loading
return null
}}
{...rest}
/>
)
}
}
PrivateRoute.propTypes = {
component: PropTypes.func.isRequired,
currentUser: PropTypes.shape({
isAuthenticated: PropTypes.bool.isRequired,
isFetching: PropTypes.bool.isRequired,
}).isRequired,
getCurrentUser: PropTypes.func.isRequired,
location: PropTypes.object.isRequired,
}
export default withRouter(
connect(
state => ({
currentUser: state.currentUser,
}),
{
getCurrentUser: actions.getCurrentUser,
},
)(PrivateRoute),
)
<!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">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>