Commit caeb5166 authored by Alexandros Georgantas's avatar Alexandros Georgantas

Merge branch 'configurable-bookbuilder' into 'master'

Configurable bookbuilder

See merge request !9
parents e852b793 7ead5ee9
**/_build
**/node_modules
**/coverage
packages/ui/styleguide
......@@ -6,37 +6,17 @@
},
"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
}
},
"overrides": [
{
"files": ["test/**/*.test.js"],
"globals": {
"fixture": true,
"text": true
}
}
]
}
.env.*
config/*.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/*
_build/*
config/local*
logs/*
pubsweet.log
tmp/
uploads/*
yarn-error.log
data
MIT License
Copyright (c) 2017 The Regents of the University of California
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
......
......@@ -3,7 +3,7 @@ import { Redirect, Route, Switch } from 'react-router-dom'
// Users and Teams
import UsersManager from 'pubsweet-component-users-manager/UsersManagerContainer'
import GlobalTeamsManager from 'pubsweet-component-booksprints-globalteams/src/GlobalTeamsManager'
import GlobalTeamsManager from 'pubsweet-component-editoria-global-teams/src/GlobalTeamsManager'
// import TeamsManager from 'pubsweet-component-teams-manager/TeamsManagerContainer'
// Authentication
......@@ -16,10 +16,10 @@ import Wax from 'pubsweet-component-wax/src/WaxPubsweet'
import WithConfig from 'pubsweet-component-wax/src/WithConfig'
// Editoria
import BookBuilder from 'pubsweet-component-bookbuilder-booksprints/src/BookBuilder'
import Dashboard from 'pubsweet-component-editoria-dashboard-booksprints/src/Dashboard'
import BookBuilder from 'pubsweet-component-bookbuilder/src/BookBuilder'
import Dashboard from 'pubsweet-component-editoria-dashboard/src/Dashboard'
import Manage from 'pubsweet-component-manage/Manage'
import PagedStyler from 'pubsweet-component-bookbuilder-booksprints/src/PagedStyler/PagedStyler'
import PagedStyler from 'pubsweet-component-bookbuilder/src/PagedStyler/PagedStyler'
import Navigation from './components/Navigation/Navigation'
import PrivateRoute from './components/PrivateRoute'
// import AuthenticatedManage from './components/AuthenticatedManage/AuthenticatedManage'
......
......@@ -14,7 +14,7 @@ const logger = new winston.Logger({
module.exports = {
authsome: {
mode: require.resolve('pubsweet-editoria-booksprints-authsome'),
mode: require.resolve('./modules/authsome'),
teams: {
productionEditor: {
name: 'Production Editor',
......
module.exports = {
instance: 'BOOKSPRINTS',
chapter: {
dropdownValues: {
back: ['Appendix A', 'Appendix B', 'Appendix C'],
......
{
"lerna": "2.4.0",
"packages": [
"packages/*"
],
"version": "independent"
}
{
"author": "Coko Foundation",
"description": "Monorepo grouping all the different parts of the Editoria project for the case of Book Sprints",
"name": "BookSprints",
"description": "An application for managing book production flows",
"private": true,
"keywords": [
"Coko",
"Coko Foundation",
"book",
"book production",
"book management"
],
"repository": {
"type": "git",
"url": "https://gitlab.coko.foundation/editoria/booksprints"
},
"homepage": "https://editoria.pub/",
"license": "MIT",
"version": "1.0.0",
"dependencies": {
"@pubsweet/component-polling-client": "^0.0.3",
"@pubsweet/component-polling-server": "^0.0.9",
"@pubsweet/db-manager": "^1.0.7",
"@pubsweet/default-theme": "^0.2.0",
"@pubsweet/logger": "^0.2.2",
"@pubsweet/ui": "^4.1.3",
"authsome": "^0.1.0",
"font-awesome": "4.7.0",
"highlight.js": "^9.13.1",
"history": "^4.7.2",
"lodash": "4.17.4",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.6.0",
"pubsweet": "^2.2.8",
"pubsweet-client": "^2.5.5",
"pubsweet-component-bookbuilder": "^1.1.4",
"pubsweet-component-editoria-dashboard": "^0.1.2",
"pubsweet-component-editoria-global-teams": "^0.1.1",
"pubsweet-component-epub": "^0.5.2",
"pubsweet-component-epub-frontend": "^0.1.3",
"pubsweet-component-ink-backend": "^0.1.1",
"pubsweet-component-ink-frontend": "^0.2.3",
"pubsweet-component-login": "^0.5.5",
"pubsweet-component-manage": "^1.0.0",
"pubsweet-component-navigation": "^1.0.1",
"pubsweet-component-pagedjs-viewer": "^0.1.1",
"pubsweet-component-password-reset-backend": "1.0.0",
"pubsweet-component-password-reset-frontend": "1.0.0",
"pubsweet-component-signup": "^0.4.1",
"pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.0",
"pubsweet-component-wax": "^0.6.15",
"pubsweet-server": "^7.2.0",
"pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0",
"react-bootstrap": "0.32.1",
"react-dnd": "2.5.4",
"react-dnd-html5-backend": "2.5.4",
"react-dom": "^16.2.0",
"react-redux": "5.0.4",
"react-router-bootstrap": "0.24.4",
"react-router-dom": "^4.2.2",
"recompose": "^0.26.0",
"redux": "3.6.0",
"typeface-fira-sans": "^0.0.43"
},
"devDependencies": {
"babel-eslint": "^8.0.3",
"app-module-path": "^2.2.0",
"autobind-decorator": "^1.3.4",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-babili": "0.0.12",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-native-modules": "^6.9.4",
"babel-preset-minify": "^0.3.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babili-webpack-plugin": "^0.0.11",
"bootstrap-sass": "^3.3.7",
"clean-webpack-plugin": "^0.1.17",
"compression-webpack-plugin": "^1.1.6",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.4",
"enzyme": "^2.7.1",
"enzyme-to-json": "^1.4.5",
"babel-eslint": "^8.0.3",
"eslint": "^4.13.1",
"eslint-config-pubsweet": "^0.0.6",
"eslint-plugin-import": "^2.8.0",
......@@ -14,32 +96,72 @@
"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"
"eslint-loader": "^1.6.0",
"extract-text-webpack-plugin": "^3.0.0",
"faker": "^4.1.0",
"file-loader": "^1.1.5",
"fs-extra": "^5.0.0",
"html-webpack-plugin": "^2.24.0",
"husky": "^0.14.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^18.1.0",
"joi-browser": "^10.0.6",
"json-loader": "^0.5.4",
"node-sass": "^4.5.2",
"pouchdb-adapter-memory": "^6.1.1",
"react-addons-test-utils": "^15.4.2",
"react-hot-loader": "^3.1.1",
"react-router-redux": "^5.0.0-alpha.9",
"react-test-renderer": "^15.4.2",
"regenerator-runtime": "^0.11.0",
"sass-loader": "^6.0.3",
"script-loader": "^0.7.0",
"sinon": "^1.17.7",
"sinon-as-promised": "^4.0.2",
"smtp-server": "^3.3.0",
"standard": "^10.0.1",
"string-replace-loader": "^1.3.0",
"style-loader": "^0.19.0",
"stylelint": "^8.2.0",
"stylelint-config-pubsweet": "^0.0.3",
"testcafe": "^0.18.6",
"testcafe-react-selectors": "^1.0.5",
"uglifyjs-webpack-plugin": "^1.1.2",
"url-loader": "^0.6.2",
"webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.20.0",
"winston-daily-rotate-file": "^3.2.1"
},
"license": "MIT",
"name": "editoria-booksprints-monorepo",
"private": true,
"repository": {
"type": "git",
"url": "git@gitlab.coko.foundation:editoria/booksprints.git"
"jest": {
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "./test/fileMock.js",
"\\.(css|less|scss)$": "identity-obj-proxy"
},
"setupFiles": [
"./test/jest.config.js"
],
"snapshotSerializers": [
"./node_modules/enzyme-to-json/serializer"
],
"transformIgnorePatterns": [
"node_modules/(?!pubsweet-frontend)",
"__snapshots__"
]
},
"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/*"
]
"setupdb": "pubsweet setupdb && npm run seed",
"start": "pubsweet start",
"server": "pubsweet start",
"resetdb": "pubsweet setupdb --clobber && npm run seed",
"start:services": "docker-compose up postgres",
"seed": "node ./scripts/seedGlobalTeams.js",
"test": "NODE_ENV=test jest",
"test:watch": "NODE_ENV=test jest --watch",
"test:cover": "NODE_ENV=test jest --coverage",
"build": "NODE_ENV=production pubsweet build"
}
}
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.
module.exports = {
frontend: {
components: [
() => require('./src/BookBuilder')
]
}
}
\ No newline at end of file
{
"name": "pubsweet-component-bookbuilder-booksprints",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"pubsweet-component",
"pubsweet-client"
],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.17.1",
"classnames": "^2.2.5",
"config": "^1.27.0",
"editoria-common": "^0.1.1",
"font-awesome": "4.7.0",
"lodash": "4.17.4",
"pubsweet-client": "^2.5.5",
"react": "^16.2.0",
"react-bootstrap": "0.32.1",
"react-dnd": "2.5.4",
"react-dnd-html5-backend": "2.5.4",
"react-dom": "^16.2.0",
"react-redux": "5.0.4",
"react-router-bootstrap": "0.24.4",
"react-router-dom": "4.2.2",
"react-select": "^2.0.0",
"react-codemirror": "^1.0.0",
"codemirror": "^5.40.2",
"redux": "3.7.2"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"enzyme": "^2.9.1",
"enzyme-to-json": "^1.5.1",
"file-loader": "^0.11.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^20.0.4",
"node-sass": "^4.5.3",
"prop-types": "^15.5.10",
"react-addons-test-utils": "^15.6.0",
"react-styleguidist": "^6.0.24",
"react-test-renderer": "^15.6.1",
"sass-loader": "^6.0.6",
"sinon": "^2.3.6",
"sinon-as-promised": "^4.0.3",
"webpack": "^2.7.0",
"webpack-node-externals": "^1.6.0"
}
}
import React from 'react'
import PropTypes from 'prop-types'
import styles from './styles/bookBuilder.local.scss'
export default class AddButton extends React.Component {
constructor(props) {
super(props)
this._addGroup = this._addGroup.bind(this)
}
_addGroup() {
const { add, group } = this.props
add(group)
}
render() {
const { group } = this.props
return (
<button className={styles.sectionBtn} onClick={this._addGroup}>
<i className={styles.addBtnIcon} />
{`add ${group}`}
</button>
)
}
}
AddButton.propTypes = {
add: PropTypes.func.isRequired,
group: PropTypes.string.isRequired,
}
This diff is collapsed.
import { flow } from 'lodash'
import React from 'react'
import PropTypes from 'prop-types'
import { DragSource, DropTarget } from 'react-dnd'
import Authorize from 'pubsweet-client/src/helpers/Authorize'
import FirstRow from './Chapter/FirstRow'
import SecondRow from './Chapter/SecondRow'
import {
chapterSource,
chapterTarget,
collectDrag,
collectDrop,
itemTypes,
} from './dnd'
import styles from './styles/bookBuilder.local.scss'
class Chapter extends React.PureComponent {
constructor(props) {
super(props)
this.toggleUpload = this.toggleUpload.bind(this)
this.update = this.update.bind(this)
this.state = {
isUploadInProgress: false,
}
}
update(patch) {
const { book, update } = this.props
update(book, patch)
}
toggleUpload() {
this.setState({
isUploadInProgress: !this.state.isUploadInProgress,
})
// if (!this.state.isUploadInProgress) this.removeUploadState()
}
renderHasContent() {
const { chapter } = this.props
const source = chapter.source || ''
const hasContent = source.trim().length > 0
return hasContent
}
// componentWillReceiveProps(nextProps) {
// const { chapter } = nextProps
// const source = chapter.source || ''
// const sourceBefore = this.props.chapter.source || ''
// const hasContentBefore = sourceBefore.trim().length > 0
// const hasContent = source.trim().length > 0
// // console.log('fragment old', this.props.chapter.source)
// // console.log('fragment new', chapter.source)
// if (!hasContentBefore && hasContent) {
// const patch = {
// id: chapter.id,
// progress: chapter.progress,
// }
// patch.progress.upload = 1
// patch.progress.file_prep = 0
// this.update(patch)
// }
// }
// getLocalStorageKey () {
// const { chapter } = this.props
// return 'chapter:upload:' + chapter.id
// }
//